/* Copyright (C) 2021,2022 fef . All rights reserved. */ #pragma once #ifndef _ARCH_SCHED_H_ #error "This file is not meant to be included directly, use " #endif /** * @brief In-kernel context save for the x86. * This precise structure layout is hardcoded in assembly, so don't forget to * update `arch/x86/sys/i386/switch.S` if you need to change it. */ struct x86_context { /** * The register itself is %esp, which points to the %eip that was pushed * by the function calling `arch_switch_to()` as per the x86 SysV ABI */ union { register_t esp; register_t *eip; }; register_t esi; register_t edi; register_t ebx; register_t ebp; } __packed; /** * @brief Arch dependent Task Control Block (i386 version). * This is what's required for in-kernel task switching. * Treat as a completely opaque type outside of the `arch/x86` directory. */ typedef struct i386_context tcb_t;