當前位置: 首頁>>代碼示例>>C++>>正文


C++ AMIGAHW_PRESENT函數代碼示例

本文整理匯總了C++中AMIGAHW_PRESENT函數的典型用法代碼示例。如果您正苦於以下問題:C++ AMIGAHW_PRESENT函數的具體用法?C++ AMIGAHW_PRESENT怎麽用?C++ AMIGAHW_PRESENT使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AMIGAHW_PRESENT函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: zorro_init

static int __init zorro_init(void)
{
    struct zorro_dev *z;
    unsigned int i;

    if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
	return 0;

    pr_info("Zorro: Probing AutoConfig expansion devices: %d device%s\n",
	   zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s");

    /* Initialize the Zorro bus */
    INIT_LIST_HEAD(&zorro_bus.devices);
    strcpy(zorro_bus.dev.bus_id, "zorro");
    device_register(&zorro_bus.dev);

    /* Request the resources */
    zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
    for (i = 0; i < zorro_bus.num_resources; i++)
	request_resource(&iomem_resource, &zorro_bus.resources[i]);

    /* Register all devices */
    for (i = 0; i < zorro_num_autocon; i++) {
	z = &zorro_autocon[i];
	z->id = (z->rom.er_Manufacturer<<16) | (z->rom.er_Product<<8);
	if (z->id == ZORRO_PROD_GVP_EPC_BASE) {
	    /* GVP quirk */
	    unsigned long magic = zorro_resource_start(z)+0x8000;
	    z->id |= *(u16 *)ZTWO_VADDR(magic) & GVP_PRODMASK;
	}
	sprintf(z->name, "Zorro device %08x", z->id);
	zorro_name_device(z);
	z->resource.name = z->name;
	if (request_resource(zorro_find_parent_resource(z), &z->resource))
	    printk(KERN_ERR "Zorro: Address space collision on device %s "
		   "[%lx:%lx]\n",
		   z->name, (unsigned long)zorro_resource_start(z),
		   (unsigned long)zorro_resource_end(z));
	sprintf(z->dev.bus_id, "%02x", i);
	z->dev.parent = &zorro_bus.dev;
	z->dev.bus = &zorro_bus_type;
	device_register(&z->dev);
	zorro_create_sysfs_dev_files(z);
    }

    /* Mark all available Zorro II memory */
    zorro_for_each_dev(z) {
	if (z->rom.er_Type & ERTF_MEMLIST)
	    mark_region(zorro_resource_start(z), zorro_resource_end(z)+1, 1);
    }

    /* Unmark all used Zorro II memory */
    for (i = 0; i < m68k_num_memory; i++)
	if (m68k_memory[i].addr < 16*1024*1024)
	    mark_region(m68k_memory[i].addr,
			m68k_memory[i].addr+m68k_memory[i].size, 0);

    return 0;
}
開發者ID:smx-smx,項目名稱:dsl-n55u,代碼行數:59,代碼來源:zorro.c

示例2: amiga_init_bus

static int __init amiga_init_bus(void)
{
	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
		return -ENODEV;

	platform_device_register_simple("amiga-zorro", -1, zorro_resources,
					AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
	return 0;
}
開發者ID:Blackburn29,項目名稱:PsycoKernel,代碼行數:9,代碼來源:platform.c

示例3: a3000_detect

int a3000_detect(Scsi_Host_Template *tpnt)
{
    static unsigned char called = 0;

    if (called)
	return 0;

    if  (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(A3000_SCSI))
	return 0;

    tpnt->proc_dir = &proc_scsi_a3000;
    tpnt->proc_info = &wd33c93_proc_info;

    a3000_host = scsi_register (tpnt, sizeof(struct WD33C93_hostdata));
    a3000_host->base = (unsigned char *)ZTWO_VADDR(0xDD0000);
    a3000_host->irq = IRQ_AMIGA_PORTS & ~IRQ_MACHSPEC;
    DMA(a3000_host)->DAWR = DAWR_A3000;
    wd33c93_init(a3000_host, (wd33c93_regs *)&(DMA(a3000_host)->SASR),
		 dma_setup, dma_stop, WD33C93_FS_12_15);
    request_irq(IRQ_AMIGA_PORTS, a3000_intr, 0, "A3000 SCSI", a3000_intr);
    DMA(a3000_host)->CNTR = CNTR_PDMD | CNTR_INTEN;
    called = 1;

    return 1;
}
開發者ID:shattered,項目名稱:linux-m68k,代碼行數:25,代碼來源:a3000.c

示例4: amiga_chip_init

void amiga_chip_init (void)
{
  struct chip_desc *dp;

  if (!AMIGAHW_PRESENT(CHIP_RAM))
    return;

  chipsize = boot_info.bi_amiga.chip_size;

  /* initialize start boundary */

  dp = DP(chipaddr);
  dp->first = 1;

  dp->alloced = 0;
  dp->length = chipsize - 2*sizeof(*dp);

  /* initialize end boundary */
  dp = DP(chipaddr + chipsize) - 1;
  dp->last = 1;
  
  dp->alloced = 0;
  dp->length = chipsize - 2*sizeof(*dp);

#ifdef DEBUG
  printk ("chipram end boundary is %p, length is %d\n", dp,
	  dp->length);
#endif
}
開發者ID:andreiw,項目名稱:mkunity,代碼行數:29,代碼來源:chipram.c

示例5: amimouse_init

static int __init amimouse_init(void)
{
	int err;

	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_MOUSE))
		return -ENODEV;

	amimouse_dev = input_allocate_device();
	if (!amimouse_dev)
		return -ENOMEM;

	amimouse_dev->name = "Amiga mouse";
	amimouse_dev->phys = "amimouse/input0";
	amimouse_dev->id.bustype = BUS_AMIGA;
	amimouse_dev->id.vendor = 0x0001;
	amimouse_dev->id.product = 0x0002;
	amimouse_dev->id.version = 0x0100;

	amimouse_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
	amimouse_dev->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
	amimouse_dev->keybit[BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) |
		BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
	amimouse_dev->open = amimouse_open;
	amimouse_dev->close = amimouse_close;

	err = input_register_device(amimouse_dev);
	if (err) {
		input_free_device(amimouse_dev);
		return err;
	}

	return 0;
}
開發者ID:johnny,項目名稱:CobraDroidBeta,代碼行數:33,代碼來源:amimouse.c

示例6: amiga_init_bus

static int __init amiga_init_bus(void)
{
	struct platform_device *pdev;
	unsigned int n;

	if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
		return -ENODEV;

	n = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
	pdev = platform_device_register_simple("amiga-zorro", -1,
					       zorro_resources, n);
	if (IS_ERR(pdev))
		return PTR_ERR(pdev);

	return 0;
}
開發者ID:7L,項目名稱:pi_plus,代碼行數:16,代碼來源:platform.c

示例7: amiga_init_IRQ

void __init amiga_init_IRQ(void)
{
	int i;

	/* initialize handlers */
	for (i = 0; i < AMI_STD_IRQS; i++) {
		if (ami_servers[i]) {
			ami_irq_list[i] = NULL;
		} else {
			ami_irq_list[i] = new_irq_node();
			ami_irq_list[i]->handler = ami_badint;
			ami_irq_list[i]->flags   = 0;
			ami_irq_list[i]->dev_id  = NULL;
			ami_irq_list[i]->devname = NULL;
			ami_irq_list[i]->next    = NULL;
		}
	}
	for (i = 0; i < AMI_IRQS; i++)
		ami_ablecount[i] = 0;

	/* turn off PCMCIA interrupts */
	if (AMIGAHW_PRESENT(PCMCIA))
		gayle.inten = GAYLE_IRQ_IDE;

	/* turn off all interrupts and enable the master interrupt bit */
	custom.intena = 0x7fff;
	custom.intreq = 0x7fff;
	custom.intena = IF_SETCLR | IF_INTEN;

	cia_init_IRQ(&ciaa_base);
	cia_init_IRQ(&ciab_base);
}
開發者ID:fgeraci,項目名稱:cs518-sched,代碼行數:32,代碼來源:amiints.c

示例8: amiga_init_IRQ

__init
void amiga_init_IRQ(void)
{
	int i;

	for (i = 0; i < AMI_IRQS; i++)
		ami_ablecount[i] = 0;

	/* turn off PCMCIA interrupts */
	if (AMIGAHW_PRESENT(PCMCIA))
		gayle.inten = GAYLE_IRQ_IDE;

	/* turn off all interrupts... */
	amiga_custom.intena = 0x7fff;
	amiga_custom.intreq = 0x7fff;

#ifdef CONFIG_APUS
	/* Clear any inter-CPU interrupt requests. Circumvents bug in
           Blizzard IPL emulation HW (or so it appears). */
	APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);

	/* Init IPL emulation. */
	APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
	APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
	APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
#endif
	/* ... and enable the master interrupt bit */
	amiga_custom.intena = IF_SETCLR | IF_INTEN;

	cia_init_IRQ(&ciaa_base);
	cia_init_IRQ(&ciab_base);
}
開發者ID:BackupTheBerlios,項目名稱:arp2-svn,代碼行數:32,代碼來源:amiints.c

示例9: a4000t_probe

static int __devinit a4000t_probe(struct device *dev)
{
	struct Scsi_Host * host = NULL;
	struct NCR_700_Host_Parameters *hostdata;

	if (!(MACH_IS_AMIGA && AMIGAHW_PRESENT(A4000_SCSI)))
		goto out;

	if (!request_mem_region(A4000T_SCSI_ADDR, 0x1000,
				"A4000T builtin SCSI"))
		goto out;

	hostdata = kmalloc(sizeof(struct NCR_700_Host_Parameters), GFP_KERNEL);
	if (hostdata == NULL) {
		printk(KERN_ERR "a4000t-scsi: Failed to allocate host data\n");
		goto out_release;
	}
	memset(hostdata, 0, sizeof(struct NCR_700_Host_Parameters));

	/* Fill in the required pieces of hostdata */
	hostdata->base = (void __iomem *)ZTWO_VADDR(A4000T_SCSI_ADDR);
	hostdata->clock = 50;
	hostdata->chip710 = 1;
	hostdata->dmode_extra = DMODE_FC2;
	hostdata->dcntl_extra = EA_710;

	/* and register the chip */
	host = NCR_700_detect(&a4000t_scsi_driver_template, hostdata, dev);
	if (!host) {
		printk(KERN_ERR "a4000t-scsi: No host detected; "
				"board configuration problem?\n");
		goto out_free;
	}

	host->this_id = 7;
	host->base = A4000T_SCSI_ADDR;
	host->irq = IRQ_AMIGA_PORTS;

	if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi",
			host)) {
		printk(KERN_ERR "a4000t-scsi: request_irq failed\n");
		goto out_put_host;
	}

	dev_set_drvdata(dev, host);
	scsi_scan_host(host);

	return 0;

 out_put_host:
	scsi_host_put(host);
 out_free:
	kfree(hostdata);
 out_release:
	release_mem_region(A4000T_SCSI_ADDR, 0x1000);
 out:
	return -ENODEV;
}
開發者ID:cilynx,項目名稱:dd-wrt,代碼行數:58,代碼來源:a4000t.c

示例10: amiga_chip_init

void __init amiga_chip_init(void)
{
	if (!AMIGAHW_PRESENT(CHIP_RAM))
		return;

	chipram_res.end = CHIP_PHYSADDR + amiga_chip_size - 1;
	request_resource(&iomem_resource, &chipram_res);

	atomic_set(&chipavail, amiga_chip_size);
}
開發者ID:nearffxx,項目名稱:xpenology,代碼行數:10,代碼來源:chipram.c

示例11: zorro_proc_init

static int __init zorro_proc_init(void)
{
	unsigned int slot;

	if (MACH_IS_AMIGA && AMIGAHW_PRESENT(ZORRO)) {
		proc_bus_zorro_dir = proc_mkdir("bus/zorro", NULL);
		proc_create_seq("devices", 0, proc_bus_zorro_dir,
			    &zorro_devices_seq_ops);
		for (slot = 0; slot < zorro_num_autocon; slot++)
			zorro_proc_attach_device(slot);
	}
	return 0;
}
開發者ID:AlexShiLucky,項目名稱:linux,代碼行數:13,代碼來源:proc.c

示例12:

struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from)
{
    struct zorro_dev *z;

    if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
        return NULL;

    for (z = from ? from+1 : &zorro_autocon[0];
            z < zorro_autocon+zorro_num_autocon;
            z++)
        if (id == ZORRO_WILDCARD || id == z->id)
            return z;
    return NULL;
}
開發者ID:emreharbutoglu,項目名稱:Xperia-X10-Kernel-2.6.29,代碼行數:14,代碼來源:zorro.c

示例13: amiga_chip_init

void __init amiga_chip_init(void)
{
    if (!AMIGAHW_PRESENT(CHIP_RAM))
	return;

    /*
     *  Remove the first 4 pages where PPC exception handlers will be located
     */
    amiga_chip_size -= 0x4000;
    chipram_res.end = amiga_chip_size-1;
    request_resource(&iomem_resource, &chipram_res);

    chipavail = amiga_chip_size;
}
開發者ID:Medvedroid,項目名稱:OT_903D-kernel-2.6.35.7,代碼行數:14,代碼來源:chipram.c

示例14: amiga_init_IRQ

__init
void amiga_init_IRQ(void)
{
	int i;

	/* initialize handlers */
	for (i = 0; i < AMI_STD_IRQS; i++) {
		if (ami_servers[i]) {
			ami_irq_list[i] = NULL;
		} else {
			ami_irq_list[i] = new_irq_node();
			ami_irq_list[i]->handler = ami_badint;
			ami_irq_list[i]->flags   = 0;
			ami_irq_list[i]->dev_id  = NULL;
			ami_irq_list[i]->devname = NULL;
			ami_irq_list[i]->next    = NULL;
		}
	}
	for (i = 0; i < AMI_IRQS; i++)
		ami_ablecount[i] = 0;

	/* turn off PCMCIA interrupts */
	if (AMIGAHW_PRESENT(PCMCIA))
		pcmcia_disable_irq();

	/* turn off all interrupts... */
	custom.intena = 0x7fff;
	custom.intreq = 0x7fff;

#ifdef CONFIG_APUS
	/* Clear any inter-CPU interrupt requests. Circumvents bug in
           Blizzard IPL emulation HW (or so it appears). */
	APUS_WRITE(APUS_INT_LVL, INTLVL_SETRESET | INTLVL_MASK);

	/* Init IPL emulation. */
	APUS_WRITE(APUS_REG_INT, REGINT_INTMASTER | REGINT_ENABLEIPL);
	APUS_WRITE(APUS_IPL_EMU, IPLEMU_DISABLEINT);
	APUS_WRITE(APUS_IPL_EMU, IPLEMU_SETRESET | IPLEMU_IPLMASK);
#endif
	/* ... and enable the master interrupt bit */
	custom.intena = IF_SETCLR | IF_INTEN;

	cia_init_IRQ(&ciaa_base);
	cia_init_IRQ(&ciab_base);
}
開發者ID:fgeraci,項目名稱:cs518-sched,代碼行數:45,代碼來源:amiints.c

示例15: amiga7xx_detect

int __init amiga7xx_detect(struct scsi_host_template *tpnt)
{
    static unsigned char called = 0;
    int num = 0;

    if (called || !MACH_IS_AMIGA)
        return 0;

    tpnt->proc_name = "Amiga7xx";

    if (AMIGAHW_PRESENT(A4000_SCSI))
        num += amiga7xx_register_one(tpnt, 0xdd0040);

#ifdef CONFIG_ZORRO
    num += amiga7xx_zorro_detect(tpnt);
#endif

    called = 1;
    return num;
}
開發者ID:rcplay,項目名稱:snake-os,代碼行數:20,代碼來源:amiga7xx.c


注:本文中的AMIGAHW_PRESENT函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。