Files
my-os-project2/kernel/dev/dev.h

29 lines
437 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];
SpinLock spinlock;
} Dev;
typedef struct {
SpinLock spinlock;
Dev devs[0x100];
} DevTable;
extern DevTable DEVTABLE;
void dev_init(void);
#endif // DEV_DEV_H_