Changeset a5556b4 in mainline


Ignore:
Timestamp:
2005-09-17T21:24:40Z (19 years ago)
Author:
Sergey Bondari <bondari@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
714675b
Parents:
6799505
Message:

outb inline function

Location:
arch/ia32
Files:
2 edited

Legend:

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

    r6799505 ra5556b4  
    4343extern __u32 inl(int port);
    4444
    45 extern void outb(int port, __u8 b);
    4645extern void outw(int port, __u16 w);
    4746extern void outl(int port, __u32 l);
     
    8483 */
    8584static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; }
     85
     86/** Byte to port
     87 *
     88 * Output byte to port
     89 *
     90 * @param port Port to write to
     91 * @param val Value to write
     92 */
     93static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
     94
    8695
    8796/** Set priority level low
     
    167176}
    168177
     178
    169179#endif
  • arch/ia32/src/asm.S

    r6799505 ra5556b4  
    4141.global inw
    4242.global inl
    43 .global outb
    4443.global outw
    4544.global outl
     
    191190        movl 4(%esp),%edx
    192191        inl %dx,%eax
    193         ret
    194 
    195 
    196 ## I/O output (byte)
    197 #
    198 # Send a byte to I/O port.
    199 #
    200 outb:
    201         push %eax
    202 
    203         movl 8(%esp),%edx
    204         movl 12(%esp),%eax
    205         outb %al,%dx
    206 
    207         pop %eax
    208192        ret
    209193
Note: See TracChangeset for help on using the changeset viewer.