Changeset 80d2bdb in mainline for arch/amd64/include/asm.h


Ignore:
Timestamp:
2005-12-15T16:10:19Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4cad8b2
Parents:
7dd2561
Message:

We are now almost -Wall clean.

  • redefined atomic_t
  • deleted many, many unused variables
  • some minor code cleanups found using compiler warning.
File:
1 edited

Legend:

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

    r7dd2561 r80d2bdb  
    5555
    5656
    57 static inline __u8 inb(__u16 port)
    58 {
    59         __u8 out;
    60 
    61         __asm__ volatile (
    62                 "mov %1, %%dx\n"
    63                 "inb %%dx,%%al\n"
    64                 "mov %%al, %0\n"
    65                 :"=m"(out)
    66                 :"m"(port)
    67                 :"%rdx","%rax"
    68                 );
    69         return out;
    70 }
    71 
    72 static inline __u8 outb(__u16 port,__u8 b)
    73 {
    74         __asm__ volatile (
    75                 "mov %0,%%dx\n"
    76                 "mov %1,%%al\n"
    77                 "outb %%al,%%dx\n"
    78                 :
    79                 :"m"( port), "m" (b)
    80                 :"%rdx","%rax"
    81                 );
    82 }
     57/** Byte from port
     58 *
     59 * Get byte from port
     60 *
     61 * @param port Port to read from
     62 * @return Value read
     63 */
     64static inline __u8 inb(__u16 port) { __u8 val; __asm__ volatile ("inb %w1, %b0 \n" : "=a" (val) : "d" (port) ); return val; }
     65
     66/** Byte to port
     67 *
     68 * Output byte to port
     69 *
     70 * @param port Port to write to
     71 * @param val Value to write
     72 */
     73static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
    8374
    8475/** Enable interrupts.
Note: See TracChangeset for help on using the changeset viewer.