Use shared macros for dev function IDs

This commit is contained in:
2025-10-04 21:34:48 +02:00
parent acbf051dbc
commit 70d6931e3b
3 changed files with 4 additions and 7 deletions

View File

@ -7,6 +7,7 @@
#include "errors.h"
#include "util/util.h"
#include "hshtb.h"
#include "sysdefs/devctl.h"
int32_t termdev_putch(uint8_t *buffer, size_t len, void *extra) {
kprintf("%.*s", (int)len, (char *)buffer);
@ -16,6 +17,6 @@ int32_t termdev_putch(uint8_t *buffer, size_t len, void *extra) {
void termdev_init(void) {
Dev *termdev = NULL;
HSHTB_ALLOC(DEVTABLE.devs, ident, "termdev", termdev);
termdev->fns[0] = &termdev_putch;
termdev->fns[DEV_TERMDEV_PUTCH] = &termdev_putch;
spinlock_init(&termdev->spinlock);
}