register.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2005 Jakub Jermar
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00035 #ifndef __ia64_REGISTER_H__
00036 #define __ia64_REGISTER_H__
00037 
00038 #define CR_IVR_MASK     0xf
00039 #define PSR_IC_MASK     0x2000
00040 #define PSR_I_MASK      0x4000
00041 #define PSR_PK_MASK     0x8000
00042 
00043 #define PSR_DT_MASK     (1<<17)
00044 #define PSR_RT_MASK     (1<<27)
00045 
00046 #define PSR_DFL_MASK    (1<<18)
00047 #define PSR_DFH_MASK    (1<<19)
00048 
00049 #define PSR_IT_MASK     0x0000001000000000
00050 
00051 #define PSR_CPL_SHIFT           32
00052 #define PSR_CPL_MASK_SHIFTED    3
00053 
00054 #define PFM_MASK        (~0x3fffffffff)
00055 
00056 #define RSC_MODE_MASK   3
00057 #define RSC_PL_MASK     12
00058 
00060 #define AR_KR0          0
00061 #define AR_KR1          1
00062 #define AR_KR2          2
00063 #define AR_KR3          3
00064 #define AR_KR4          4
00065 #define AR_KR5          5
00066 #define AR_KR6          6
00067 #define AR_KR7          7
00068 /* AR 8-15 reserved */
00069 #define AR_RSC          16
00070 #define AR_BSP          17
00071 #define AR_BSPSTORE     18
00072 #define AR_RNAT         19
00073 /* AR 20 reserved */
00074 #define AR_FCR          21
00075 /* AR 22-23 reserved */
00076 #define AR_EFLAG        24
00077 #define AR_CSD          25
00078 #define AR_SSD          26
00079 #define AR_CFLG         27
00080 #define AR_FSR          28
00081 #define AR_FIR          29
00082 #define AR_FDR          30
00083 /* AR 31 reserved */
00084 #define AR_CCV          32
00085 /* AR 33-35 reserved */
00086 #define AR_UNAT         36
00087 /* AR 37-39 reserved */
00088 #define AR_FPSR         40
00089 /* AR 41-43 reserved */
00090 #define AR_ITC          44
00091 /* AR 45-47 reserved */
00092 /* AR 48-63 ignored */
00093 #define AR_PFS          64
00094 #define AR_LC           65
00095 #define AR_EC           66
00096 /* AR 67-111 reserved */
00097 /* AR 112-127 ignored */
00098 
00100 #define CR_DCR          0
00101 #define CR_ITM          1
00102 #define CR_IVA          2
00103 /* CR3-CR7 reserved */
00104 #define CR_PTA          8
00105 /* CR9-CR15 reserved */
00106 #define CR_IPSR         16
00107 #define CR_ISR          17
00108 /* CR18 reserved */
00109 #define CR_IIP          19
00110 #define CR_IFA          20
00111 #define CR_ITIR         21
00112 #define CR_IIPA         22
00113 #define CR_IFS          23
00114 #define CR_IIM          24
00115 #define CR_IHA          25
00116 /* CR26-CR63 reserved */
00117 #define CR_LID          64
00118 #define CR_IVR          65
00119 #define CR_TPR          66
00120 #define CR_EOI          67
00121 #define CR_IRR0         68
00122 #define CR_IRR1         69
00123 #define CR_IRR2         70
00124 #define CR_IRR3         71
00125 #define CR_ITV          72
00126 #define CR_PMV          73
00127 #define CR_CMCV         74
00128 /* CR75-CR79 reserved */
00129 #define CR_LRR0         80
00130 #define CR_LRR1         81
00131 /* CR82-CR127 reserved */
00132 
00133 #ifndef __ASM__
00134 
00135 #include <arch/types.h>
00136 
00138 union psr {
00139         __u64 value;
00140         struct {
00141                 unsigned : 1;
00142                 unsigned be : 1;        
00143                 unsigned up : 1;        
00144                 unsigned ac : 1;        
00145                 unsigned mfl : 1;       
00146                 unsigned mfh : 1;       
00147                 unsigned : 7;
00148                 unsigned ic : 1;        
00149                 unsigned i : 1;         
00150                 unsigned pk : 1;        
00151                 unsigned : 1;
00152                 unsigned dt : 1;        
00153                 unsigned dfl : 1;       
00154                 unsigned dfh : 1;       
00155                 unsigned sp : 1;        
00156                 unsigned pp : 1;        
00157                 unsigned di : 1;        
00158                 unsigned si : 1;        
00159                 unsigned db : 1;        
00160                 unsigned lp : 1;        
00161                 unsigned tb : 1;        
00162                 unsigned rt : 1;        
00163                 unsigned : 4;
00164                 unsigned cpl : 2;       
00165                 unsigned is : 1;        
00166                 unsigned mc : 1;        
00167                 unsigned it : 1;        
00168                 unsigned id : 1;        
00169                 unsigned da : 1;        
00170                 unsigned dd : 1;        
00171                 unsigned ss : 1;        
00172                 unsigned ri : 2;        
00173                 unsigned ed : 1;        
00174                 unsigned bn : 1;        
00175                 unsigned ia : 1;        
00176         } __attribute__ ((packed));
00177 };
00178 typedef union psr psr_t;
00179 
00181 union rsc {
00182         __u64 value;
00183         struct {
00184                 unsigned mode : 2;
00185                 unsigned pl : 2;        
00186                 unsigned be : 1;        
00187                 unsigned : 11;
00188                 unsigned loadrs : 14;
00189         } __attribute__ ((packed));
00190 };
00191 typedef union rsc rsc_t;
00192 
00194 union cr_ivr {
00195         __u8  vector;
00196         __u64 value;
00197 };
00198 
00199 typedef union cr_ivr cr_ivr_t;
00200 
00202 union cr_tpr {
00203         struct {
00204                 unsigned : 4;
00205                 unsigned mic: 4;                
00206                 unsigned : 8;
00207                 unsigned mmi: 1;                
00208         } __attribute__ ((packed));
00209         __u64 value;
00210 };
00211 
00212 typedef union cr_tpr cr_tpr_t;
00213 
00215 union cr_itv {
00216         struct {
00217                 unsigned vector : 8;
00218                 unsigned : 4;
00219                 unsigned : 1;
00220                 unsigned : 3;
00221                 unsigned m : 1;                 
00222         } __attribute__ ((packed));
00223         __u64 value;
00224 };
00225 
00226 typedef union cr_itv cr_itv_t;
00227 
00229 union cr_isr {
00230         struct {
00231                 union {
00233                         struct {
00234                                 unsigned ge_na : 4;
00235                                 unsigned ge_code : 4;
00236                         } __attribute__ ((packed));
00237                         __u16 code;
00238                 };
00239                 __u8 vector;
00240                 unsigned : 8;
00241                 unsigned x : 1;                 
00242                 unsigned w : 1;                 
00243                 unsigned r : 1;                 
00244                 unsigned na : 1;                
00245                 unsigned sp : 1;                
00246                 unsigned rs : 1;                
00247                 unsigned ir : 1;                
00248                 unsigned ni : 1;                
00249                 unsigned so : 1;                
00250                 unsigned ei : 2;                
00251                 unsigned ed : 1;                
00252                 unsigned : 20;
00253         } __attribute__ ((packed));
00254         __u64 value;
00255 };
00256 
00257 typedef union cr_isr cr_isr_t;
00258 
00260 union cpuid3 {
00261         struct {
00262                 __u8 number;
00263                 __u8 revision;
00264                 __u8 model;
00265                 __u8 family;
00266                 __u8 archrev;
00267         } __attribute__ ((packed));
00268         __u64 value;
00269 };
00270 
00271 typedef union cpuid3 cpuid3_t;
00272 
00273 #endif /* !__ASM__ */
00274 
00275 #endif
00276 

Generated on Sun Jun 18 16:51:20 2006 for HelenOS Kernel (ia64) by  doxygen 1.4.6