You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
/* See the end of this file for copyright and license terms. */
|
|
|
|
#pragma once
|
|
|
|
#ifndef _ARCH_SCHED_H_
|
|
#error "This file is not meant to be included directly, use <arch/page.h>"
|
|
#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;
|
|
|
|
/*
|
|
* This file is part of GayBSD.
|
|
* Copyright (c) 2021 fef <owo@fef.moe>.
|
|
*
|
|
* GayBSD is nonviolent software: you may only use, redistribute, and/or
|
|
* modify it under the terms of the Cooperative Nonviolent Public License
|
|
* (CNPL) as found in the LICENSE file in the source code root directory
|
|
* or at <https://git.pixie.town/thufie/npl-builder>; either version 7
|
|
* of the license, or (at your option) any later version.
|
|
*
|
|
* GayBSD comes with ABSOLUTELY NO WARRANTY, to the extent
|
|
* permitted by applicable law. See the CNPL for details.
|
|
*/
|