mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-01 02:09:06 +00:00
UEFI: add support for tasks scheduler and make it default (#5553)
* add support for UEFI time and UEFI events; fix STOP \n -> \r\n conversion * make it so both scheduler=none and scheduler=tasks works * address pr comments - Renamed/shared the amd64 Win64 ABI task stack Go file for both Windows and UEFI. - Deleted the duplicate UEFI task stack Go file and old Windows-suffixed Go file. - Added task_stack_amd64_windows.S unconditionally to targets/uefi-amd64.json. - Removed the UEFI ExtraFiles() special case from compileopts/config.go. - Added a scheduler.none tinygo_task_exit stub. - Removed the custom UEFI sleep override so normal scheduler sleep queue is used. * revert back to simpler return value for ExtraFiles() * create uefi specific tasks_none file * remove unused sleepSchedulerCustom stuff * add back the uefi tag * lib: restore macos-minimal-sdk pointer
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
//go:build scheduler.none && uefi
|
||||||
|
|
||||||
|
package task
|
||||||
|
|
||||||
|
//go:export tinygo_task_exit
|
||||||
|
func taskExit() {
|
||||||
|
runtimePanic("scheduler is disabled")
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
//go:build scheduler.tasks && amd64 && !windows
|
//go:build scheduler.tasks && amd64 && !windows && !uefi
|
||||||
|
|
||||||
package task
|
package task
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
//go:build scheduler.tasks && amd64 && windows
|
//go:build scheduler.tasks && amd64 && (windows || uefi)
|
||||||
|
|
||||||
package task
|
package task
|
||||||
|
|
||||||
// This is almost the same as task_stack_amd64.go, but with the extra rdi and
|
// This is almost the same as task_stack_amd64.go, but with the extra rdi and
|
||||||
// rsi registers saved: Windows has a slightly different calling convention.
|
// rsi registers saved: Windows and UEFI use the Win64 calling convention.
|
||||||
|
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
@@ -297,10 +297,6 @@ func sleep(duration int64) {
|
|||||||
if duration <= 0 {
|
if duration <= 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if schedulerSleepCustom(duration) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
addSleepTask(task.Current(), nanosecondsToTicks(duration))
|
addSleepTask(task.Current(), nanosecondsToTicks(duration))
|
||||||
task.Pause()
|
task.Pause()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
//go:build !(scheduler.tasks && uefi)
|
|
||||||
|
|
||||||
package runtime
|
|
||||||
|
|
||||||
func schedulerSleepCustom(duration int64) bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
"goos": "linux",
|
"goos": "linux",
|
||||||
"goarch": "amd64",
|
"goarch": "amd64",
|
||||||
"gc": "leaking",
|
"gc": "leaking",
|
||||||
"scheduler": "none",
|
"scheduler": "tasks",
|
||||||
"linker": "ld.lld",
|
"linker": "ld.lld",
|
||||||
"linker-flavor": "coff",
|
"linker-flavor": "coff",
|
||||||
"libc": "picolibc",
|
"libc": "picolibc",
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
"extra-files": [
|
"extra-files": [
|
||||||
"src/device/amd64/cpu_amd64.S",
|
"src/device/amd64/cpu_amd64.S",
|
||||||
"src/device/uefi/asm_amd64.S",
|
"src/device/uefi/asm_amd64.S",
|
||||||
"src/runtime/asm_amd64_windows.S"
|
"src/runtime/asm_amd64_windows.S",
|
||||||
|
"src/internal/task/task_stack_amd64_windows.S"
|
||||||
],
|
],
|
||||||
"gdb": ["gdb-multiarch", "gdb"]
|
"gdb": ["gdb-multiarch", "gdb"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user