1bdcaa8d0Smrg/*
2bdcaa8d0Smrg * file vos.h
3bdcaa8d0Smrg *
4bdcaa8d0Smrg * layer to map operating system dependent system calls
5bdcaa8d0Smrg */
6bdcaa8d0Smrg
7bdcaa8d0Smrg#ifndef __VOS_H__
8bdcaa8d0Smrg#define __VOS_H__
9bdcaa8d0Smrg
10bdcaa8d0Smrg
11bdcaa8d0Smrg/* Define IODEBUG if you need to debug out/in functions.  <DI> */
12bdcaa8d0Smrg/* IODEBUG define is used in compiler.h. DON'T MOVE DOWN!      */
13bdcaa8d0Smrg
14bdcaa8d0Smrg/* #define IODEBUG */
15bdcaa8d0Smrg
16bdcaa8d0Smrg/*
17bdcaa8d0Smrg * includes
18bdcaa8d0Smrg */
19bdcaa8d0Smrg
20bdcaa8d0Smrg#include "compiler.h"
21bdcaa8d0Smrg#include "vtypes.h"
22bdcaa8d0Smrg
23bdcaa8d0Smrg/*
24bdcaa8d0Smrg * function prototypes
25bdcaa8d0Smrg */
26880c7e28Smrg#define /*void*/ verite_out8(/*unsigned long*/ port, /*vu8*/ data) \
27bdcaa8d0Smrg                   outb(port, data)
28bdcaa8d0Smrg
29880c7e28Smrg#define /*void*/ verite_out16(/*unsigned long*/ port, /*vu16*/ data) \
30bdcaa8d0Smrg                   outw(port, data)
31bdcaa8d0Smrg
32880c7e28Smrg#define /*void*/ verite_out32(/*unsigned long*/ port, /*vu32*/ data) \
33bdcaa8d0Smrg                   outl(port, data)
34bdcaa8d0Smrg
35880c7e28Smrg#define /*vu8*/  verite_in8(/*unsigned long*/ io_base)  ((vu8)inb(io_base))
36880c7e28Smrg#define /*vu16*/ verite_in16(/*unsigned long*/ io_base) ((vu16)inw(io_base))
37880c7e28Smrg#define /*vu32*/ verite_in32(/*unsigned long*/ io_base) ((vu32)inl(io_base))
38bdcaa8d0Smrg
39bdcaa8d0Smrg/* memory accesses */
40bdcaa8d0Smrg#define verite_read_memory32(base, offset) MMIO_IN32(base, offset)
41bdcaa8d0Smrg#define verite_read_memory16(base, offset) MMIO_IN16(base, offset)
42bdcaa8d0Smrg#define verite_read_memory8(base, offset)  MMIO_IN8(base, offset)
43bdcaa8d0Smrg#define verite_write_memory32(base, offset, data) MMIO_OUT32(base, offset, data)
44bdcaa8d0Smrg#define verite_write_memory16(base, offset, data) MMIO_OUT16(base, offset, data)
45bdcaa8d0Smrg#define verite_write_memory8(base, offset, data)  MMIO_OUT8(base, offset, data)
46bdcaa8d0Smrg
47bdcaa8d0Smrg/* the rest of it */
48bdcaa8d0Smrgvoid verite_enableio(void);
49bdcaa8d0Smrgvoid verite_disableio(void);
50bdcaa8d0Smrgvu8 *verite_mapmemory(vu8 *membase, vu32 size);
51bdcaa8d0Smrgvoid verite_unmapmemory(vu8 *vmembase, vu32 size);
52bdcaa8d0Smrg
53bdcaa8d0Smrg#endif /* #ifndef _VOS_H_ */
54bdcaa8d0Smrg
55bdcaa8d0Smrg/*
56bdcaa8d0Smrg * end of file vos.h
57bdcaa8d0Smrg */
58