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

📄 type.h

📁 一个简单的操作系统minix的核心代码
💻 H
字号:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
				src/kernel/type.h	 	 
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

04500	#ifndef TYPE_H
04501	#define TYPE_H
04502	
04503	typedef _PROTOTYPE( void task_t, (void) );
04504	typedef _PROTOTYPE( int (*rdwt_t), (message *m_ptr) );
04505	typedef _PROTOTYPE( void (*watchdog_t), (void) );
04506	
04507	struct tasktab {
04508	  task_t *initial_pc;
04509	  int stksize;
04510	  char name[8];
04511	};
04512	
04513	struct memory {
04514	  phys_clicks base;
04515	  phys_clicks size;
04516	};
04517	
04518	/* Administration for clock polling. */
04519	struct milli_state {
04520	  unsigned long accum_count;    /* accumulated clock ticks */
04521	  unsigned prev_count;          /* previous clock value */
04522	};
04523	
04524	#if (CHIP == INTEL)
04525	typedef unsigned port_t;
04526	typedef unsigned segm_t;
04527	typedef unsigned reg_t;         /* machine register */
04528	
04529	/* The stack frame layout is determined by the software, but for efficiency
04530	 * it is laid out so the assembly code to use it is as simple as possible.
04531	 * 80286 protected mode and all real modes use the same frame, built with
04532	 * 16-bit registers.  Real mode lacks an automatic stack switch, so little
04533	 * is lost by using the 286 frame for it.  The 386 frame differs only in
04534	 * having 32-bit registers and more segment registers.  The same names are
04535	 * used for the larger registers to avoid differences in the code.
04536	 */
04537	struct stackframe_s {           /* proc_ptr points here */
04538	#if _WORD_SIZE == 4
04539	  u16_t gs;                     /* last item pushed by save */
04540	  u16_t fs;                     /*  ^ */
04541	#endif
04542	  u16_t es;                     /*  | */
04543	  u16_t ds;                     /*  | */
04544	  reg_t di;                     /* di through cx are not accessed in C */
04545	  reg_t si;                     /* order is to match pusha/popa */
04546	  reg_t fp;                     /* bp */
04547	  reg_t st;                     /* hole for another copy of sp */
04548	  reg_t bx;                     /*  | */
04549	  reg_t dx;                     /*  | */
04550	  reg_t cx;                     /*  | */
04551	  reg_t retreg;                 /* ax and above are all pushed by save */
04552	  reg_t retadr;                 /* return address for assembly code save() */
04553	  reg_t pc;                     /*  ^  last item pushed by interrupt */
04554	  reg_t cs;                     /*  | */
04555	  reg_t psw;                    /*  | */
04556	  reg_t sp;                     /*  | */
04557	  reg_t ss;                     /* these are pushed by CPU during interrupt */
04558	};
04559	
04560	struct segdesc_s {              /* segment descriptor for protected mode */
04561	  u16_t limit_low;
04562	  u16_t base_low;
04563	  u8_t base_middle;
04564	  u8_t access;                  /* |P|DL|1|X|E|R|A| */
04565	#if _WORD_SIZE == 4
04566	  u8_t granularity;             /* |G|X|0|A|LIMT| */
04567	  u8_t base_high;
04568	#else
04569	  u16_t reserved;
04570	#endif
04571	};
04572	
04573	typedef _PROTOTYPE( int (*irq_handler_t), (int irq) );
04574	
04575	#endif /* (CHIP == INTEL) */
04576	
04577	#if (CHIP == M68000)
04578	typedef _PROTOTYPE( void (*dmaint_t), (void) );
04579	
04580	typedef u32_t reg_t;            /* machine register */
04581	
04582	/* The name and fields of this struct were chosen for PC compatibility. */
04583	struct stackframe_s {
04584	  reg_t retreg;                 /* d0 */
04585	  reg_t d1;
04586	  reg_t d2;
04587	  reg_t d3;
04588	  reg_t d4;
04589	  reg_t d5;
04590	  reg_t d6;
04591	  reg_t d7;
04592	  reg_t a0;
04593	  reg_t a1;
04594	  reg_t a2;
04595	  reg_t a3;
04596	  reg_t a4;
04597	  reg_t a5;
04598	  reg_t fp;                     /* also known as a6 */
04599	  reg_t sp;                     /* also known as a7 */
04600	  reg_t pc;
04601	  u16_t psw;
04602	  u16_t dummy;                  /* make size multiple of reg_t for system.c */
04603	};
04604	
04605	struct fsave {
04606	  struct cpu_state {
04607	        u16_t i_format;
04608	        u32_t i_addr;
04609	        u16_t i_state[4];
04610	  } cpu_state;
04611	  struct state_frame {
04612	        u8_t frame_type;
04613	        u8_t frame_size;
04614	        u16_t reserved;
04615	        u8_t frame[212];
04616	  } state_frame;
04617	  struct fpp_model {
04618	        u32_t fpcr;
04619	        u32_t fpsr;
04620	        u32_t fpiar;
04621	        struct fpN {
04622	                u32_t high;
04623	                u32_t low;
04624	                u32_t mid;
04625	        } fpN[8];
04626	  } fpp_model;
04627	};
04628	#endif /* (CHIP == M68000) */
04629	
04630	#endif /* TYPE_H */

⌨️ 快捷键说明

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