00001
00006 #ifndef __L4_FPAGE_32BIT_H__
00007 #define __L4_FPAGE_32BIT_H__
00008
00009
00010
00011
00012
00022 typedef struct {
00023 unsigned grant:1;
00024 unsigned write:1;
00025 unsigned size:6;
00026 unsigned zero:1;
00027 unsigned cache:3;
00028 unsigned page:20;
00029 } l4_fpage_struct_t;
00030
00035 typedef struct {
00036 unsigned grant:1;
00037 unsigned zero1:1;
00038 unsigned iosize:6;
00039 unsigned zero2:4;
00040 unsigned iopage:16;
00041 unsigned f: 4;
00042 } l4_iofpage_struct_t;
00043
00048 typedef struct {
00049 unsigned grant:1;
00050 unsigned zero1:1;
00051 unsigned order:6;
00052 unsigned one:4;
00053 unsigned taskno:16;
00054 unsigned f: 4;
00055 } l4_capfpage_struct_t;
00056
00061 typedef union {
00062 l4_umword_t fpage;
00063 l4_umword_t raw;
00064 l4_fpage_struct_t fp;
00065 l4_iofpage_struct_t iofp;
00066 l4_capfpage_struct_t capfp;
00067 } l4_fpage_t;
00068
00072 enum
00073 {
00074 L4_WHOLE_ADDRESS_SPACE = 32
00075 };
00076
00077 #include <l4/sys/__l4_fpage-common.h>
00078
00079 L4_INLINE l4_fpage_t
00080 l4_fpage(unsigned long address, unsigned int size,
00081 unsigned char write, unsigned char grant)
00082 {
00083 return ((l4_fpage_t){fp:{grant, write, size, 0, 0,
00084 (address & L4_PAGEMASK) >> 12 }});
00085 }
00086
00087
00088 L4_INLINE int
00089 l4_is_io_page_fault(unsigned long address)
00090 {
00091 l4_fpage_t t;
00092 t.fpage = address;
00093 return t.iofp.f == 0xf && t.iofp.zero2 == 0;
00094 }
00095
00096 L4_INLINE l4_fpage_t
00097 l4_iofpage(unsigned port, unsigned int size,
00098 unsigned char grant)
00099 {
00100 return ((l4_fpage_t){iofp:{grant, 0, size, 0, port, 0xf}});
00101 }
00102
00103
00104 L4_INLINE l4_fpage_t
00105 l4_capfpage(unsigned taskno, unsigned int order,
00106 unsigned char grant)
00107 {
00108 return ((l4_fpage_t){capfp:{grant, 0, order, 1, taskno, 0xf}});
00109 }
00110
00111 #endif