28 lines
416 B
C
28 lines
416 B
C
#ifndef DEV_DEV_H_
|
|
#define DEV_DEV_H_
|
|
|
|
#include <stdint.h>
|
|
#include "spinlock/spinlock.h"
|
|
|
|
#define DEV_FNS_MAX 32
|
|
|
|
typedef int32_t (*DevFn)(uint8_t *buffer, size_t len, void *extra);
|
|
|
|
typedef struct {
|
|
int _hshtbstate;
|
|
char ident[0x100];
|
|
DevFn fns[DEV_FNS_MAX];
|
|
} Dev;
|
|
|
|
|
|
typedef struct {
|
|
SpinLock spinlock;
|
|
Dev devs[0x100];
|
|
} DevTable;
|
|
|
|
extern DevTable DEVTABLE;
|
|
|
|
void dev_init(void);
|
|
|
|
#endif // DEV_DEV_H_
|