/*

    Copyright (C) Corollary, Inc., 1993, 1994.
    All Rights Reserved.
    This Module contains Proprietary Information of
    Corollary, Inc., and should be treated as Confidential.

Module Name:

    cbustype.h

Abstract:

    Cbus1 architecture type definitions for the Corollary C-bus I
    multiprocessor PSD modules.

Author:

    Landy Wang (landy@corollary.com) 11-Jan-1994
 */

#ifndef _CBUSTYPES_
#define _CBUSTYPES_

#define IN
#define OUT

#define TRUE            1
#define FALSE           0

#define NO_ERROR        0

#define UNREFERENCED_PARAMETER(x)       (x = x)

typedef void *          PVOID;
typedef void            VOID;

typedef char            CHAR;
typedef char            BOOL;
typedef char *          PCHAR;
typedef char *          caddr_t;
typedef unsigned char   UCHAR;
typedef unsigned char * PUCHAR;
typedef unsigned short  USHORT;
typedef long            LONG;
typedef long *          PLONG;
typedef unsigned long   ULONG;
typedef unsigned long   ULONG;
typedef unsigned long * PULONG;

/*
 * OS/2 PSD return values
 */
#define NO_ERROR        0
#define API_FAILED      (ULONG)-1

/*
 * 8259 PIC access addresses
 */
#define MIMR_PORT       (PUCHAR)0x21
#define SIMR_PORT       (PUCHAR)0xA1

/*
 * usage of the PLMA space...
 */

#define IRQSTACKSIZE 48

typedef struct cbusprivate_s {
        ULONG   processor;              /* zero-based processor number */
        PULONG  taskpri;                /* task priority register pointer */
        PULONG  EOIReg;                 /* EOI register pointer */

        ULONG   IrqCount;
        ULONG   IrqStack[IRQSTACKSIZE];

} CBUS_PRIVATE;

#ifdef DEBUG
#define ASSERT(x)       if (!(x))   printf("FATAL CBUS ASSERTION ERROR\n");
#else
#define ASSERT(x)
#endif

/*--------------- function prototypes start here  ------------------*/

extern ULONG            psd_map(ULONG, ULONG);
extern void             psd_unmap(caddr_t, ULONG);
//whh extern void             psd_unmap(caddr_t, ULONG, ULONG);

extern void             printf(char *, ...);

extern  void            outb(PUCHAR, CHAR);
extern  UCHAR           inb(PUCHAR);

extern  void            bcopy(PVOID, PVOID, ULONG);
extern  void            bzero(PVOID, ULONG);

/*--------------- function prototypes end here  ------------------*/

#endif      /* _CBUSTYPES_ */
