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.

Dependency Surface

Detected Declarations

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

Implementation Notes