x86: implement userspace APIs
- _arch_user_mode_enter() implemented - _arch_is_user_context() implemented - _new_thread() will honor K_USER option if passed in - System call triggering macros implemented - _thread_entry_wrapper moved and now looks for the next function to call in EDI Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
3f091b5dd9
commit
424e993b41
11 changed files with 510 additions and 101 deletions
|
@ -135,7 +135,12 @@ def main():
|
|||
|
||||
if "CONFIG_X86_STACK_PROTECTION" in syms:
|
||||
stackprot = True
|
||||
num_entries = 5
|
||||
if "CONFIG_X86_USERSPACE" in syms:
|
||||
userspace = True
|
||||
num_entries = 7
|
||||
else:
|
||||
userspace = False
|
||||
num_entries = 5
|
||||
else:
|
||||
stackprot = False
|
||||
num_entries = 3
|
||||
|
@ -165,6 +170,15 @@ def main():
|
|||
# Selector 0x20: double-fault TSS
|
||||
fp.write(create_tss_entry(df_tss, 0x67, 0))
|
||||
|
||||
if userspace:
|
||||
# Selector 0x28: code descriptor, dpl = 3
|
||||
fp.write(create_code_data_entry(0, 0xFFFFF, 3,
|
||||
FLAGS_GRAN, ACCESS_EX | ACCESS_RW))
|
||||
|
||||
# Selector 0x30: data descriptor, dpl = 3
|
||||
fp.write(create_code_data_entry(0, 0xFFFFF, 3,
|
||||
FLAGS_GRAN, ACCESS_RW))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue