Files
jsix_import/definitions/objects/thread.def
Justin C. Miller 4125175870 [kernel] Give threads initial arguments
This commit changes the add_user_thunk to point to a new routine,
initialize_user_cpu, which sets all the registers that were previously
unset when starting a new user thread. The values for rdi and rsi are
popped off the initial stack values that add_user_thunk sets up, so that
user thread procs can take up to two arguments.

To suppor this, j6_thread_create gained two new arguments, which are
passed on to the thread.

This also let me finally get rid of the hack of passing an argument in
rsp when starting init.
2023-02-08 23:10:17 -08:00

27 lines
474 B
Modula-2

object thread : object {
uid 11f23e593d5761bd
capabilities [
kill
join
]
method create [constructor] {
param process ref process [cap:create_thread]
param stack_top address
param entrypoint address
param arg0 uint64
param arg1 uint64
}
method kill [destructor cap:kill]
method join [cap:join]
method exit [static]
method sleep [static] {
param duration uint64
}
}