Пример #1
0
static void kgdb_register_callbacks(void)
{
	if (!kgdb_io_module_registered) {
		kgdb_io_module_registered = 1;
		kgdb_arch_init();
		if (!dbg_is_early)
			kgdb_arch_late();
		atomic_notifier_chain_register(&panic_notifier_list,
					       &kgdb_panic_event_nb);
#ifdef CONFIG_MAGIC_SYSRQ
		register_sysrq_key('g', &sysrq_dbg_op);
#endif
		if (kgdb_use_con && !kgdb_con_registered) {
			register_console(&kgdbcons);
			kgdb_con_registered = 1;
		}
	}
}
Пример #2
0
Файл: etm.c Проект: 08opt/linux
static int __init etm_init(void)
{
	int retval;

	retval = amba_driver_register(&etb_driver);
	if (retval) {
		printk(KERN_ERR "Failed to register etb\n");
		return retval;
	}

	retval = amba_driver_register(&etm_driver);
	if (retval) {
		amba_driver_unregister(&etb_driver);
		printk(KERN_ERR "Failed to probe etm\n");
		return retval;
	}

	/* not being able to install this handler is not fatal */
	(void)register_sysrq_key('v', &sysrq_etm_op);

	return 0;
}
Пример #3
0
static int __init pm_sysrq_init(void)
{
	register_sysrq_key('o', &sysrq_poweroff_op);
	return 0;
}
Пример #4
0
static int
acpi_system_add (
	struct acpi_device	*device)
{
	int			result = 0;
	acpi_status		status = AE_OK;
	struct acpi_system	*system = NULL;
	u8			i = 0;

	ACPI_FUNCTION_TRACE("acpi_system_add");

	if (!device)
		return_VALUE(-EINVAL);

	system = kmalloc(sizeof(struct acpi_system), GFP_KERNEL);
	if (!system)
		return_VALUE(-ENOMEM);
	memset(system, 0, sizeof(struct acpi_system));

	system->handle = device->handle;
	sprintf(acpi_device_name(device), "%s", ACPI_SYSTEM_DEVICE_NAME);
	sprintf(acpi_device_class(device), "%s", ACPI_SYSTEM_CLASS);
	acpi_driver_data(device) = system;

	result = acpi_system_add_fs(device);
	if (result)
		goto end;

	printk(KERN_INFO PREFIX "%s [%s] (supports", 
		acpi_device_name(device), acpi_device_bid(device));
	for (i=0; i<ACPI_S_STATE_COUNT; i++) {
		u8 type_a, type_b;
		status = acpi_get_sleep_type_data(i, &type_a, &type_b);
		switch (i) {
		case ACPI_STATE_S4:
			if (acpi_gbl_FACS->S4bios_f &&
			    0 != acpi_gbl_FADT->smi_cmd) {
				printk(" S4bios");
				system->states[i] = 1;
			}
			/* no break */
		default: 
			if (ACPI_SUCCESS(status)) {
				system->states[i] = 1;
				printk(" S%d", i);
			}
		}
	}
	printk(")\n");

#ifdef CONFIG_PM
	/* Install the soft-off (S5) handler. */
	if (system->states[ACPI_STATE_S5]) {
		pm_power_off = acpi_power_off;
		register_sysrq_key('o', &sysrq_acpi_poweroff_op);
	}
#endif

end:
	if (result)
		kfree(system);

	return_VALUE(result);
}
Пример #5
0
int __init emac_init_debug(void)
{
	return register_sysrq_key('c', &emac_sysrq_op);
}
Пример #6
0
static int __init setup_xmon_sysrq(void)
{
	register_sysrq_key('x', &sysrq_xmon_op);
	return 0;
}
Пример #7
0
/*
 * Initialize by setting up the sysctl and proc/knllog entries, allocating
 * default storage and resetting the variables.
 */
void knllog_init(void)
{
   /* register sysctl table */
   printk(KERN_NOTICE "%s\n", __FUNCTION__);

#ifdef CONFIG_MAGIC_SYSRQ
   register_sysrq_key('z', &sysrq_knllog_op);
#endif
   gSysCtlHeader = register_sysctl_table( gSysCtl );
   if ( gSysCtlHeader == NULL )
   {
      printk(KERN_ERR "%s: could not register sysctl table\n", __FUNCTION__);
   }

   memset(&knllog, 0, sizeof(KNLLOG_OBJ));   /* zero entries, idx, wrap, and enable */
   knllog.entries = 0;
   knllog.idx = 0;
   knllog.wrap = 0;
   knllog.enable = 0;   /* Logging on by default */
   knllog.entries = KNLLOG_DEFAULT_ENTRIES;
   knllog.maxargs = MAXARGS;
   knllog.bufp = (KNLLOG_ENTRY *)vmalloc(sizeof(KNLLOG_ENTRY) * knllog.entries);
   if (knllog.bufp == NULL)
   {
      knllog.entries = 0;
      knllog.enable = 0;
      printk(KERN_ERR "%s: Cannot allocate memory for knllog buffer\n", __FUNCTION__);   /* i.e. don't enable it. */
      return;
   }
   strcpy(knllog.filename, "/tmp/knllog.txt");  /* default local file name */
   knllog.logfile = 1;                          /* log to local file by default */
   strcpy(knllog.ipaddr, "10.136.49.91");       /* dummy host ip address */
   knllog.port = 4000;                          /* default logging ip:port */
   knllog.sleeptime = 0;                        /* default sleep time between events */
   knllog.dumping = 0;                          /* not dumping at init */

#if defined ( CONFIG_BCM_PERFCNT_SUPPORT )
   knllog.use_perfcnt = 0;                      /* don't use perf counters by default */
#endif

   /* Create dumping to file or socket thread */
   init_completion(&knllogExited);
   knllogThreadPid = kernel_thread(knllog_thread, 0, 0);

#if 0 /* TEST */
   KNLLOG("testnoarg\n", 0);
   KNLLOG("test %d\n", 0);
   KNLLOG("test2 val1=0x%x, val2=%d", 1, 2);
   KNLLOG("test3 val1=%d val2=0x%08x, val3=%05d", 1,2,3);
   KNLLOG("test4 %d %d %d %d\n", 0xf000,2,3,4);
   KNLLOG("test4 0x%x 0x%04x 0x%08x %u", 0xf000,2,3,4);
   KNLLOG("test5 %d\n\n\n\n\n\n", 0);
   KNLLOG("test6\n\n\n\n\n\n");
   KNLLOG("test7\nbla1\nbla2\n%d\n\n\n\n\n\n", 1234);
   KNLLOG("\n\n\n");
   KNLLOG("\n");
   KNLLOG("");
   {
       uint8_t  mem[] =
       {
           'T', 'h', 'i', 's', ' ', 'i', 's', ' ', 'a', ' ', 't', 'e', 's', 't', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 126, 127, 128, 129, 130
       };

       KNLLOG_DUMP_MEM( 0, mem, sizeof( mem ));
   }
#endif
}