Changeset 23d22eb in mainline for arch/ia32/include/asm.h
- Timestamp:
- 2006-03-17T11:55:43Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd72b475
- Parents:
- 4e49572
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/include/asm.h
r4e49572 r23d22eb 54 54 static inline void cpu_sleep(void) { __asm__("hlt\n"); }; 55 55 56 /** Read CR2 57 * 58 * Return value in CR2 59 * 60 * @return Value read. 61 */ 62 static inline __u32 read_cr2(void) { __u32 v; __asm__ volatile ("movl %%cr2,%0\n" : "=r" (v)); return v; } 63 64 /** Write CR3 65 * 66 * Write value to CR3. 67 * 68 * @param v Value to be written. 69 */ 70 static inline void write_cr3(__u32 v) { __asm__ volatile ("movl %0,%%cr3\n" : : "r" (v)); } 71 72 /** Read CR3 73 * 74 * Return value in CR3 75 * 76 * @return Value read. 77 */ 78 static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; } 56 #define GEN_READ_REG(reg) static inline __native read_ ##reg (void) \ 57 { \ 58 __native res; \ 59 __asm__ volatile ("movl %%" #reg ", %0" : "=r" (res) ); \ 60 return res; \ 61 } 62 63 #define GEN_WRITE_REG(reg) static inline void write_ ##reg (__native regn) \ 64 { \ 65 __asm__ volatile ("movl %0, %%" #reg : : "r" (regn)); \ 66 } 67 68 GEN_READ_REG(cr0); 69 GEN_READ_REG(cr2); 70 GEN_READ_REG(cr3); 71 GEN_WRITE_REG(cr3); 72 73 GEN_READ_REG(dr0); 74 GEN_READ_REG(dr1); 75 GEN_READ_REG(dr2); 76 GEN_READ_REG(dr3); 77 GEN_READ_REG(dr6); 78 GEN_READ_REG(dr7); 79 80 GEN_WRITE_REG(dr0); 81 GEN_WRITE_REG(dr1); 82 GEN_WRITE_REG(dr2); 83 GEN_WRITE_REG(dr3); 84 GEN_WRITE_REG(dr6); 85 GEN_WRITE_REG(dr7); 79 86 80 87 /** Byte to port
Note:
See TracChangeset
for help on using the changeset viewer.