kernel: don't use typedef for enums or non-opaque structs

This commit is contained in:
2023-04-12 20:17:11 +01:00
parent 0d75e347e9
commit b6f8c1ccaa
51 changed files with 663 additions and 665 deletions

View File

@@ -6,7 +6,7 @@
Consoles are like simplified TTYs. Their purpose is to serve as an output
sink for messages printed using printk.
a console_t could be used to represent a serial port, UART port, or even
a struct console could be used to represent a serial port, UART port, or even
a text-based framebuffer display. Anything where the job of displaying
or sending text can be abstracted to a simple write() call.
@@ -22,29 +22,29 @@
extern "C" {
#endif
typedef enum console_flags {
enum console_flags {
/* console is only used during the boot process. the console
will be automatically de-registered when the first
non-boot console is registered */
CON_BOOT = 0x01u,
} console_flags_t;
};
typedef struct console {
struct console {
char c_name[16];
console_flags_t c_flags;
enum console_flags c_flags;
spin_lock_t c_lock;
void (*c_write)(struct console *, const char *, unsigned int);
int (*c_read)(struct console *, char *, unsigned int);
queue_entry_t c_list;
} console_t;
struct queue_entry c_list;
};
extern kern_status_t console_register(console_t *con);
extern kern_status_t console_unregister(console_t *con);
extern kern_status_t console_register(struct console *con);
extern kern_status_t console_unregister(struct console *con);
extern void console_write(console_t *con, const char *s, unsigned int len);
extern int console_read(console_t *con, char *s, unsigned int len);
extern void console_write(struct console *con, const char *s, unsigned int len);
extern int console_read(struct console *con, char *s, unsigned int len);
#ifdef __cplusplus
}