aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/scheduler_tasks.go
blob: 67b475496eacf42a0c7b11b71125a13e06573157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//go:build scheduler.tasks
// +build scheduler.tasks

package runtime

import "internal/task"

// getSystemStackPointer returns the current stack pointer of the system stack.
// This is not necessarily the same as the current stack pointer.
func getSystemStackPointer() uintptr {
	// TODO: this always returns the correct stack on Cortex-M, so don't bother
	// comparing against 0.
	sp := task.SystemStack()
	if sp == 0 {
		sp = getCurrentStackPointer()
	}
	return sp
}