Changeset 80d2bdb in mainline for arch/amd64/include/asm.h
- Timestamp:
- 2005-12-15T16:10:19Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b4cad8b2
- Parents:
- 7dd2561
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/include/asm.h
r7dd2561 r80d2bdb 55 55 56 56 57 static inline __u8 inb(__u16 port) 58 { 59 __u8 out; 60 61 __asm__ volatile ( 62 "mov %1, %%dx\n" 63 "inb %%dx,%%al\n" 64 "mov %%al, %0\n" 65 :"=m"(out) 66 :"m"(port) 67 :"%rdx","%rax" 68 ); 69 return out; 70 } 71 72 static inline __u8 outb(__u16 port,__u8 b) 73 { 74 __asm__ volatile ( 75 "mov %0,%%dx\n" 76 "mov %1,%%al\n" 77 "outb %%al,%%dx\n" 78 : 79 :"m"( port), "m" (b) 80 :"%rdx","%rax" 81 ); 82 } 57 /** Byte from port 58 * 59 * Get byte from port 60 * 61 * @param port Port to read from 62 * @return Value read 63 */ 64 static inline __u8 inb(__u16 port) { __u8 val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; } 65 66 /** Byte to port 67 * 68 * Output byte to port 69 * 70 * @param port Port to write to 71 * @param val Value to write 72 */ 73 static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); } 83 74 84 75 /** Enable interrupts.
Note:
See TracChangeset
for help on using the changeset viewer.