当前位置: 首页>>代码示例>>C++>>正文


C++ ia64_platform_is函数代码示例

本文整理汇总了C++中ia64_platform_is函数的典型用法代码示例。如果您正苦于以下问题:C++ ia64_platform_is函数的具体用法?C++ ia64_platform_is怎么用?C++ ia64_platform_is使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ia64_platform_is函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mmtimer_init

/**
 * mmtimer_init - device initialization routine
 *
 * Does initial setup for the mmtimer device.
 */
static int __init mmtimer_init(void)
{
	if (!ia64_platform_is("sn2"))
		return -1;

	/*
	 * Sanity check the cycles/sec variable
	 */
	if (sn_rtc_cycles_per_second < 100000) {
		printk(KERN_ERR "%s: unable to determine clock frequency\n",
		       MMTIMER_NAME);
		return -1;
	}

	mmtimer_femtoperiod = ((unsigned long)1E15 + sn_rtc_cycles_per_second /
			       2) / sn_rtc_cycles_per_second;

	strcpy(mmtimer_miscdev.devfs_name, MMTIMER_NAME);
	if (misc_register(&mmtimer_miscdev)) {
		printk(KERN_ERR "%s: failed to register device\n",
		       MMTIMER_NAME);
		return -1;
	}

	printk(KERN_INFO "%s: v%s, %ld MHz\n", MMTIMER_DESC, MMTIMER_VERSION,
	       sn_rtc_cycles_per_second/(unsigned long)1E6);

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:tuxap,代码行数:34,代码来源:mmtimer.c

示例2: prominfo_init

int __init prominfo_init(void)
{
    struct proc_dir_entry **entp;
    cnodeid_t cnodeid;
    unsigned long nasid;
    int size;
    char name[NODE_NAME_LEN];

    if (!ia64_platform_is("sn2"))
        return 0;

    size = num_online_nodes() * sizeof(struct proc_dir_entry *);
    proc_entries = kzalloc(size, GFP_KERNEL);
    if (!proc_entries)
        return -ENOMEM;

    sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);

    entp = proc_entries;
    for_each_online_node(cnodeid) {
        sprintf(name, "node%d", cnodeid);
        *entp = proc_mkdir(name, sgi_prominfo_entry);
        nasid = cnodeid_to_nasid(cnodeid);
        create_proc_read_entry("fit", 0, *entp, read_fit_entry,
                               (void *)nasid);
        create_proc_read_entry("version", 0, *entp,
                               read_version_entry, (void *)nasid);
        entp++;
    }

    return 0;
}
开发者ID:Kevindeving,项目名称:CM_FIRE_KERNEL,代码行数:32,代码来源:prominfo_proc.c

示例3: mspec_init

/*
 * mspec_init
 *
 * Called at boot time to initialize the mspec facility.
 */
static int __init
mspec_init(void)
{
	int ret;
	int nid;

	/*
	 * The fetchop device only works on SN2 hardware, uncached and cached
	 * memory drivers should both be valid on all ia64 hardware
	 */
#ifdef CONFIG_SGI_SN
	if (ia64_platform_is("sn2")) {
		is_sn2 = 1;
		if (is_shub2()) {
			ret = -ENOMEM;
			for_each_node_state(nid, N_ONLINE) {
				int actual_nid;
				int nasid;
				unsigned long phys;

				scratch_page[nid] = uncached_alloc_page(nid, 1);
				if (scratch_page[nid] == 0)
					goto free_scratch_pages;
				phys = __pa(scratch_page[nid]);
				nasid = get_node_number(phys);
				actual_nid = nasid_to_cnodeid(nasid);
				if (actual_nid != nid)
					goto free_scratch_pages;
			}
		}
开发者ID:AshishNamdev,项目名称:linux,代码行数:35,代码来源:mspec.c

示例4: check_versions

static void __init
check_versions (struct ia64_sal_systab *systab)
{
	sal_revision = (systab->sal_rev_major << 8) | systab->sal_rev_minor;
	sal_version = (systab->sal_b_rev_major << 8) | systab->sal_b_rev_minor;

	/* Check for broken firmware */
	if ((sal_revision == SAL_VERSION_CODE(49, 29))
	    && (sal_version == SAL_VERSION_CODE(49, 29)))
	{
		/*
		 * Old firmware for zx2000 prototypes have this weird version number,
		 * reset it to something sane.
		 */
		sal_revision = SAL_VERSION_CODE(2, 8);
		sal_version = SAL_VERSION_CODE(0, 0);
	}

	if (ia64_platform_is("sn2") && (sal_revision == SAL_VERSION_CODE(2, 9)))
		/*
		 * SGI Altix has hard-coded version 2.9 in their prom
		 * but they actually implement 3.2, so let's fix it here.
		 */
		sal_revision = SAL_VERSION_CODE(3, 2);
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:25,代码来源:sal.c

示例5: __cpu_disable

/* must be called with cpucontrol mutex held */
int __cpu_disable(void)
{
	int cpu = smp_processor_id();

	/*
	 * dont permit boot processor for now
	 */
	if (cpu == 0 && !bsp_remove_ok) {
		printk ("Your platform does not support removal of BSP\n");
		return (-EBUSY);
	}

	if (ia64_platform_is("sn2")) {
		if (!sn_cpu_disable_allowed(cpu))
			return -EBUSY;
	}

	set_cpu_online(cpu, false);

	if (migrate_platform_irqs(cpu)) {
		set_cpu_online(cpu, true);
		return -EBUSY;
	}

	remove_siblinginfo(cpu);
	fixup_irqs();
	local_flush_tlb_all();
	cpu_clear(cpu, cpu_callin_map);
	return 0;
}
开发者ID:7L,项目名称:pi_plus,代码行数:31,代码来源:smpboot.c

示例6: simrs_init

static int __init simrs_init(void)
{
	struct serial_state *state;
	int retval;

	if (!ia64_platform_is("hpsim"))
		return -ENODEV;

	hp_simserial_driver = alloc_tty_driver(NR_PORTS);
	if (!hp_simserial_driver)
		return -ENOMEM;

	printk(KERN_INFO "SimSerial driver with no serial options enabled\n");

	/* Initialize the tty_driver structure */

	hp_simserial_driver->driver_name = "simserial";
	hp_simserial_driver->name = "ttyS";
	hp_simserial_driver->major = TTY_MAJOR;
	hp_simserial_driver->minor_start = 64;
	hp_simserial_driver->type = TTY_DRIVER_TYPE_SERIAL;
	hp_simserial_driver->subtype = SERIAL_TYPE_NORMAL;
	hp_simserial_driver->init_termios = tty_std_termios;
	hp_simserial_driver->init_termios.c_cflag =
		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
	hp_simserial_driver->flags = TTY_DRIVER_REAL_RAW;
	tty_set_operations(hp_simserial_driver, &hp_ops);

	state = rs_table;
	tty_port_init(&state->port);
	state->port.ops = &hp_port_ops;
	state->port.close_delay = 0; /* XXX really 0? */

	retval = hpsim_get_irq(KEYBOARD_INTR);
	if (retval < 0) {
		printk(KERN_ERR "%s: out of interrupt vectors!\n",
				__func__);
		goto err_free_tty;
	}

	state->irq = retval;

	/* the port is imaginary */
	printk(KERN_INFO "ttyS0 at 0x03f8 (irq = %d) is a 16550\n", state->irq);

	tty_port_link_device(&state->port, hp_simserial_driver, 0);
	retval = tty_register_driver(hp_simserial_driver);
	if (retval) {
		printk(KERN_ERR "Couldn't register simserial driver\n");
		goto err_free_tty;
	}

	return 0;
err_free_tty:
	put_tty_driver(hp_simserial_driver);
	tty_port_destroy(&state->port);
	return retval;
}
开发者ID:01org,项目名称:thunderbolt-software-kernel-tree,代码行数:58,代码来源:simserial.c

示例7: get_memory_proximity_domain

static int get_memory_proximity_domain(struct acpi_table_memory_affinity *ma)
{
	int pxm;

	pxm = ma->proximity_domain;
	if (ia64_platform_is("sn2"))
		pxm += ma->reserved1[0] << 8;
	return pxm;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:9,代码来源:acpi.c

示例8: is_affinity_mask_valid

bool is_affinity_mask_valid(const struct cpumask *cpumask)
{
	if (ia64_platform_is("sn2")) {
		/* Only allow one CPU to be specified in the smp_affinity mask */
		if (cpumask_weight(cpumask) != 1)
			return false;
	}
	return true;
}
开发者ID:hothanhbinh,项目名称:AndromadusMod-New,代码行数:9,代码来源:irq.c

示例9: get_processor_proximity_domain

static int get_processor_proximity_domain(struct acpi_table_processor_affinity *pa)
{
	int pxm;

	pxm = pa->proximity_domain;
	if (ia64_platform_is("sn2"))
		pxm += pa->reserved[0] << 8;
	return pxm;
}
开发者ID:FatSunHYS,项目名称:OSCourseDesign,代码行数:9,代码来源:acpi.c

示例10: simrs_init

/*
 * The serial driver boot-time initialization code!
 */
static int __init
simrs_init (void)
{
	int			i, rc;
	struct serial_state	*state;

	if (!ia64_platform_is("hpsim"))
		return -ENODEV;

	hp_simserial_driver = alloc_tty_driver(1);
	if (!hp_simserial_driver)
		return -ENOMEM;

	show_serial_version();

	/* Initialize the tty_driver structure */

	hp_simserial_driver->owner = THIS_MODULE;
	hp_simserial_driver->driver_name = "simserial";
	hp_simserial_driver->name = "ttyS";
	hp_simserial_driver->major = TTY_MAJOR;
	hp_simserial_driver->minor_start = 64;
	hp_simserial_driver->type = TTY_DRIVER_TYPE_SERIAL;
	hp_simserial_driver->subtype = SERIAL_TYPE_NORMAL;
	hp_simserial_driver->init_termios = tty_std_termios;
	hp_simserial_driver->init_termios.c_cflag =
		B9600 | CS8 | CREAD | HUPCL | CLOCAL;
	hp_simserial_driver->flags = TTY_DRIVER_REAL_RAW;
	tty_set_operations(hp_simserial_driver, &hp_ops);

	/*
	 * Let's have a little bit of fun !
	 */
	for (i = 0, state = rs_table; i < NR_PORTS; i++,state++) {

		if (state->type == PORT_UNKNOWN) continue;

		if (!state->irq) {
			if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
				panic("%s: out of interrupt vectors!\n",
				      __FUNCTION__);
			state->irq = rc;
			ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
		}

		printk(KERN_INFO "ttyS%d at 0x%04lx (irq = %d) is a %s\n",
		       state->line,
		       state->port, state->irq,
		       uart_config[state->type].name);
	}

	if (tty_register_driver(hp_simserial_driver))
		panic("Couldn't register simserial driver\n");

	return 0;
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:59,代码来源:simserial.c

示例11: hpsim_setup

void __init
hpsim_setup (char **cmdline_p)
{
	ROOT_DEV = Root_SDA1;		/* default to first SCSI drive */

#ifdef CONFIG_HP_SIMSERIAL_CONSOLE
	{
		extern struct console hpsim_cons;
		if (ia64_platform_is("hpsim"))
			register_console(&hpsim_cons);
	}
#endif
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:13,代码来源:hpsim_setup.c

示例12: get_processor_proximity_domain

static int __init
get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa)
{
	int pxm;

	pxm = pa->proximity_domain_lo;
	if (srat_rev >= 2) {
		pxm += pa->proximity_domain_hi[0] << 8;
		pxm += pa->proximity_domain_hi[1] << 16;
		pxm += pa->proximity_domain_hi[2] << 24;
	} else if (ia64_platform_is("sn2"))
		pxm += pa->proximity_domain_hi[0] << 8;
	return pxm;
}
开发者ID:jamesbulpin,项目名称:xcp-xen-4.1,代码行数:14,代码来源:acpi.c

示例13: tiocx_init

static int __init tiocx_init(void)
{
	cnodeid_t cnodeid;
	int found_tiocx_device = 0;

	if (!ia64_platform_is("sn2"))
		return 0;

	bus_register(&tiocx_bus_type);

	for (cnodeid = 0; cnodeid < num_cnodes; cnodeid++) {
		nasid_t nasid;
		int bt;

		nasid = cnodeid_to_nasid(cnodeid);

		if ((nasid & 0x1) && is_fpga_tio(nasid, &bt)) {
			struct hubdev_info *hubdev;
			struct xwidget_info *widgetp;

			DBG("Found TIO at nasid 0x%x\n", nasid);

			hubdev =
			    (struct hubdev_info *)(NODEPDA(cnodeid)->pdinfo);

			widgetp = &hubdev->hdi_xwidget_info[TIOCX_CORELET];

			/* The CE hangs off of the CX port but is not an FPGA */
			if (widgetp->xwi_hwid.part_num == TIO_CE_ASIC_PARTNUM)
				continue;

			tio_corelet_reset(nasid, TIOCX_CORELET);
			tio_conveyor_enable(nasid);

			if (cx_device_register
			    (nasid, widgetp->xwi_hwid.part_num,
			     widgetp->xwi_hwid.mfg_num, hubdev, bt) < 0)
				return -ENXIO;
			else
				found_tiocx_device++;
		}
	}

	/* It's ok if we find zero devices. */
	DBG("found_tiocx_device= %d\n", found_tiocx_device);

	return 0;
}
开发者ID:dduval,项目名称:kernel-rhel4,代码行数:48,代码来源:tiocx.c

示例14: xp_init

int __init
xp_init(void)
{
	int ret, ch_number;
	u64 func_addr = *(u64 *) xp_nofault_PIOR;
	u64 err_func_addr = *(u64 *) xp_error_PIOR;


	if (!ia64_platform_is("sn2")) {
		return -ENODEV;
	}

	/*
	 * Register a nofault code region which performs a cross-partition
	 * PIO read. If the PIO read times out, the MCA handler will consume
	 * the error and return to a kernel-provided instruction to indicate
	 * an error. This PIO read exists because it is guaranteed to timeout
	 * if the destination is down (AMO operations do not timeout on at
	 * least some CPUs on Shubs <= v1.2, which unfortunately we have to
	 * work around).
	 */
	if ((ret = sn_register_nofault_code(func_addr, err_func_addr,
						err_func_addr, 1, 1)) != 0) {
		printk(KERN_ERR "XP: can't register nofault code, error=%d\n",
			ret);
	}
	/*
	 * Setup the nofault PIO read target. (There is no special reason why
	 * SH_IPI_ACCESS was selected.)
	 */
	if (is_shub2()) {
		xp_nofault_PIOR_target = SH2_IPI_ACCESS0;
	} else {
		xp_nofault_PIOR_target = SH1_IPI_ACCESS;
	}

	/* initialize the connection registration mutex */
	for (ch_number = 0; ch_number < XPC_NCHANNELS; ch_number++) {
		mutex_init(&xpc_registrations[ch_number].mutex);
	}

	return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:43,代码来源:xp_main.c

示例15: prominfo_init

int __init
prominfo_init(void)
{
	struct proc_dir_entry **entp;
	struct proc_dir_entry *p;
	cnodeid_t cnodeid;
	nasid_t nasid;
	char name[NODE_NAME_LEN];

	if (!ia64_platform_is("sn2"))
		return 0;

	TRACE();

	DPRINTK("running on cpu %d\n", smp_processor_id());
	DPRINTK("numnodes %d\n", numnodes);

	proc_entries = kmalloc(numnodes * sizeof(struct proc_dir_entry *),
			       GFP_KERNEL);

	sgi_prominfo_entry = proc_mkdir("sgi_prominfo", NULL);

	for (cnodeid = 0, entp = proc_entries;
	     cnodeid < numnodes;
	     cnodeid++, entp++) {
		sprintf(name, "node%d", cnodeid);
		*entp = proc_mkdir(name, sgi_prominfo_entry);
		nasid = cnodeid_to_nasid(cnodeid);
		p = create_proc_read_entry(
			"fit", 0, *entp, read_fit_entry,
			lookup_fit(nasid));
		if (p)
			p->owner = THIS_MODULE;
		p = create_proc_read_entry(
			"version", 0, *entp, read_version_entry,
			lookup_fit(nasid));
		if (p)
			p->owner = THIS_MODULE;
	}

	return 0;
}
开发者ID:12019,项目名称:hg556a_source,代码行数:42,代码来源:prominfo_proc.c


注:本文中的ia64_platform_is函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。