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.

33 lines
766 B
C

/* Copyright (C) 2021,2022 fef <owo@fef.moe>. All rights reserved. */
#pragma once
#define _ARCH_SCHED_H_
#include <arch/page.h>
#define KERN_STACK_PAGES 2
#define KERN_STACK_SHIFT (PAGE_SHIFT + KERN_STACK_PAGES - 1)
#define KERN_STACK_SIZE (1 << KERN_STACK_SHIFT)
#ifndef _ASM_SOURCE
#include <gay/cdefs.h>
#include <gay/types.h>
#ifdef __x86_64__
#include <amd64/sched.h>
#else
#include <i386/sched.h>
#endif
/**
* @brief Arch dependent low level task switch routine (x86 version).
* `new` must not be equal to `old` or the whole thing probably blows up.
*
* @param new TCB of the new task we are switching to
* @param old TCB of the old task we are switching from
*/
extern void arch_switch_to(tcb_t *new, tcb_t *old);
#endif /* not _ASM_SOURCE */