- Timestamp:
- 2006-06-11T17:05:41Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f8d5b85
- Parents:
- 290c0db
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fb/ega.c
r290c0db r15039b67 50 50 #include <ipc/ns.h> 51 51 #include <ipc/services.h> 52 #include <libarch/ddi.h> 52 53 53 54 #include "ega.h" … … 71 72 #define EGA_STYLE(fg,bg) ((fg) > (bg) ? NORMAL_COLOR : INVERTED_COLOR) 72 73 73 typedef unsigned char u8;74 typedef unsigned short u16;75 typedef unsigned int u32;76 77 78 74 /* Allow only 1 connection */ 79 75 static int client_connected = 0; … … 84 80 85 81 static unsigned int style = NORMAL_COLOR; 86 87 static inline void outb(u16 port, u8 b)88 {89 asm volatile ("outb %0, %1\n" :: "a" (b), "d" (port));90 }91 92 static inline void outw(u16 port, u16 w)93 {94 asm volatile ("outw %0, %1\n" :: "a" (w), "d" (port));95 }96 97 static inline void outl(u16 port, u32 l)98 {99 asm volatile ("outl %0, %1\n" :: "a" (l), "d" (port));100 }101 102 static inline u8 inb(u16 port)103 {104 u8 val;105 106 asm volatile ("inb %1, %0 \n" : "=a" (val) : "d"(port));107 return val;108 }109 110 static inline u16 inw(u16 port)111 {112 u16 val;113 114 asm volatile ("inw %1, %0 \n" : "=a" (val) : "d"(port));115 return val;116 }117 118 static inline u32 inl(u16 port)119 {120 u32 val;121 122 asm volatile ("inl %1, %0 \n" : "=a" (val) : "d"(port));123 return val;124 }125 126 127 128 82 129 83 static void clrscr(void) … … 151 105 static void cursor_disable(void) 152 106 { 153 u8 stat; 107 uint8_t stat; 108 154 109 outb(EGA_IO_ADDRESS , 0xa); 155 110 stat=inb(EGA_IO_ADDRESS + 1); … … 160 115 static void cursor_enable(void) 161 116 { 162 u8 stat; 117 uint8_t stat; 118 163 119 outb(EGA_IO_ADDRESS , 0xa); 164 120 stat=inb(EGA_IO_ADDRESS + 1);
Note:
See TracChangeset
for help on using the changeset viewer.