arch/s390/appldata/appldata_base.c
Source file repositories/reference/linux-study-clean/arch/s390/appldata/appldata_base.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/appldata/appldata_base.c- Extension
.c- Size
- 10593 bytes
- Lines
- 426
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/export.hlinux/module.hlinux/sched/stat.hlinux/init.hlinux/slab.hlinux/errno.hlinux/interrupt.hlinux/proc_fs.hlinux/mm.hlinux/swap.hlinux/pagemap.hlinux/sysctl.hlinux/notifier.hlinux/cpu.hlinux/workqueue.hlinux/uaccess.hlinux/io.hasm/appldata.hasm/vtimer.hasm/smp.happldata.h
Detected Declarations
function appldata_timer_functionfunction appldata_work_fnfunction appldata_diagfunction __appldata_vtimer_setupfunction appldata_timer_handlerfunction appldata_interval_handlerfunction appldata_generic_handlerfunction appldata_register_opsfunction appldata_unregister_opsfunction appldata_initexport appldata_register_opsexport appldata_unregister_opsexport appldata_diagexport si_swapinfoexport nr_threadsexport nr_runningexport nr_iowait
Annotated Snippet
if (ops->active == 1) {
ops->callback(ops->data);
}
}
mutex_unlock(&appldata_ops_mutex);
}
static struct appldata_product_id appldata_id = {
.prod_nr = {0xD3, 0xC9, 0xD5, 0xE4,
0xE7, 0xD2, 0xD9}, /* "LINUXKR" */
.prod_fn = 0xD5D3, /* "NL" */
.version_nr = 0xF2F6, /* "26" */
.release_nr = 0xF0F1, /* "01" */
};
/*
* appldata_diag()
*
* prepare parameter list, issue DIAG 0xDC
*/
int appldata_diag(char record_nr, u16 function, unsigned long buffer,
u16 length, char *mod_lvl)
{
struct appldata_parameter_list *parm_list;
struct appldata_product_id *id;
int rc;
parm_list = kmalloc_obj(*parm_list);
id = kmemdup(&appldata_id, sizeof(appldata_id), GFP_KERNEL);
rc = -ENOMEM;
if (parm_list && id) {
id->record_nr = record_nr;
id->mod_lvl = (mod_lvl[0]) << 8 | mod_lvl[1];
rc = appldata_asm(parm_list, id, function,
(void *) buffer, length);
}
kfree(id);
kfree(parm_list);
return rc;
}
/************************ timer, work, DIAG <END> ****************************/
/****************************** /proc stuff **********************************/
#define APPLDATA_ADD_TIMER 0
#define APPLDATA_DEL_TIMER 1
#define APPLDATA_MOD_TIMER 2
/*
* __appldata_vtimer_setup()
*
* Add, delete or modify virtual timers on all online cpus.
* The caller needs to get the appldata_timer_lock spinlock.
*/
static void __appldata_vtimer_setup(int cmd)
{
u64 timer_interval = (u64) appldata_interval * 1000 * TOD_MICRO;
switch (cmd) {
case APPLDATA_ADD_TIMER:
if (appldata_timer_active)
break;
appldata_timer.expires = timer_interval;
add_virt_timer_periodic(&appldata_timer);
appldata_timer_active = 1;
break;
case APPLDATA_DEL_TIMER:
del_virt_timer(&appldata_timer);
if (!appldata_timer_active)
break;
appldata_timer_active = 0;
break;
case APPLDATA_MOD_TIMER:
if (!appldata_timer_active)
break;
mod_virt_timer_periodic(&appldata_timer, timer_interval);
}
}
/*
* appldata_timer_handler()
*
* Start/Stop timer, show status of timer (0 = not active, 1 = active)
*/
static int
appldata_timer_handler(const struct ctl_table *ctl, int write,
void *buffer, size_t *lenp, loff_t *ppos)
{
int timer_active = appldata_timer_active;
Annotation
- Immediate include surface: `linux/export.h`, `linux/module.h`, `linux/sched/stat.h`, `linux/init.h`, `linux/slab.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/proc_fs.h`.
- Detected declarations: `function appldata_timer_function`, `function appldata_work_fn`, `function appldata_diag`, `function __appldata_vtimer_setup`, `function appldata_timer_handler`, `function appldata_interval_handler`, `function appldata_generic_handler`, `function appldata_register_ops`, `function appldata_unregister_ops`, `function appldata_init`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration 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.