[363] | 1 | /*
|
---|
| 2 | * TOPPERS/JSP Kernel
|
---|
| 3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
| 4 | * Just Standard Profile Kernel
|
---|
| 5 | *
|
---|
| 6 | * Copyright (C) 2000,2001 by Embedded and Real-Time Systems Laboratory
|
---|
| 7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
| 8 | * Copyright (C) 2002 by Monami software, Limited Partners.
|
---|
| 9 | * Copyright (C) 2008- by Monami Software Limited Partnership, JAPAN
|
---|
| 10 | *
|
---|
| 11 | * ä¸è¨èä½æ¨©è
|
---|
| 12 | ã¯ï¼ä»¥ä¸ã®(1)ã(4)ã®æ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§
|
---|
| 13 | * ã¢ï¼æ¬ã½ããã¦ã§ã¢ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹
|
---|
| 14 | * å¤ã»åé
|
---|
| 15 | å¸ï¼ä»¥ä¸ï¼å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
| 16 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
| 17 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
| 18 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
| 19 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 20 | * ç¨ã§ããå½¢ã§åé
|
---|
| 21 | å¸ããå ´åã«ã¯ï¼åé
|
---|
| 22 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
| 23 | * è
|
---|
| 24 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®èä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
| 25 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 26 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
| 27 | * ç¨ã§ããªãå½¢ã§åé
|
---|
| 28 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
| 29 | * ã¨ï¼
|
---|
| 30 | * (a) åé
|
---|
| 31 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
| 32 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
| 33 | * ä½æ¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
| 34 | * (b) åé
|
---|
| 35 | å¸ã®å½¢æ
|
---|
| 36 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
| 37 | * å ±åãããã¨ï¼
|
---|
| 38 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
| 39 | * 害ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 40 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
| 41 | 責ãããã¨ï¼
|
---|
| 42 | * ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®ã¦ã¼ã¶ã¾ãã¯ã¨ã³ãã¦ã¼ã¶ããã®ãããªãç
|
---|
| 43 | * ç±ã«åºã¥ãè«æ±ãããï¼ä¸è¨èä½æ¨©è
|
---|
| 44 | ããã³TOPPERSããã¸ã§ã¯ãã
|
---|
| 45 | * å
|
---|
| 46 | 責ãããã¨ï¼
|
---|
| 47 | *
|
---|
| 48 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨èä½æ¨©è
|
---|
| 49 | ã
|
---|
| 50 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ç¹å®ã®ä½¿ç¨ç®ç
|
---|
| 51 | * ã«å¯¾ããé©åæ§ãå«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§
|
---|
| 52 | * ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ害ã«é¢ãã¦ãï¼ã
|
---|
| 53 | * ã®è²¬ä»»ãè² ããªãï¼
|
---|
| 54 | *
|
---|
| 55 | * @(#) $Id: i386.h,v 1.1 2004/07/21 02:49:36 monaka Exp $
|
---|
| 56 | */
|
---|
| 57 |
|
---|
| 58 | #ifndef _I386_H_
|
---|
| 59 | #define _I386_H_
|
---|
| 60 |
|
---|
| 61 | /* Segment type */
|
---|
| 62 | #define I386_TYPE_SEG_DATA (0x00) /* 0000 ãã¼ã¿ã»ã°ã¡ã³ã */
|
---|
| 63 | #define I386_TYPE_SEG_EXPAND (0x04) /* 0100 ã¨ã¯ã¹ãã³ããã¦ã³ */
|
---|
| 64 | #define I386_TYPE_SEG_WRITEABLE (0x02) /* 0010 æ¸ãè¾¼ã¿å¯ */
|
---|
| 65 | #define I386_TYPE_SEG_ACCESSED (0x01) /* 0001 ã¢ã¯ã»ã¹ããããï¼ */
|
---|
| 66 | #define I386_TYPE_SEG_CODE (0x08) /* 1000 ã³ã¼ãã»ã°ã¡ã³ã */
|
---|
| 67 |
|
---|
| 68 | #define I386_TYPE_SEG_CONFORMING (0x04) /* 0100 ã³ã³ãã©ã¼ãã³ã° */
|
---|
| 69 | #define I386_TYPE_SEG_READABLE (0x02) /* 0010 èªã¿åãå¯ */
|
---|
| 70 | #define I386_TYPE_SEG_ACCESSED (0x01) /* 0001 ã¢ã¯ã»ã¹ããããï¼ */
|
---|
| 71 |
|
---|
| 72 | /* Gate type */
|
---|
| 73 | #define I386_TYPE_GATE_INTR 0xe
|
---|
| 74 | #define I386_TYPE_GATE_TRAP 0xf
|
---|
| 75 |
|
---|
| 76 | /* Segment descriptor */
|
---|
| 77 | typedef struct __i386_segment_descriptor {
|
---|
| 78 | unsigned limit_L:16;
|
---|
| 79 | unsigned base_L:24;
|
---|
| 80 | unsigned type:4;
|
---|
| 81 | unsigned s:1;
|
---|
| 82 | unsigned dpl:2;
|
---|
| 83 | unsigned p:1;
|
---|
| 84 | unsigned limit_H:4;
|
---|
| 85 | unsigned avl:1;
|
---|
| 86 | unsigned x:1;
|
---|
| 87 | unsigned db:1;
|
---|
| 88 | unsigned g:1;
|
---|
| 89 | unsigned base_H:8;
|
---|
| 90 | } __attribute__ ((packed)) SEGDESC;
|
---|
| 91 |
|
---|
| 92 | /* Gate descriptor */
|
---|
| 93 | typedef struct __i386_gate_descriptor {
|
---|
| 94 | unsigned long offset_L:16;
|
---|
| 95 | unsigned long selector:16;
|
---|
| 96 | unsigned long copy:8;
|
---|
| 97 | unsigned long type:4;
|
---|
| 98 | unsigned long s:1;
|
---|
| 99 | unsigned long dpl:2;
|
---|
| 100 | unsigned long p:1;
|
---|
| 101 | unsigned long offset_H:16;
|
---|
| 102 | } __attribute__ ((packed)) GATEDESC;
|
---|
| 103 |
|
---|
| 104 | typedef struct {
|
---|
| 105 | unsigned limit:16;
|
---|
| 106 | unsigned base:32;
|
---|
| 107 | } __attribute__ ((packed)) DESCPTR;
|
---|
| 108 |
|
---|
| 109 | #endif /* _I386_H_ */
|
---|