dev: remove console driver, merge into serial
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
This commit is contained in:
parent
cfe2ee22fb
commit
52ba70f4b7
13 changed files with 163 additions and 547 deletions
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef _CONSOLE_H_
|
||||
#define _CONSOLE_H_
|
||||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
void console_init();
|
||||
void console_resize();
|
||||
void console_input(char c);
|
||||
void console_clear();
|
||||
bool console_ready();
|
||||
void console_putchar(char c);
|
||||
|
||||
#endif /* __ASM__ */
|
||||
#endif /* _CONSOLE_H_ */
|
||||
|
|
@ -6,9 +6,12 @@
|
|||
|
||||
#ifndef __ASM__
|
||||
|
||||
#include <kernel/common.h>
|
||||
|
||||
void isr_serial_input();
|
||||
void isr_serial_input_1();
|
||||
void serial_write(char c);
|
||||
ssize_t serial_write(const char *buf, size_t count);
|
||||
void serial_putchar(char c);
|
||||
void serial_trap();
|
||||
int serial_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -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_ */
|
||||
|
|
|
|||
|
|
@ -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
20
include/kernel/ringbuf.h
Normal 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 */
|
||||
Loading…
Reference in a new issue