Changeset 714675b in mainline


Ignore:
Timestamp:
2005-09-18T09:14:02Z (19 years ago)
Author:
Sergey Bondari <bondari@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7b43e11
Parents:
a5556b4
Message:

Outb, outw, outl are now inline functions

Location:
arch/ia32
Files:
2 edited

Legend:

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

    ra5556b4 r714675b  
    4242extern __u16 inw(int port);
    4343extern __u32 inl(int port);
    44 
    45 extern void outw(int port, __u16 w);
    46 extern void outl(int port, __u32 l);
    4744
    4845extern void enable_l_apic_in_msr(void);
     
    9390static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
    9491
     92/** Word to port
     93 *
     94 * Output word to port
     95 *
     96 * @param port Port to write to
     97 * @param val Value to write
     98 */
     99static inline void outw(__u16 port, __u16 val) { __asm__ volatile ("outw %w0, %w1\n" : : "a" (val), "d" (port) ); }
     100
     101
     102
     103/** Double word to port
     104 *
     105 * Output double word to port
     106 *
     107 * @param port Port to write to
     108 * @param val Value to write
     109 */
     110static inline void outl(__u16 port, __u32 val) { __asm__ volatile ("outl %l0, %w1\n" : : "a" (val), "d" (port) ); }
    95111
    96112/** Set priority level low
  • arch/ia32/src/asm.S

    ra5556b4 r714675b  
    4141.global inw
    4242.global inl
    43 .global outw
    44 .global outl
    4543.global memcpy
    4644.global memsetb
     
    190188        movl 4(%esp),%edx
    191189        inl %dx,%eax
    192         ret
    193 
    194 
    195 ## I/O output (word)
    196 #
    197 # Send a word to I/O port.
    198 #
    199 outw:
    200         push %eax
    201 
    202         movl 8(%esp),%edx
    203         movl 12(%esp),%eax
    204         outw %ax,%dx
    205 
    206         pop %eax
    207         ret
    208 
    209 
    210 ## I/O output (dword)
    211 #
    212 # Send a dword to I/O port.
    213 #
    214 outl:
    215         push %eax
    216 
    217         movl 8(%esp),%edx
    218         movl 12(%esp),%eax
    219         outl %eax,%dx
    220 
    221         pop %eax
    222190        ret
    223191
Note: See TracChangeset for help on using the changeset viewer.