include/linux/serial_core.h
Source file repositories/reference/linux-study-clean/include/linux/serial_core.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/serial_core.h- Extension
.h- Size
- 41977 bytes
- Lines
- 1322
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitops.hlinux/compiler.hlinux/console.hlinux/interrupt.hlinux/lockdep.hlinux/printk.hlinux/spinlock.hlinux/sched.hlinux/tty.hlinux/mutex.hlinux/sysrq.huapi/linux/serial_core.h
Detected Declarations
struct uart_portstruct serial_structstruct serial_port_devicestruct devicestruct gpio_descstruct uart_opsstruct uart_icountstruct uart_portstruct uart_statestruct modulestruct tty_driverstruct uart_driverstruct earlycon_devicestruct earlycon_idenum uart_iotypeenum uart_pm_stateenum UART_TX_FLAGSfunction __uart_port_lock_irqsavefunction __uart_port_unlock_irqrestorefunction uart_port_set_consfunction __uart_port_using_nbconfunction __uart_port_nbcon_try_acquirefunction __uart_port_nbcon_acquirefunction __uart_port_nbcon_releasefunction uart_port_lockfunction uart_port_lock_irqfunction uart_port_lock_irqsavefunction uart_port_trylockfunction uart_port_trylock_irqsavefunction uart_port_unlockfunction uart_port_unlock_irqfunction uart_port_unlock_irqrestorefunction serial_port_infunction serial_port_outfunction uart_xmit_advancefunction uart_fifo_outfunction uart_fifo_getfunction uart_fifo_timeoutfunction uart_poll_timeoutfunction setup_earlyconfunction uart_console_registered_lockedfunction uart_console_registeredfunction uart_tx_stoppedfunction uart_cts_enabledfunction uart_softcts_modefunction uart_handle_sysrq_charfunction uart_prepare_sysrq_charfunction uart_unlock_and_check_sysrq
Annotated Snippet
struct uart_ops {
unsigned int (*tx_empty)(struct uart_port *);
void (*set_mctrl)(struct uart_port *, unsigned int mctrl);
unsigned int (*get_mctrl)(struct uart_port *);
void (*stop_tx)(struct uart_port *);
void (*start_tx)(struct uart_port *);
void (*throttle)(struct uart_port *);
void (*unthrottle)(struct uart_port *);
void (*send_xchar)(struct uart_port *, char ch);
void (*stop_rx)(struct uart_port *);
void (*start_rx)(struct uart_port *);
void (*enable_ms)(struct uart_port *);
void (*break_ctl)(struct uart_port *, int ctl);
int (*startup)(struct uart_port *);
void (*shutdown)(struct uart_port *);
void (*flush_buffer)(struct uart_port *);
void (*set_termios)(struct uart_port *, struct ktermios *new,
const struct ktermios *old);
void (*set_ldisc)(struct uart_port *, struct ktermios *);
void (*pm)(struct uart_port *, unsigned int state,
unsigned int oldstate);
const char *(*type)(struct uart_port *);
void (*release_port)(struct uart_port *);
int (*request_port)(struct uart_port *);
void (*config_port)(struct uart_port *, int);
int (*verify_port)(struct uart_port *, struct serial_struct *);
int (*ioctl)(struct uart_port *, unsigned int, unsigned long);
#ifdef CONFIG_CONSOLE_POLL
int (*poll_init)(struct uart_port *);
void (*poll_put_char)(struct uart_port *, unsigned char);
int (*poll_get_char)(struct uart_port *);
#endif
};
#define NO_POLL_CHAR 0x00ff0000
#define UART_CONFIG_TYPE (1 << 0)
#define UART_CONFIG_IRQ (1 << 1)
struct uart_icount {
__u32 cts;
__u32 dsr;
__u32 rng;
__u32 dcd;
__u32 rx;
__u32 tx;
__u32 frame;
__u32 overrun;
__u32 parity;
__u32 brk;
__u32 buf_overrun;
};
typedef u64 __bitwise upf_t;
typedef unsigned int __bitwise upstat_t;
enum uart_iotype {
UPIO_UNKNOWN = -1,
UPIO_PORT = SERIAL_IO_PORT, /* 8b I/O port access */
UPIO_HUB6 = SERIAL_IO_HUB6, /* Hub6 ISA card */
UPIO_MEM = SERIAL_IO_MEM, /* driver-specific */
UPIO_MEM32 = SERIAL_IO_MEM32, /* 32b little endian */
UPIO_AU = SERIAL_IO_AU, /* Au1x00 and RT288x type IO */
UPIO_TSI = SERIAL_IO_TSI, /* Tsi108/109 type IO */
UPIO_MEM32BE = SERIAL_IO_MEM32BE, /* 32b big endian */
UPIO_MEM16 = SERIAL_IO_MEM16, /* 16b little endian */
};
struct uart_port {
spinlock_t lock; /* port lock */
unsigned long iobase; /* in/out[bwl] */
unsigned char __iomem *membase; /* read/write[bwl] */
u32 (*serial_in)(struct uart_port *, unsigned int offset);
void (*serial_out)(struct uart_port *, unsigned int offset, u32 val);
void (*set_termios)(struct uart_port *,
struct ktermios *new,
const struct ktermios *old);
void (*set_ldisc)(struct uart_port *,
struct ktermios *);
unsigned int (*get_mctrl)(struct uart_port *);
void (*set_mctrl)(struct uart_port *, unsigned int);
unsigned int (*get_divisor)(struct uart_port *,
unsigned int baud,
unsigned int *frac);
void (*set_divisor)(struct uart_port *,
unsigned int baud,
unsigned int quot,
unsigned int quot_frac);
int (*startup)(struct uart_port *port);
void (*shutdown)(struct uart_port *port);
void (*throttle)(struct uart_port *port);
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/compiler.h`, `linux/console.h`, `linux/interrupt.h`, `linux/lockdep.h`, `linux/printk.h`, `linux/spinlock.h`, `linux/sched.h`.
- Detected declarations: `struct uart_port`, `struct serial_struct`, `struct serial_port_device`, `struct device`, `struct gpio_desc`, `struct uart_ops`, `struct uart_icount`, `struct uart_port`, `struct uart_state`, `struct module`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.