Changeset 3c79afe in mainline for kernel/genarch/include
- Timestamp:
- 2009-03-12T17:54:24Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a1c048
- Parents:
- a0e1b48
- Location:
- kernel/genarch/include/drivers
- Files:
-
- 3 edited
-
i8042/i8042.h (modified) (2 diffs)
-
ns16550/ns16550.h (modified) (2 diffs)
-
z8530/z8530.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/drivers/i8042/i8042.h
ra0e1b48 r3c79afe 27 27 */ 28 28 29 /** @addtogroup genarch 29 /** @addtogroup genarch 30 30 * @{ 31 31 */ … … 41 41 #include <typedefs.h> 42 42 43 struct i8042{43 typedef struct { 44 44 ioport8_t data; 45 45 uint8_t pad[3]; 46 46 ioport8_t status; 47 } __attribute__ ((packed)); 48 typedef struct i8042 i8042_t; 47 } __attribute__ ((packed)) i8042_t; 49 48 50 typedef struct i8042_instance{49 typedef struct { 51 50 devno_t devno; 52 51 irq_t irq; 53 52 i8042_t *i8042; 54 chardev_t *devout;53 indev_t kbrdin; 55 54 } i8042_instance_t; 56 55 57 extern bool i8042_init(i8042_t *, devno_t, inr_t, chardev_t *);56 extern indev_t *i8042_init(i8042_t *, devno_t, inr_t); 58 57 59 58 #endif -
kernel/genarch/include/drivers/ns16550/ns16550.h
ra0e1b48 r3c79afe 27 27 */ 28 28 29 /** @addtogroup genarch 29 /** @addtogroup genarch 30 30 * @{ 31 31 */ 32 32 /** 33 33 * @file 34 * @brief Headers for NS 16550 serial controller.34 * @brief Headers for NS 16550 serial controller. 35 35 */ 36 36 … … 42 42 #include <console/chardev.h> 43 43 44 #define IER_ERBFI 0x01/** Enable Receive Buffer Full Interrupt. */44 #define IER_ERBFI 0x01 /** Enable Receive Buffer Full Interrupt. */ 45 45 46 #define LCR_DLAB 0x80/** Divisor Latch Access bit. */46 #define LCR_DLAB 0x80 /** Divisor Latch Access bit. */ 47 47 48 #define MCR_OUT2 0x08/** OUT2. */48 #define MCR_OUT2 0x08 /** OUT2. */ 49 49 50 50 /** NS16550 registers. */ 51 struct ns16550{52 ioport8_t rbr; /**< Receiver Buffer Register. */53 ioport8_t ier; /**< Interrupt Enable Register. */51 typedef struct { 52 ioport8_t rbr; /**< Receiver Buffer Register. */ 53 ioport8_t ier; /**< Interrupt Enable Register. */ 54 54 union { 55 ioport8_t iir; /**< Interrupt Ident Register (read). */56 ioport8_t fcr; /**< FIFO control register (write). */55 ioport8_t iir; /**< Interrupt Ident Register (read). */ 56 ioport8_t fcr; /**< FIFO control register (write). */ 57 57 } __attribute__ ((packed)); 58 ioport8_t lcr; /**< Line Control register. */ 59 ioport8_t mcr; /**< Modem Control Register. */ 60 ioport8_t lsr; /**< Line Status Register. */ 61 } __attribute__ ((packed)); 62 typedef struct ns16550 ns16550_t; 58 ioport8_t lcr; /**< Line Control register. */ 59 ioport8_t mcr; /**< Modem Control Register. */ 60 ioport8_t lsr; /**< Line Status Register. */ 61 } __attribute__ ((packed)) ns16550_t; 63 62 64 63 /** Structure representing the ns16550 device. */ 65 typedef struct ns16550_instance{64 typedef struct { 66 65 devno_t devno; 67 66 ns16550_t *ns16550; 68 67 irq_t irq; 69 chardev_t *devout;68 indev_t kbrdin; 70 69 } ns16550_instance_t; 71 70 72 extern bool ns16550_init(ns16550_t *, devno_t, inr_t, cir_t, void *, 73 chardev_t *); 74 extern irq_ownership_t ns16550_claim(irq_t *); 75 extern void ns16550_irq_handler(irq_t *); 71 extern indev_t *ns16550_init(ns16550_t *, devno_t, inr_t, cir_t, void *) 76 72 77 73 #endif -
kernel/genarch/include/drivers/z8530/z8530.h
ra0e1b48 r3c79afe 27 27 */ 28 28 29 /** @addtogroup genarch 29 /** @addtogroup genarch 30 30 * @{ 31 31 */ 32 32 /** 33 33 * @file 34 * @brief Headers for Zilog 8530 serial controller.34 * @brief Headers for Zilog 8530 serial controller. 35 35 */ 36 36 … … 42 42 #include <console/chardev.h> 43 43 44 #define WR0 045 #define WR1 146 #define WR2 247 #define WR3 348 #define WR4 449 #define WR5 550 #define WR6 651 #define WR7 752 #define WR8 853 #define WR9 954 #define WR10 1055 #define WR11 1156 #define WR12 1257 #define WR13 1358 #define WR14 1459 #define WR15 1544 #define WR0 0 45 #define WR1 1 46 #define WR2 2 47 #define WR3 3 48 #define WR4 4 49 #define WR5 5 50 #define WR6 6 51 #define WR7 7 52 #define WR8 8 53 #define WR9 9 54 #define WR10 10 55 #define WR11 11 56 #define WR12 12 57 #define WR13 13 58 #define WR14 14 59 #define WR15 15 60 60 61 #define RR0 062 #define RR1 163 #define RR2 264 #define RR3 365 #define RR8 866 #define RR10 1067 #define RR12 1268 #define RR13 1369 #define RR14 1470 #define RR15 1561 #define RR0 0 62 #define RR1 1 63 #define RR2 2 64 #define RR3 3 65 #define RR8 8 66 #define RR10 10 67 #define RR12 12 68 #define RR13 13 69 #define RR14 14 70 #define RR15 15 71 71 72 72 /** Reset pending TX interrupt. */ 73 #define WR0_TX_IP_RST (0x5 << 3)74 #define WR0_ERR_RST (0x6 << 3)73 #define WR0_TX_IP_RST (0x5 << 3) 74 #define WR0_ERR_RST (0x6 << 3) 75 75 76 76 /** Receive Interrupts Disabled. */ 77 #define WR1_RID (0x0 << 3)77 #define WR1_RID (0x0 << 3) 78 78 /** Receive Interrupt on First Character or Special Condition. */ 79 #define WR1_RIFCSC (0x1 << 3)79 #define WR1_RIFCSC (0x1 << 3) 80 80 /** Interrupt on All Receive Characters or Special Conditions. */ 81 #define WR1_IARCSC (0x2 << 3)81 #define WR1_IARCSC (0x2 << 3) 82 82 /** Receive Interrupt on Special Condition. */ 83 #define WR1_RISC (0x3 << 3)83 #define WR1_RISC (0x3 << 3) 84 84 /** Parity Is Special Condition. */ 85 #define WR1_PISC (0x1 << 2)85 #define WR1_PISC (0x1 << 2) 86 86 87 87 /** Rx Enable. */ 88 #define WR3_RX_ENABLE (0x1 << 0)88 #define WR3_RX_ENABLE (0x1 << 0) 89 89 /** 8-bits per character. */ 90 #define WR3_RX8BITSCH (0x3 << 6)90 #define WR3_RX8BITSCH (0x3 << 6) 91 91 92 92 /** Master Interrupt Enable. */ 93 #define WR9_MIE (0x1 << 3)93 #define WR9_MIE (0x1 << 3) 94 94 95 95 /** Receive Character Available. */ 96 #define RR0_RCA (0x1 << 0)96 #define RR0_RCA (0x1 << 0) 97 97 98 98 /** z8530's registers. */ 99 struct z8530{99 typedef struct { 100 100 union { 101 101 ioport8_t ctl_b; … … 111 111 uint8_t pad3; 112 112 ioport8_t data_a; 113 } __attribute__ ((packed)); 114 typedef struct z8530 z8530_t; 113 } __attribute__ ((packed)) z8530_t; 115 114 116 115 /** Structure representing the z8530 device. */ … … 119 118 irq_t irq; 120 119 z8530_t *z8530; 121 chardev_t *devout;120 indev_t kbrdin; 122 121 } z8530_instance_t; 123 122 124 extern bool z8530_init(z8530_t *, devno_t, inr_t, cir_t, void *, chardev_t *); 125 extern irq_ownership_t z8530_claim(irq_t *); 126 extern void z8530_irq_handler(irq_t *); 123 extern devin_t *z8530_init(z8530_t *, devno_t, inr_t, cir_t, void *); 127 124 128 125 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
