drivers/misc/sgi-xp/xpc_main.c
Source file repositories/reference/linux-study-clean/drivers/misc/sgi-xp/xpc_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/sgi-xp/xpc_main.c- Extension
.c- Size
- 35823 bytes
- Lines
- 1310
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/slab.hlinux/sysctl.hlinux/device.hlinux/delay.hlinux/reboot.hlinux/kdebug.hlinux/kthread.hxpc.hasm/traps.h
Detected Declarations
function xpc_timeout_partition_disengagefunction xpc_hb_beaterfunction xpc_start_hb_beaterfunction xpc_stop_hb_beaterfunction xpc_check_remote_hbfunction xpc_hb_checkerfunction xpc_initiate_discoveryfunction xpc_activatingfunction xpc_kzalloc_cacheline_alignedfunction xpc_setup_ch_structuresfunction xpc_teardown_ch_structuresfunction xpc_activatingfunction xpc_activate_partitionfunction xpc_activate_kthreadsfunction xpc_kthread_waitmsgsfunction xpc_kthread_startfunction blockfunction atomic_inc_returnfunction xpc_disconnect_waitfunction xpc_setup_partitionsfunction xpc_teardown_partitionsfunction xpc_do_exitfunction xpc_system_rebootfunction xpc_die_deactivatefunction xpc_system_diefunction xpc_initfunction xpc_exitmodule init xpc_init
Annotated Snippet
static struct device_driver xpc_dbg_name = {
.name = "xpc"
};
static struct device xpc_part_dbg_subname = {
.init_name = "", /* set to "part" at xpc_init() time */
.driver = &xpc_dbg_name
};
static struct device xpc_chan_dbg_subname = {
.init_name = "", /* set to "chan" at xpc_init() time */
.driver = &xpc_dbg_name
};
struct device *xpc_part = &xpc_part_dbg_subname;
struct device *xpc_chan = &xpc_chan_dbg_subname;
static int xpc_kdebug_ignore;
/* systune related variables for /proc/sys directories */
static int xpc_hb_interval = XPC_HB_DEFAULT_INTERVAL;
static int xpc_hb_min_interval = 1;
static int xpc_hb_max_interval = 10;
static int xpc_hb_check_interval = XPC_HB_CHECK_DEFAULT_INTERVAL;
static int xpc_hb_check_min_interval = 10;
static int xpc_hb_check_max_interval = 120;
int xpc_disengage_timelimit = XPC_DISENGAGE_DEFAULT_TIMELIMIT;
static int xpc_disengage_min_timelimit; /* = 0 */
static int xpc_disengage_max_timelimit = 120;
static const struct ctl_table xpc_sys_xpc_hb[] = {
{
.procname = "hb_interval",
.data = &xpc_hb_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_hb_min_interval,
.extra2 = &xpc_hb_max_interval},
{
.procname = "hb_check_interval",
.data = &xpc_hb_check_interval,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_hb_check_min_interval,
.extra2 = &xpc_hb_check_max_interval},
};
static const struct ctl_table xpc_sys_xpc[] = {
{
.procname = "disengage_timelimit",
.data = &xpc_disengage_timelimit,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
.extra1 = &xpc_disengage_min_timelimit,
.extra2 = &xpc_disengage_max_timelimit},
};
static struct ctl_table_header *xpc_sysctl;
static struct ctl_table_header *xpc_sysctl_hb;
/* non-zero if any remote partition disengage was timed out */
int xpc_disengage_timedout;
/* #of activate IRQs received and not yet processed */
int xpc_activate_IRQ_rcvd;
DEFINE_SPINLOCK(xpc_activate_IRQ_rcvd_lock);
/* IRQ handler notifies this wait queue on receipt of an IRQ */
DECLARE_WAIT_QUEUE_HEAD(xpc_activate_IRQ_wq);
static unsigned long xpc_hb_check_timeout;
static struct timer_list xpc_hb_timer;
/* notification that the xpc_hb_checker thread has exited */
static DECLARE_COMPLETION(xpc_hb_checker_exited);
/* notification that the xpc_discovery thread has exited */
static DECLARE_COMPLETION(xpc_discovery_exited);
static void xpc_kthread_waitmsgs(struct xpc_partition *, struct xpc_channel *);
static int xpc_system_reboot(struct notifier_block *, unsigned long, void *);
static struct notifier_block xpc_reboot_notifier = {
.notifier_call = xpc_system_reboot,
};
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/sysctl.h`, `linux/device.h`, `linux/delay.h`, `linux/reboot.h`, `linux/kdebug.h`, `linux/kthread.h`.
- Detected declarations: `function xpc_timeout_partition_disengage`, `function xpc_hb_beater`, `function xpc_start_hb_beater`, `function xpc_stop_hb_beater`, `function xpc_check_remote_hb`, `function xpc_hb_checker`, `function xpc_initiate_discovery`, `function xpc_activating`, `function xpc_kzalloc_cacheline_aligned`, `function xpc_setup_ch_structures`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: pattern 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.