home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / usr / include / pexpert / i386 / protos.h < prev   
Encoding:
C/C++ Source or Header  |  2001-09-30  |  2.1 KB  |  75 lines

  1. /*
  2.  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  3.  *
  4.  * @APPLE_LICENSE_HEADER_START@
  5.  * 
  6.  * The contents of this file constitute Original Code as defined in and
  7.  * are subject to the Apple Public Source License Version 1.1 (the
  8.  * "License").  You may not use this file except in compliance with the
  9.  * License.  Please obtain a copy of the License at
  10.  * http://www.apple.com/publicsource and read it before using this file.
  11.  * 
  12.  * This Original Code and all software distributed under the License are
  13.  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  14.  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  15.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  16.  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
  17.  * License for the specific language governing rights and limitations
  18.  * under the License.
  19.  * 
  20.  * @APPLE_LICENSE_HEADER_END@
  21.  */
  22. #ifndef _PEXPERT_I386_PROTOS_H
  23. #define _PEXPERT_I386_PROTOS_H
  24.  
  25. //------------------------------------------------------------------------
  26. // x86 IN/OUT I/O inline functions.
  27. //
  28. // IN :  inb, inw, inl
  29. //       IN(port)
  30. //
  31. // OUT:  outb, outw, outl
  32. //       OUT(port, data)
  33.  
  34. typedef unsigned short   i386_ioport_t;
  35.  
  36. #define __IN(s, u) \
  37. static __inline__ unsigned u \
  38. in##s(i386_ioport_t port) \
  39. { \
  40.     unsigned u data; \
  41.     asm volatile ( \
  42.         "in" #s " %1,%0" \
  43.         : "=a" (data) \
  44.         : "d" (port)); \
  45.     return (data); \
  46. }
  47.  
  48. #define __OUT(s, u) \
  49. static __inline__ void \
  50. out##s(i386_ioport_t port, unsigned u data) \
  51. { \
  52.     asm volatile ( \
  53.         "out" #s " %1,%0" \
  54.         : \
  55.         : "d" (port), "a" (data)); \
  56. }
  57.  
  58. __IN(b, char)
  59. __IN(w, short)
  60. __IN(l, long)
  61.  
  62. __OUT(b, char)
  63. __OUT(w, short)
  64. __OUT(l, long)
  65.  
  66. extern void cninit(void);
  67. extern void bcopy(void * from, void * to, int size);
  68. extern int  sprintf(char * str, const char * format, ...);
  69.  
  70. extern boolean_t vc_progress_initialize( void * desc,
  71.                                          unsigned char * data,
  72.                                          unsigned char * clut );
  73.  
  74. #endif /* _PEXPERT_I386_PROTOS_H */
  75.