⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arch.h

📁 一本叫自己动手写嵌入式操作系统的书的源代码,作者是蓝枫叶,详细介绍了如何写一个嵌入式操作系统,而不是操作系统
💻 H
字号:
//***********************************************************************/
//    Author                    : Garry
//    Original Date             : Sep,18 2006
//    Module Name               : ARCH_X86.H
//    Module Funciton           : 
//                                This module countains CPU specific code,in this file,
//                                Intel X86 series CPU's specific code is included.
//
//    Last modified Author      :
//    Last modified Date        :
//    Last modified Content     :
//                                1.
//                                2.
//    Lines number              :
//***********************************************************************/

#ifndef __ARCH_X86_H__
#define __ARCH_X86_H__
#endif

//
//This value is the smallest stack size of a kernel thread in IA32 platform.
//
#define MIN_STACK_SIZE 128
//
//This value is the default stack size of a kernel thread in IA32 platform,
//if the user does not give a stack size in CreateKernelThread calling,then
//use this value as stack size.
//
#define DEFAULT_STACK_SIZE 0x00004000 //16k bytes.

typedef VOID (*__KERNEL_THREAD_WRAPPER)(__COMMON_OBJECT*);

//
//Initializes the context of a kernel thread.
//The initialization process is different on different platforms,so
//implement this routine in ARCH directory.
//
VOID InitKernelThreadContext(__KERNEL_THREAD_OBJECT* lpKernelThread,
							 __KERNEL_THREAD_WRAPPER lpStartAddr);

VOID __SwitchTo(__KERNEL_THREAD_CONTEXT* lpContext);  //Switch to a new kernel thread.

//Saves current kernel thread's context,and switches to the new one.
VOID __SaveAndSwitch(__KERNEL_THREAD_CONTEXT** lppOldContext,
					 __KERNEL_THREAD_CONTEXT** lppNewContext);

VOID __GetTsc(__U64*);  //Get TSC counter.

VOID __MicroDelay(DWORD dwmSeconds);  //Microsecond delay.

#define NOP() \
__asm{    \
	nop   \
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -