v2 initial commit
This commit is contained in:
parent
2c97dba9f7
commit
d2ef885e8d
118 changed files with 2420 additions and 9320 deletions
40
include/drivers/tty.h
Normal file
40
include/drivers/tty.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _TTY_H_
|
||||
#define _TTY_H_
|
||||
|
||||
#include <kernel/device.h>
|
||||
|
||||
#define DEV_CLASS_TTY 0x01
|
||||
|
||||
struct tty_serial_ops {
|
||||
void (*serial_putchar)(struct tty *tty, char c);
|
||||
char (*serial_getchar)(struct tty *tty);
|
||||
};
|
||||
|
||||
struct tty {
|
||||
dev_t dev;
|
||||
dev_t serial_device;
|
||||
void *serial_device_private;
|
||||
|
||||
struct tty_serial_ops *serial_ops;
|
||||
};
|
||||
|
||||
void tty_layer_init();
|
||||
|
||||
struct tty *tty_create(const char *name, dev_t serial_device);
|
||||
void tty_putchar(struct tty *tty, char c);
|
||||
char tty_getchar(struct tty *tty);
|
||||
void tty_write(struct tty *tty, const char *s);
|
||||
|
||||
void arch_serial_write(struct tty *tty, char c);
|
||||
char arch_serial_read(struct tty *tty);
|
||||
|
||||
void tty_send_dsr(struct tty *tty);
|
||||
void tty_set_origin_mode(struct tty *tty);
|
||||
void tty_clear_screen(struct tty *tty);
|
||||
void tty_set_cursor_pos(struct tty *tty, int x, int y);
|
||||
void tty_get_cursor_pos(struct tty *tty, int *row, int *col);
|
||||
void tty_get_size(struct tty *tty, int *rows, int *cols);
|
||||
void tty_setlf(struct tty *tty);
|
||||
|
||||
#endif /* _TTY_H_ */
|
||||
Loading…
Reference in a new issue