Changeset 63530c62 in mainline for kernel/arch/sparc64/include/drivers/ns16550.h
- Timestamp:
- 2006-10-14T19:31:03Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e3890b3f
- Parents:
- 7dcf22a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/drivers/ns16550.h
r7dcf22a r63530c62 51 51 #define LCR_DLAB 0x80 /** Divisor Latch Access bit. */ 52 52 53 static inline uint8_t ns16550_rbr_read(void) 53 /** Structure representing the ns16550 device. */ 54 typedef struct { 55 devno_t devno; 56 volatile uint8_t *reg; /** Memory mapped registers of the ns16550. */ 57 } ns16550_t; 58 59 static inline uint8_t ns16550_rbr_read(ns16550_t *dev) 54 60 { 55 return kbd_virt_address[RBR_REG];61 return dev->reg[RBR_REG]; 56 62 } 57 63 58 static inline uint8_t ns16550_ier_read( void)64 static inline uint8_t ns16550_ier_read(ns16550_t *dev) 59 65 { 60 return kbd_virt_address[IER_REG];66 return dev->reg[IER_REG]; 61 67 } 62 68 63 static inline void ns16550_ier_write( uint8_t v)69 static inline void ns16550_ier_write(ns16550_t *dev, uint8_t v) 64 70 { 65 kbd_virt_address[IER_REG] = v;71 dev->reg[IER_REG] = v; 66 72 } 67 73 68 static inline uint8_t ns16550_iir_read( void)74 static inline uint8_t ns16550_iir_read(ns16550_t *dev) 69 75 { 70 return kbd_virt_address[IIR_REG];76 return dev->reg[IIR_REG]; 71 77 } 72 78 73 static inline void ns16550_fcr_write( uint8_t v)79 static inline void ns16550_fcr_write(ns16550_t *dev, uint8_t v) 74 80 { 75 kbd_virt_address[FCR_REG] = v;81 dev->reg[FCR_REG] = v; 76 82 } 77 83 78 static inline uint8_t ns16550_lcr_read( void)84 static inline uint8_t ns16550_lcr_read(ns16550_t *dev) 79 85 { 80 return kbd_virt_address[LCR_REG];86 return dev->reg[LCR_REG]; 81 87 } 82 88 83 static inline void ns16550_lcr_write( uint8_t v)89 static inline void ns16550_lcr_write(ns16550_t *dev, uint8_t v) 84 90 { 85 kbd_virt_address[LCR_REG] = v;91 dev->reg[LCR_REG] = v; 86 92 } 87 93 88 static inline uint8_t ns16550_lsr_read( void)94 static inline uint8_t ns16550_lsr_read(ns16550_t *dev) 89 95 { 90 return kbd_virt_address[LSR_REG];96 return dev->reg[LSR_REG]; 91 97 } 92 98
Note:
See TracChangeset
for help on using the changeset viewer.