Changeset ee06f2a in mainline for kernel/arch/ia64


Ignore:
Timestamp:
2009-02-15T15:28:00Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2d96f4d
Parents:
e7f2ad68
Message:

Introduce a more platform-neutral name for programmed I/O.

The new API looks like pio_read_n() or pio_write_n(), where n is 8, 16 or 32.
The old API (i.e. inb(), inw(), inl(), outb() outw(), outl()) may have made
some people think that the interface is only to be used with the separate I/O
space. That's not the case. This API is to be implemented on all platforms
so that we can finally have really generic kernel device drivers.

Location:
kernel/arch/ia64
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/asm.h

    re7f2ad68 ree06f2a  
    4242#define IA64_IOSPACE_ADDRESS 0xE001000000000000ULL
    4343
    44 static inline void outb(ioport_t port, uint8_t v)
     44static inline void pio_write_8(ioport_t port, uint8_t v)
    4545{
    4646        *((uint8_t *)(IA64_IOSPACE_ADDRESS +
     
    5050}
    5151
    52 static inline void outw(ioport_t port, uint16_t v)
     52static inline void pio_write_16(ioport_t port, uint16_t v)
    5353{
    5454        *((uint16_t *)(IA64_IOSPACE_ADDRESS +
     
    5858}
    5959
    60 static inline void outl(ioport_t port, uint32_t v)
     60static inline void pio_write_32(ioport_t port, uint32_t v)
    6161{
    6262        *((uint32_t *)(IA64_IOSPACE_ADDRESS +
     
    6666}
    6767
    68 static inline uint8_t inb(ioport_t port)
     68static inline uint8_t pio_read_8(ioport_t port)
    6969{
    7070        asm volatile ("mf\n" ::: "memory");
     
    7474}
    7575
    76 static inline uint16_t inw(ioport_t port)
     76static inline uint16_t pio_read_16(ioport_t port)
    7777{
    7878        asm volatile ("mf\n" ::: "memory");
     
    8282}
    8383
    84 static inline uint32_t inl(ioport_t port)
     84static inline uint32_t pio_read_32(ioport_t port)
    8585{
    8686        asm volatile ("mf\n" ::: "memory");
  • kernel/arch/ia64/include/drivers/i8042.h

    re7f2ad68 ree06f2a  
    4848static inline void i8042_data_write(uint8_t data)
    4949{
    50         outb(i8042_DATA, data);
     50        pio_write_8(i8042_DATA, data);
    5151}
    5252
    5353static inline uint8_t i8042_data_read(void)
    5454{
    55         return inb(i8042_DATA);
     55        return pio_read_8(i8042_DATA);
    5656}
    5757
    5858static inline uint8_t i8042_status_read(void)
    5959{
    60         return inb(i8042_STATUS);
     60        return pio_read_8(i8042_STATUS);
    6161}
    6262
    6363static inline void i8042_command_write(uint8_t command)
    6464{
    65         outb(i8042_STATUS, command);
     65        pio_write_8(i8042_STATUS, command);
    6666}
    6767
  • kernel/arch/ia64/src/ia64.c

    re7f2ad68 ree06f2a  
    250250void arch_reboot(void)
    251251{
    252         outb(0x64, 0xfe);
     252        pio_write_8(0x64, 0xfe);
    253253        while (1)
    254254                ;
Note: See TracChangeset for help on using the changeset viewer.