github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/internal/task/task_stack_cortexm.c (about)

     1  //go:build scheduler.tasks && cortexm
     2  #include <stdint.h>
     3  
     4  uintptr_t SystemStack() {
     5      uintptr_t sp;
     6      asm volatile(
     7          "mrs %0, MSP"
     8          : "=r"(sp)
     9          :
    10          : "memory"
    11      );
    12      return sp;
    13  }