Changeset 7d60cf5 in mainline for kernel/arch/ia32/include/asm.h


Ignore:
Timestamp:
2009-02-19T21:58:37Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5cb223f
Parents:
4b44099d
Message:

Introduce ioport8_t, ioport16_t and ioport32_t. These types are to be used with
pio_read_n() and pio_write_n() functions. This breaks everything.

File:
1 edited

Legend:

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

    r4b44099d r7d60cf5  
    106106 * @param val Value to write
    107107 */
    108 static inline void pio_write_8(uint16_t port, uint8_t val)
    109 {
    110         asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) );
     108static inline void pio_write_8(ioport8_t *port, uint8_t val)
     109{
     110        asm volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port));
    111111}
    112112
     
    118118 * @param val Value to write
    119119 */
    120 static inline void pio_write_16(uint16_t port, uint16_t val)
    121 {
    122         asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) );
     120static inline void pio_write_16(ioport16_t *port, uint16_t val)
     121{
     122        asm volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port));
    123123}
    124124
     
    130130 * @param val Value to write
    131131 */
    132 static inline void pio_write_32(uint16_t port, uint32_t val)
    133 {
    134         asm volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) );
     132static inline void pio_write_32(ioport32_t *port, uint32_t val)
     133{
     134        asm volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port));
    135135}
    136136
     
    142142 * @return Value read
    143143 */
    144 static inline uint8_t pio_read_8(uint16_t port)
     144static inline uint8_t pio_read_8(ioport8_t *port)
    145145{
    146146        uint8_t val;
    147147       
    148         asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) );
     148        asm volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port));
    149149        return val;
    150150}
     
    157157 * @return Value read
    158158 */
    159 static inline uint16_t pio_read_16(uint16_t port)
     159static inline uint16_t pio_read_16(ioport16_t *port)
    160160{
    161161        uint16_t val;
    162162       
    163         asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port) );
     163        asm volatile ("inw %w1, %w0 \n" : "=a" (val) : "d" (port));
    164164        return val;
    165165}
     
    172172 * @return Value read
    173173 */
    174 static inline uint32_t pio_read_32(uint16_t port)
     174static inline uint32_t pio_read_32(ioport32_t *port)
    175175{
    176176        uint32_t val;
    177177       
    178         asm volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port) );
     178        asm volatile ("inl %w1, %l0 \n" : "=a" (val) : "d" (port));
    179179        return val;
    180180}
Note: See TracChangeset for help on using the changeset viewer.