arch/um/drivers/ssl.c
Source file repositories/reference/linux-study-clean/arch/um/drivers/ssl.c
File Facts
- System
- Linux kernel
- Corpus path
arch/um/drivers/ssl.c- Extension
.c- Size
- 4932 bytes
- Lines
- 206
- Domain
- Architecture Layer
- Bucket
- arch/um
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- 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/fs.hlinux/tty.hlinux/tty_driver.hlinux/major.hlinux/mm.hlinux/init.hlinux/console.hasm/termbits.hasm/irq.hchan.hinit.hirq_user.hmconsole_kern.h
Detected Declarations
function ssl_announcefunction ssl_configfunction ssl_get_configfunction ssl_removefunction ssl_installfunction ssl_console_writefunction ssl_console_setupfunction ssl_initfunction ssl_exitfunction ssl_chan_setupfunction ssl_non_raw_setup
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com)
*/
#include <linux/fs.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/major.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/console.h>
#include <asm/termbits.h>
#include <asm/irq.h>
#include "chan.h"
#include <init.h>
#include <irq_user.h>
#include "mconsole_kern.h"
static const int ssl_version = 1;
#define NR_PORTS 64
static void ssl_announce(char *dev_name, int dev)
{
printk(KERN_INFO "Serial line %d assigned device '%s'\n", dev,
dev_name);
}
/* Almost const, except that xterm_title may be changed in an initcall */
static struct chan_opts opts = {
.announce = ssl_announce,
.xterm_title = "Serial Line #%d",
.raw = 1,
};
static int ssl_config(char *str, char **error_out);
static int ssl_get_config(char *dev, char *str, int size, char **error_out);
static int ssl_remove(int n, char **error_out);
/* Const, except for .mc.list */
static struct line_driver driver = {
.name = "UML serial line",
.device_name = "ttyS",
.major = TTY_MAJOR,
.minor_start = 64,
.type = TTY_DRIVER_TYPE_SERIAL,
.subtype = 0,
.read_irq_name = "ssl",
.write_irq_name = "ssl-write",
.mc = {
.list = LIST_HEAD_INIT(driver.mc.list),
.name = "ssl",
.config = ssl_config,
.get_config = ssl_get_config,
.id = line_id,
.remove = ssl_remove,
},
};
/* The array is initialized by line_init, at initcall time. The
* elements are locked individually as needed.
*/
static char *conf[NR_PORTS];
static char *def_conf = CONFIG_SSL_CHAN;
static struct line serial_lines[NR_PORTS];
static int ssl_config(char *str, char **error_out)
{
return line_config(serial_lines, ARRAY_SIZE(serial_lines), str, &opts,
error_out);
}
static int ssl_get_config(char *dev, char *str, int size, char **error_out)
{
return line_get_config(dev, serial_lines, ARRAY_SIZE(serial_lines), str,
size, error_out);
}
static int ssl_remove(int n, char **error_out)
{
return line_remove(serial_lines, ARRAY_SIZE(serial_lines), n,
error_out);
}
static int ssl_install(struct tty_driver *driver, struct tty_struct *tty)
{
return line_install(driver, tty, &serial_lines[tty->index]);
}
Annotation
- Immediate include surface: `linux/fs.h`, `linux/tty.h`, `linux/tty_driver.h`, `linux/major.h`, `linux/mm.h`, `linux/init.h`, `linux/console.h`, `asm/termbits.h`.
- Detected declarations: `function ssl_announce`, `function ssl_config`, `function ssl_get_config`, `function ssl_remove`, `function ssl_install`, `function ssl_console_write`, `function ssl_console_setup`, `function ssl_init`, `function ssl_exit`, `function ssl_chan_setup`.
- Atlas domain: Architecture Layer / arch/um.
- 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.