dev: remove console driver, merge into serial

Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
Michael Shaw 2024-06-17 20:32:44 -04:00
commit 52ba70f4b7
13 changed files with 163 additions and 547 deletions

View file

@ -4,4 +4,12 @@
#include <kernel/common.h>
struct char_device {
char *name;
void *data;
};
struct char_device *char_device_create(const char *name, void *data);
void char_device_destroy(struct char_device *cd);
#endif /* _CHAR_H_ */

View file

@ -1,9 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _CMD_H_
#define _CMD_H_
#include <kernel/common.h>
void kexec(const char *cmd);
#endif /* _CMD_H_ */

20
include/kernel/ringbuf.h Normal file
View file

@ -0,0 +1,20 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _RINGBUF_H
#define _RINGBUF_H
#include <kernel/common.h>
struct ringbuf {
char *buf;
size_t size;
size_t head;
size_t tail;
};
struct ringbuf *ringbuf_create(size_t size);
void ringbuf_destroy(struct ringbuf *rb);
size_t ringbuf_write(struct ringbuf *rb, const char *buf, size_t count);
size_t ringbuf_read(struct ringbuf *rb, char *buf, size_t count);
#endif /* _RINGBUF_H */