exception.h

来自「小型操作系统,以VC为开发环境,需要boachs调试」· C头文件 代码 · 共 63 行

H
63
字号
/***************************************************************************
**     File name   : exception.h
**     Author      : x.cheng
**     Create date :
**
**	  Comments:
**		exception...
**	
**     Revisions:
**     $Log: exception.h,v $
**     Revision 1.1  2005/08/05 15:07:03  x.cheng
**     add into repositories
**
**
***************************************************************************/
#ifndef __EXCEPTION_H__
#define __EXCEPTION_H__

//! Context after an exception.
typedef struct ExceptionContext_Struct
{
	// General purpose register.
	unsigned long ulEdi, ulEsi, ulEbp, ulEbx, ulEdx, ulEcx, ulEax;
	
	unsigned long ulEs, ulDs;	// Segment register.
	
	unsigned long ulExcNb, ulErrorCode;	// The exception number and error code.

	unsigned long ulEip;		// Current instruction pointer (k.a. program counter).
	
	unsigned long ulCs;			// Code segment register.
	
	unsigned long ulEflags;		// EFLAGS register.

} __attribute__ ((packed)) ts_ExceptionContext;

//! Context after an exception.
typedef struct ExceptionUserContext_Struct
{
	// General purpose register.
	unsigned long ulEdi, ulEsi, ulEbp, ulEbx, ulEdx, ulEcx, ulEax;
	
	unsigned long ulEs, ulDs;	// Segment register.
	
	unsigned long ulExcNb, ulErrorCode;	// The exception number and error code.

	unsigned long ulEip;		// Current instruction pointer (k.a. program counter).
	
	unsigned long ulCs;			// Code segment register.
	
	unsigned long ulEflags;		// EFLAGS register.

	unsigned long ulUserEsp;	// User stack pointer register.
	
	unsigned long ulUserSs;		// User stack segment register.

} __attribute__ ((packed)) ts_ExceptionUserContext;


void DefaultExceptionHandler(ts_ExceptionContext* pstContext);

#endif /* end of  __EXCEPTION_H__ */

⌨️ 快捷键说明

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