#ifndef SHARE_SYSDEFS_DEV_H_
#define SHARE_SYSDEFS_DEV_H_

#include <stdint.h>
#include <stddef.h>

#define DEV_TERMDEV_PUTCH 0

#define DEV_PS2KBDEV_READCH     0
#define DEV_PS2KBDEV_ATTCHCONS  1

#define DEV_SERIALDEV_SENDB     0
#define DEV_SERIALDEV_SENDREADY 1
#define DEV_SERIALDEV_RECVB     2
#define DEV_SERIALDEV_RECVREADY 3

#define DEV_FBDEV_GETINFO 0

#define DEV_STOREDEV_READ       0
#define DEV_STOREDEV_WRITE      1
#define DEV_STOREDEV_SECCOUNT   2
#define DEV_STOREDEV_SECTSIZE   3

typedef struct {
  uint8_t *const buffer;
  ptrdiff_t sector;
  ptrdiff_t off;
  size_t size;
} StoreDevRead;

typedef struct {
  const uint8_t *const buffer;
  ptrdiff_t sector;
  ptrdiff_t off;
  size_t size;
} StoreDevWrite;

typedef uint64_t Dev_t;

typedef struct {
  uint16_t w, h;
  uint16_t margin;
  uint8_t fontw, fonth;
} FbDevGetInfo;

typedef struct {
  bool present;
  char name[0x100];
  size_t nfns;
} DevStat;

#endif // SHARE_SYSDEFS_DEV_H_
