Ignore:
Timestamp:
2006-10-14T19:31:03Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3890b3f
Parents:
7dcf22a
Message:

Changes in ns16550 and z8530 drivers.
Add some stuff for IRQ notifications to irq_t.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/drivers/ns16550.h

    r7dcf22a r63530c62  
    5151#define LCR_DLAB        0x80    /** Divisor Latch Access bit. */
    5252
    53 static inline uint8_t ns16550_rbr_read(void)
     53/** Structure representing the ns16550 device. */
     54typedef struct {
     55        devno_t devno;
     56        volatile uint8_t *reg;  /** Memory mapped registers of the ns16550. */
     57} ns16550_t;
     58
     59static inline uint8_t ns16550_rbr_read(ns16550_t *dev)
    5460{
    55         return kbd_virt_address[RBR_REG];
     61        return dev->reg[RBR_REG];
    5662}
    5763
    58 static inline uint8_t ns16550_ier_read(void)
     64static inline uint8_t ns16550_ier_read(ns16550_t *dev)
    5965{
    60         return kbd_virt_address[IER_REG];
     66        return dev->reg[IER_REG];
    6167}
    6268
    63 static inline void ns16550_ier_write(uint8_t v)
     69static inline void ns16550_ier_write(ns16550_t *dev, uint8_t v)
    6470{
    65         kbd_virt_address[IER_REG] = v;
     71        dev->reg[IER_REG] = v;
    6672}
    6773
    68 static inline uint8_t ns16550_iir_read(void)
     74static inline uint8_t ns16550_iir_read(ns16550_t *dev)
    6975{
    70         return kbd_virt_address[IIR_REG];
     76        return dev->reg[IIR_REG];
    7177}
    7278
    73 static inline void ns16550_fcr_write(uint8_t v)
     79static inline void ns16550_fcr_write(ns16550_t *dev, uint8_t v)
    7480{
    75         kbd_virt_address[FCR_REG] = v;
     81        dev->reg[FCR_REG] = v;
    7682}
    7783
    78 static inline uint8_t ns16550_lcr_read(void)
     84static inline uint8_t ns16550_lcr_read(ns16550_t *dev)
    7985{
    80         return kbd_virt_address[LCR_REG];
     86        return dev->reg[LCR_REG];
    8187}
    8288
    83 static inline void ns16550_lcr_write(uint8_t v)
     89static inline void ns16550_lcr_write(ns16550_t *dev, uint8_t v)
    8490{
    85         kbd_virt_address[LCR_REG] = v;
     91        dev->reg[LCR_REG] = v;
    8692}
    8793
    88 static inline uint8_t ns16550_lsr_read(void)
     94static inline uint8_t ns16550_lsr_read(ns16550_t *dev)
    8995{
    90         return kbd_virt_address[LSR_REG];
     96        return dev->reg[LSR_REG];
    9197}
    9298
Note: See TracChangeset for help on using the changeset viewer.