kernel: don't use typedef for enums or non-opaque structs
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user