Ignore:
Timestamp:
Mar 9, 2006, 4:35:00 PM (15 years ago)
Author:
Sam Hocevar
Message:
  • Added assembly code for inb() and outb().
  • Print a small message at kernel boot time just to check that the kernel was properly loaded.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/kernel/kernel.h

    r568 r573  
    2828#define __BIG_ENDIAN 2
    2929
     30/* Assembly code for outb and inb */
     31extern inline void outb(unsigned char val, unsigned short port);
     32extern inline unsigned char inb(unsigned short port);
     33
     34extern inline void outb(unsigned char val, unsigned short port)
     35{
     36    __asm__ __volatile__ ("outb %b0,%w1" : : "a" (val), "Nd" (port));
     37}
     38
     39extern inline unsigned char inb(unsigned short port)
     40{
     41    unsigned char tmp;
     42    __asm__ __volatile__ ("inb %w1,%0" : "=a" (tmp) : "Nd" (port));
     43    return tmp;
     44}
     45
    3046/* Various typedefs -- some are x86-specific */
    3147#define CUSTOM_INTTYPES
    3248typedef unsigned char uint8_t;
    3349typedef unsigned short uint16_t;
    34 typedef unsigned int uint32_t;
    35 typedef unsigned int uintptr_t;
     50typedef unsigned long int uint32_t;
     51typedef long int intptr_t;
     52typedef long unsigned int uintptr_t;
    3653
    3754typedef unsigned int size_t;
Note: See TracChangeset for help on using the changeset viewer.