#ifndef _KAIOCTL_H_
#define _KAIOCTL_H_

#ifndef _IOWR
#ifdef KERNEL
#include "../h/ioctl.h"
#else
#include <sys/ioctl.h>
#endif
#endif

#include "../rciext/crashinfo.h"

struct blkdesc {
  int size;
  char *addr;
  } ;

struct blkdescto {
  int size;
  char *addr;
  int timeout;
  } ;

struct blkadesc {
  int size;
  char *haddr;
  char *saddr;
  } ;

struct sharedesc {
  int size;
  char *addr;
  int qbhandle;
  } ;

struct qballocreq {
  int size;
  int cpu;
  int qbhandle;
  } ;

#define KAIOC_GETIPCR  _IOR(k,1,unsigned short int)
#define KAIOC_SETIPCR  _IOW(k,2,unsigned short int)
#define KAIOC_BISIPCR  _IOW(k,3,unsigned short int)
#define KAIOC_BICIPCR  _IOW(k,4,unsigned short int)
#define KAIOC_BOOT     _IOW(k,5,struct blkdesc)
#define KAIOC_RMSGBUF  _IOW(k,6,struct blkdesc)
#define KAIOC_WMSGBUF  _IOW(k,7,struct blkdesc)
#define KAIOC_CLEAR    _IO(k,8)
#define KAIOC_DOWNLOAD _IOW(k,9,struct blkadesc)
#define KAIOC_START    _IOW(k,10,int[2])
#define KAIOC_STOP     _IO(k,11)
#define KAIOC_ALLOC    _IOW(k,12,struct blkdesc)
#define KAIOC_READONLY _IOW(k,13,struct blkdesc)
#define KAIOC_QBALLOC  _IOWR(k,14,struct qballocreq)
#define KAIOC_IMPORT   _IOW(k,15,struct sharedesc)
#define KAIOC_EXPORT   _IOW(k,16,struct sharedesc)
#define KAIOC_SIMPORT  _IOW(k,17,struct sharedesc)
#define KAIOC_SEXPORT  _IOW(k,18,struct sharedesc) /* "sexport"...teehee */
#define KAIOC_REQSIGS  _IO(k,19)
#define KAIOC_GETSKV   _IOW(k,20,struct blkdescto)
#define KAIOC_SBRK     _IOWR(k,21,int)
#define KAIOC_SIGNAL   _IOW(k,22,int)
#define KAIOC_ONCRASH  _IOW(k,23,int)
#define KAIOC_GETCRASH _IOW(k,24,CRASHINFO*)
#define KAIOC_SETCLEAR _IOW(k,25,int)
#define KAIOC_SETSTOP  _IOW(k,26,int)

#include "../rciext/kaipcr.h"

#endif
