aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-08-29 16:12:36 -0400
commit2fca877b68b2b4fc5b94277858a1bedd46017cde (patch)
treefd02725406299ba2f26354463b3c261721e9eb6b /include
parentff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (diff)
parent02b3e4e2d71b6058ec11cc01c72ac651eb3ded2b (diff)
/spare/repo/libata-dev branch 'v2.6.13'
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h7
-rw-r--r--include/acpi/acdebug.h146
-rw-r--r--include/acpi/acdisasm.h114
-rw-r--r--include/acpi/acdispat.h171
-rw-r--r--include/acpi/acevents.h85
-rw-r--r--include/acpi/acexcep.h5
-rw-r--r--include/acpi/acglobal.h12
-rw-r--r--include/acpi/achware.h52
-rw-r--r--include/acpi/acinterp.h243
-rw-r--r--include/acpi/aclocal.h10
-rw-r--r--include/acpi/acmacros.h10
-rw-r--r--include/acpi/acnames.h84
-rw-r--r--include/acpi/acnamesp.h163
-rw-r--r--include/acpi/acobject.h2
-rw-r--r--include/acpi/acopcode.h325
-rw-r--r--include/acpi/acparser.h134
-rw-r--r--include/acpi/acpi.h1
-rw-r--r--include/acpi/acpi_bus.h38
-rw-r--r--include/acpi/acpi_drivers.h9
-rw-r--r--include/acpi/acpiosxf.h18
-rw-r--r--include/acpi/acpixf.h13
-rw-r--r--include/acpi/acresrc.h67
-rw-r--r--include/acpi/acstruct.h1
-rw-r--r--include/acpi/actables.h70
-rw-r--r--include/acpi/actbl.h2
-rw-r--r--include/acpi/actypes.h2
-rw-r--r--include/acpi/acutils.h274
-rw-r--r--include/acpi/amlcode.h12
-rw-r--r--include/acpi/pdc_intel.h29
-rw-r--r--include/acpi/platform/acenv.h20
-rw-r--r--include/acpi/processor.h34
-rw-r--r--include/asm-alpha/emergency-restart.h6
-rw-r--r--include/asm-alpha/mmzone.h3
-rw-r--r--include/asm-alpha/pci.h24
-rw-r--r--include/asm-alpha/pgtable.h6
-rw-r--r--include/asm-alpha/serial.h47
-rw-r--r--include/asm-alpha/system.h29
-rw-r--r--include/asm-alpha/unistd.h7
-rw-r--r--include/asm-arm/arch-imx/imxfb.h1
-rw-r--r--include/asm-arm/arch-ixp2000/gpio.h31
-rw-r--r--include/asm-arm/arch-ixp2000/io.h96
-rw-r--r--include/asm-arm/arch-ixp2000/ixdp2x00.h4
-rw-r--r--include/asm-arm/arch-ixp2000/ixdp2x01.h4
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h21
-rw-r--r--include/asm-arm/arch-ixp2000/platform.h23
-rw-r--r--include/asm-arm/arch-ixp2000/vmalloc.h2
-rw-r--r--include/asm-arm/arch-ixp4xx/debug-macro.S1
-rw-r--r--include/asm-arm/arch-ixp4xx/io.h176
-rw-r--r--include/asm-arm/arch-ixp4xx/ixp4xx-regs.h10
-rw-r--r--include/asm-arm/arch-ixp4xx/timex.h6
-rw-r--r--include/asm-arm/arch-omap/board-h2.h5
-rw-r--r--include/asm-arm/arch-omap/board-h3.h5
-rw-r--r--include/asm-arm/arch-omap/board-osk.h5
-rw-r--r--include/asm-arm/arch-omap/board.h12
-rw-r--r--include/asm-arm/arch-omap/common.h36
-rw-r--r--include/asm-arm/arch-omap/dma.h1
-rw-r--r--include/asm-arm/arch-omap/hardware.h24
-rw-r--r--include/asm-arm/arch-omap/irqs.h3
-rw-r--r--include/asm-arm/arch-omap/mux.h28
-rw-r--r--include/asm-arm/arch-omap/omap16xx.h32
-rw-r--r--include/asm-arm/arch-omap/system.h21
-rw-r--r--include/asm-arm/arch-omap/tps65010.h76
-rw-r--r--include/asm-arm/arch-omap/usb.h9
-rw-r--r--include/asm-arm/arch-pxa/debug-macro.S2
-rw-r--r--include/asm-arm/arch-pxa/mtd-xip.h37
-rw-r--r--include/asm-arm/arch-pxa/pxa-regs.h2
-rw-r--r--include/asm-arm/arch-s3c2410/audio.h49
-rw-r--r--include/asm-arm/arch-s3c2410/regs-iis.h10
-rw-r--r--include/asm-arm/arch-s3c2410/usb-control.h3
-rw-r--r--include/asm-arm/arch-sa1100/mtd-xip.h26
-rw-r--r--include/asm-arm/arch-shark/io.h147
-rw-r--r--include/asm-arm/bitops.h9
-rw-r--r--include/asm-arm/bug.h2
-rw-r--r--include/asm-arm/cpu-multi32.h2
-rw-r--r--include/asm-arm/cpu-single.h2
-rw-r--r--include/asm-arm/emergency-restart.h6
-rw-r--r--include/asm-arm/hardware/arm_timer.h21
-rw-r--r--include/asm-arm/ide.h2
-rw-r--r--include/asm-arm/io.h4
-rw-r--r--include/asm-arm/locks.h40
-rw-r--r--include/asm-arm/mach/arch.h34
-rw-r--r--include/asm-arm/mach/time.h23
-rw-r--r--include/asm-arm/mtd-xip.h26
-rw-r--r--include/asm-arm/pci.h16
-rw-r--r--include/asm-arm/pgalloc.h24
-rw-r--r--include/asm-arm/pgtable.h14
-rw-r--r--include/asm-arm/signal.h1
-rw-r--r--include/asm-arm/smp.h3
-rw-r--r--include/asm-arm/spinlock.h82
-rw-r--r--include/asm-arm/stat.h2
-rw-r--r--include/asm-arm/system.h130
-rw-r--r--include/asm-arm/thread_info.h2
-rw-r--r--include/asm-arm/tlbflush.h28
-rw-r--r--include/asm-arm/unistd.h5
-rw-r--r--include/asm-arm26/emergency-restart.h6
-rw-r--r--include/asm-arm26/serial.h22
-rw-r--r--include/asm-arm26/thread_info.h2
-rw-r--r--include/asm-cris/arch-v10/atomic.h7
-rw-r--r--include/asm-cris/arch-v10/bitops.h2
-rw-r--r--include/asm-cris/arch-v10/dma.h28
-rw-r--r--include/asm-cris/arch-v10/elf.h10
-rw-r--r--include/asm-cris/arch-v10/ide.h99
-rw-r--r--include/asm-cris/arch-v10/io.h1
-rw-r--r--include/asm-cris/arch-v10/io_interface_mux.h75
-rw-r--r--include/asm-cris/arch-v10/irq.h27
-rw-r--r--include/asm-cris/arch-v10/memmap.h22
-rw-r--r--include/asm-cris/arch-v10/mmu.h5
-rw-r--r--include/asm-cris/arch-v10/offset.h2
-rw-r--r--include/asm-cris/arch-v10/processor.h8
-rw-r--r--include/asm-cris/arch-v10/system.h2
-rw-r--r--include/asm-cris/arch-v32/arbiter.h30
-rw-r--r--include/asm-cris/arch-v32/atomic.h36
-rw-r--r--include/asm-cris/arch-v32/bitops.h64
-rw-r--r--include/asm-cris/arch-v32/byteorder.h20
-rw-r--r--include/asm-cris/arch-v32/cache.h9
-rw-r--r--include/asm-cris/arch-v32/checksum.h29
-rw-r--r--include/asm-cris/arch-v32/cryptocop.h272
-rw-r--r--include/asm-cris/arch-v32/delay.h18
-rw-r--r--include/asm-cris/arch-v32/dma.h79
-rw-r--r--include/asm-cris/arch-v32/elf.h73
-rw-r--r--include/asm-cris/arch-v32/hwregs/Makefile187
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/ata_defs_asm.h222
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/bif_core_defs_asm.h319
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/bif_dma_defs_asm.h495
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/bif_slave_defs_asm.h249
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/config_defs_asm.h131
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/cpu_vect.h41
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/cris_defs_asm.h114
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/cris_supp_reg.h10
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/dma_defs_asm.h368
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/eth_defs_asm.h498
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/gio_defs_asm.h276
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/intr_vect.h38
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/intr_vect_defs_asm.h355
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/irq_nmi_defs_asm.h69
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/marb_defs_asm.h579
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/mmu_defs_asm.h212
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/mmu_supp_reg.h7
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/pinmux_defs_asm.h632
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/reg_map_asm.h96
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/rt_trace_defs_asm.h142
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/ser_defs_asm.h359
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/sser_defs_asm.h462
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/strcop_defs_asm.h84
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/strmux_defs_asm.h100
-rw-r--r--include/asm-cris/arch-v32/hwregs/asm/timer_defs_asm.h229
-rw-r--r--include/asm-cris/arch-v32/hwregs/ata_defs.h222
-rw-r--r--include/asm-cris/arch-v32/hwregs/bif_core_defs.h284
-rw-r--r--include/asm-cris/arch-v32/hwregs/bif_dma_defs.h473
-rw-r--r--include/asm-cris/arch-v32/hwregs/bif_slave_defs.h249
-rw-r--r--include/asm-cris/arch-v32/hwregs/config_defs.h142
-rw-r--r--include/asm-cris/arch-v32/hwregs/cpu_vect.h41
-rw-r--r--include/asm-cris/arch-v32/hwregs/dma.h128
-rw-r--r--include/asm-cris/arch-v32/hwregs/dma_defs.h436
-rw-r--r--include/asm-cris/arch-v32/hwregs/eth_defs.h384
-rw-r--r--include/asm-cris/arch-v32/hwregs/extmem_defs.h369
-rw-r--r--include/asm-cris/arch-v32/hwregs/gio_defs.h295
-rw-r--r--include/asm-cris/arch-v32/hwregs/intr_vect.h39
-rw-r--r--include/asm-cris/arch-v32/hwregs/intr_vect_defs.h225
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/Makefile146
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_crc_par_defs_asm.h171
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_in_defs_asm.h321
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_out_defs_asm.h349
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_defs_asm.h234
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_extra_defs_asm.h155
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_defs_asm.h254
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_extra_defs_asm.h158
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_mpu_defs_asm.h177
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_reg_space_asm.h44
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_in_defs_asm.h182
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_out_defs_asm.h346
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_in_defs_asm.h111
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_out_defs_asm.h105
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_spu_defs_asm.h573
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cfg_defs_asm.h1052
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cpu_defs_asm.h1758
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_mpu_defs_asm.h1776
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_spu_defs_asm.h691
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_timer_grp_defs_asm.h237
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_trigger_grp_defs_asm.h157
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/asm/iop_version_defs_asm.h64
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_crc_par_defs.h232
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_dmc_in_defs.h325
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_dmc_out_defs.h326
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_defs.h255
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_extra_defs.h164
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_defs.h278
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_extra_defs.h164
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_mpu_defs.h190
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_mpu_macros.h764
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_reg_space.h44
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sap_in_defs.h179
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sap_out_defs.h306
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_scrc_in_defs.h160
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_scrc_out_defs.h146
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_spu_defs.h453
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sw_cfg_defs.h1042
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sw_cpu_defs.h853
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sw_mpu_defs.h893
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_sw_spu_defs.h552
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_timer_grp_defs.h249
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_trigger_grp_defs.h170
-rw-r--r--include/asm-cris/arch-v32/hwregs/iop/iop_version_defs.h99
-rw-r--r--include/asm-cris/arch-v32/hwregs/irq_nmi_defs.h104
-rw-r--r--include/asm-cris/arch-v32/hwregs/marb_bp_defs.h205
-rw-r--r--include/asm-cris/arch-v32/hwregs/marb_defs.h475
-rw-r--r--include/asm-cris/arch-v32/hwregs/pinmux_defs.h357
-rw-r--r--include/asm-cris/arch-v32/hwregs/reg_map.h103
-rw-r--r--include/asm-cris/arch-v32/hwregs/reg_rdwr.h15
-rw-r--r--include/asm-cris/arch-v32/hwregs/rt_trace_defs.h173
-rw-r--r--include/asm-cris/arch-v32/hwregs/ser_defs.h308
-rw-r--r--include/asm-cris/arch-v32/hwregs/sser_defs.h331
-rw-r--r--include/asm-cris/arch-v32/hwregs/strcop.h57
-rw-r--r--include/asm-cris/arch-v32/hwregs/strcop_defs.h109
-rw-r--r--include/asm-cris/arch-v32/hwregs/strmux_defs.h127
-rw-r--r--include/asm-cris/arch-v32/hwregs/supp_reg.h78
-rw-r--r--include/asm-cris/arch-v32/hwregs/timer_defs.h266
-rw-r--r--include/asm-cris/arch-v32/ide.h61
-rw-r--r--include/asm-cris/arch-v32/intmem.h9
-rw-r--r--include/asm-cris/arch-v32/io.h98
-rw-r--r--include/asm-cris/arch-v32/irq.h120
-rw-r--r--include/asm-cris/arch-v32/juliette.h326
-rw-r--r--include/asm-cris/arch-v32/memmap.h24
-rw-r--r--include/asm-cris/arch-v32/mmu.h111
-rw-r--r--include/asm-cris/arch-v32/offset.h35
-rw-r--r--include/asm-cris/arch-v32/page.h28
-rw-r--r--include/asm-cris/arch-v32/pgtable.h9
-rw-r--r--include/asm-cris/arch-v32/pinmux.h39
-rw-r--r--include/asm-cris/arch-v32/processor.h60
-rw-r--r--include/asm-cris/arch-v32/ptrace.h114
-rw-r--r--include/asm-cris/arch-v32/spinlock.h163
-rw-r--r--include/asm-cris/arch-v32/system.h79
-rw-r--r--include/asm-cris/arch-v32/thread_info.h13
-rw-r--r--include/asm-cris/arch-v32/timex.h31
-rw-r--r--include/asm-cris/arch-v32/tlb.h14
-rw-r--r--include/asm-cris/arch-v32/uaccess.h748
-rw-r--r--include/asm-cris/arch-v32/unistd.h148
-rw-r--r--include/asm-cris/arch-v32/user.h41
-rw-r--r--include/asm-cris/atomic.h66
-rw-r--r--include/asm-cris/axisflashmap.h3
-rw-r--r--include/asm-cris/bitops.h35
-rw-r--r--include/asm-cris/dma-mapping.h170
-rw-r--r--include/asm-cris/dma.h8
-rw-r--r--include/asm-cris/elf.h45
-rw-r--r--include/asm-cris/emergency-restart.h6
-rw-r--r--include/asm-cris/etraxgpio.h10
-rw-r--r--include/asm-cris/hardirq.h5
-rw-r--r--include/asm-cris/hw_irq.h7
-rw-r--r--include/asm-cris/ide.h1
-rw-r--r--include/asm-cris/io.h103
-rw-r--r--include/asm-cris/irq.h10
-rw-r--r--include/asm-cris/kmap_types.h4
-rw-r--r--include/asm-cris/mmu_context.h2
-rw-r--r--include/asm-cris/page.h7
-rw-r--r--include/asm-cris/pci.h102
-rw-r--r--include/asm-cris/pgalloc.h10
-rw-r--r--include/asm-cris/pgtable.h42
-rw-r--r--include/asm-cris/processor.h9
-rw-r--r--include/asm-cris/ptrace.h2
-rw-r--r--include/asm-cris/semaphore.h21
-rw-r--r--include/asm-cris/smp.h7
-rw-r--r--include/asm-cris/spinlock.h1
-rw-r--r--include/asm-cris/sync_serial.h106
-rw-r--r--include/asm-cris/termbits.h2
-rw-r--r--include/asm-cris/thread_info.h4
-rw-r--r--include/asm-cris/timex.h2
-rw-r--r--include/asm-cris/tlbflush.h19
-rw-r--r--include/asm-cris/types.h2
-rw-r--r--include/asm-cris/unistd.h11
-rw-r--r--include/asm-frv/emergency-restart.h6
-rw-r--r--include/asm-frv/pci.h10
-rw-r--r--include/asm-frv/thread_info.h2
-rw-r--r--include/asm-generic/emergency-restart.h9
-rw-r--r--include/asm-generic/pci.h8
-rw-r--r--include/asm-generic/percpu.h2
-rw-r--r--include/asm-generic/sections.h1
-rw-r--r--include/asm-generic/topology.h9
-rw-r--r--include/asm-generic/vmlinux.lds.h2
-rw-r--r--include/asm-h8300/emergency-restart.h6
-rw-r--r--include/asm-h8300/pci.h2
-rw-r--r--include/asm-h8300/thread_info.h2
-rw-r--r--include/asm-i386/acpi.h10
-rw-r--r--include/asm-i386/apic.h15
-rw-r--r--include/asm-i386/apicdef.h9
-rw-r--r--include/asm-i386/bitops.h53
-rw-r--r--include/asm-i386/checksum.h2
-rw-r--r--include/asm-i386/cpu.h2
-rw-r--r--include/asm-i386/emergency-restart.h6
-rw-r--r--include/asm-i386/genapic.h1
-rw-r--r--include/asm-i386/highmem.h1
-rw-r--r--include/asm-i386/i387.h26
-rw-r--r--include/asm-i386/i8253.h6
-rw-r--r--include/asm-i386/ide.h12
-rw-r--r--include/asm-i386/irq.h6
-rw-r--r--include/asm-i386/kdebug.h2
-rw-r--r--include/asm-i386/kexec.h33
-rw-r--r--include/asm-i386/kprobes.h3
-rw-r--r--include/asm-i386/mach-bigsmp/mach_apic.h2
-rw-r--r--include/asm-i386/mach-default/do_timer.h1
-rw-r--r--include/asm-i386/mach-default/mach_apic.h2
-rw-r--r--include/asm-i386/mach-default/mach_ipi.h27
-rw-r--r--include/asm-i386/mach-es7000/mach_apic.h2
-rw-r--r--include/asm-i386/mach-generic/mach_apic.h1
-rw-r--r--include/asm-i386/mach-numaq/mach_apic.h2
-rw-r--r--include/asm-i386/mach-summit/mach_apic.h2
-rw-r--r--include/asm-i386/mach-visws/do_timer.h1
-rw-r--r--include/asm-i386/mach-visws/mach_apic.h2
-rw-r--r--include/asm-i386/mmzone.h107
-rw-r--r--include/asm-i386/page.h9
-rw-r--r--include/asm-i386/param.h4
-rw-r--r--include/asm-i386/pci.h12
-rw-r--r--include/asm-i386/pgtable.h4
-rw-r--r--include/asm-i386/processor.h26
-rw-r--r--include/asm-i386/ptrace.h15
-rw-r--r--include/asm-i386/serial.h102
-rw-r--r--include/asm-i386/smp.h13
-rw-r--r--include/asm-i386/sparsemem.h31
-rw-r--r--include/asm-i386/string.h32
-rw-r--r--include/asm-i386/thread_info.h2
-rw-r--r--include/asm-i386/timer.h2
-rw-r--r--include/asm-i386/timex.h5
-rw-r--r--include/asm-i386/tlbflush.h12
-rw-r--r--include/asm-i386/topology.h15
-rw-r--r--include/asm-i386/unistd.h7
-rw-r--r--include/asm-ia64/acpi.h9
-rw-r--r--include/asm-ia64/break.h2
-rw-r--r--include/asm-ia64/compat.h1
-rw-r--r--include/asm-ia64/emergency-restart.h6
-rw-r--r--include/asm-ia64/fcntl.h2
-rw-r--r--include/asm-ia64/hw_irq.h1
-rw-r--r--include/asm-ia64/io.h8
-rw-r--r--include/asm-ia64/iosapic.h12
-rw-r--r--include/asm-ia64/kdebug.h61
-rw-r--r--include/asm-ia64/kprobes.h120
-rw-r--r--include/asm-ia64/mmu_context.h3
-rw-r--r--include/asm-ia64/mmzone.h4
-rw-r--r--include/asm-ia64/param.h2
-rw-r--r--include/asm-ia64/pci.h22
-rw-r--r--include/asm-ia64/percpu.h2
-rw-r--r--include/asm-ia64/sections.h1
-rw-r--r--include/asm-ia64/sn/addrs.h17
-rw-r--r--include/asm-ia64/sn/arch.h1
-rw-r--r--include/asm-ia64/sn/intr.h6
-rw-r--r--include/asm-ia64/sn/l1.h1
-rw-r--r--include/asm-ia64/sn/pcibr_provider.h159
-rw-r--r--include/asm-ia64/sn/pcibus_provider_defs.h3
-rw-r--r--include/asm-ia64/sn/pcidev.h16
-rw-r--r--include/asm-ia64/sn/pic.h261
-rw-r--r--include/asm-ia64/sn/shub_mmr.h346
-rw-r--r--include/asm-ia64/sn/simulator.h16
-rw-r--r--include/asm-ia64/sn/sn2/sn_hwperf.h2
-rw-r--r--include/asm-ia64/sn/sn_cpuid.h5
-rw-r--r--include/asm-ia64/sn/sn_sal.h47
-rw-r--r--include/asm-ia64/sn/tioca_provider.h1
-rw-r--r--include/asm-ia64/sn/tiocp.h256
-rw-r--r--include/asm-ia64/sn/xp.h1
-rw-r--r--include/asm-ia64/system.h10
-rw-r--r--include/asm-ia64/thread_info.h2
-rw-r--r--include/asm-ia64/topology.h66
-rw-r--r--include/asm-ia64/unistd.h5
-rw-r--r--include/asm-ia64/vga.h5
-rw-r--r--include/asm-m32r/emergency-restart.h6
-rw-r--r--include/asm-m32r/mmzone.h3
-rw-r--r--include/asm-m32r/s1d13806.h199
-rw-r--r--include/asm-m32r/smp.h2
-rw-r--r--include/asm-m32r/thread_info.h2
-rw-r--r--include/asm-m32r/topology.h44
-rw-r--r--include/asm-m68k/emergency-restart.h6
-rw-r--r--include/asm-m68k/page.h6
-rw-r--r--include/asm-m68k/pci.h2
-rw-r--r--include/asm-m68k/serial.h47
-rw-r--r--include/asm-m68k/thread_info.h2
-rw-r--r--include/asm-m68knommu/emergency-restart.h6
-rw-r--r--include/asm-m68knommu/thread_info.h2
-rw-r--r--include/asm-mips/compat.h1
-rw-r--r--include/asm-mips/emergency-restart.h6
-rw-r--r--include/asm-mips/mmzone.h4
-rw-r--r--include/asm-mips/page.h2
-rw-r--r--include/asm-mips/pci.h12
-rw-r--r--include/asm-mips/pgtable.h2
-rw-r--r--include/asm-mips/serial.h84
-rw-r--r--include/asm-mips/system.h10
-rw-r--r--include/asm-mips/thread_info.h2
-rw-r--r--include/asm-parisc/compat.h2
-rw-r--r--include/asm-parisc/emergency-restart.h6
-rw-r--r--include/asm-parisc/mmzone.h3
-rw-r--r--include/asm-parisc/pci.h23
-rw-r--r--include/asm-parisc/serial.h16
-rw-r--r--include/asm-parisc/thread_info.h2
-rw-r--r--include/asm-ppc/cpm2.h5
-rw-r--r--include/asm-ppc/dma-mapping.h2
-rw-r--r--include/asm-ppc/emergency-restart.h6
-rw-r--r--include/asm-ppc/fsl_ocp.h54
-rw-r--r--include/asm-ppc/ibm44x.h38
-rw-r--r--include/asm-ppc/ibm4xx.h4
-rw-r--r--include/asm-ppc/ibm_ocp.h12
-rw-r--r--include/asm-ppc/kexec.h40
-rw-r--r--include/asm-ppc/machdep.h31
-rw-r--r--include/asm-ppc/macio.h5
-rw-r--r--include/asm-ppc/mmu.h2
-rw-r--r--include/asm-ppc/mmu_context.h4
-rw-r--r--include/asm-ppc/mpc10x.h3
-rw-r--r--include/asm-ppc/mpc8xx.h4
-rw-r--r--include/asm-ppc/ocp.h4
-rw-r--r--include/asm-ppc/of_device.h20
-rw-r--r--include/asm-ppc/open_pic.h6
-rw-r--r--include/asm-ppc/pc_serial.h86
-rw-r--r--include/asm-ppc/pci.h22
-rw-r--r--include/asm-ppc/pgtable.h52
-rw-r--r--include/asm-ppc/ppc4xx_dma.h2
-rw-r--r--include/asm-ppc/ppc_asm.h8
-rw-r--r--include/asm-ppc/reg.h1
-rw-r--r--include/asm-ppc/reg_booke.h18
-rw-r--r--include/asm-ppc/thread_info.h3
-rw-r--r--include/asm-ppc/time.h2
-rw-r--r--include/asm-ppc/unistd.h9
-rw-r--r--include/asm-ppc64/bug.h7
-rw-r--r--include/asm-ppc64/byteorder.h10
-rw-r--r--include/asm-ppc64/compat.h1
-rw-r--r--include/asm-ppc64/cputable.h3
-rw-r--r--include/asm-ppc64/emergency-restart.h6
-rw-r--r--include/asm-ppc64/hvconsole.h17
-rw-r--r--include/asm-ppc64/iSeries/HvCallHpt.h11
-rw-r--r--include/asm-ppc64/iSeries/HvReleaseData.h11
-rw-r--r--include/asm-ppc64/iSeries/ItLpQueue.h15
-rw-r--r--include/asm-ppc64/iSeries/LparMap.h32
-rw-r--r--include/asm-ppc64/kdebug.h2
-rw-r--r--include/asm-ppc64/kexec.h41
-rw-r--r--include/asm-ppc64/kprobes.h5
-rw-r--r--include/asm-ppc64/machdep.h13
-rw-r--r--include/asm-ppc64/mmu.h107
-rw-r--r--include/asm-ppc64/mmzone.h44
-rw-r--r--include/asm-ppc64/nvram.h1
-rw-r--r--include/asm-ppc64/paca.h3
-rw-r--r--include/asm-ppc64/page.h3
-rw-r--r--include/asm-ppc64/pci.h32
-rw-r--r--include/asm-ppc64/ppc32.h2
-rw-r--r--include/asm-ppc64/processor.h41
-rw-r--r--include/asm-ppc64/rtas.h6
-rw-r--r--include/asm-ppc64/smp.h8
-rw-r--r--include/asm-ppc64/sparsemem.h16
-rw-r--r--include/asm-ppc64/thread_info.h2
-rw-r--r--include/asm-ppc64/time.h9
-rw-r--r--include/asm-ppc64/topology.h3
-rw-r--r--include/asm-ppc64/unistd.h9
-rw-r--r--include/asm-ppc64/xics.h1
-rw-r--r--include/asm-s390/atomic.h8
-rw-r--r--include/asm-s390/bitops.h440
-rw-r--r--include/asm-s390/cpcmd.h18
-rw-r--r--include/asm-s390/debug.h48
-rw-r--r--include/asm-s390/emergency-restart.h6
-rw-r--r--include/asm-s390/kexec.h42
-rw-r--r--include/asm-s390/lowcore.h11
-rw-r--r--include/asm-s390/processor.h57
-rw-r--r--include/asm-s390/ptrace.h2
-rw-r--r--include/asm-s390/spinlock.h252
-rw-r--r--include/asm-s390/system.h38
-rw-r--r--include/asm-s390/thread_info.h4
-rw-r--r--include/asm-s390/uaccess.h21
-rw-r--r--include/asm-s390/unistd.h9
-rw-r--r--include/asm-sh/bigsur/serial.h5
-rw-r--r--include/asm-sh/ec3104/serial.h4
-rw-r--r--include/asm-sh/emergency-restart.h6
-rw-r--r--include/asm-sh/pci.h12
-rw-r--r--include/asm-sh/serial.h6
-rw-r--r--include/asm-sh/thread_info.h2
-rw-r--r--include/asm-sh/unistd.h10
-rw-r--r--include/asm-sh64/emergency-restart.h6
-rw-r--r--include/asm-sh64/pci.h12
-rw-r--r--include/asm-sh64/serial.h4
-rw-r--r--include/asm-sh64/thread_info.h2
-rw-r--r--include/asm-sh64/unistd.h7
-rw-r--r--include/asm-sparc/emergency-restart.h6
-rw-r--r--include/asm-sparc/pci.h12
-rw-r--r--include/asm-sparc/system.h4
-rw-r--r--include/asm-sparc/thread_info.h4
-rw-r--r--include/asm-sparc/unistd.h10
-rw-r--r--include/asm-sparc64/auxio.h2
-rw-r--r--include/asm-sparc64/bitops.h56
-rw-r--r--include/asm-sparc64/compat.h1
-rw-r--r--include/asm-sparc64/emergency-restart.h6
-rw-r--r--include/asm-sparc64/floppy.h16
-rw-r--r--include/asm-sparc64/irq.h56
-rw-r--r--include/asm-sparc64/kdebug.h2
-rw-r--r--include/asm-sparc64/param.h5
-rw-r--r--include/asm-sparc64/parport.h4
-rw-r--r--include/asm-sparc64/pbm.h3
-rw-r--r--include/asm-sparc64/pci.h21
-rw-r--r--include/asm-sparc64/ptrace.h5
-rw-r--r--include/asm-sparc64/rwsem.h47
-rw-r--r--include/asm-sparc64/seccomp.h21
-rw-r--r--include/asm-sparc64/signal.h15
-rw-r--r--include/asm-sparc64/spinlock.h29
-rw-r--r--include/asm-sparc64/spitfire.h131
-rw-r--r--include/asm-sparc64/system.h25
-rw-r--r--include/asm-sparc64/termios.h78
-rw-r--r--include/asm-sparc64/thread_info.h28
-rw-r--r--include/asm-sparc64/timer.h41
-rw-r--r--include/asm-sparc64/unistd.h10
-rw-r--r--include/asm-um/emergency-restart.h6
-rw-r--r--include/asm-um/ldt.h5
-rw-r--r--include/asm-um/mmu_context.h10
-rw-r--r--include/asm-um/page.h4
-rw-r--r--include/asm-um/ptrace-i386.h4
-rw-r--r--include/asm-um/thread_info.h2
-rw-r--r--include/asm-um/vm86.h6
-rw-r--r--include/asm-v850/bitops.h6
-rw-r--r--include/asm-v850/cache.h7
-rw-r--r--include/asm-v850/checksum.h11
-rw-r--r--include/asm-v850/emergency-restart.h6
-rw-r--r--include/asm-v850/io.h37
-rw-r--r--include/asm-v850/mmu.h17
-rw-r--r--include/asm-v850/page.h5
-rw-r--r--include/asm-v850/pci.h47
-rw-r--r--include/asm-v850/pgtable.h2
-rw-r--r--include/asm-v850/thread_info.h3
-rw-r--r--include/asm-v850/v850e2_cache.h5
-rw-r--r--include/asm-x86_64/acpi.h8
-rw-r--r--include/asm-x86_64/apic.h2
-rw-r--r--include/asm-x86_64/apicdef.h2
-rw-r--r--include/asm-x86_64/bitops.h5
-rw-r--r--include/asm-x86_64/bug.h13
-rw-r--r--include/asm-x86_64/desc.h1
-rw-r--r--include/asm-x86_64/e820.h2
-rw-r--r--include/asm-x86_64/emergency-restart.h6
-rw-r--r--include/asm-x86_64/ia32.h2
-rw-r--r--include/asm-x86_64/ia32_unistd.h7
-rw-r--r--include/asm-x86_64/io.h5
-rw-r--r--include/asm-x86_64/io_apic.h2
-rw-r--r--include/asm-x86_64/ipi.h45
-rw-r--r--include/asm-x86_64/irq.h7
-rw-r--r--include/asm-x86_64/kdebug.h2
-rw-r--r--include/asm-x86_64/kexec.h33
-rw-r--r--include/asm-x86_64/kprobes.h3
-rw-r--r--include/asm-x86_64/mmzone.h20
-rw-r--r--include/asm-x86_64/msr.h7
-rw-r--r--include/asm-x86_64/page.h10
-rw-r--r--include/asm-x86_64/param.h6
-rw-r--r--include/asm-x86_64/pci.h12
-rw-r--r--include/asm-x86_64/percpu.h2
-rw-r--r--include/asm-x86_64/pgtable.h2
-rw-r--r--include/asm-x86_64/processor.h10
-rw-r--r--include/asm-x86_64/proto.h7
-rw-r--r--include/asm-x86_64/ptrace.h1
-rw-r--r--include/asm-x86_64/serial.h102
-rw-r--r--include/asm-x86_64/smp.h10
-rw-r--r--include/asm-x86_64/sparsemem.h26
-rw-r--r--include/asm-x86_64/suspend.h2
-rw-r--r--include/asm-x86_64/system.h7
-rw-r--r--include/asm-x86_64/thread_info.h2
-rw-r--r--include/asm-x86_64/timex.h3
-rw-r--r--include/asm-x86_64/tlbflush.h21
-rw-r--r--include/asm-x86_64/topology.h28
-rw-r--r--include/asm-x86_64/unistd.h16
-rw-r--r--include/asm-xtensa/a.out.h33
-rw-r--r--include/asm-xtensa/atomic.h272
-rw-r--r--include/asm-xtensa/bitops.h446
-rw-r--r--include/asm-xtensa/bootparam.h61
-rw-r--r--include/asm-xtensa/bug.h41
-rw-r--r--include/asm-xtensa/bugs.h22
-rw-r--r--include/asm-xtensa/byteorder.h82
-rw-r--r--include/asm-xtensa/cache.h32
-rw-r--r--include/asm-xtensa/cacheflush.h122
-rw-r--r--include/asm-xtensa/checksum.h264
-rw-r--r--include/asm-xtensa/coprocessor.h70
-rw-r--r--include/asm-xtensa/cpumask.h16
-rw-r--r--include/asm-xtensa/cputime.h6
-rw-r--r--include/asm-xtensa/current.h38
-rw-r--r--include/asm-xtensa/delay.h50
-rw-r--r--include/asm-xtensa/div64.h19
-rw-r--r--include/asm-xtensa/dma-mapping.h182
-rw-r--r--include/asm-xtensa/dma.h61
-rw-r--r--include/asm-xtensa/elf.h222
-rw-r--r--include/asm-xtensa/emergency-restart.h6
-rw-r--r--include/asm-xtensa/errno.h16
-rw-r--r--include/asm-xtensa/fcntl.h101
-rw-r--r--include/asm-xtensa/fixmap.h252
-rw-r--r--include/asm-xtensa/hardirq.h28
-rw-r--r--include/asm-xtensa/hdreg.h17
-rw-r--r--include/asm-xtensa/highmem.h17
-rw-r--r--include/asm-xtensa/hw_irq.h18
-rw-r--r--include/asm-xtensa/ide.h36
-rw-r--r--include/asm-xtensa/io.h197
-rw-r--r--include/asm-xtensa/ioctl.h83
-rw-r--r--include/asm-xtensa/ioctls.h112
-rw-r--r--include/asm-xtensa/ipcbuf.h37
-rw-r--r--include/asm-xtensa/irq.h37
-rw-r--r--include/asm-xtensa/kmap_types.h31
-rw-r--r--include/asm-xtensa/linkage.h16
-rw-r--r--include/asm-xtensa/local.h16
-rw-r--r--include/asm-xtensa/mman.h80
-rw-r--r--include/asm-xtensa/mmu.h17
-rw-r--r--include/asm-xtensa/mmu_context.h330
-rw-r--r--include/asm-xtensa/module.h25
-rw-r--r--include/asm-xtensa/msgbuf.h48
-rw-r--r--include/asm-xtensa/namei.h26
-rw-r--r--include/asm-xtensa/page.h133
-rw-r--r--include/asm-xtensa/page.h.n135
-rw-r--r--include/asm-xtensa/param.h34
-rw-r--r--include/asm-xtensa/pci-bridge.h88
-rw-r--r--include/asm-xtensa/pci.h89
-rw-r--r--include/asm-xtensa/percpu.h16
-rw-r--r--include/asm-xtensa/pgalloc.h116
-rw-r--r--include/asm-xtensa/pgtable.h468
-rw-r--r--include/asm-xtensa/platform-iss/hardware.h29
-rw-r--r--include/asm-xtensa/platform.h92
-rw-r--r--include/asm-xtensa/poll.h37
-rw-r--r--include/asm-xtensa/posix_types.h123
-rw-r--r--include/asm-xtensa/processor.h205
-rw-r--r--include/asm-xtensa/ptrace.h135
-rw-r--r--include/asm-xtensa/resource.h16
-rw-r--r--include/asm-xtensa/rmap.h16
-rw-r--r--include/asm-xtensa/rwsem.h175
-rw-r--r--include/asm-xtensa/scatterlist.h34
-rw-r--r--include/asm-xtensa/sections.h16
-rw-r--r--include/asm-xtensa/segment.h16
-rw-r--r--include/asm-xtensa/semaphore.h129
-rw-r--r--include/asm-xtensa/sembuf.h44
-rw-r--r--include/asm-xtensa/serial.h18
-rw-r--r--include/asm-xtensa/setup.h16
-rw-r--r--include/asm-xtensa/shmbuf.h50
-rw-r--r--include/asm-xtensa/shmparam.h23
-rw-r--r--include/asm-xtensa/sigcontext.h44
-rw-r--r--include/asm-xtensa/siginfo.h16
-rw-r--r--include/asm-xtensa/signal.h187
-rw-r--r--include/asm-xtensa/smp.h27
-rw-r--r--include/asm-xtensa/socket.h61
-rw-r--r--include/asm-xtensa/sockios.h30
-rw-r--r--include/asm-xtensa/spinlock.h16
-rw-r--r--include/asm-xtensa/stat.h105
-rw-r--r--include/asm-xtensa/statfs.h17
-rw-r--r--include/asm-xtensa/string.h124
-rw-r--r--include/asm-xtensa/system.h252
-rw-r--r--include/asm-xtensa/termbits.h194
-rw-r--r--include/asm-xtensa/termios.h122
-rw-r--r--include/asm-xtensa/thread_info.h146
-rw-r--r--include/asm-xtensa/timex.h94
-rw-r--r--include/asm-xtensa/tlb.h25
-rw-r--r--include/asm-xtensa/tlbflush.h200
-rw-r--r--include/asm-xtensa/topology.h16
-rw-r--r--include/asm-xtensa/types.h66
-rw-r--r--include/asm-xtensa/uaccess.h532
-rw-r--r--include/asm-xtensa/ucontext.h22
-rw-r--r--include/asm-xtensa/unaligned.h28
-rw-r--r--include/asm-xtensa/unistd.h439
-rw-r--r--include/asm-xtensa/user.h20
-rw-r--r--include/asm-xtensa/vga.h19
-rw-r--r--include/asm-xtensa/xor.h16
-rw-r--r--include/asm-xtensa/xtensa/cacheasm.h708
-rw-r--r--include/asm-xtensa/xtensa/cacheattrasm.h432
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/core.h1270
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/defs.h270
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/specreg.h99
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/system.h198
-rw-r--r--include/asm-xtensa/xtensa/config-linux_be/tie.h275
-rw-r--r--include/asm-xtensa/xtensa/coreasm.h526
-rw-r--r--include/asm-xtensa/xtensa/corebits.h77
-rw-r--r--include/asm-xtensa/xtensa/hal.h822
-rw-r--r--include/asm-xtensa/xtensa/simcall.h130
-rw-r--r--include/asm-xtensa/xtensa/xt2000-uart.h155
-rw-r--r--include/asm-xtensa/xtensa/xt2000.h408
-rw-r--r--include/asm-xtensa/xtensa/xtboard.h120
-rw-r--r--include/linux/a.out.h2
-rw-r--r--include/linux/acpi.h30
-rw-r--r--include/linux/atalk.h2
-rw-r--r--include/linux/audit.h2
-rw-r--r--include/linux/binfmts.h5
-rw-r--r--include/linux/bio.h14
-rw-r--r--include/linux/blkdev.h41
-rw-r--r--include/linux/bootmem.h13
-rw-r--r--include/linux/buffer_head.h3
-rw-r--r--include/linux/byteorder/swabb.h17
-rw-r--r--include/linux/cache.h6
-rw-r--r--include/linux/cciss_ioctl.h1
-rw-r--r--include/linux/compat_ioctl.h19
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/cpufreq.h2
-rw-r--r--include/linux/crash_dump.h18
-rw-r--r--include/linux/crypto.h34
-rw-r--r--include/linux/dcookies.h4
-rw-r--r--include/linux/device.h13
-rw-r--r--include/linux/dmi.h1
-rw-r--r--include/linux/dqblk_v1.h6
-rw-r--r--include/linux/dqblk_v2.h6
-rw-r--r--include/linux/efi.h2
-rw-r--r--include/linux/elevator.h8
-rw-r--r--include/linux/etherdevice.h5
-rw-r--r--include/linux/ext2_fs.h25
-rw-r--r--include/linux/ext3_fs.h15
-rw-r--r--include/linux/ext3_jbd.h19
-rw-r--r--include/linux/fadvise.h10
-rw-r--r--include/linux/fcntl.h4
-rw-r--r--include/linux/fddidevice.h2
-rw-r--r--include/linux/fs.h71
-rw-r--r--include/linux/fsnotify.h251
-rw-r--r--include/linux/ftape.h2
-rw-r--r--include/linux/genhd.h3
-rw-r--r--include/linux/gfp.h4
-rw-r--r--include/linux/hardirq.h1
-rw-r--r--include/linux/hdlc.h4
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/hwmon-sysfs.h (renamed from include/linux/i2c-sysfs.h)8
-rw-r--r--include/linux/i2c-dev.h1
-rw-r--r--include/linux/i2c-id.h1
-rw-r--r--include/linux/i2c-vid.h12
-rw-r--r--include/linux/i2c.h12
-rw-r--r--include/linux/i2o-dev.h43
-rw-r--r--include/linux/i2o.h497
-rw-r--r--include/linux/ide.h8
-rw-r--r--include/linux/if_bonding.h7
-rw-r--r--include/linux/if_shaper.h2
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/in6.h2
-rw-r--r--include/linux/init.h12
-rw-r--r--include/linux/init_task.h3
-rw-r--r--include/linux/inotify.h110
-rw-r--r--include/linux/input.h10
-rw-r--r--include/linux/ioprio.h85
-rw-r--r--include/linux/ipmi.h5
-rw-r--r--include/linux/irq.h6
-rw-r--r--include/linux/jffs2_fs_sb.h9
-rw-r--r--include/linux/joystick.h33
-rw-r--r--include/linux/kernel.h18
-rw-r--r--include/linux/kexec.h135
-rw-r--r--include/linux/key-ui.h47
-rw-r--r--include/linux/key.h44
-rw-r--r--include/linux/keyctl.h11
-rw-r--r--include/linux/kmod.h13
-rw-r--r--include/linux/kprobes.h80
-rw-r--r--include/linux/libps2.h1
-rw-r--r--include/linux/list.h2
-rw-r--r--include/linux/lockd/lockd.h7
-rw-r--r--include/linux/loop.h2
-rw-r--r--include/linux/mbcache.h2
-rw-r--r--include/linux/mempool.h11
-rw-r--r--include/linux/mm.h141
-rw-r--r--include/linux/mmzone.h171
-rw-r--r--include/linux/mod_devicetable.h57
-rw-r--r--include/linux/module.h5
-rw-r--r--include/linux/mount.h8
-rw-r--r--include/linux/mtd/cfi.h85
-rw-r--r--include/linux/mtd/flashchip.h7
-rw-r--r--include/linux/mtd/inftl.h4
-rw-r--r--include/linux/mtd/map.h33
-rw-r--r--include/linux/mtd/mtd.h15
-rw-r--r--include/linux/mtd/nand.h48
-rw-r--r--include/linux/mtd/plat-ram.h35
-rw-r--r--include/linux/mtd/xip.h31
-rw-r--r--include/linux/namespace.h4
-rw-r--r--include/linux/netdevice.h19
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h5
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper.h7
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLUSTERIP.h3
-rw-r--r--include/linux/netlink.h8
-rw-r--r--include/linux/netpoll.h48
-rw-r--r--include/linux/nfs4.h4
-rw-r--r--include/linux/nfs_fs.h344
-rw-r--r--include/linux/nfs_fs_i.h5
-rw-r--r--include/linux/nfs_fs_sb.h1
-rw-r--r--include/linux/nfs_mount.h1
-rw-r--r--include/linux/nfs_page.h30
-rw-r--r--include/linux/nfs_xdr.h43
-rw-r--r--include/linux/nfsacl.h58
-rw-r--r--include/linux/nfsd/nfsd.h26
-rw-r--r--include/linux/nfsd/state.h56
-rw-r--r--include/linux/nfsd/xdr.h4
-rw-r--r--include/linux/nfsd/xdr3.h26
-rw-r--r--include/linux/nfsd/xdr4.h1
-rw-r--r--include/linux/nfsd_idmap.h5
-rw-r--r--include/linux/numa.h2
-rw-r--r--include/linux/nvram.h2
-rw-r--r--include/linux/pci-dynids.h18
-rw-r--r--include/linux/pci.h42
-rw-r--r--include/linux/pci_ids.h36
-rw-r--r--include/linux/pkt_cls.h2
-rw-r--r--include/linux/pkt_sched.h9
-rw-r--r--include/linux/pktcdvd.h2
-rw-r--r--include/linux/pm.h35
-rw-r--r--include/linux/pmu.h6
-rw-r--r--include/linux/posix_acl_xattr.h11
-rw-r--r--include/linux/proc_fs.h7
-rw-r--r--include/linux/qnx4_fs.h18
-rw-r--r--include/linux/qnxtypes.h16
-rw-r--r--include/linux/quota.h7
-rw-r--r--include/linux/quotaops.h3
-rw-r--r--include/linux/raid/bitmap.h3
-rw-r--r--include/linux/reboot.h20
-rw-r--r--include/linux/reiserfs_acl.h53
-rw-r--r--include/linux/reiserfs_fs.h1610
-rw-r--r--include/linux/reiserfs_fs_i.h59
-rw-r--r--include/linux/reiserfs_fs_sb.h614
-rw-r--r--include/linux/reiserfs_xattr.h126
-rw-r--r--include/linux/rmap.h6
-rw-r--r--include/linux/rtnetlink.h15
-rw-r--r--include/linux/sched.h131
-rw-r--r--include/linux/seccomp.h10
-rw-r--r--include/linux/serial.h6
-rw-r--r--include/linux/serialP.h1
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/serial_core.h7
-rw-r--r--include/linux/serio.h6
-rw-r--r--include/linux/skbuff.h74
-rw-r--r--include/linux/slab.h6
-rw-r--r--include/linux/string.h2
-rw-r--r--include/linux/sunrpc/clnt.h6
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--include/linux/sunrpc/svc.h14
-rw-r--r--include/linux/sunrpc/xdr.h22
-rw-r--r--include/linux/suspend.h2
-rw-r--r--include/linux/swap.h5
-rw-r--r--include/linux/syscalls.h8
-rw-r--r--include/linux/sysctl.h22
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h5
-rw-r--r--include/linux/tc_ematch/tc_em_text.h19
-rw-r--r--include/linux/tcp.h52
-rw-r--r--include/linux/tcp_diag.h4
-rw-r--r--include/linux/textsearch.h180
-rw-r--r--include/linux/textsearch_fsm.h48
-rw-r--r--include/linux/timer.h34
-rw-r--r--include/linux/topology.h14
-rw-r--r--include/linux/tty.h1
-rw-r--r--include/linux/uinput.h5
-rw-r--r--include/linux/usb.h10
-rw-r--r--include/linux/usb_cdc.h13
-rw-r--r--include/linux/usb_ch9.h189
-rw-r--r--include/linux/usb_gadget.h14
-rw-r--r--include/linux/usb_input.h25
-rw-r--r--include/linux/usb_isp116x.h47
-rw-r--r--include/linux/videodev2.h2
-rw-r--r--include/linux/wait.h16
-rw-r--r--include/linux/wanrouter.h3
-rw-r--r--include/linux/watchdog.h10
-rw-r--r--include/linux/writeback.h8
-rw-r--r--include/linux/x25.h12
-rw-r--r--include/linux/xattr_acl.h50
-rw-r--r--include/linux/zlib.h5
-rw-r--r--include/media/audiochip.h5
-rw-r--r--include/media/id.h4
-rw-r--r--include/media/ir-common.h3
-rw-r--r--include/media/saa6752hs.h49
-rw-r--r--include/media/tuner.h54
-rw-r--r--include/media/tveeprom.h5
-rw-r--r--include/mtd/mtd-abi.h19
-rw-r--r--include/net/ax25.h18
-rw-r--r--include/net/bluetooth/bluetooth.h8
-rw-r--r--include/net/ieee80211.h856
-rw-r--r--include/net/ipv6.h1
-rw-r--r--include/net/irda/irda_device.h2
-rw-r--r--include/net/pkt_sched.h17
-rw-r--r--include/net/sch_generic.h13
-rw-r--r--include/net/sctp/constants.h18
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/sctp/sm.h17
-rw-r--r--include/net/sctp/structs.h54
-rw-r--r--include/net/sctp/ulpevent.h16
-rw-r--r--include/net/sctp/ulpqueue.h11
-rw-r--r--include/net/slhc_vj.h21
-rw-r--r--include/net/sock.h30
-rw-r--r--include/net/tcp.h402
-rw-r--r--include/net/x25.h9
-rw-r--r--include/net/x25device.h3
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/pcmcia/ciscode.h2
-rw-r--r--include/pcmcia/cs.h44
-rw-r--r--include/pcmcia/cs_types.h4
-rw-r--r--include/pcmcia/device_id.h249
-rw-r--r--include/pcmcia/ds.h32
-rw-r--r--include/pcmcia/ss.h42
-rw-r--r--include/pcmcia/version.h3
-rw-r--r--include/scsi/scsi.h4
-rw-r--r--include/scsi/scsi_cmnd.h5
-rw-r--r--include/scsi/scsi_device.h3
-rw-r--r--include/scsi/scsi_host.h6
-rw-r--r--include/scsi/scsi_transport.h8
-rw-r--r--include/scsi/sg_request.h26
-rw-r--r--include/sound/ac97_codec.h8
-rw-r--r--include/sound/asound.h16
-rw-r--r--include/sound/control.h2
-rw-r--r--include/sound/core.h40
-rw-r--r--include/sound/driver.h2
-rw-r--r--include/sound/emu10k1.h43
-rw-r--r--include/sound/gus.h23
-rw-r--r--include/sound/hdspm.h131
-rw-r--r--include/sound/pcm.h32
-rw-r--r--include/sound/seq_midi_event.h2
-rw-r--r--include/sound/seq_virmidi.h1
-rw-r--r--include/sound/timer.h2
-rw-r--r--include/sound/version.h4
-rw-r--r--include/sound/vx_core.h16
889 files changed, 59026 insertions, 7316 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 2b41e47b7d80..2f6ab189fc6f 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -64,7 +64,7 @@
64 64
65/* Version string */ 65/* Version string */
66 66
67#define ACPI_CA_VERSION 0x20050309 67#define ACPI_CA_VERSION 0x20050408
68 68
69/* 69/*
70 * OS name, used for the _OS object. The _OS object is essentially obsolete, 70 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -130,9 +130,8 @@
130#define ACPI_MAX_GPE_BLOCKS 2 130#define ACPI_MAX_GPE_BLOCKS 2
131#define ACPI_GPE_REGISTER_WIDTH 8 131#define ACPI_GPE_REGISTER_WIDTH 8
132 132
133/* 133/* Method info (in WALK_STATE), containing local variables and argumetns */
134 * Method info (in WALK_STATE), containing local variables and argumetns 134
135 */
136#define ACPI_METHOD_NUM_LOCALS 8 135#define ACPI_METHOD_NUM_LOCALS 8
137#define ACPI_METHOD_MAX_LOCAL 7 136#define ACPI_METHOD_MAX_LOCAL 7
138 137
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index 223b2a506e49..8ba372b0f245 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -61,9 +61,7 @@ struct argument_info
61 61
62 62
63#define PARAM_LIST(pl) pl 63#define PARAM_LIST(pl) pl
64
65#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose) 64#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
66
67#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\ 65#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
68 acpi_os_printf PARAM_LIST(fp);} 66 acpi_os_printf PARAM_LIST(fp);}
69 67
@@ -71,13 +69,9 @@ struct argument_info
71#define EX_SINGLE_STEP 2 69#define EX_SINGLE_STEP 2
72 70
73 71
74/* Prototypes */
75
76
77/* 72/*
78 * dbxface - external debugger interfaces 73 * dbxface - external debugger interfaces
79 */ 74 */
80
81acpi_status 75acpi_status
82acpi_db_initialize ( 76acpi_db_initialize (
83 void); 77 void);
@@ -92,20 +86,10 @@ acpi_db_single_step (
92 union acpi_parse_object *op, 86 union acpi_parse_object *op,
93 u32 op_type); 87 u32 op_type);
94 88
95acpi_status
96acpi_db_start_command (
97 struct acpi_walk_state *walk_state,
98 union acpi_parse_object *op);
99
100void
101acpi_db_method_end (
102 struct acpi_walk_state *walk_state);
103
104 89
105/* 90/*
106 * dbcmds - debug commands and output routines 91 * dbcmds - debug commands and output routines
107 */ 92 */
108
109acpi_status 93acpi_status
110acpi_db_disassemble_method ( 94acpi_db_disassemble_method (
111 char *name); 95 char *name);
@@ -177,57 +161,30 @@ acpi_db_find_references (
177 char *object_arg); 161 char *object_arg);
178 162
179void 163void
180acpi_db_display_locks (void); 164acpi_db_display_locks (
181 165 void);
182 166
183void 167void
184acpi_db_display_resources ( 168acpi_db_display_resources (
185 char *object_arg); 169 char *object_arg);
186 170
187void 171void
188acpi_db_display_gpes (void); 172acpi_db_display_gpes (
173 void);
189 174
190void 175void
191acpi_db_check_integrity ( 176acpi_db_check_integrity (
192 void); 177 void);
193 178
194acpi_status
195acpi_db_integrity_walk (
196 acpi_handle obj_handle,
197 u32 nesting_level,
198 void *context,
199 void **return_value);
200
201acpi_status
202acpi_db_walk_and_match_name (
203 acpi_handle obj_handle,
204 u32 nesting_level,
205 void *context,
206 void **return_value);
207
208acpi_status
209acpi_db_walk_for_references (
210 acpi_handle obj_handle,
211 u32 nesting_level,
212 void *context,
213 void **return_value);
214
215acpi_status
216acpi_db_walk_for_specific_objects (
217 acpi_handle obj_handle,
218 u32 nesting_level,
219 void *context,
220 void **return_value);
221
222void 179void
223acpi_db_generate_gpe ( 180acpi_db_generate_gpe (
224 char *gpe_arg, 181 char *gpe_arg,
225 char *block_arg); 182 char *block_arg);
226 183
184
227/* 185/*
228 * dbdisply - debug display commands 186 * dbdisply - debug display commands
229 */ 187 */
230
231void 188void
232acpi_db_display_method_info ( 189acpi_db_display_method_info (
233 union acpi_parse_object *op); 190 union acpi_parse_object *op);
@@ -271,19 +228,10 @@ acpi_db_display_argument_object (
271 union acpi_operand_object *obj_desc, 228 union acpi_operand_object *obj_desc,
272 struct acpi_walk_state *walk_state); 229 struct acpi_walk_state *walk_state);
273 230
274void
275acpi_db_dump_parser_descriptor (
276 union acpi_parse_object *op);
277
278void *
279acpi_db_get_pointer (
280 void *target);
281
282 231
283/* 232/*
284 * dbexec - debugger control method execution 233 * dbexec - debugger control method execution
285 */ 234 */
286
287void 235void
288acpi_db_execute ( 236acpi_db_execute (
289 char *name, 237 char *name,
@@ -296,44 +244,15 @@ acpi_db_create_execution_threads (
296 char *num_loops_arg, 244 char *num_loops_arg,
297 char *method_name_arg); 245 char *method_name_arg);
298 246
299acpi_status
300acpi_db_execute_method (
301 struct acpi_db_method_info *info,
302 struct acpi_buffer *return_obj);
303
304void
305acpi_db_execute_setup (
306 struct acpi_db_method_info *info);
307
308u32
309acpi_db_get_outstanding_allocations (
310 void);
311
312void ACPI_SYSTEM_XFACE
313acpi_db_method_thread (
314 void *context);
315
316acpi_status
317acpi_db_execution_walk (
318 acpi_handle obj_handle,
319 u32 nesting_level,
320 void *context,
321 void **return_value);
322
323 247
324/* 248/*
325 * dbfileio - Debugger file I/O commands 249 * dbfileio - Debugger file I/O commands
326 */ 250 */
327
328acpi_object_type 251acpi_object_type
329acpi_db_match_argument ( 252acpi_db_match_argument (
330 char *user_argument, 253 char *user_argument,
331 struct argument_info *arguments); 254 struct argument_info *arguments);
332 255
333acpi_status
334ae_local_load_table (
335 struct acpi_table_header *table_ptr);
336
337void 256void
338acpi_db_close_debug_file ( 257acpi_db_close_debug_file (
339 void); 258 void);
@@ -356,16 +275,17 @@ acpi_db_read_table_from_file (
356 char *filename, 275 char *filename,
357 struct acpi_table_header **table); 276 struct acpi_table_header **table);
358 277
278
359/* 279/*
360 * dbhistry - debugger HISTORY command 280 * dbhistry - debugger HISTORY command
361 */ 281 */
362
363void 282void
364acpi_db_add_to_history ( 283acpi_db_add_to_history (
365 char *command_line); 284 char *command_line);
366 285
367void 286void
368acpi_db_display_history (void); 287acpi_db_display_history (
288 void);
369 289
370char * 290char *
371acpi_db_get_from_history ( 291acpi_db_get_from_history (
@@ -375,7 +295,6 @@ acpi_db_get_from_history (
375/* 295/*
376 * dbinput - user front-end to the AML debugger 296 * dbinput - user front-end to the AML debugger
377 */ 297 */
378
379acpi_status 298acpi_status
380acpi_db_command_dispatch ( 299acpi_db_command_dispatch (
381 char *input_buffer, 300 char *input_buffer,
@@ -386,71 +305,28 @@ void ACPI_SYSTEM_XFACE
386acpi_db_execute_thread ( 305acpi_db_execute_thread (
387 void *context); 306 void *context);
388 307
389void
390acpi_db_display_help (
391 char *help_type);
392
393char *
394acpi_db_get_next_token (
395 char *string,
396 char **next);
397
398u32
399acpi_db_get_line (
400 char *input_buffer);
401
402u32
403acpi_db_match_command (
404 char *user_command);
405
406void
407acpi_db_single_thread (
408 void);
409
410 308
411/* 309/*
412 * dbstats - Generation and display of ACPI table statistics 310 * dbstats - Generation and display of ACPI table statistics
413 */ 311 */
414
415void 312void
416acpi_db_generate_statistics ( 313acpi_db_generate_statistics (
417 union acpi_parse_object *root, 314 union acpi_parse_object *root,
418 u8 is_method); 315 u8 is_method);
419 316
420
421acpi_status 317acpi_status
422acpi_db_display_statistics ( 318acpi_db_display_statistics (
423 char *type_arg); 319 char *type_arg);
424 320
425acpi_status
426acpi_db_classify_one_object (
427 acpi_handle obj_handle,
428 u32 nesting_level,
429 void *context,
430 void **return_value);
431
432void
433acpi_db_count_namespace_objects (
434 void);
435
436void
437acpi_db_enumerate_object (
438 union acpi_operand_object *obj_desc);
439
440 321
441/* 322/*
442 * dbutils - AML debugger utilities 323 * dbutils - AML debugger utilities
443 */ 324 */
444
445void 325void
446acpi_db_set_output_destination ( 326acpi_db_set_output_destination (
447 u32 where); 327 u32 where);
448 328
449void 329void
450acpi_db_dump_buffer (
451 u32 address);
452
453void
454acpi_db_dump_object ( 330acpi_db_dump_object (
455 union acpi_object *obj_desc, 331 union acpi_object *obj_desc,
456 u32 level); 332 u32 level);
@@ -459,14 +335,8 @@ void
459acpi_db_prep_namestring ( 335acpi_db_prep_namestring (
460 char *name); 336 char *name);
461 337
462
463acpi_status
464acpi_db_second_pass_parse (
465 union acpi_parse_object *root);
466
467struct acpi_namespace_node * 338struct acpi_namespace_node *
468acpi_db_local_ns_lookup ( 339acpi_db_local_ns_lookup (
469 char *name); 340 char *name);
470 341
471
472#endif /* __ACDEBUG_H__ */ 342#endif /* __ACDEBUG_H__ */
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 26d907eae6fe..dbfa877121ba 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -102,58 +102,16 @@ acpi_status (*asl_walk_callback) (
102/* 102/*
103 * dmwalk 103 * dmwalk
104 */ 104 */
105
106void
107acpi_dm_walk_parse_tree (
108 union acpi_parse_object *op,
109 asl_walk_callback descending_callback,
110 asl_walk_callback ascending_callback,
111 void *context);
112
113acpi_status
114acpi_dm_descending_op (
115 union acpi_parse_object *op,
116 u32 level,
117 void *context);
118
119acpi_status
120acpi_dm_ascending_op (
121 union acpi_parse_object *op,
122 u32 level,
123 void *context);
124
125
126/*
127 * dmopcode
128 */
129
130void
131acpi_dm_validate_name (
132 char *name,
133 union acpi_parse_object *op);
134
135u32
136acpi_dm_dump_name (
137 char *name);
138
139void
140acpi_dm_unicode (
141 union acpi_parse_object *op);
142
143void 105void
144acpi_dm_disassemble ( 106acpi_dm_disassemble (
145 struct acpi_walk_state *walk_state, 107 struct acpi_walk_state *walk_state,
146 union acpi_parse_object *origin, 108 union acpi_parse_object *origin,
147 u32 num_opcodes); 109 u32 num_opcodes);
148 110
149void
150acpi_dm_namestring (
151 char *name);
152
153void
154acpi_dm_display_path (
155 union acpi_parse_object *op);
156 111
112/*
113 * dmopcode
114 */
157void 115void
158acpi_dm_disassemble_one_op ( 116acpi_dm_disassemble_one_op (
159 struct acpi_walk_state *walk_state, 117 struct acpi_walk_state *walk_state,
@@ -165,18 +123,9 @@ acpi_dm_decode_internal_object (
165 union acpi_operand_object *obj_desc); 123 union acpi_operand_object *obj_desc);
166 124
167u32 125u32
168acpi_dm_block_type (
169 union acpi_parse_object *op);
170
171u32
172acpi_dm_list_type ( 126acpi_dm_list_type (
173 union acpi_parse_object *op); 127 union acpi_parse_object *op);
174 128
175acpi_status
176acpi_ps_display_object_pathname (
177 struct acpi_walk_state *walk_state,
178 union acpi_parse_object *op);
179
180void 129void
181acpi_dm_method_flags ( 130acpi_dm_method_flags (
182 union acpi_parse_object *op); 131 union acpi_parse_object *op);
@@ -197,10 +146,6 @@ void
197acpi_dm_match_op ( 146acpi_dm_match_op (
198 union acpi_parse_object *op); 147 union acpi_parse_object *op);
199 148
200void
201acpi_dm_match_keyword (
202 union acpi_parse_object *op);
203
204u8 149u8
205acpi_dm_comma_if_list_member ( 150acpi_dm_comma_if_list_member (
206 union acpi_parse_object *op); 151 union acpi_parse_object *op);
@@ -211,13 +156,25 @@ acpi_dm_comma_if_field_member (
211 156
212 157
213/* 158/*
214 * dmobject 159 * dmnames
215 */ 160 */
161u32
162acpi_dm_dump_name (
163 char *name);
164
165acpi_status
166acpi_ps_display_object_pathname (
167 struct acpi_walk_state *walk_state,
168 union acpi_parse_object *op);
216 169
217void 170void
218acpi_dm_decode_node ( 171acpi_dm_namestring (
219 struct acpi_namespace_node *node); 172 char *name);
173
220 174
175/*
176 * dmobject
177 */
221void 178void
222acpi_dm_display_internal_object ( 179acpi_dm_display_internal_object (
223 union acpi_operand_object *obj_desc, 180 union acpi_operand_object *obj_desc,
@@ -241,6 +198,16 @@ acpi_dm_dump_method_info (
241/* 198/*
242 * dmbuffer 199 * dmbuffer
243 */ 200 */
201void
202acpi_dm_disasm_byte_list (
203 u32 level,
204 u8 *byte_data,
205 u32 byte_count);
206
207void
208acpi_dm_byte_list (
209 struct acpi_op_walk_info *info,
210 union acpi_parse_object *op);
244 211
245void 212void
246acpi_is_eisa_id ( 213acpi_is_eisa_id (
@@ -262,18 +229,6 @@ acpi_dm_is_string_buffer (
262/* 229/*
263 * dmresrc 230 * dmresrc
264 */ 231 */
265
266void
267acpi_dm_disasm_byte_list (
268 u32 level,
269 u8 *byte_data,
270 u32 byte_count);
271
272void
273acpi_dm_byte_list (
274 struct acpi_op_walk_info *info,
275 union acpi_parse_object *op);
276
277void 232void
278acpi_dm_resource_descriptor ( 233acpi_dm_resource_descriptor (
279 struct acpi_op_walk_info *info, 234 struct acpi_op_walk_info *info,
@@ -296,19 +251,10 @@ void
296acpi_dm_decode_attribute ( 251acpi_dm_decode_attribute (
297 u8 attribute); 252 u8 attribute);
298 253
254
299/* 255/*
300 * dmresrcl 256 * dmresrcl
301 */ 257 */
302
303void
304acpi_dm_io_flags (
305 u8 flags);
306
307void
308acpi_dm_memory_flags (
309 u8 flags,
310 u8 specific_flags);
311
312void 258void
313acpi_dm_word_descriptor ( 259acpi_dm_word_descriptor (
314 struct asl_word_address_desc *resource, 260 struct asl_word_address_desc *resource,
@@ -373,7 +319,6 @@ acpi_dm_vendor_large_descriptor (
373/* 319/*
374 * dmresrcs 320 * dmresrcs
375 */ 321 */
376
377void 322void
378acpi_dm_irq_descriptor ( 323acpi_dm_irq_descriptor (
379 struct asl_irq_format_desc *resource, 324 struct asl_irq_format_desc *resource,
@@ -420,7 +365,6 @@ acpi_dm_vendor_small_descriptor (
420/* 365/*
421 * dmutils 366 * dmutils
422 */ 367 */
423
424void 368void
425acpi_dm_add_to_external_list ( 369acpi_dm_add_to_external_list (
426 char *path); 370 char *path);
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 237d63433581..8f5f2f71b1de 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -50,40 +50,9 @@
50#define NAMEOF_ARG_NTE "__A0" 50#define NAMEOF_ARG_NTE "__A0"
51 51
52 52
53/* Common interfaces */ 53/*
54 54 * dsopcode - support for late evaluation
55acpi_status 55 */
56acpi_ds_obj_stack_push (
57 void *object,
58 struct acpi_walk_state *walk_state);
59
60acpi_status
61acpi_ds_obj_stack_pop (
62 u32 pop_count,
63 struct acpi_walk_state *walk_state);
64
65#ifdef ACPI_FUTURE_USAGE
66void *
67acpi_ds_obj_stack_get_value (
68 u32 index,
69 struct acpi_walk_state *walk_state);
70#endif
71
72acpi_status
73acpi_ds_obj_stack_pop_object (
74 union acpi_operand_object **object,
75 struct acpi_walk_state *walk_state);
76
77
78/* dsopcode - support for late evaluation */
79
80acpi_status
81acpi_ds_execute_arguments (
82 struct acpi_namespace_node *node,
83 struct acpi_namespace_node *scope_node,
84 u32 aml_length,
85 u8 *aml_start);
86
87acpi_status 56acpi_status
88acpi_ds_get_buffer_field_arguments ( 57acpi_ds_get_buffer_field_arguments (
89 union acpi_operand_object *obj_desc); 58 union acpi_operand_object *obj_desc);
@@ -101,15 +70,6 @@ acpi_ds_get_package_arguments (
101 union acpi_operand_object *obj_desc); 70 union acpi_operand_object *obj_desc);
102 71
103acpi_status 72acpi_status
104acpi_ds_init_buffer_field (
105 u16 aml_opcode,
106 union acpi_operand_object *obj_desc,
107 union acpi_operand_object *buffer_desc,
108 union acpi_operand_object *offset_desc,
109 union acpi_operand_object *length_desc,
110 union acpi_operand_object *result_desc);
111
112acpi_status
113acpi_ds_eval_buffer_field_operands ( 73acpi_ds_eval_buffer_field_operands (
114 struct acpi_walk_state *walk_state, 74 struct acpi_walk_state *walk_state,
115 union acpi_parse_object *op); 75 union acpi_parse_object *op);
@@ -130,9 +90,9 @@ acpi_ds_initialize_region (
130 acpi_handle obj_handle); 90 acpi_handle obj_handle);
131 91
132 92
133/* dsctrl - Parser/Interpreter interface, control stack routines */ 93/*
134 94 * dsctrl - Parser/Interpreter interface, control stack routines
135 95 */
136acpi_status 96acpi_status
137acpi_ds_exec_begin_control_op ( 97acpi_ds_exec_begin_control_op (
138 struct acpi_walk_state *walk_state, 98 struct acpi_walk_state *walk_state,
@@ -144,9 +104,9 @@ acpi_ds_exec_end_control_op (
144 union acpi_parse_object *op); 104 union acpi_parse_object *op);
145 105
146 106
147/* dsexec - Parser/Interpreter interface, method execution callbacks */ 107/*
148 108 * dsexec - Parser/Interpreter interface, method execution callbacks
149 109 */
150acpi_status 110acpi_status
151acpi_ds_get_predicate_value ( 111acpi_ds_get_predicate_value (
152 struct acpi_walk_state *walk_state, 112 struct acpi_walk_state *walk_state,
@@ -162,14 +122,9 @@ acpi_ds_exec_end_op (
162 struct acpi_walk_state *state); 122 struct acpi_walk_state *state);
163 123
164 124
165/* dsfield - Parser/Interpreter interface for AML fields */ 125/*
166 126 * dsfield - Parser/Interpreter interface for AML fields
167acpi_status 127 */
168acpi_ds_get_field_names (
169 struct acpi_create_field_info *info,
170 struct acpi_walk_state *walk_state,
171 union acpi_parse_object *arg);
172
173acpi_status 128acpi_status
174acpi_ds_create_field ( 129acpi_ds_create_field (
175 union acpi_parse_object *op, 130 union acpi_parse_object *op,
@@ -199,8 +154,9 @@ acpi_ds_init_field_objects (
199 struct acpi_walk_state *walk_state); 154 struct acpi_walk_state *walk_state);
200 155
201 156
202/* dsload - Parser/Interpreter interface, namespace load callbacks */ 157/*
203 158 * dsload - Parser/Interpreter interface, namespace load callbacks
159 */
204acpi_status 160acpi_status
205acpi_ds_load1_begin_op ( 161acpi_ds_load1_begin_op (
206 struct acpi_walk_state *walk_state, 162 struct acpi_walk_state *walk_state,
@@ -225,9 +181,9 @@ acpi_ds_init_callbacks (
225 u32 pass_number); 181 u32 pass_number);
226 182
227 183
228/* dsmthdat - method data (locals/args) */ 184/*
229 185 * dsmthdat - method data (locals/args)
230 186 */
231acpi_status 187acpi_status
232acpi_ds_store_object_to_local ( 188acpi_ds_store_object_to_local (
233 u16 opcode, 189 u16 opcode,
@@ -250,14 +206,6 @@ u8
250acpi_ds_is_method_value ( 206acpi_ds_is_method_value (
251 union acpi_operand_object *obj_desc); 207 union acpi_operand_object *obj_desc);
252 208
253#ifdef ACPI_FUTURE_USAGE
254acpi_object_type
255acpi_ds_method_data_get_type (
256 u16 opcode,
257 u32 index,
258 struct acpi_walk_state *walk_state);
259#endif
260
261acpi_status 209acpi_status
262acpi_ds_method_data_get_value ( 210acpi_ds_method_data_get_value (
263 u16 opcode, 211 u16 opcode,
@@ -265,12 +213,6 @@ acpi_ds_method_data_get_value (
265 struct acpi_walk_state *walk_state, 213 struct acpi_walk_state *walk_state,
266 union acpi_operand_object **dest_desc); 214 union acpi_operand_object **dest_desc);
267 215
268void
269acpi_ds_method_data_delete_value (
270 u16 opcode,
271 u32 index,
272 struct acpi_walk_state *walk_state);
273
274acpi_status 216acpi_status
275acpi_ds_method_data_init_args ( 217acpi_ds_method_data_init_args (
276 union acpi_operand_object **params, 218 union acpi_operand_object **params,
@@ -288,16 +230,10 @@ void
288acpi_ds_method_data_init ( 230acpi_ds_method_data_init (
289 struct acpi_walk_state *walk_state); 231 struct acpi_walk_state *walk_state);
290 232
291acpi_status
292acpi_ds_method_data_set_value (
293 u16 opcode,
294 u32 index,
295 union acpi_operand_object *object,
296 struct acpi_walk_state *walk_state);
297
298
299/* dsmethod - Parser/Interpreter interface - control method parsing */
300 233
234/*
235 * dsmethod - Parser/Interpreter interface - control method parsing
236 */
301acpi_status 237acpi_status
302acpi_ds_parse_method ( 238acpi_ds_parse_method (
303 acpi_handle obj_handle); 239 acpi_handle obj_handle);
@@ -324,20 +260,18 @@ acpi_ds_begin_method_execution (
324 struct acpi_namespace_node *calling_method_node); 260 struct acpi_namespace_node *calling_method_node);
325 261
326 262
327/* dsobj - Parser/Interpreter interface - object initialization and conversion */ 263/*
328 264 * dsinit
329acpi_status 265 */
330acpi_ds_init_one_object (
331 acpi_handle obj_handle,
332 u32 level,
333 void *context,
334 void **return_value);
335
336acpi_status 266acpi_status
337acpi_ds_initialize_objects ( 267acpi_ds_initialize_objects (
338 struct acpi_table_desc *table_desc, 268 struct acpi_table_desc *table_desc,
339 struct acpi_namespace_node *start_node); 269 struct acpi_namespace_node *start_node);
340 270
271
272/*
273 * dsobject - Parser/Interpreter interface - object initialization and conversion
274 */
341acpi_status 275acpi_status
342acpi_ds_build_internal_buffer_obj ( 276acpi_ds_build_internal_buffer_obj (
343 struct acpi_walk_state *walk_state, 277 struct acpi_walk_state *walk_state,
@@ -353,12 +287,6 @@ acpi_ds_build_internal_package_obj (
353 union acpi_operand_object **obj_desc); 287 union acpi_operand_object **obj_desc);
354 288
355acpi_status 289acpi_status
356acpi_ds_build_internal_object (
357 struct acpi_walk_state *walk_state,
358 union acpi_parse_object *op,
359 union acpi_operand_object **obj_desc_ptr);
360
361acpi_status
362acpi_ds_init_object_from_op ( 290acpi_ds_init_object_from_op (
363 struct acpi_walk_state *walk_state, 291 struct acpi_walk_state *walk_state,
364 union acpi_parse_object *op, 292 union acpi_parse_object *op,
@@ -372,8 +300,9 @@ acpi_ds_create_node (
372 union acpi_parse_object *op); 300 union acpi_parse_object *op);
373 301
374 302
375/* dsutils - Parser/Interpreter interface utility routines */ 303/*
376 304 * dsutils - Parser/Interpreter interface utility routines
305 */
377void 306void
378acpi_ds_clear_implicit_return ( 307acpi_ds_clear_implicit_return (
379 struct acpi_walk_state *walk_state); 308 struct acpi_walk_state *walk_state);
@@ -418,7 +347,6 @@ acpi_ds_clear_operands (
418/* 347/*
419 * dswscope - Scope Stack manipulation 348 * dswscope - Scope Stack manipulation
420 */ 349 */
421
422acpi_status 350acpi_status
423acpi_ds_scope_stack_push ( 351acpi_ds_scope_stack_push (
424 struct acpi_namespace_node *node, 352 struct acpi_namespace_node *node,
@@ -435,7 +363,18 @@ acpi_ds_scope_stack_clear (
435 struct acpi_walk_state *walk_state); 363 struct acpi_walk_state *walk_state);
436 364
437 365
438/* dswstate - parser WALK_STATE management routines */ 366/*
367 * dswstate - parser WALK_STATE management routines
368 */
369acpi_status
370acpi_ds_obj_stack_push (
371 void *object,
372 struct acpi_walk_state *walk_state);
373
374acpi_status
375acpi_ds_obj_stack_pop (
376 u32 pop_count,
377 struct acpi_walk_state *walk_state);
439 378
440struct acpi_walk_state * 379struct acpi_walk_state *
441acpi_ds_create_walk_state ( 380acpi_ds_create_walk_state (
@@ -454,12 +393,6 @@ acpi_ds_init_aml_walk (
454 struct acpi_parameter_info *info, 393 struct acpi_parameter_info *info,
455 u32 pass_number); 394 u32 pass_number);
456 395
457#ifdef ACPI_FUTURE_USAGE
458acpi_status
459acpi_ds_obj_stack_delete_all (
460 struct acpi_walk_state *walk_state);
461#endif
462
463acpi_status 396acpi_status
464acpi_ds_obj_stack_pop_and_delete ( 397acpi_ds_obj_stack_pop_and_delete (
465 u32 pop_count, 398 u32 pop_count,
@@ -494,20 +427,8 @@ struct acpi_walk_state *
494acpi_ds_get_current_walk_state ( 427acpi_ds_get_current_walk_state (
495 struct acpi_thread_state *thread); 428 struct acpi_thread_state *thread);
496 429
497#ifdef ACPI_ENABLE_OBJECT_CACHE
498void
499acpi_ds_delete_walk_state_cache (
500 void);
501#endif
502
503#ifdef ACPI_FUTURE_USAGE 430#ifdef ACPI_FUTURE_USAGE
504acpi_status 431acpi_status
505acpi_ds_result_insert (
506 void *object,
507 u32 index,
508 struct acpi_walk_state *walk_state);
509
510acpi_status
511acpi_ds_result_remove ( 432acpi_ds_result_remove (
512 union acpi_operand_object **object, 433 union acpi_operand_object **object,
513 u32 index, 434 u32 index,
@@ -529,4 +450,10 @@ acpi_ds_result_pop_from_bottom (
529 union acpi_operand_object **object, 450 union acpi_operand_object **object,
530 struct acpi_walk_state *walk_state); 451 struct acpi_walk_state *walk_state);
531 452
453#ifdef ACPI_ENABLE_OBJECT_CACHE
454void
455acpi_ds_delete_walk_state_cache (
456 void);
457#endif
458
532#endif /* _ACDISPAT_H_ */ 459#endif /* _ACDISPAT_H_ */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 2dec083ba1cd..61a27c8c5079 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -45,6 +45,9 @@
45#define __ACEVENTS_H__ 45#define __ACEVENTS_H__
46 46
47 47
48/*
49 * evevent
50 */
48acpi_status 51acpi_status
49acpi_ev_initialize_events ( 52acpi_ev_initialize_events (
50 void); 53 void);
@@ -53,28 +56,14 @@ acpi_status
53acpi_ev_install_xrupt_handlers ( 56acpi_ev_install_xrupt_handlers (
54 void); 57 void);
55 58
56
57/*
58 * Evfixed - Fixed event handling
59 */
60
61acpi_status
62acpi_ev_fixed_event_initialize (
63 void);
64
65u32 59u32
66acpi_ev_fixed_event_detect ( 60acpi_ev_fixed_event_detect (
67 void); 61 void);
68 62
69u32
70acpi_ev_fixed_event_dispatch (
71 u32 event);
72
73 63
74/* 64/*
75 * Evmisc 65 * evmisc
76 */ 66 */
77
78u8 67u8
79acpi_ev_is_notify_object ( 68acpi_ev_is_notify_object (
80 struct acpi_namespace_node *node); 69 struct acpi_namespace_node *node);
@@ -100,24 +89,10 @@ acpi_ev_queue_notify_request (
100 struct acpi_namespace_node *node, 89 struct acpi_namespace_node *node,
101 u32 notify_value); 90 u32 notify_value);
102 91
103void ACPI_SYSTEM_XFACE
104acpi_ev_notify_dispatch (
105 void *context);
106
107 92
108/* 93/*
109 * Evgpe - GPE handling and dispatch 94 * evgpe - GPE handling and dispatch
110 */ 95 */
111
112acpi_status
113acpi_ev_walk_gpe_list (
114 ACPI_GPE_CALLBACK gpe_walk_callback,
115 u32 flags);
116
117u8
118acpi_ev_valid_gpe_event (
119 struct acpi_gpe_event_info *gpe_event_info);
120
121acpi_status 96acpi_status
122acpi_ev_update_gpe_enable_masks ( 97acpi_ev_update_gpe_enable_masks (
123 struct acpi_gpe_event_info *gpe_event_info, 98 struct acpi_gpe_event_info *gpe_event_info,
@@ -137,9 +112,23 @@ acpi_ev_get_gpe_event_info (
137 acpi_handle gpe_device, 112 acpi_handle gpe_device,
138 u32 gpe_number); 113 u32 gpe_number);
139 114
115
116/*
117 * evgpeblk
118 */
119u8
120acpi_ev_valid_gpe_event (
121 struct acpi_gpe_event_info *gpe_event_info);
122
140acpi_status 123acpi_status
141acpi_ev_gpe_initialize ( 124acpi_ev_walk_gpe_list (
142 void); 125 ACPI_GPE_CALLBACK gpe_walk_callback,
126 u32 flags);
127
128acpi_status
129acpi_ev_delete_gpe_handlers (
130 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
131 struct acpi_gpe_block_info *gpe_block);
143 132
144acpi_status 133acpi_status
145acpi_ev_create_gpe_block ( 134acpi_ev_create_gpe_block (
@@ -154,11 +143,6 @@ acpi_status
154acpi_ev_delete_gpe_block ( 143acpi_ev_delete_gpe_block (
155 struct acpi_gpe_block_info *gpe_block); 144 struct acpi_gpe_block_info *gpe_block);
156 145
157acpi_status
158acpi_ev_delete_gpe_handlers (
159 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
160 struct acpi_gpe_block_info *gpe_block);
161
162u32 146u32
163acpi_ev_gpe_dispatch ( 147acpi_ev_gpe_dispatch (
164 struct acpi_gpe_event_info *gpe_event_info, 148 struct acpi_gpe_event_info *gpe_event_info,
@@ -177,10 +161,14 @@ acpi_status
177acpi_ev_check_for_wake_only_gpe ( 161acpi_ev_check_for_wake_only_gpe (
178 struct acpi_gpe_event_info *gpe_event_info); 162 struct acpi_gpe_event_info *gpe_event_info);
179 163
164acpi_status
165acpi_ev_gpe_initialize (
166 void);
167
168
180/* 169/*
181 * Evregion - Address Space handling 170 * evregion - Address Space handling
182 */ 171 */
183
184acpi_status 172acpi_status
185acpi_ev_install_region_handlers ( 173acpi_ev_install_region_handlers (
186 void); 174 void);
@@ -198,13 +186,6 @@ acpi_ev_address_space_dispatch (
198 void *value); 186 void *value);
199 187
200acpi_status 188acpi_status
201acpi_ev_install_handler (
202 acpi_handle obj_handle,
203 u32 level,
204 void *context,
205 void **return_value);
206
207acpi_status
208acpi_ev_attach_region ( 189acpi_ev_attach_region (
209 union acpi_operand_object *handler_obj, 190 union acpi_operand_object *handler_obj,
210 union acpi_operand_object *region_obj, 191 union acpi_operand_object *region_obj,
@@ -233,17 +214,10 @@ acpi_ev_execute_reg_method (
233 union acpi_operand_object *region_obj, 214 union acpi_operand_object *region_obj,
234 u32 function); 215 u32 function);
235 216
236acpi_status
237acpi_ev_reg_run (
238 acpi_handle obj_handle,
239 u32 level,
240 void *context,
241 void **return_value);
242 217
243/* 218/*
244 * Evregini - Region initialization and setup 219 * evregini - Region initialization and setup
245 */ 220 */
246
247acpi_status 221acpi_status
248acpi_ev_system_memory_region_setup ( 222acpi_ev_system_memory_region_setup (
249 acpi_handle handle, 223 acpi_handle handle,
@@ -293,9 +267,8 @@ acpi_ev_initialize_region (
293 267
294 268
295/* 269/*
296 * Evsci - SCI (System Control Interrupt) handling/dispatch 270 * evsci - SCI (System Control Interrupt) handling/dispatch
297 */ 271 */
298
299u32 ACPI_SYSTEM_XFACE 272u32 ACPI_SYSTEM_XFACE
300acpi_ev_gpe_xrupt_handler ( 273acpi_ev_gpe_xrupt_handler (
301 void *context); 274 void *context);
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 53f8b50fac1a..60d737b2d70f 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -48,7 +48,6 @@
48/* 48/*
49 * Exceptions returned by external ACPI interfaces 49 * Exceptions returned by external ACPI interfaces
50 */ 50 */
51
52#define AE_CODE_ENVIRONMENTAL 0x0000 51#define AE_CODE_ENVIRONMENTAL 0x0000
53#define AE_CODE_PROGRAMMER 0x1000 52#define AE_CODE_PROGRAMMER 0x1000
54#define AE_CODE_ACPI_TABLES 0x2000 53#define AE_CODE_ACPI_TABLES 0x2000
@@ -99,6 +98,7 @@
99 98
100#define AE_CODE_ENV_MAX 0x001E 99#define AE_CODE_ENV_MAX 0x001E
101 100
101
102/* 102/*
103 * Programmer exceptions 103 * Programmer exceptions
104 */ 104 */
@@ -168,6 +168,7 @@
168 168
169#define AE_CODE_AML_MAX 0x0021 169#define AE_CODE_AML_MAX 0x0021
170 170
171
171/* 172/*
172 * Internal exceptions used for control 173 * Internal exceptions used for control
173 */ 174 */
@@ -188,6 +189,7 @@
188 189
189#ifdef DEFINE_ACPI_GLOBALS 190#ifdef DEFINE_ACPI_GLOBALS
190 191
192
191/* 193/*
192 * String versions of the exception codes above 194 * String versions of the exception codes above
193 * These strings must match the corresponding defines exactly 195 * These strings must match the corresponding defines exactly
@@ -304,5 +306,4 @@ char const *acpi_gbl_exception_names_ctrl[] =
304 306
305#endif /* ACPI GLOBALS */ 307#endif /* ACPI GLOBALS */
306 308
307
308#endif /* __ACEXCEP_H__ */ 309#endif /* __ACEXCEP_H__ */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index c7f387a972cb..4946696088c3 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -146,15 +146,15 @@ ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
146ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; 146ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS;
147ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; 147ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
148/* 148/*
149 * Since there may be multiple SSDTs and PSDTS, a single pointer is not 149 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
150 * sufficient; Therefore, there isn't one! 150 * sufficient; Therefore, there isn't one!
151 */ 151 */
152 152
153 153
154/* 154/*
155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths 155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths:
156 * If we are running a method that exists in a 32-bit ACPI table. 156 * If we are executing a method that exists in a 32-bit ACPI table,
157 * Use only 32 bits of the Integer for conversion. 157 * use only the lower 32 bits of the (internal) 64-bit Integer.
158 */ 158 */
159ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 159ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
160ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 160ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
@@ -246,6 +246,7 @@ ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer;
246ACPI_EXTERN u32 acpi_gbl_deepest_nesting; 246ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
247#endif 247#endif
248 248
249
249/***************************************************************************** 250/*****************************************************************************
250 * 251 *
251 * Interpreter globals 252 * Interpreter globals
@@ -268,6 +269,7 @@ ACPI_EXTERN u8 acpi_gbl_cm_single_step;
268 269
269ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root; 270ACPI_EXTERN union acpi_parse_object *acpi_gbl_parsed_namespace_root;
270 271
272
271/***************************************************************************** 273/*****************************************************************************
272 * 274 *
273 * Hardware globals 275 * Hardware globals
@@ -298,7 +300,6 @@ ACPI_EXTERN acpi_handle acpi_gbl_gpe_lock;
298 * 300 *
299 ****************************************************************************/ 301 ****************************************************************************/
300 302
301
302ACPI_EXTERN u8 acpi_gbl_db_output_flags; 303ACPI_EXTERN u8 acpi_gbl_db_output_flags;
303 304
304#ifdef ACPI_DISASSEMBLER 305#ifdef ACPI_DISASSEMBLER
@@ -353,5 +354,4 @@ ACPI_EXTERN u32 acpi_gbl_size_of_acpi_objects;
353 354
354#endif /* ACPI_DEBUGGER */ 355#endif /* ACPI_DEBUGGER */
355 356
356
357#endif /* __ACGLOBAL_H__ */ 357#endif /* __ACGLOBAL_H__ */
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 28ad1398c159..9d63641b8e7d 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -46,22 +46,26 @@
46 46
47 47
48/* PM Timer ticks per second (HZ) */ 48/* PM Timer ticks per second (HZ) */
49
49#define PM_TIMER_FREQUENCY 3579545 50#define PM_TIMER_FREQUENCY 3579545
50 51
52/* Values for the _SST reserved method */
51 53
52/* Prototypes */ 54#define ACPI_SST_INDICATOR_OFF 0
55#define ACPI_SST_WORKING 1
56#define ACPI_SST_WAKING 2
57#define ACPI_SST_SLEEPING 3
58#define ACPI_SST_SLEEP_CONTEXT 4
53 59
54 60
55acpi_status 61/* Prototypes */
56acpi_hw_initialize (
57 void);
58 62
59acpi_status
60acpi_hw_shutdown (
61 void);
62 63
64/*
65 * hwacpi - high level functions
66 */
63acpi_status 67acpi_status
64acpi_hw_initialize_system_info ( 68acpi_hw_initialize (
65 void); 69 void);
66 70
67acpi_status 71acpi_status
@@ -72,12 +76,10 @@ u32
72acpi_hw_get_mode ( 76acpi_hw_get_mode (
73 void); 77 void);
74 78
75u32
76acpi_hw_get_mode_capabilities (
77 void);
78
79/* Register I/O Prototypes */
80 79
80/*
81 * hwregs - ACPI Register I/O
82 */
81struct acpi_bit_register_info * 83struct acpi_bit_register_info *
82acpi_hw_get_bit_register_info ( 84acpi_hw_get_bit_register_info (
83 u32 register_id); 85 u32 register_id);
@@ -111,8 +113,9 @@ acpi_hw_clear_acpi_status (
111 u32 flags); 113 u32 flags);
112 114
113 115
114/* GPE support */ 116/*
115 117 * hwgpe - GPE support
118 */
116acpi_status 119acpi_status
117acpi_hw_write_gpe_enable_reg ( 120acpi_hw_write_gpe_enable_reg (
118 struct acpi_gpe_event_info *gpe_event_info); 121 struct acpi_gpe_event_info *gpe_event_info);
@@ -131,12 +134,12 @@ acpi_hw_clear_gpe_block (
131 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 134 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
132 struct acpi_gpe_block_info *gpe_block); 135 struct acpi_gpe_block_info *gpe_block);
133 136
134#ifdef ACPI_FUTURE_USAGE 137#ifdef ACPI_FUTURE_USAGE
135acpi_status 138acpi_status
136acpi_hw_get_gpe_status ( 139acpi_hw_get_gpe_status (
137 struct acpi_gpe_event_info *gpe_event_info, 140 struct acpi_gpe_event_info *gpe_event_info,
138 acpi_event_status *event_status); 141 acpi_event_status *event_status);
139#endif 142#endif /* ACPI_FUTURE_USAGE */
140 143
141acpi_status 144acpi_status
142acpi_hw_disable_all_gpes ( 145acpi_hw_disable_all_gpes (
@@ -155,15 +158,11 @@ acpi_hw_enable_runtime_gpe_block (
155 struct acpi_gpe_xrupt_info *gpe_xrupt_info, 158 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
156 struct acpi_gpe_block_info *gpe_block); 159 struct acpi_gpe_block_info *gpe_block);
157 160
158acpi_status
159acpi_hw_enable_wakeup_gpe_block (
160 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
161 struct acpi_gpe_block_info *gpe_block);
162
163
164/* ACPI Timer prototypes */
165 161
166#ifdef ACPI_FUTURE_USAGE 162#ifdef ACPI_FUTURE_USAGE
163/*
164 * hwtimer - ACPI Timer prototypes
165 */
167acpi_status 166acpi_status
168acpi_get_timer_resolution ( 167acpi_get_timer_resolution (
169 u32 *resolution); 168 u32 *resolution);
@@ -177,6 +176,7 @@ acpi_get_timer_duration (
177 u32 start_ticks, 176 u32 start_ticks,
178 u32 end_ticks, 177 u32 end_ticks,
179 u32 *time_elapsed); 178 u32 *time_elapsed);
180#endif /* ACPI_FUTURE_USAGE */ 179#endif /* ACPI_FUTURE_USAGE */
180
181 181
182#endif /* __ACHWARE_H__ */ 182#endif /* __ACHWARE_H__ */
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index c5301f5ffaf4..5c7172477a0f 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -48,37 +48,9 @@
48#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1])) 48#define ACPI_WALK_OPERANDS (&(walk_state->operands [walk_state->num_operands -1]))
49 49
50 50
51acpi_status
52acpi_ex_resolve_operands (
53 u16 opcode,
54 union acpi_operand_object **stack_ptr,
55 struct acpi_walk_state *walk_state);
56
57acpi_status
58acpi_ex_check_object_type (
59 acpi_object_type type_needed,
60 acpi_object_type this_type,
61 void *object);
62
63/*
64 * exxface - External interpreter interfaces
65 */
66
67acpi_status
68acpi_ex_load_table (
69 acpi_table_type table_id);
70
71acpi_status
72acpi_ex_execute_method (
73 struct acpi_namespace_node *method_node,
74 union acpi_operand_object **params,
75 union acpi_operand_object **return_obj_desc);
76
77
78/* 51/*
79 * exconvrt - object conversion 52 * exconvrt - object conversion
80 */ 53 */
81
82acpi_status 54acpi_status
83acpi_ex_convert_to_integer ( 55acpi_ex_convert_to_integer (
84 union acpi_operand_object *obj_desc, 56 union acpi_operand_object *obj_desc,
@@ -110,17 +82,10 @@ acpi_ex_convert_to_target_type (
110 union acpi_operand_object **result_desc, 82 union acpi_operand_object **result_desc,
111 struct acpi_walk_state *walk_state); 83 struct acpi_walk_state *walk_state);
112 84
113u32
114acpi_ex_convert_to_ascii (
115 acpi_integer integer,
116 u16 base,
117 u8 *string,
118 u8 max_length);
119 85
120/* 86/*
121 * exfield - ACPI AML (p-code) execution - field manipulation 87 * exfield - ACPI AML (p-code) execution - field manipulation
122 */ 88 */
123
124acpi_status 89acpi_status
125acpi_ex_common_buffer_setup ( 90acpi_ex_common_buffer_setup (
126 union acpi_operand_object *obj_desc, 91 union acpi_operand_object *obj_desc,
@@ -128,42 +93,6 @@ acpi_ex_common_buffer_setup (
128 u32 *datum_count); 93 u32 *datum_count);
129 94
130acpi_status 95acpi_status
131acpi_ex_extract_from_field (
132 union acpi_operand_object *obj_desc,
133 void *buffer,
134 u32 buffer_length);
135
136acpi_status
137acpi_ex_insert_into_field (
138 union acpi_operand_object *obj_desc,
139 void *buffer,
140 u32 buffer_length);
141
142acpi_status
143acpi_ex_setup_region (
144 union acpi_operand_object *obj_desc,
145 u32 field_datum_byte_offset);
146
147acpi_status
148acpi_ex_access_region (
149 union acpi_operand_object *obj_desc,
150 u32 field_datum_byte_offset,
151 acpi_integer *value,
152 u32 read_write);
153
154u8
155acpi_ex_register_overflow (
156 union acpi_operand_object *obj_desc,
157 acpi_integer value);
158
159acpi_status
160acpi_ex_field_datum_io (
161 union acpi_operand_object *obj_desc,
162 u32 field_datum_byte_offset,
163 acpi_integer *value,
164 u32 read_write);
165
166acpi_status
167acpi_ex_write_with_update_rule ( 96acpi_ex_write_with_update_rule (
168 union acpi_operand_object *obj_desc, 97 union acpi_operand_object *obj_desc,
169 acpi_integer mask, 98 acpi_integer mask,
@@ -198,28 +127,33 @@ acpi_ex_write_data_to_field (
198 union acpi_operand_object *obj_desc, 127 union acpi_operand_object *obj_desc,
199 union acpi_operand_object **result_desc); 128 union acpi_operand_object **result_desc);
200 129
130
201/* 131/*
202 * exmisc - ACPI AML (p-code) execution - specific opcodes 132 * exfldio - low level field I/O
203 */ 133 */
204
205acpi_status 134acpi_status
206acpi_ex_opcode_3A_0T_0R ( 135acpi_ex_extract_from_field (
207 struct acpi_walk_state *walk_state); 136 union acpi_operand_object *obj_desc,
137 void *buffer,
138 u32 buffer_length);
208 139
209acpi_status 140acpi_status
210acpi_ex_opcode_3A_1T_1R ( 141acpi_ex_insert_into_field (
211 struct acpi_walk_state *walk_state); 142 union acpi_operand_object *obj_desc,
143 void *buffer,
144 u32 buffer_length);
212 145
213acpi_status 146acpi_status
214acpi_ex_opcode_6A_0T_1R ( 147acpi_ex_access_region (
215 struct acpi_walk_state *walk_state); 148 union acpi_operand_object *obj_desc,
149 u32 field_datum_byte_offset,
150 acpi_integer *value,
151 u32 read_write);
216 152
217u8
218acpi_ex_do_match (
219 u32 match_op,
220 union acpi_operand_object *package_obj,
221 union acpi_operand_object *match_obj);
222 153
154/*
155 * exmisc - misc support routines
156 */
223acpi_status 157acpi_status
224acpi_ex_get_object_reference ( 158acpi_ex_get_object_reference (
225 union acpi_operand_object *obj_desc, 159 union acpi_operand_object *obj_desc,
@@ -227,13 +161,6 @@ acpi_ex_get_object_reference (
227 struct acpi_walk_state *walk_state); 161 struct acpi_walk_state *walk_state);
228 162
229acpi_status 163acpi_status
230acpi_ex_resolve_multiple (
231 struct acpi_walk_state *walk_state,
232 union acpi_operand_object *operand,
233 acpi_object_type *return_type,
234 union acpi_operand_object **return_desc);
235
236acpi_status
237acpi_ex_concat_template ( 164acpi_ex_concat_template (
238 union acpi_operand_object *obj_desc, 165 union acpi_operand_object *obj_desc,
239 union acpi_operand_object *obj_desc2, 166 union acpi_operand_object *obj_desc2,
@@ -308,13 +235,6 @@ acpi_ex_create_method (
308/* 235/*
309 * exconfig - dynamic table load/unload 236 * exconfig - dynamic table load/unload
310 */ 237 */
311
312acpi_status
313acpi_ex_add_table (
314 struct acpi_table_header *table,
315 struct acpi_namespace_node *parent_node,
316 union acpi_operand_object **ddb_handle);
317
318acpi_status 238acpi_status
319acpi_ex_load_op ( 239acpi_ex_load_op (
320 union acpi_operand_object *obj_desc, 240 union acpi_operand_object *obj_desc,
@@ -334,7 +254,6 @@ acpi_ex_unload_table (
334/* 254/*
335 * exmutex - mutex support 255 * exmutex - mutex support
336 */ 256 */
337
338acpi_status 257acpi_status
339acpi_ex_acquire_mutex ( 258acpi_ex_acquire_mutex (
340 union acpi_operand_object *time_desc, 259 union acpi_operand_object *time_desc,
@@ -354,15 +273,10 @@ void
354acpi_ex_unlink_mutex ( 273acpi_ex_unlink_mutex (
355 union acpi_operand_object *obj_desc); 274 union acpi_operand_object *obj_desc);
356 275
357void
358acpi_ex_link_mutex (
359 union acpi_operand_object *obj_desc,
360 struct acpi_thread_state *thread);
361 276
362/* 277/*
363 * exprep - ACPI AML (p-code) execution - prep utilities 278 * exprep - ACPI AML execution - prep utilities
364 */ 279 */
365
366acpi_status 280acpi_status
367acpi_ex_prep_common_field_object ( 281acpi_ex_prep_common_field_object (
368 union acpi_operand_object *obj_desc, 282 union acpi_operand_object *obj_desc,
@@ -375,10 +289,10 @@ acpi_status
375acpi_ex_prep_field_value ( 289acpi_ex_prep_field_value (
376 struct acpi_create_field_info *info); 290 struct acpi_create_field_info *info);
377 291
292
378/* 293/*
379 * exsystem - Interface to OS services 294 * exsystem - Interface to OS services
380 */ 295 */
381
382acpi_status 296acpi_status
383acpi_ex_system_do_notify_op ( 297acpi_ex_system_do_notify_op (
384 union acpi_operand_object *value, 298 union acpi_operand_object *value,
@@ -421,9 +335,8 @@ acpi_ex_system_wait_semaphore (
421 335
422 336
423/* 337/*
424 * exmonadic - ACPI AML (p-code) execution, monadic operators 338 * exoparg1 - ACPI AML execution, 1 operand
425 */ 339 */
426
427acpi_status 340acpi_status
428acpi_ex_opcode_0A_0T_1R ( 341acpi_ex_opcode_0A_0T_1R (
429 struct acpi_walk_state *walk_state); 342 struct acpi_walk_state *walk_state);
@@ -445,9 +358,8 @@ acpi_ex_opcode_1A_1T_0R (
445 struct acpi_walk_state *walk_state); 358 struct acpi_walk_state *walk_state);
446 359
447/* 360/*
448 * exdyadic - ACPI AML (p-code) execution, dyadic operators 361 * exoparg2 - ACPI AML execution, 2 operands
449 */ 362 */
450
451acpi_status 363acpi_status
452acpi_ex_opcode_2A_0T_0R ( 364acpi_ex_opcode_2A_0T_0R (
453 struct acpi_walk_state *walk_state); 365 struct acpi_walk_state *walk_state);
@@ -466,21 +378,56 @@ acpi_ex_opcode_2A_2T_1R (
466 378
467 379
468/* 380/*
469 * exresolv - Object resolution and get value functions 381 * exoparg3 - ACPI AML execution, 3 operands
382 */
383acpi_status
384acpi_ex_opcode_3A_0T_0R (
385 struct acpi_walk_state *walk_state);
386
387acpi_status
388acpi_ex_opcode_3A_1T_1R (
389 struct acpi_walk_state *walk_state);
390
391
392/*
393 * exoparg6 - ACPI AML execution, 6 operands
470 */ 394 */
395acpi_status
396acpi_ex_opcode_6A_0T_1R (
397 struct acpi_walk_state *walk_state);
398
471 399
400/*
401 * exresolv - Object resolution and get value functions
402 */
472acpi_status 403acpi_status
473acpi_ex_resolve_to_value ( 404acpi_ex_resolve_to_value (
474 union acpi_operand_object **stack_ptr, 405 union acpi_operand_object **stack_ptr,
475 struct acpi_walk_state *walk_state); 406 struct acpi_walk_state *walk_state);
476 407
477acpi_status 408acpi_status
409acpi_ex_resolve_multiple (
410 struct acpi_walk_state *walk_state,
411 union acpi_operand_object *operand,
412 acpi_object_type *return_type,
413 union acpi_operand_object **return_desc);
414
415
416/*
417 * exresnte - resolve namespace node
418 */
419acpi_status
478acpi_ex_resolve_node_to_value ( 420acpi_ex_resolve_node_to_value (
479 struct acpi_namespace_node **stack_ptr, 421 struct acpi_namespace_node **stack_ptr,
480 struct acpi_walk_state *walk_state); 422 struct acpi_walk_state *walk_state);
481 423
424
425/*
426 * exresop - resolve operand to value
427 */
482acpi_status 428acpi_status
483acpi_ex_resolve_object_to_value ( 429acpi_ex_resolve_operands (
430 u16 opcode,
484 union acpi_operand_object **stack_ptr, 431 union acpi_operand_object **stack_ptr,
485 struct acpi_walk_state *walk_state); 432 struct acpi_walk_state *walk_state);
486 433
@@ -488,7 +435,6 @@ acpi_ex_resolve_object_to_value (
488/* 435/*
489 * exdump - Interpreter debug output routines 436 * exdump - Interpreter debug output routines
490 */ 437 */
491
492void 438void
493acpi_ex_dump_operand ( 439acpi_ex_dump_operand (
494 union acpi_operand_object *obj_desc, 440 union acpi_operand_object *obj_desc,
@@ -504,7 +450,7 @@ acpi_ex_dump_operands (
504 char *module_name, 450 char *module_name,
505 u32 line_number); 451 u32 line_number);
506 452
507#ifdef ACPI_FUTURE_USAGE 453#ifdef ACPI_FUTURE_USAGE
508void 454void
509acpi_ex_dump_object_descriptor ( 455acpi_ex_dump_object_descriptor (
510 union acpi_operand_object *object, 456 union acpi_operand_object *object,
@@ -514,46 +460,12 @@ void
514acpi_ex_dump_node ( 460acpi_ex_dump_node (
515 struct acpi_namespace_node *node, 461 struct acpi_namespace_node *node,
516 u32 flags); 462 u32 flags);
463#endif /* ACPI_FUTURE_USAGE */
517 464
518void
519acpi_ex_out_string (
520 char *title,
521 char *value);
522
523void
524acpi_ex_out_pointer (
525 char *title,
526 void *value);
527
528void
529acpi_ex_out_integer (
530 char *title,
531 u32 value);
532
533void
534acpi_ex_out_address (
535 char *title,
536 acpi_physical_address value);
537#endif /* ACPI_FUTURE_USAGE */
538 465
539/* 466/*
540 * exnames - interpreter/scanner name load/execute 467 * exnames - AML namestring support
541 */ 468 */
542
543char *
544acpi_ex_allocate_name_string (
545 u32 prefix_count,
546 u32 num_name_segs);
547
548u32
549acpi_ex_good_char (
550 u32 character);
551
552acpi_status
553acpi_ex_name_segment (
554 u8 **in_aml_address,
555 char *name_string);
556
557acpi_status 469acpi_status
558acpi_ex_get_name_string ( 470acpi_ex_get_name_string (
559 acpi_object_type data_type, 471 acpi_object_type data_type,
@@ -561,16 +473,10 @@ acpi_ex_get_name_string (
561 char **out_name_string, 473 char **out_name_string,
562 u32 *out_name_length); 474 u32 *out_name_length);
563 475
564acpi_status
565acpi_ex_do_name (
566 acpi_object_type data_type,
567 acpi_interpreter_mode load_exec_mode);
568
569 476
570/* 477/*
571 * exstore - Object store support 478 * exstore - Object store support
572 */ 479 */
573
574acpi_status 480acpi_status
575acpi_ex_store ( 481acpi_ex_store (
576 union acpi_operand_object *val_desc, 482 union acpi_operand_object *val_desc,
@@ -578,12 +484,6 @@ acpi_ex_store (
578 struct acpi_walk_state *walk_state); 484 struct acpi_walk_state *walk_state);
579 485
580acpi_status 486acpi_status
581acpi_ex_store_object_to_index (
582 union acpi_operand_object *val_desc,
583 union acpi_operand_object *dest_desc,
584 struct acpi_walk_state *walk_state);
585
586acpi_status
587acpi_ex_store_object_to_node ( 487acpi_ex_store_object_to_node (
588 union acpi_operand_object *source_desc, 488 union acpi_operand_object *source_desc,
589 struct acpi_namespace_node *node, 489 struct acpi_namespace_node *node,
@@ -593,10 +493,10 @@ acpi_ex_store_object_to_node (
593#define ACPI_IMPLICIT_CONVERSION TRUE 493#define ACPI_IMPLICIT_CONVERSION TRUE
594#define ACPI_NO_IMPLICIT_CONVERSION FALSE 494#define ACPI_NO_IMPLICIT_CONVERSION FALSE
595 495
496
596/* 497/*
597 * exstoren 498 * exstoren - resolve/store object
598 */ 499 */
599
600acpi_status 500acpi_status
601acpi_ex_resolve_object ( 501acpi_ex_resolve_object (
602 union acpi_operand_object **source_desc_ptr, 502 union acpi_operand_object **source_desc_ptr,
@@ -612,9 +512,8 @@ acpi_ex_store_object_to_object (
612 512
613 513
614/* 514/*
615 * excopy - object copy 515 * exstorob - store object - buffer/string
616 */ 516 */
617
618acpi_status 517acpi_status
619acpi_ex_store_buffer_to_buffer ( 518acpi_ex_store_buffer_to_buffer (
620 union acpi_operand_object *source_desc, 519 union acpi_operand_object *source_desc,
@@ -625,6 +524,10 @@ acpi_ex_store_string_to_string (
625 union acpi_operand_object *source_desc, 524 union acpi_operand_object *source_desc,
626 union acpi_operand_object *target_desc); 525 union acpi_operand_object *target_desc);
627 526
527
528/*
529 * excopy - object copy
530 */
628acpi_status 531acpi_status
629acpi_ex_copy_integer_to_index_field ( 532acpi_ex_copy_integer_to_index_field (
630 union acpi_operand_object *source_desc, 533 union acpi_operand_object *source_desc,
@@ -645,10 +548,10 @@ acpi_ex_copy_integer_to_buffer_field (
645 union acpi_operand_object *source_desc, 548 union acpi_operand_object *source_desc,
646 union acpi_operand_object *target_desc); 549 union acpi_operand_object *target_desc);
647 550
551
648/* 552/*
649 * exutils - interpreter/scanner utilities 553 * exutils - interpreter/scanner utilities
650 */ 554 */
651
652acpi_status 555acpi_status
653acpi_ex_enter_interpreter ( 556acpi_ex_enter_interpreter (
654 void); 557 void);
@@ -669,11 +572,6 @@ void
669acpi_ex_release_global_lock ( 572acpi_ex_release_global_lock (
670 u8 locked); 573 u8 locked);
671 574
672u32
673acpi_ex_digits_needed (
674 acpi_integer value,
675 u32 base);
676
677void 575void
678acpi_ex_eisa_id_to_string ( 576acpi_ex_eisa_id_to_string (
679 u32 numeric_id, 577 u32 numeric_id,
@@ -688,7 +586,6 @@ acpi_ex_unsigned_integer_to_string (
688/* 586/*
689 * exregion - default op_region handlers 587 * exregion - default op_region handlers
690 */ 588 */
691
692acpi_status 589acpi_status
693acpi_ex_system_memory_space_handler ( 590acpi_ex_system_memory_space_handler (
694 u32 function, 591 u32 function,
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 01d3b4bc0c85..030e641115cb 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -72,7 +72,6 @@ typedef u32 acpi_mutex_handle;
72 * 72 *
73 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also! 73 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also!
74 */ 74 */
75
76#define ACPI_MTX_EXECUTE 0 75#define ACPI_MTX_EXECUTE 0
77#define ACPI_MTX_INTERPRETER 1 76#define ACPI_MTX_INTERPRETER 1
78#define ACPI_MTX_PARSER 2 77#define ACPI_MTX_PARSER 2
@@ -151,13 +150,13 @@ typedef u16 acpi_owner_id;
151#define ACPI_FIELD_DWORD_GRANULARITY 4 150#define ACPI_FIELD_DWORD_GRANULARITY 4
152#define ACPI_FIELD_QWORD_GRANULARITY 8 151#define ACPI_FIELD_QWORD_GRANULARITY 8
153 152
153
154/***************************************************************************** 154/*****************************************************************************
155 * 155 *
156 * Namespace typedefs and structs 156 * Namespace typedefs and structs
157 * 157 *
158 ****************************************************************************/ 158 ****************************************************************************/
159 159
160
161/* Operational modes of the AML interpreter/scanner */ 160/* Operational modes of the AML interpreter/scanner */
162 161
163typedef enum 162typedef enum
@@ -176,7 +175,6 @@ typedef enum
176 * data_type is used to differentiate between internal descriptors, and MUST 175 * data_type is used to differentiate between internal descriptors, and MUST
177 * be the first byte in this structure. 176 * be the first byte in this structure.
178 */ 177 */
179
180union acpi_name_union 178union acpi_name_union
181{ 179{
182 u32 integer; 180 u32 integer;
@@ -415,7 +413,6 @@ struct acpi_field_info
415 * 413 *
416 ****************************************************************************/ 414 ****************************************************************************/
417 415
418
419#define ACPI_CONTROL_NORMAL 0xC0 416#define ACPI_CONTROL_NORMAL 0xC0
420#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 417#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
421#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 418#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
@@ -424,6 +421,7 @@ struct acpi_field_info
424 421
425 422
426/* Forward declarations */ 423/* Forward declarations */
424
427struct acpi_walk_state ; 425struct acpi_walk_state ;
428struct acpi_obj_mutex; 426struct acpi_obj_mutex;
429union acpi_parse_object ; 427union acpi_parse_object ;
@@ -601,7 +599,6 @@ struct acpi_opcode_info
601 u8 type; /* Opcode type */ 599 u8 type; /* Opcode type */
602}; 600};
603 601
604
605union acpi_parse_value 602union acpi_parse_value
606{ 603{
607 acpi_integer integer; /* Integer constant (Up to 64 bits) */ 604 acpi_integer integer; /* Integer constant (Up to 64 bits) */
@@ -613,7 +610,6 @@ union acpi_parse_value
613 union acpi_parse_object *arg; /* arguments and contained ops */ 610 union acpi_parse_object *arg; /* arguments and contained ops */
614}; 611};
615 612
616
617#define ACPI_PARSE_COMMON \ 613#define ACPI_PARSE_COMMON \
618 u8 data_type; /* To differentiate various internal objs */\ 614 u8 data_type; /* To differentiate various internal objs */\
619 u8 flags; /* Type of Op */\ 615 u8 flags; /* Type of Op */\
@@ -691,7 +687,6 @@ struct acpi_parse_obj_asl
691 char parse_op_name[12]; 687 char parse_op_name[12];
692}; 688};
693 689
694
695union acpi_parse_object 690union acpi_parse_object
696{ 691{
697 struct acpi_parse_obj_common common; 692 struct acpi_parse_obj_common common;
@@ -834,7 +829,6 @@ struct acpi_bit_register_info
834 * 829 *
835 ****************************************************************************/ 830 ****************************************************************************/
836 831
837
838/* resource_type values */ 832/* resource_type values */
839 833
840#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0 834#define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index fcaced16b16f..09be937d2c39 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -539,11 +539,6 @@
539 539
540 540
541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b) 541#define ACPI_DUMP_ENTRY(a,b) acpi_ns_dump_entry (a,b)
542
543#ifdef ACPI_FUTURE_USAGE
544#define ACPI_DUMP_TABLES(a,b) acpi_ns_dump_tables(a,b)
545#endif
546
547#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d) 542#define ACPI_DUMP_PATHNAME(a,b,c,d) acpi_ns_dump_pathname(a,b,c,d)
548#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) 543#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
549#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT) 544#define ACPI_DUMP_BUFFER(a,b) acpi_ut_dump_buffer((u8 *)a,b,DB_BYTE_DISPLAY,_COMPONENT)
@@ -596,11 +591,6 @@
596#define ACPI_DUMP_STACK_ENTRY(a) 591#define ACPI_DUMP_STACK_ENTRY(a)
597#define ACPI_DUMP_OPERANDS(a,b,c,d,e) 592#define ACPI_DUMP_OPERANDS(a,b,c,d,e)
598#define ACPI_DUMP_ENTRY(a,b) 593#define ACPI_DUMP_ENTRY(a,b)
599
600#ifdef ACPI_FUTURE_USAGE
601#define ACPI_DUMP_TABLES(a,b)
602#endif
603
604#define ACPI_DUMP_PATHNAME(a,b,c,d) 594#define ACPI_DUMP_PATHNAME(a,b,c,d)
605#define ACPI_DUMP_RESOURCE_LIST(a) 595#define ACPI_DUMP_RESOURCE_LIST(a)
606#define ACPI_DUMP_BUFFER(a,b) 596#define ACPI_DUMP_BUFFER(a,b)
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
new file mode 100644
index 000000000000..deb7cb06f5f0
--- /dev/null
+++ b/include/acpi/acnames.h
@@ -0,0 +1,84 @@
1/******************************************************************************
2 *
3 * Name: acnames.h - Global names and strings
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACNAMES_H__
45#define __ACNAMES_H__
46
47/* Method names - these methods can appear anywhere in the namespace */
48
49#define METHOD_NAME__HID "_HID"
50#define METHOD_NAME__CID "_CID"
51#define METHOD_NAME__UID "_UID"
52#define METHOD_NAME__ADR "_ADR"
53#define METHOD_NAME__INI "_INI"
54#define METHOD_NAME__STA "_STA"
55#define METHOD_NAME__REG "_REG"
56#define METHOD_NAME__SEG "_SEG"
57#define METHOD_NAME__BBN "_BBN"
58#define METHOD_NAME__PRT "_PRT"
59#define METHOD_NAME__CRS "_CRS"
60#define METHOD_NAME__PRS "_PRS"
61#define METHOD_NAME__PRW "_PRW"
62#define METHOD_NAME__SRS "_SRS"
63
64/* Method names - these methods must appear at the namespace root */
65
66#define METHOD_NAME__BFS "\\_BFS"
67#define METHOD_NAME__GTS "\\_GTS"
68#define METHOD_NAME__PTS "\\_PTS"
69#define METHOD_NAME__SST "\\_SI._SST"
70#define METHOD_NAME__WAK "\\_WAK"
71
72/* Definitions of the predefined namespace names */
73
74#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
75#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
76#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
77
78#define ACPI_NS_ROOT_PATH "\\"
79#define ACPI_NS_SYSTEM_BUS "_SB_"
80
81
82#endif /* __ACNAMES_H__ */
83
84
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 8b3cdc3566b1..d1b3ce80056f 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -57,17 +57,6 @@
57#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */ 57#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
58#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */ 58#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
59 59
60
61/* Definitions of the predefined namespace names */
62
63#define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
64#define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
65#define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
66
67#define ACPI_NS_ROOT_PATH "\\"
68#define ACPI_NS_SYSTEM_BUS "_SB_"
69
70
71/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ 60/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
72 61
73#define ACPI_NS_NO_UPSEARCH 0 62#define ACPI_NS_NO_UPSEARCH 0
@@ -80,10 +69,9 @@
80#define ACPI_NS_WALK_NO_UNLOCK FALSE 69#define ACPI_NS_WALK_NO_UNLOCK FALSE
81 70
82 71
83acpi_status 72/*
84acpi_ns_load_namespace ( 73 * nsinit - Namespace initialization
85 void); 74 */
86
87acpi_status 75acpi_status
88acpi_ns_initialize_objects ( 76acpi_ns_initialize_objects (
89 void); 77 void);
@@ -93,23 +81,22 @@ acpi_ns_initialize_devices (
93 void); 81 void);
94 82
95 83
96/* Namespace init - nsxfinit */ 84/*
97 85 * nsload - Namespace loading
86 */
98acpi_status 87acpi_status
99acpi_ns_init_one_device ( 88acpi_ns_load_namespace (
100 acpi_handle obj_handle, 89 void);
101 u32 nesting_level,
102 void *context,
103 void **return_value);
104 90
105acpi_status 91acpi_status
106acpi_ns_init_one_object ( 92acpi_ns_load_table (
107 acpi_handle obj_handle, 93 struct acpi_table_desc *table_desc,
108 u32 level, 94 struct acpi_namespace_node *node);
109 void *context,
110 void **return_value);
111 95
112 96
97/*
98 * nswalk - walk the namespace
99 */
113acpi_status 100acpi_status
114acpi_ns_walk_namespace ( 101acpi_ns_walk_namespace (
115 acpi_object_type type, 102 acpi_object_type type,
@@ -126,37 +113,24 @@ acpi_ns_get_next_node (
126 struct acpi_namespace_node *parent, 113 struct acpi_namespace_node *parent,
127 struct acpi_namespace_node *child); 114 struct acpi_namespace_node *child);
128 115
129void
130acpi_ns_delete_namespace_by_owner (
131 u16 table_id);
132
133
134/* Namespace loading - nsload */
135
136acpi_status
137acpi_ns_one_complete_parse (
138 u32 pass_number,
139 struct acpi_table_desc *table_desc);
140 116
117/*
118 * nsparse - table parsing
119 */
141acpi_status 120acpi_status
142acpi_ns_parse_table ( 121acpi_ns_parse_table (
143 struct acpi_table_desc *table_desc, 122 struct acpi_table_desc *table_desc,
144 struct acpi_namespace_node *scope); 123 struct acpi_namespace_node *scope);
145 124
146acpi_status 125acpi_status
147acpi_ns_load_table ( 126acpi_ns_one_complete_parse (
148 struct acpi_table_desc *table_desc, 127 u32 pass_number,
149 struct acpi_namespace_node *node); 128 struct acpi_table_desc *table_desc);
150
151acpi_status
152acpi_ns_load_table_by_type (
153 acpi_table_type table_type);
154 129
155 130
156/* 131/*
157 * Top-level namespace access - nsaccess 132 * nsaccess - Top-level namespace access
158 */ 133 */
159
160acpi_status 134acpi_status
161acpi_ns_root_initialize ( 135acpi_ns_root_initialize (
162 void); 136 void);
@@ -173,9 +147,8 @@ acpi_ns_lookup (
173 147
174 148
175/* 149/*
176 * Named object allocation/deallocation - nsalloc 150 * nsalloc - Named object allocation/deallocation
177 */ 151 */
178
179struct acpi_namespace_node * 152struct acpi_namespace_node *
180acpi_ns_create_node ( 153acpi_ns_create_node (
181 u32 name); 154 u32 name);
@@ -189,6 +162,10 @@ acpi_ns_delete_namespace_subtree (
189 struct acpi_namespace_node *parent_handle); 162 struct acpi_namespace_node *parent_handle);
190 163
191void 164void
165acpi_ns_delete_namespace_by_owner (
166 u16 table_id);
167
168void
192acpi_ns_detach_object ( 169acpi_ns_detach_object (
193 struct acpi_namespace_node *node); 170 struct acpi_namespace_node *node);
194 171
@@ -201,36 +178,16 @@ acpi_ns_compare_names (
201 char *name1, 178 char *name1,
202 char *name2); 179 char *name2);
203 180
204void
205acpi_ns_remove_reference (
206 struct acpi_namespace_node *node);
207
208 181
209/* 182/*
210 * Namespace modification - nsmodify 183 * nsdump - Namespace dump/print utilities
211 */ 184 */
212 185#ifdef ACPI_FUTURE_USAGE
213#ifdef ACPI_FUTURE_USAGE
214acpi_status
215acpi_ns_unload_namespace (
216 acpi_handle handle);
217
218acpi_status
219acpi_ns_delete_subtree (
220 acpi_handle start_handle);
221#endif
222
223
224/*
225 * Namespace dump/print utilities - nsdump
226 */
227
228#ifdef ACPI_FUTURE_USAGE
229void 186void
230acpi_ns_dump_tables ( 187acpi_ns_dump_tables (
231 acpi_handle search_base, 188 acpi_handle search_base,
232 u32 max_depth); 189 u32 max_depth);
233#endif 190#endif /* ACPI_FUTURE_USAGE */
234 191
235void 192void
236acpi_ns_dump_entry ( 193acpi_ns_dump_entry (
@@ -249,19 +206,6 @@ acpi_ns_print_pathname (
249 u32 num_segments, 206 u32 num_segments,
250 char *pathname); 207 char *pathname);
251 208
252#ifdef ACPI_FUTURE_USAGE
253acpi_status
254acpi_ns_dump_one_device (
255 acpi_handle obj_handle,
256 u32 level,
257 void *context,
258 void **return_value);
259
260void
261acpi_ns_dump_root_devices (
262 void);
263#endif /* ACPI_FUTURE_USAGE */
264
265acpi_status 209acpi_status
266acpi_ns_dump_one_object ( 210acpi_ns_dump_one_object (
267 acpi_handle obj_handle, 211 acpi_handle obj_handle,
@@ -269,7 +213,7 @@ acpi_ns_dump_one_object (
269 void *context, 213 void *context,
270 void **return_value); 214 void **return_value);
271 215
272#ifdef ACPI_FUTURE_USAGE 216#ifdef ACPI_FUTURE_USAGE
273void 217void
274acpi_ns_dump_objects ( 218acpi_ns_dump_objects (
275 acpi_object_type type, 219 acpi_object_type type,
@@ -277,13 +221,12 @@ acpi_ns_dump_objects (
277 u32 max_depth, 221 u32 max_depth,
278 u32 ownder_id, 222 u32 ownder_id,
279 acpi_handle start_handle); 223 acpi_handle start_handle);
280#endif 224#endif /* ACPI_FUTURE_USAGE */
281 225
282 226
283/* 227/*
284 * Namespace evaluation functions - nseval 228 * nseval - Namespace evaluation functions
285 */ 229 */
286
287acpi_status 230acpi_status
288acpi_ns_evaluate_by_handle ( 231acpi_ns_evaluate_by_handle (
289 struct acpi_parameter_info *info); 232 struct acpi_parameter_info *info);
@@ -298,40 +241,14 @@ acpi_ns_evaluate_relative (
298 char *pathname, 241 char *pathname,
299 struct acpi_parameter_info *info); 242 struct acpi_parameter_info *info);
300 243
301acpi_status
302acpi_ns_execute_control_method (
303 struct acpi_parameter_info *info);
304
305acpi_status
306acpi_ns_get_object_value (
307 struct acpi_parameter_info *info);
308
309
310/*
311 * Parent/Child/Peer utility functions
312 */
313
314#ifdef ACPI_FUTURE_USAGE
315acpi_name
316acpi_ns_find_parent_name (
317 struct acpi_namespace_node *node_to_search);
318#endif
319
320 244
321/* 245/*
322 * Name and Scope manipulation - nsnames 246 * nsnames - Name and Scope manipulation
323 */ 247 */
324
325u32 248u32
326acpi_ns_opens_scope ( 249acpi_ns_opens_scope (
327 acpi_object_type type); 250 acpi_object_type type);
328 251
329void
330acpi_ns_build_external_path (
331 struct acpi_namespace_node *node,
332 acpi_size size,
333 char *name_buffer);
334
335char * 252char *
336acpi_ns_get_external_pathname ( 253acpi_ns_get_external_pathname (
337 struct acpi_namespace_node *node); 254 struct acpi_namespace_node *node);
@@ -363,9 +280,8 @@ acpi_ns_get_pathname_length (
363 280
364 281
365/* 282/*
366 * Object management for namespace nodes - nsobject 283 * nsobject - Object management for namespace nodes
367 */ 284 */
368
369acpi_status 285acpi_status
370acpi_ns_attach_object ( 286acpi_ns_attach_object (
371 struct acpi_namespace_node *node, 287 struct acpi_namespace_node *node,
@@ -399,9 +315,8 @@ acpi_ns_get_attached_data (
399 315
400 316
401/* 317/*
402 * Namespace searching and entry - nssearch 318 * nssearch - Namespace searching and entry
403 */ 319 */
404
405acpi_status 320acpi_status
406acpi_ns_search_and_enter ( 321acpi_ns_search_and_enter (
407 u32 entry_name, 322 u32 entry_name,
@@ -428,17 +343,12 @@ acpi_ns_install_node (
428 343
429 344
430/* 345/*
431 * Utility functions - nsutils 346 * nsutils - Utility functions
432 */ 347 */
433
434u8 348u8
435acpi_ns_valid_root_prefix ( 349acpi_ns_valid_root_prefix (
436 char prefix); 350 char prefix);
437 351
438u8
439acpi_ns_valid_path_separator (
440 char sep);
441
442acpi_object_type 352acpi_object_type
443acpi_ns_get_type ( 353acpi_ns_get_type (
444 struct acpi_namespace_node *node); 354 struct acpi_namespace_node *node);
@@ -511,5 +421,4 @@ struct acpi_namespace_node *
511acpi_ns_get_next_valid_node ( 421acpi_ns_get_next_valid_node (
512 struct acpi_namespace_node *node); 422 struct acpi_namespace_node *node);
513 423
514
515#endif /* __ACNAMESP_H__ */ 424#endif /* __ACNAMESP_H__ */
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 036023a940b2..e079b94e4fce 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -133,6 +133,7 @@ struct acpi_object_integer
133 acpi_integer value; 133 acpi_integer value;
134}; 134};
135 135
136
136/* 137/*
137 * Note: The String and Buffer object must be identical through the Pointer 138 * Note: The String and Buffer object must be identical through the Pointer
138 * element. There is code that depends on this. 139 * element. There is code that depends on this.
@@ -468,7 +469,6 @@ union acpi_operand_object
468 * 469 *
469 *****************************************************************************/ 470 *****************************************************************************/
470 471
471
472/* Object descriptor types */ 472/* Object descriptor types */
473 473
474#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 474#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
new file mode 100644
index 000000000000..118ecba4cf05
--- /dev/null
+++ b/include/acpi/acopcode.h
@@ -0,0 +1,325 @@
1/******************************************************************************
2 *
3 * Name: acopcode.h - AML opcode information for the AML parser and interpreter
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACOPCODE_H__
45#define __ACOPCODE_H__
46
47#define MAX_EXTENDED_OPCODE 0x88
48#define NUM_EXTENDED_OPCODE (MAX_EXTENDED_OPCODE + 1)
49#define MAX_INTERNAL_OPCODE
50#define NUM_INTERNAL_OPCODE (MAX_INTERNAL_OPCODE + 1)
51
52/* Used for non-assigned opcodes */
53
54#define _UNK 0x6B
55
56/*
57 * Reserved ASCII characters. Do not use any of these for
58 * internal opcodes, since they are used to differentiate
59 * name strings from AML opcodes
60 */
61#define _ASC 0x6C
62#define _NAM 0x6C
63#define _PFX 0x6D
64
65
66/*
67 * All AML opcodes and the parse-time arguments for each. Used by the AML
68 * parser Each list is compressed into a 32-bit number and stored in the
69 * master opcode table (in psopcode.c).
70 */
71#define ARGP_ACCESSFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
72#define ARGP_ACQUIRE_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_WORDDATA)
73#define ARGP_ADD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
74#define ARGP_ALIAS_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_NAME)
75#define ARGP_ARG0 ARG_NONE
76#define ARGP_ARG1 ARG_NONE
77#define ARGP_ARG2 ARG_NONE
78#define ARGP_ARG3 ARG_NONE
79#define ARGP_ARG4 ARG_NONE
80#define ARGP_ARG5 ARG_NONE
81#define ARGP_ARG6 ARG_NONE
82#define ARGP_BANK_FIELD_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_TERMARG, ARGP_BYTEDATA, ARGP_FIELDLIST)
83#define ARGP_BIT_AND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
84#define ARGP_BIT_NAND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
85#define ARGP_BIT_NOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
86#define ARGP_BIT_NOT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
87#define ARGP_BIT_OR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
88#define ARGP_BIT_XOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
89#define ARGP_BREAK_OP ARG_NONE
90#define ARGP_BREAK_POINT_OP ARG_NONE
91#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
92#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
93#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
94#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
95#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
96#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
97#define ARGP_CONTINUE_OP ARG_NONE
98#define ARGP_COPY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SIMPLENAME)
99#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
100#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
101#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
102#define ARGP_CREATE_FIELD_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
103#define ARGP_CREATE_QWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
104#define ARGP_CREATE_WORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
105#define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
106#define ARGP_DEBUG_OP ARG_NONE
107#define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
108#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_TERMARG)
109#define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
110#define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET)
111#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
112#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
113#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
114#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
115#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
116#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
117#define ARGP_FIND_SET_RIGHT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
118#define ARGP_FROM_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
119#define ARGP_IF_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
120#define ARGP_INCREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
121#define ARGP_INDEX_FIELD_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_BYTEDATA, ARGP_FIELDLIST)
122#define ARGP_INDEX_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
123#define ARGP_LAND_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
124#define ARGP_LEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
125#define ARGP_LGREATER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
126#define ARGP_LGREATEREQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
127#define ARGP_LLESS_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
128#define ARGP_LLESSEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
129#define ARGP_LNOT_OP ARGP_LIST1 (ARGP_TERMARG)
130#define ARGP_LNOTEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
131#define ARGP_LOAD_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_SUPERNAME)
132#define ARGP_LOAD_TABLE_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
133#define ARGP_LOCAL0 ARG_NONE
134#define ARGP_LOCAL1 ARG_NONE
135#define ARGP_LOCAL2 ARG_NONE
136#define ARGP_LOCAL3 ARG_NONE
137#define ARGP_LOCAL4 ARG_NONE
138#define ARGP_LOCAL5 ARG_NONE
139#define ARGP_LOCAL6 ARG_NONE
140#define ARGP_LOCAL7 ARG_NONE
141#define ARGP_LOR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
142#define ARGP_MATCH_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
143#define ARGP_METHOD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMLIST)
144#define ARGP_METHODCALL_OP ARGP_LIST1 (ARGP_NAMESTRING)
145#define ARGP_MID_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
146#define ARGP_MOD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
147#define ARGP_MULTIPLY_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
148#define ARGP_MUTEX_OP ARGP_LIST2 (ARGP_NAME, ARGP_BYTEDATA)
149#define ARGP_NAME_OP ARGP_LIST2 (ARGP_NAME, ARGP_DATAOBJ)
150#define ARGP_NAMEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
151#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
152#define ARGP_NOOP_OP ARG_NONE
153#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
154#define ARGP_ONE_OP ARG_NONE
155#define ARGP_ONES_OP ARG_NONE
156#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
157#define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST)
158#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
159#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
160#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
161#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
162#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
163#define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
164#define ARGP_RESET_OP ARGP_LIST1 (ARGP_SUPERNAME)
165#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
166#define ARGP_REVISION_OP ARG_NONE
167#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
168#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
169#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
170#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
171#define ARGP_SIZE_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
172#define ARGP_SLEEP_OP ARGP_LIST1 (ARGP_TERMARG)
173#define ARGP_STALL_OP ARGP_LIST1 (ARGP_TERMARG)
174#define ARGP_STATICSTRING_OP ARGP_LIST1 (ARGP_NAMESTRING)
175#define ARGP_STORE_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SUPERNAME)
176#define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST)
177#define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
178#define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
179#define ARGP_TIMER_OP ARG_NONE
180#define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
181#define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
182#define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
183#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
184#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
185#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
186#define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME)
187#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
188#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_DATAOBJLIST)
189#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
190#define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
191#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
192#define ARGP_ZERO_OP ARG_NONE
193
194
195/*
196 * All AML opcodes and the runtime arguments for each. Used by the AML
197 * interpreter Each list is compressed into a 32-bit number and stored
198 * in the master opcode table (in psopcode.c).
199 *
200 * (Used by prep_operands procedure and the ASL Compiler)
201 */
202#define ARGI_ACCESSFIELD_OP ARGI_INVALID_OPCODE
203#define ARGI_ACQUIRE_OP ARGI_LIST2 (ARGI_MUTEX, ARGI_INTEGER)
204#define ARGI_ADD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
205#define ARGI_ALIAS_OP ARGI_INVALID_OPCODE
206#define ARGI_ARG0 ARG_NONE
207#define ARGI_ARG1 ARG_NONE
208#define ARGI_ARG2 ARG_NONE
209#define ARGI_ARG3 ARG_NONE
210#define ARGI_ARG4 ARG_NONE
211#define ARGI_ARG5 ARG_NONE
212#define ARGI_ARG6 ARG_NONE
213#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE
214#define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
215#define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
216#define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
217#define ARGI_BIT_NOT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
218#define ARGI_BIT_OR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
219#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
220#define ARGI_BREAK_OP ARG_NONE
221#define ARGI_BREAK_POINT_OP ARG_NONE
222#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
223#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
224#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
225#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
226#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
227#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
228#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
229#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
230#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
231#define ARGI_CREATE_BYTE_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
232#define ARGI_CREATE_DWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
233#define ARGI_CREATE_FIELD_OP ARGI_LIST4 (ARGI_BUFFER, ARGI_INTEGER, ARGI_INTEGER, ARGI_REFERENCE)
234#define ARGI_CREATE_QWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
235#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
236#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
237#define ARGI_DEBUG_OP ARG_NONE
238#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
239#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING)
240#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
241#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
242#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
243#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
244#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
245#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
246#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
247#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
248#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
249#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
250#define ARGI_IF_OP ARGI_INVALID_OPCODE
251#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF)
252#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
253#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
254#define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
255#define ARGI_LEQUAL_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
256#define ARGI_LGREATER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
257#define ARGI_LGREATEREQUAL_OP ARGI_INVALID_OPCODE
258#define ARGI_LLESS_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
259#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
260#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
261#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
262#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF)
263#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
264#define ARGI_LOCAL0 ARG_NONE
265#define ARGI_LOCAL1 ARG_NONE
266#define ARGI_LOCAL2 ARG_NONE
267#define ARGI_LOCAL3 ARG_NONE
268#define ARGI_LOCAL4 ARG_NONE
269#define ARGI_LOCAL5 ARG_NONE
270#define ARGI_LOCAL6 ARG_NONE
271#define ARGI_LOCAL7 ARG_NONE
272#define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
273#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_COMPUTEDATA, ARGI_INTEGER,ARGI_COMPUTEDATA,ARGI_INTEGER)
274#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
275#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
276#define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFER_OR_STRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
277#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
278#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
279#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
280#define ARGI_NAME_OP ARGI_INVALID_OPCODE
281#define ARGI_NAMEDFIELD_OP ARGI_INVALID_OPCODE
282#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
283#define ARGI_NOOP_OP ARG_NONE
284#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
285#define ARGI_ONE_OP ARG_NONE
286#define ARGI_ONES_OP ARG_NONE
287#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
288#define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE
289#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
290#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
291#define ARGI_REF_OF_OP ARGI_LIST1 (ARGI_OBJECT_REF)
292#define ARGI_REGION_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
293#define ARGI_RELEASE_OP ARGI_LIST1 (ARGI_MUTEX)
294#define ARGI_RESERVEDFIELD_OP ARGI_INVALID_OPCODE
295#define ARGI_RESET_OP ARGI_LIST1 (ARGI_EVENT)
296#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
297#define ARGI_REVISION_OP ARG_NONE
298#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
299#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
300#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
301#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
302#define ARGI_SIZE_OF_OP ARGI_LIST1 (ARGI_DATAOBJECT)
303#define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER)
304#define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER)
305#define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE
306#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF)
307#define ARGI_STRING_OP ARGI_INVALID_OPCODE
308#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
309#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
310#define ARGI_TIMER_OP ARG_NONE
311#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
312#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
313#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
314#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
315#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
316#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
317#define ARGI_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
318#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
319#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
320#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
321#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
322#define ARGI_WORD_OP ARGI_INVALID_OPCODE
323#define ARGI_ZERO_OP ARG_NONE
324
325#endif /* __ACOPCODE_H__ */
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index c0395ef2b0d0..698276571818 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -64,8 +64,17 @@
64 64
65#define ACPI_PARSE_DEFERRED_OP 0x0100 65#define ACPI_PARSE_DEFERRED_OP 0x0100
66 66
67/* Parser external interfaces */
68 67
68/******************************************************************************
69 *
70 * Parser interfaces
71 *
72 *****************************************************************************/
73
74
75/*
76 * psxface - Parser external interfaces
77 */
69acpi_status 78acpi_status
70acpi_psx_load_table ( 79acpi_psx_load_table (
71 u8 *pcode_addr, 80 u8 *pcode_addr,
@@ -76,23 +85,13 @@ acpi_psx_execute (
76 struct acpi_parameter_info *info); 85 struct acpi_parameter_info *info);
77 86
78 87
79/****************************************************************************** 88/*
80 * 89 * psargs - Parse AML opcode arguments
81 * Parser interfaces 90 */
82 *
83 *****************************************************************************/
84
85
86/* psargs - Parse AML opcode arguments */
87
88u8 * 91u8 *
89acpi_ps_get_next_package_end ( 92acpi_ps_get_next_package_end (
90 struct acpi_parse_state *parser_state); 93 struct acpi_parse_state *parser_state);
91 94
92u32
93acpi_ps_get_next_package_length (
94 struct acpi_parse_state *parser_state);
95
96char * 95char *
97acpi_ps_get_next_namestring ( 96acpi_ps_get_next_namestring (
98 struct acpi_parse_state *parser_state); 97 struct acpi_parse_state *parser_state);
@@ -110,10 +109,6 @@ acpi_ps_get_next_namepath (
110 union acpi_parse_object *arg, 109 union acpi_parse_object *arg,
111 u8 method_call); 110 u8 method_call);
112 111
113union acpi_parse_object *
114acpi_ps_get_next_field (
115 struct acpi_parse_state *parser_state);
116
117acpi_status 112acpi_status
118acpi_ps_get_next_arg ( 113acpi_ps_get_next_arg (
119 struct acpi_walk_state *walk_state, 114 struct acpi_walk_state *walk_state,
@@ -122,8 +117,9 @@ acpi_ps_get_next_arg (
122 union acpi_parse_object **return_arg); 117 union acpi_parse_object **return_arg);
123 118
124 119
125/* psfind */ 120/*
126 121 * psfind
122 */
127union acpi_parse_object * 123union acpi_parse_object *
128acpi_ps_find_name ( 124acpi_ps_find_name (
129 union acpi_parse_object *scope, 125 union acpi_parse_object *scope,
@@ -135,8 +131,9 @@ acpi_ps_get_parent (
135 union acpi_parse_object *op); 131 union acpi_parse_object *op);
136 132
137 133
138/* psopcode - AML Opcode information */ 134/*
139 135 * psopcode - AML Opcode information
136 */
140const struct acpi_opcode_info * 137const struct acpi_opcode_info *
141acpi_ps_get_opcode_info ( 138acpi_ps_get_opcode_info (
142 u16 opcode); 139 u16 opcode);
@@ -146,56 +143,25 @@ acpi_ps_get_opcode_name (
146 u16 opcode); 143 u16 opcode);
147 144
148 145
149/* psparse - top level parsing routines */ 146/*
150 147 * psparse - top level parsing routines
151u32 148 */
152acpi_ps_get_opcode_size (
153 u32 opcode);
154
155void
156acpi_ps_complete_this_op (
157 struct acpi_walk_state *walk_state,
158 union acpi_parse_object *op);
159
160acpi_status
161acpi_ps_next_parse_state (
162 struct acpi_walk_state *walk_state,
163 union acpi_parse_object *op,
164 acpi_status callback_status);
165
166acpi_status
167acpi_ps_find_object (
168 struct acpi_walk_state *walk_state,
169 union acpi_parse_object **out_op);
170
171void
172acpi_ps_delete_parse_tree (
173 union acpi_parse_object *root);
174
175acpi_status
176acpi_ps_parse_loop (
177 struct acpi_walk_state *walk_state);
178
179acpi_status 149acpi_status
180acpi_ps_parse_aml ( 150acpi_ps_parse_aml (
181 struct acpi_walk_state *walk_state); 151 struct acpi_walk_state *walk_state);
182 152
183acpi_status 153u32
184acpi_ps_parse_table ( 154acpi_ps_get_opcode_size (
185 u8 *aml, 155 u32 opcode);
186 u32 aml_size,
187 acpi_parse_downwards descending_callback,
188 acpi_parse_upwards ascending_callback,
189 union acpi_parse_object **root_object);
190 156
191u16 157u16
192acpi_ps_peek_opcode ( 158acpi_ps_peek_opcode (
193 struct acpi_parse_state *state); 159 struct acpi_parse_state *state);
194 160
195 161
196/* psscope - Scope stack management routines */ 162/*
197 163 * psscope - Scope stack management routines
198 164 */
199acpi_status 165acpi_status
200acpi_ps_init_scope ( 166acpi_ps_init_scope (
201 struct acpi_parse_state *parser_state, 167 struct acpi_parse_state *parser_state,
@@ -228,8 +194,9 @@ acpi_ps_cleanup_scope (
228 struct acpi_parse_state *state); 194 struct acpi_parse_state *state);
229 195
230 196
231/* pstree - parse tree manipulation routines */ 197/*
232 198 * pstree - parse tree manipulation routines
199 */
233void 200void
234acpi_ps_append_arg( 201acpi_ps_append_arg(
235 union acpi_parse_object *op, 202 union acpi_parse_object *op,
@@ -247,20 +214,17 @@ acpi_ps_get_arg(
247 union acpi_parse_object *op, 214 union acpi_parse_object *op,
248 u32 argn); 215 u32 argn);
249 216
250#ifdef ACPI_FUTURE_USAGE 217#ifdef ACPI_FUTURE_USAGE
251union acpi_parse_object *
252acpi_ps_get_child (
253 union acpi_parse_object *op);
254
255union acpi_parse_object * 218union acpi_parse_object *
256acpi_ps_get_depth_next ( 219acpi_ps_get_depth_next (
257 union acpi_parse_object *origin, 220 union acpi_parse_object *origin,
258 union acpi_parse_object *op); 221 union acpi_parse_object *op);
259#endif /* ACPI_FUTURE_USAGE */ 222#endif /* ACPI_FUTURE_USAGE */
260
261 223
262/* pswalk - parse tree walk routines */
263 224
225/*
226 * pswalk - parse tree walk routines
227 */
264acpi_status 228acpi_status
265acpi_ps_walk_parsed_aml ( 229acpi_ps_walk_parsed_aml (
266 union acpi_parse_object *start_op, 230 union acpi_parse_object *start_op,
@@ -283,9 +247,14 @@ acpi_status
283acpi_ps_delete_completed_op ( 247acpi_ps_delete_completed_op (
284 struct acpi_walk_state *walk_state); 248 struct acpi_walk_state *walk_state);
285 249
250void
251acpi_ps_delete_parse_tree (
252 union acpi_parse_object *root);
286 253
287/* psutils - parser utilities */
288 254
255/*
256 * psutils - parser utilities
257 */
289union acpi_parse_object * 258union acpi_parse_object *
290acpi_ps_create_scope_op ( 259acpi_ps_create_scope_op (
291 void); 260 void);
@@ -303,12 +272,6 @@ void
303acpi_ps_free_op ( 272acpi_ps_free_op (
304 union acpi_parse_object *op); 273 union acpi_parse_object *op);
305 274
306#ifdef ACPI_ENABLE_OBJECT_CACHE
307void
308acpi_ps_delete_parse_cache (
309 void);
310#endif
311
312u8 275u8
313acpi_ps_is_leading_char ( 276acpi_ps_is_leading_char (
314 u32 c); 277 u32 c);
@@ -317,20 +280,27 @@ u8
317acpi_ps_is_prefix_char ( 280acpi_ps_is_prefix_char (
318 u32 c); 281 u32 c);
319 282
320#ifdef ACPI_FUTURE_USAGE 283#ifdef ACPI_FUTURE_USAGE
321u32 284u32
322acpi_ps_get_name( 285acpi_ps_get_name(
323 union acpi_parse_object *op); 286 union acpi_parse_object *op);
324#endif 287#endif /* ACPI_FUTURE_USAGE */
325 288
326void 289void
327acpi_ps_set_name( 290acpi_ps_set_name(
328 union acpi_parse_object *op, 291 union acpi_parse_object *op,
329 u32 name); 292 u32 name);
330 293
294#ifdef ACPI_ENABLE_OBJECT_CACHE
295void
296acpi_ps_delete_parse_cache (
297 void);
298#endif
331 299
332/* psdump - display parser tree */
333 300
301/*
302 * psdump - display parser tree
303 */
334u32 304u32
335acpi_ps_sprint_path ( 305acpi_ps_sprint_path (
336 char *buffer_start, 306 char *buffer_start,
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index ad53252dd42d..a69d78942040 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -49,6 +49,7 @@
49 * We put them here because we don't want to duplicate them 49 * We put them here because we don't want to duplicate them
50 * in the rest of the source code again and again. 50 * in the rest of the source code again and again.
51 */ 51 */
52#include "acnames.h" /* Global ACPI names and strings */
52#include "acconfig.h" /* Configuration constants */ 53#include "acconfig.h" /* Configuration constants */
53#include "platform/acenv.h" /* Target environment specific items */ 54#include "platform/acenv.h" /* Target environment specific items */
54#include "actypes.h" /* Fundamental common data types */ 55#include "actypes.h" /* Fundamental common data types */
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c627bc408a6b..8d0e1290bc76 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -108,6 +108,21 @@ typedef int (*acpi_op_unbind) (struct acpi_device *device);
108typedef int (*acpi_op_match) (struct acpi_device *device, 108typedef int (*acpi_op_match) (struct acpi_device *device,
109 struct acpi_driver *driver); 109 struct acpi_driver *driver);
110 110
111struct acpi_bus_ops {
112 u32 acpi_op_add:1;
113 u32 acpi_op_remove:1;
114 u32 acpi_op_lock:1;
115 u32 acpi_op_start:1;
116 u32 acpi_op_stop:1;
117 u32 acpi_op_suspend:1;
118 u32 acpi_op_resume:1;
119 u32 acpi_op_scan:1;
120 u32 acpi_op_bind:1;
121 u32 acpi_op_unbind:1;
122 u32 acpi_op_match:1;
123 u32 reserved:21;
124};
125
111struct acpi_device_ops { 126struct acpi_device_ops {
112 acpi_op_add add; 127 acpi_op_add add;
113 acpi_op_remove remove; 128 acpi_op_remove remove;
@@ -327,15 +342,36 @@ int acpi_bus_generate_event (struct acpi_device *device, u8 type, int data);
327int acpi_bus_receive_event (struct acpi_bus_event *event); 342int acpi_bus_receive_event (struct acpi_bus_event *event);
328int acpi_bus_register_driver (struct acpi_driver *driver); 343int acpi_bus_register_driver (struct acpi_driver *driver);
329int acpi_bus_unregister_driver (struct acpi_driver *driver); 344int acpi_bus_unregister_driver (struct acpi_driver *driver);
330int acpi_bus_scan (struct acpi_device *start);
331int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent, 345int acpi_bus_add (struct acpi_device **child, struct acpi_device *parent,
332 acpi_handle handle, int type); 346 acpi_handle handle, int type);
347int acpi_bus_start (struct acpi_device *device);
333 348
334 349
335int acpi_match_ids (struct acpi_device *device, char *ids); 350int acpi_match_ids (struct acpi_device *device, char *ids);
336int acpi_create_dir(struct acpi_device *); 351int acpi_create_dir(struct acpi_device *);
337void acpi_remove_dir(struct acpi_device *); 352void acpi_remove_dir(struct acpi_device *);
338 353
354
355/*
356 * Bind physical devices with ACPI devices
357 */
358#include <linux/device.h>
359struct acpi_bus_type {
360 struct list_head list;
361 struct bus_type *bus;
362 /* For general devices under the bus*/
363 int (*find_device)(struct device *, acpi_handle*);
364 /* For bridges, such as PCI root bridge, IDE controller */
365 int (*find_bridge)(struct device *, acpi_handle *);
366};
367int register_acpi_bus_type(struct acpi_bus_type *);
368int unregister_acpi_bus_type(struct acpi_bus_type *);
369struct device *acpi_get_physical_device(acpi_handle);
370/* helper */
371acpi_handle acpi_get_child(acpi_handle, acpi_integer);
372acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
373#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->firmware_data))
374
339#endif /*CONFIG_ACPI_BUS*/ 375#endif /*CONFIG_ACPI_BUS*/
340 376
341#endif /*__ACPI_BUS_H__*/ 377#endif /*__ACPI_BUS_H__*/
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index c62e92ec43b2..579fe191b7e7 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -56,8 +56,9 @@
56/* ACPI PCI Interrupt Link (pci_link.c) */ 56/* ACPI PCI Interrupt Link (pci_link.c) */
57 57
58int acpi_irq_penalty_init (void); 58int acpi_irq_penalty_init (void);
59int acpi_pci_link_get_irq (acpi_handle handle, int index, int *edge_level, 59int acpi_pci_link_allocate_irq (acpi_handle handle, int index, int *edge_level,
60 int *active_high_low, char **name); 60 int *active_high_low, char **name);
61int acpi_pci_link_free_irq(acpi_handle handle);
61 62
62/* ACPI PCI Interrupt Routing (pci_irq.c) */ 63/* ACPI PCI Interrupt Routing (pci_irq.c) */
63 64
@@ -68,6 +69,7 @@ void acpi_pci_irq_del_prt (int segment, int bus);
68 69
69struct pci_bus; 70struct pci_bus;
70 71
72acpi_status acpi_get_pci_id (acpi_handle handle, struct acpi_pci_id *id);
71int acpi_pci_bind (struct acpi_device *device); 73int acpi_pci_bind (struct acpi_device *device);
72int acpi_pci_unbind (struct acpi_device *device); 74int acpi_pci_unbind (struct acpi_device *device);
73int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus); 75int acpi_pci_bind_root (struct acpi_device *device, struct acpi_pci_id *id, struct pci_bus *bus);
@@ -108,5 +110,10 @@ int acpi_ec_ecdt_probe (void);
108 110
109int acpi_processor_set_thermal_limit(acpi_handle handle, int type); 111int acpi_processor_set_thermal_limit(acpi_handle handle, int type);
110 112
113/* --------------------------------------------------------------------------
114 Hot Keys
115 -------------------------------------------------------------------------- */
116
117extern int acpi_specific_hotkey_enabled;
111 118
112#endif /*__ACPI_DRIVERS_H__*/ 119#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 857c8072eb1e..ea489f235216 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -79,7 +79,6 @@ struct acpi_signal_fatal_info
79/* 79/*
80 * OSL Initialization and shutdown primitives 80 * OSL Initialization and shutdown primitives
81 */ 81 */
82
83acpi_status 82acpi_status
84acpi_os_initialize ( 83acpi_os_initialize (
85 void); 84 void);
@@ -92,7 +91,6 @@ acpi_os_terminate (
92/* 91/*
93 * ACPI Table interfaces 92 * ACPI Table interfaces
94 */ 93 */
95
96acpi_status 94acpi_status
97acpi_os_get_root_pointer ( 95acpi_os_get_root_pointer (
98 u32 flags, 96 u32 flags,
@@ -112,7 +110,6 @@ acpi_os_table_override (
112/* 110/*
113 * Synchronization primitives 111 * Synchronization primitives
114 */ 112 */
115
116acpi_status 113acpi_status
117acpi_os_create_semaphore ( 114acpi_os_create_semaphore (
118 u32 max_units, 115 u32 max_units,
@@ -156,7 +153,6 @@ acpi_os_release_lock (
156/* 153/*
157 * Memory allocation and mapping 154 * Memory allocation and mapping
158 */ 155 */
159
160void * 156void *
161acpi_os_allocate ( 157acpi_os_allocate (
162 acpi_size size); 158 acpi_size size);
@@ -187,7 +183,6 @@ acpi_os_get_physical_address (
187/* 183/*
188 * Interrupt handlers 184 * Interrupt handlers
189 */ 185 */
190
191acpi_status 186acpi_status
192acpi_os_install_interrupt_handler ( 187acpi_os_install_interrupt_handler (
193 u32 gsi, 188 u32 gsi,
@@ -203,7 +198,6 @@ acpi_os_remove_interrupt_handler (
203/* 198/*
204 * Threads and Scheduling 199 * Threads and Scheduling
205 */ 200 */
206
207u32 201u32
208acpi_os_get_thread_id ( 202acpi_os_get_thread_id (
209 void); 203 void);
@@ -234,7 +228,6 @@ acpi_os_stall (
234/* 228/*
235 * Platform and hardware-independent I/O interfaces 229 * Platform and hardware-independent I/O interfaces
236 */ 230 */
237
238acpi_status 231acpi_status
239acpi_os_read_port ( 232acpi_os_read_port (
240 acpi_io_address address, 233 acpi_io_address address,
@@ -251,7 +244,6 @@ acpi_os_write_port (
251/* 244/*
252 * Platform and hardware-independent physical memory interfaces 245 * Platform and hardware-independent physical memory interfaces
253 */ 246 */
254
255acpi_status 247acpi_status
256acpi_os_read_memory ( 248acpi_os_read_memory (
257 acpi_physical_address address, 249 acpi_physical_address address,
@@ -270,7 +262,6 @@ acpi_os_write_memory (
270 * Note: Can't use "Register" as a parameter, changed to "Reg" -- 262 * Note: Can't use "Register" as a parameter, changed to "Reg" --
271 * certain compilers complain. 263 * certain compilers complain.
272 */ 264 */
273
274acpi_status 265acpi_status
275acpi_os_read_pci_configuration ( 266acpi_os_read_pci_configuration (
276 struct acpi_pci_id *pci_id, 267 struct acpi_pci_id *pci_id,
@@ -288,7 +279,6 @@ acpi_os_write_pci_configuration (
288/* 279/*
289 * Interim function needed for PCI IRQ routing 280 * Interim function needed for PCI IRQ routing
290 */ 281 */
291
292void 282void
293acpi_os_derive_pci_id( 283acpi_os_derive_pci_id(
294 acpi_handle rhandle, 284 acpi_handle rhandle,
@@ -298,7 +288,6 @@ acpi_os_derive_pci_id(
298/* 288/*
299 * Miscellaneous 289 * Miscellaneous
300 */ 290 */
301
302u8 291u8
303acpi_os_readable ( 292acpi_os_readable (
304 void *pointer, 293 void *pointer,
@@ -323,7 +312,6 @@ acpi_os_signal (
323/* 312/*
324 * Debug print routines 313 * Debug print routines
325 */ 314 */
326
327void ACPI_INTERNAL_VAR_XFACE 315void ACPI_INTERNAL_VAR_XFACE
328acpi_os_printf ( 316acpi_os_printf (
329 const char *format, 317 const char *format,
@@ -339,11 +327,10 @@ acpi_os_redirect_output (
339 void *destination); 327 void *destination);
340 328
341 329
330#ifdef ACPI_FUTURE_USAGE
342/* 331/*
343 * Debug input 332 * Debug input
344 */ 333 */
345
346#ifdef ACPI_FUTURE_USAGE
347u32 334u32
348acpi_os_get_line ( 335acpi_os_get_line (
349 char *buffer); 336 char *buffer);
@@ -353,7 +340,6 @@ acpi_os_get_line (
353/* 340/*
354 * Directory manipulation 341 * Directory manipulation
355 */ 342 */
356
357void * 343void *
358acpi_os_open_directory ( 344acpi_os_open_directory (
359 char *pathname, 345 char *pathname,
@@ -377,7 +363,6 @@ acpi_os_close_directory (
377/* 363/*
378 * Debug 364 * Debug
379 */ 365 */
380
381void 366void
382acpi_os_dbg_assert( 367acpi_os_dbg_assert(
383 void *failed_assertion, 368 void *failed_assertion,
@@ -385,5 +370,4 @@ acpi_os_dbg_assert(
385 u32 line_number, 370 u32 line_number,
386 char *message); 371 char *message);
387 372
388
389#endif /* __ACPIOSXF_H__ */ 373#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 00d78b79652e..f8f619f8e4f8 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -50,10 +50,9 @@
50#include "actbl.h" 50#include "actbl.h"
51 51
52 52
53 /* 53/*
54 * Global interfaces 54 * Global interfaces
55 */ 55 */
56
57acpi_status 56acpi_status
58acpi_initialize_subsystem ( 57acpi_initialize_subsystem (
59 void); 58 void);
@@ -106,9 +105,8 @@ acpi_install_initialization_handler (
106#endif 105#endif
107 106
108/* 107/*
109 * ACPI Memory manager 108 * ACPI Memory managment
110 */ 109 */
111
112void * 110void *
113acpi_allocate ( 111acpi_allocate (
114 u32 size); 112 u32 size);
@@ -125,7 +123,6 @@ acpi_free (
125/* 123/*
126 * ACPI table manipulation interfaces 124 * ACPI table manipulation interfaces
127 */ 125 */
128
129acpi_status 126acpi_status
130acpi_find_root_pointer ( 127acpi_find_root_pointer (
131 u32 flags, 128 u32 flags,
@@ -168,7 +165,6 @@ acpi_get_firmware_table (
168/* 165/*
169 * Namespace and name interfaces 166 * Namespace and name interfaces
170 */ 167 */
171
172acpi_status 168acpi_status
173acpi_walk_namespace ( 169acpi_walk_namespace (
174 acpi_object_type type, 170 acpi_object_type type,
@@ -218,7 +214,6 @@ acpi_get_data (
218/* 214/*
219 * Object manipulation and enumeration 215 * Object manipulation and enumeration
220 */ 216 */
221
222acpi_status 217acpi_status
223acpi_evaluate_object ( 218acpi_evaluate_object (
224 acpi_handle object, 219 acpi_handle object,
@@ -262,7 +257,6 @@ acpi_get_parent (
262/* 257/*
263 * Event handler interfaces 258 * Event handler interfaces
264 */ 259 */
265
266acpi_status 260acpi_status
267acpi_install_fixed_event_handler ( 261acpi_install_fixed_event_handler (
268 u32 acpi_event, 262 u32 acpi_event,
@@ -319,7 +313,6 @@ acpi_install_exception_handler (
319/* 313/*
320 * Event interfaces 314 * Event interfaces
321 */ 315 */
322
323acpi_status 316acpi_status
324acpi_acquire_global_lock ( 317acpi_acquire_global_lock (
325 u16 timeout, 318 u16 timeout,
@@ -404,7 +397,6 @@ acpi_remove_gpe_block (
404/* 397/*
405 * Resource interfaces 398 * Resource interfaces
406 */ 399 */
407
408typedef 400typedef
409acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) ( 401acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
410 struct acpi_resource *resource, 402 struct acpi_resource *resource,
@@ -448,7 +440,6 @@ acpi_resource_to_address64 (
448/* 440/*
449 * Hardware (ACPI device) interfaces 441 * Hardware (ACPI device) interfaces
450 */ 442 */
451
452acpi_status 443acpi_status
453acpi_get_register ( 444acpi_get_register (
454 u32 register_id, 445 u32 register_id,
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 93c55ff5c237..ed679264c12c 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -48,7 +48,6 @@
48/* 48/*
49 * Function prototypes called from Acpi* APIs 49 * Function prototypes called from Acpi* APIs
50 */ 50 */
51
52acpi_status 51acpi_status
53acpi_rs_get_prt_method_data ( 52acpi_rs_get_prt_method_data (
54 acpi_handle handle, 53 acpi_handle handle,
@@ -60,12 +59,12 @@ acpi_rs_get_crs_method_data (
60 acpi_handle handle, 59 acpi_handle handle,
61 struct acpi_buffer *ret_buffer); 60 struct acpi_buffer *ret_buffer);
62 61
63#ifdef ACPI_FUTURE_USAGE 62#ifdef ACPI_FUTURE_USAGE
64acpi_status 63acpi_status
65acpi_rs_get_prs_method_data ( 64acpi_rs_get_prs_method_data (
66 acpi_handle handle, 65 acpi_handle handle,
67 struct acpi_buffer *ret_buffer); 66 struct acpi_buffer *ret_buffer);
68#endif 67#endif /* ACPI_FUTURE_USAGE */
69 68
70acpi_status 69acpi_status
71acpi_rs_get_method_data ( 70acpi_rs_get_method_data (
@@ -95,61 +94,9 @@ acpi_rs_create_pci_routing_table (
95 94
96 95
97/* 96/*
98 * Function prototypes called from acpi_rs_create* 97 * rsdump
99 */ 98 */
100#ifdef ACPI_FUTURE_USAGE 99#ifdef ACPI_FUTURE_USAGE
101void
102acpi_rs_dump_irq (
103 union acpi_resource_data *data);
104
105void
106acpi_rs_dump_address16 (
107 union acpi_resource_data *data);
108
109void
110acpi_rs_dump_address32 (
111 union acpi_resource_data *data);
112
113void
114acpi_rs_dump_address64 (
115 union acpi_resource_data *data);
116
117void
118acpi_rs_dump_dma (
119 union acpi_resource_data *data);
120
121void
122acpi_rs_dump_io (
123 union acpi_resource_data *data);
124
125void
126acpi_rs_dump_extended_irq (
127 union acpi_resource_data *data);
128
129void
130acpi_rs_dump_fixed_io (
131 union acpi_resource_data *data);
132
133void
134acpi_rs_dump_fixed_memory32 (
135 union acpi_resource_data *data);
136
137void
138acpi_rs_dump_memory24 (
139 union acpi_resource_data *data);
140
141void
142acpi_rs_dump_memory32 (
143 union acpi_resource_data *data);
144
145void
146acpi_rs_dump_start_depend_fns (
147 union acpi_resource_data *data);
148
149void
150acpi_rs_dump_vendor_specific (
151 union acpi_resource_data *data);
152
153void 100void
154acpi_rs_dump_resource_list ( 101acpi_rs_dump_resource_list (
155 struct acpi_resource *resource); 102 struct acpi_resource *resource);
@@ -157,8 +104,12 @@ acpi_rs_dump_resource_list (
157void 104void
158acpi_rs_dump_irq_list ( 105acpi_rs_dump_irq_list (
159 u8 *route_table); 106 u8 *route_table);
160#endif /* ACPI_FUTURE_USAGE */ 107#endif /* ACPI_FUTURE_USAGE */
161 108
109
110/*
111 * rscalc
112 */
162acpi_status 113acpi_status
163acpi_rs_get_byte_stream_start ( 114acpi_rs_get_byte_stream_start (
164 u8 *byte_stream_buffer, 115 u8 *byte_stream_buffer,
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index c97843f6bcbc..e6b9e36a2eda 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -56,7 +56,6 @@
56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 56 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
57 * the tree (for whatever reason), and for control method execution. 57 * the tree (for whatever reason), and for control method execution.
58 */ 58 */
59
60#define ACPI_NEXT_OP_DOWNWARD 1 59#define ACPI_NEXT_OP_DOWNWARD 1
61#define ACPI_NEXT_OP_UPWARD 2 60#define ACPI_NEXT_OP_UPWARD 2
62 61
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index e8f5d4ffd452..39df92e21a0d 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -50,17 +50,9 @@
50#define SIZE_IN_HEADER 0 50#define SIZE_IN_HEADER 0
51 51
52 52
53#ifdef ACPI_FUTURE_USAGE
54acpi_status
55acpi_tb_handle_to_object (
56 u16 table_id,
57 struct acpi_table_desc **table_desc);
58#endif
59
60/* 53/*
61 * tbconvrt - Table conversion routines 54 * tbconvrt - Table conversion routines
62 */ 55 */
63
64acpi_status 56acpi_status
65acpi_tb_convert_to_xsdt ( 57acpi_tb_convert_to_xsdt (
66 struct acpi_table_desc *table_info); 58 struct acpi_table_desc *table_info);
@@ -78,10 +70,10 @@ acpi_tb_get_table_count (
78 struct rsdp_descriptor *RSDP, 70 struct rsdp_descriptor *RSDP,
79 struct acpi_table_header *RSDT); 71 struct acpi_table_header *RSDT);
80 72
73
81/* 74/*
82 * tbget - Table "get" routines 75 * tbget - Table "get" routines
83 */ 76 */
84
85acpi_status 77acpi_status
86acpi_tb_get_table ( 78acpi_tb_get_table (
87 struct acpi_pointer *address, 79 struct acpi_pointer *address,
@@ -99,17 +91,6 @@ acpi_tb_get_table_body (
99 struct acpi_table_desc *table_info); 91 struct acpi_table_desc *table_info);
100 92
101acpi_status 93acpi_status
102acpi_tb_get_this_table (
103 struct acpi_pointer *address,
104 struct acpi_table_header *header,
105 struct acpi_table_desc *table_info);
106
107acpi_status
108acpi_tb_table_override (
109 struct acpi_table_header *header,
110 struct acpi_table_desc *table_info);
111
112acpi_status
113acpi_tb_get_table_ptr ( 94acpi_tb_get_table_ptr (
114 acpi_table_type table_type, 95 acpi_table_type table_type,
115 u32 instance, 96 u32 instance,
@@ -127,36 +108,23 @@ acpi_status
127acpi_tb_validate_rsdt ( 108acpi_tb_validate_rsdt (
128 struct acpi_table_header *table_ptr); 109 struct acpi_table_header *table_ptr);
129 110
111
112/*
113 * tbgetall - get multiple required tables
114 */
130acpi_status 115acpi_status
131acpi_tb_get_required_tables ( 116acpi_tb_get_required_tables (
132 void); 117 void);
133 118
134acpi_status
135acpi_tb_get_primary_table (
136 struct acpi_pointer *address,
137 struct acpi_table_desc *table_info);
138
139acpi_status
140acpi_tb_get_secondary_table (
141 struct acpi_pointer *address,
142 acpi_string signature,
143 struct acpi_table_desc *table_info);
144 119
145/* 120/*
146 * tbinstall - Table installation 121 * tbinstall - Table installation
147 */ 122 */
148
149acpi_status 123acpi_status
150acpi_tb_install_table ( 124acpi_tb_install_table (
151 struct acpi_table_desc *table_info); 125 struct acpi_table_desc *table_info);
152 126
153acpi_status 127acpi_status
154acpi_tb_match_signature (
155 char *signature,
156 struct acpi_table_desc *table_info,
157 u8 search_type);
158
159acpi_status
160acpi_tb_recognize_table ( 128acpi_tb_recognize_table (
161 struct acpi_table_desc *table_info, 129 struct acpi_table_desc *table_info,
162 u8 search_type); 130 u8 search_type);
@@ -170,7 +138,6 @@ acpi_tb_init_table_descriptor (
170/* 138/*
171 * tbremove - Table removal and deletion 139 * tbremove - Table removal and deletion
172 */ 140 */
173
174void 141void
175acpi_tb_delete_all_tables ( 142acpi_tb_delete_all_tables (
176 void); 143 void);
@@ -189,35 +156,23 @@ acpi_tb_uninstall_table (
189 156
190 157
191/* 158/*
192 * tbrsd - RSDP, RSDT utilities 159 * tbxfroot - RSDP, RSDT utilities
193 */ 160 */
161acpi_status
162acpi_tb_find_table (
163 char *signature,
164 char *oem_id,
165 char *oem_table_id,
166 struct acpi_table_header **table_ptr);
194 167
195acpi_status 168acpi_status
196acpi_tb_get_table_rsdt ( 169acpi_tb_get_table_rsdt (
197 void); 170 void);
198 171
199u8 *
200acpi_tb_scan_memory_for_rsdp (
201 u8 *start_address,
202 u32 length);
203
204acpi_status
205acpi_tb_find_rsdp (
206 struct acpi_table_desc *table_info,
207 u32 flags);
208
209 172
210/* 173/*
211 * tbutils - common table utilities 174 * tbutils - common table utilities
212 */ 175 */
213
214acpi_status
215acpi_tb_find_table (
216 char *signature,
217 char *oem_id,
218 char *oem_table_id,
219 struct acpi_table_header **table_ptr);
220
221acpi_status 176acpi_status
222acpi_tb_verify_table_checksum ( 177acpi_tb_verify_table_checksum (
223 struct acpi_table_header *table_header); 178 struct acpi_table_header *table_header);
@@ -231,5 +186,4 @@ acpi_status
231acpi_tb_validate_table_header ( 186acpi_tb_validate_table_header (
232 struct acpi_table_header *table_header); 187 struct acpi_table_header *table_header);
233 188
234
235#endif /* __ACTABLES_H__ */ 189#endif /* __ACTABLES_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 7eee731112b1..b5cdcca444c8 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -133,7 +133,6 @@ struct acpi_table_header /* ACPI common table header */
133#define DUAL_PIC 0 133#define DUAL_PIC 0
134#define MULTIPLE_APIC 1 134#define MULTIPLE_APIC 1
135 135
136
137/* Master MADT */ 136/* Master MADT */
138 137
139struct multiple_apic_table 138struct multiple_apic_table
@@ -144,7 +143,6 @@ struct multiple_apic_table
144 u32 reserved1 : 31; 143 u32 reserved1 : 31;
145}; 144};
146 145
147
148/* Values for Type in APIC_HEADER_DEF */ 146/* Values for Type in APIC_HEADER_DEF */
149 147
150#define APIC_PROCESSOR 0 148#define APIC_PROCESSOR 0
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 7acb550af3eb..3a451dc48ac8 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -478,7 +478,6 @@ typedef u32 acpi_object_type;
478#define ACPI_TYPE_INVALID 0x1E 478#define ACPI_TYPE_INVALID 0x1E
479#define ACPI_TYPE_NOT_FOUND 0xFF 479#define ACPI_TYPE_NOT_FOUND 0xFF
480 480
481
482/* 481/*
483 * Bitmapped ACPI types. Used internally only 482 * Bitmapped ACPI types. Used internally only
484 */ 483 */
@@ -803,7 +802,6 @@ struct acpi_system_info
803/* 802/*
804 * Types specific to the OS service interfaces 803 * Types specific to the OS service interfaces
805 */ 804 */
806
807typedef u32 805typedef u32
808(ACPI_SYSTEM_XFACE *acpi_osd_handler) ( 806(ACPI_SYSTEM_XFACE *acpi_osd_handler) (
809 void *context); 807 void *context);
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 0de26b8f1028..192d0bea3884 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -52,13 +52,6 @@ acpi_status (*acpi_pkg_callback) (
52 union acpi_generic_state *state, 52 union acpi_generic_state *state,
53 void *context); 53 void *context);
54 54
55acpi_status
56acpi_ut_walk_package_tree (
57 union acpi_operand_object *source_object,
58 void *target_object,
59 acpi_pkg_callback walk_callback,
60 void *context);
61
62struct acpi_pkg_info 55struct acpi_pkg_info
63{ 56{
64 u8 *free_space; 57 u8 *free_space;
@@ -79,37 +72,13 @@ struct acpi_pkg_info
79#define DB_QWORD_DISPLAY 8 72#define DB_QWORD_DISPLAY 8
80 73
81 74
82/* Global initialization interfaces */
83
84void
85acpi_ut_init_globals (
86 void);
87
88void
89acpi_ut_terminate (
90 void);
91
92
93/* 75/*
94 * ut_init - miscellaneous initialization and shutdown 76 * utglobal - Global data structures and procedures
95 */ 77 */
96
97acpi_status
98acpi_ut_hardware_initialize (
99 void);
100
101void 78void
102acpi_ut_subsystem_shutdown ( 79acpi_ut_init_globals (
103 void);
104
105acpi_status
106acpi_ut_validate_fadt (
107 void); 80 void);
108 81
109/*
110 * ut_global - Global data structures and procedures
111 */
112
113#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 82#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
114 83
115char * 84char *
@@ -157,9 +126,24 @@ acpi_ut_allocate_owner_id (
157 126
158 127
159/* 128/*
160 * ut_clib - Local implementations of C library functions 129 * utinit - miscellaneous initialization and shutdown
161 */ 130 */
131acpi_status
132acpi_ut_hardware_initialize (
133 void);
162 134
135void
136acpi_ut_subsystem_shutdown (
137 void);
138
139acpi_status
140acpi_ut_validate_fadt (
141 void);
142
143
144/*
145 * utclib - Local implementations of C library functions
146 */
163#ifndef ACPI_USE_SYSTEM_CLIBRARY 147#ifndef ACPI_USE_SYSTEM_CLIBRARY
164 148
165acpi_size 149acpi_size
@@ -260,10 +244,10 @@ extern const u8 _acpi_ctype[];
260 244
261#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 245#endif /* ACPI_USE_SYSTEM_CLIBRARY */
262 246
247
263/* 248/*
264 * ut_copy - Object construction and conversion interfaces 249 * utcopy - Object construction and conversion interfaces
265 */ 250 */
266
267acpi_status 251acpi_status
268acpi_ut_build_simple_object( 252acpi_ut_build_simple_object(
269 union acpi_operand_object *obj, 253 union acpi_operand_object *obj,
@@ -278,30 +262,11 @@ acpi_ut_build_package_object (
278 u32 *space_used); 262 u32 *space_used);
279 263
280acpi_status 264acpi_status
281acpi_ut_copy_ielement_to_eelement (
282 u8 object_type,
283 union acpi_operand_object *source_object,
284 union acpi_generic_state *state,
285 void *context);
286
287acpi_status
288acpi_ut_copy_ielement_to_ielement (
289 u8 object_type,
290 union acpi_operand_object *source_object,
291 union acpi_generic_state *state,
292 void *context);
293
294acpi_status
295acpi_ut_copy_iobject_to_eobject ( 265acpi_ut_copy_iobject_to_eobject (
296 union acpi_operand_object *obj, 266 union acpi_operand_object *obj,
297 struct acpi_buffer *ret_buffer); 267 struct acpi_buffer *ret_buffer);
298 268
299acpi_status 269acpi_status
300acpi_ut_copy_esimple_to_isimple(
301 union acpi_object *user_obj,
302 union acpi_operand_object **return_obj);
303
304acpi_status
305acpi_ut_copy_eobject_to_iobject ( 270acpi_ut_copy_eobject_to_iobject (
306 union acpi_object *obj, 271 union acpi_object *obj,
307 union acpi_operand_object **internal_obj); 272 union acpi_operand_object **internal_obj);
@@ -312,17 +277,6 @@ acpi_ut_copy_isimple_to_isimple (
312 union acpi_operand_object *dest_obj); 277 union acpi_operand_object *dest_obj);
313 278
314acpi_status 279acpi_status
315acpi_ut_copy_ipackage_to_ipackage (
316 union acpi_operand_object *source_obj,
317 union acpi_operand_object *dest_obj,
318 struct acpi_walk_state *walk_state);
319
320acpi_status
321acpi_ut_copy_simple_object (
322 union acpi_operand_object *source_desc,
323 union acpi_operand_object *dest_desc);
324
325acpi_status
326acpi_ut_copy_iobject_to_iobject ( 280acpi_ut_copy_iobject_to_iobject (
327 union acpi_operand_object *source_desc, 281 union acpi_operand_object *source_desc,
328 union acpi_operand_object **dest_desc, 282 union acpi_operand_object **dest_desc,
@@ -330,9 +284,8 @@ acpi_ut_copy_iobject_to_iobject (
330 284
331 285
332/* 286/*
333 * ut_create - Object creation 287 * utcreate - Object creation
334 */ 288 */
335
336acpi_status 289acpi_status
337acpi_ut_update_object_reference ( 290acpi_ut_update_object_reference (
338 union acpi_operand_object *object, 291 union acpi_operand_object *object,
@@ -340,9 +293,8 @@ acpi_ut_update_object_reference (
340 293
341 294
342/* 295/*
343 * ut_debug - Debug interfaces 296 * utdebug - Debug interfaces
344 */ 297 */
345
346void 298void
347acpi_ut_init_stack_ptr_trace ( 299acpi_ut_init_stack_ptr_trace (
348 void); 300 void);
@@ -440,11 +392,14 @@ acpi_ut_debug_print_raw (
440 392
441 393
442/* 394/*
443 * ut_delete - Object deletion 395 * utdelete - Object deletion and reference counts
444 */ 396 */
397void
398acpi_ut_add_reference (
399 union acpi_operand_object *object);
445 400
446void 401void
447acpi_ut_delete_internal_obj ( 402acpi_ut_remove_reference (
448 union acpi_operand_object *object); 403 union acpi_operand_object *object);
449 404
450void 405void
@@ -461,25 +416,8 @@ acpi_ut_delete_internal_object_list (
461 416
462 417
463/* 418/*
464 * ut_eval - object evaluation 419 * uteval - object evaluation
465 */ 420 */
466
467/* Method name strings */
468
469#define METHOD_NAME__HID "_HID"
470#define METHOD_NAME__CID "_CID"
471#define METHOD_NAME__UID "_UID"
472#define METHOD_NAME__ADR "_ADR"
473#define METHOD_NAME__STA "_STA"
474#define METHOD_NAME__REG "_REG"
475#define METHOD_NAME__SEG "_SEG"
476#define METHOD_NAME__BBN "_BBN"
477#define METHOD_NAME__PRT "_PRT"
478#define METHOD_NAME__CRS "_CRS"
479#define METHOD_NAME__PRS "_PRS"
480#define METHOD_NAME__PRW "_PRW"
481
482
483acpi_status 421acpi_status
484acpi_ut_osi_implementation ( 422acpi_ut_osi_implementation (
485 struct acpi_walk_state *walk_state); 423 struct acpi_walk_state *walk_state);
@@ -522,39 +460,10 @@ acpi_ut_execute_sxds (
522 struct acpi_namespace_node *device_node, 460 struct acpi_namespace_node *device_node,
523 u8 *highest); 461 u8 *highest);
524 462
525/*
526 * ut_mutex - mutual exclusion interfaces
527 */
528
529acpi_status
530acpi_ut_mutex_initialize (
531 void);
532
533void
534acpi_ut_mutex_terminate (
535 void);
536
537acpi_status
538acpi_ut_create_mutex (
539 acpi_mutex_handle mutex_id);
540
541acpi_status
542acpi_ut_delete_mutex (
543 acpi_mutex_handle mutex_id);
544
545acpi_status
546acpi_ut_acquire_mutex (
547 acpi_mutex_handle mutex_id);
548
549acpi_status
550acpi_ut_release_mutex (
551 acpi_mutex_handle mutex_id);
552
553 463
554/* 464/*
555 * ut_object - internal object create/delete/cache routines 465 * utobject - internal object create/delete/cache routines
556 */ 466 */
557
558union acpi_operand_object * 467union acpi_operand_object *
559acpi_ut_create_internal_object_dbg ( 468acpi_ut_create_internal_object_dbg (
560 char *module_name, 469 char *module_name,
@@ -587,50 +496,15 @@ union acpi_operand_object *
587acpi_ut_create_string_object ( 496acpi_ut_create_string_object (
588 acpi_size string_size); 497 acpi_size string_size);
589 498
590
591/*
592 * ut_ref_cnt - Object reference count management
593 */
594
595void
596acpi_ut_add_reference (
597 union acpi_operand_object *object);
598
599void
600acpi_ut_remove_reference (
601 union acpi_operand_object *object);
602
603/*
604 * ut_size - Object size routines
605 */
606
607acpi_status
608acpi_ut_get_simple_object_size (
609 union acpi_operand_object *obj,
610 acpi_size *obj_length);
611
612acpi_status
613acpi_ut_get_package_object_size (
614 union acpi_operand_object *obj,
615 acpi_size *obj_length);
616
617acpi_status 499acpi_status
618acpi_ut_get_object_size( 500acpi_ut_get_object_size(
619 union acpi_operand_object *obj, 501 union acpi_operand_object *obj,
620 acpi_size *obj_length); 502 acpi_size *obj_length);
621 503
622acpi_status
623acpi_ut_get_element_length (
624 u8 object_type,
625 union acpi_operand_object *source_object,
626 union acpi_generic_state *state,
627 void *context);
628
629 504
630/* 505/*
631 * ut_state - Generic state creation/cache routines 506 * utstate - Generic state creation/cache routines
632 */ 507 */
633
634void 508void
635acpi_ut_push_generic_state ( 509acpi_ut_push_generic_state (
636 union acpi_generic_state **list_head, 510 union acpi_generic_state **list_head,
@@ -666,14 +540,14 @@ acpi_ut_create_update_state_and_push (
666 u16 action, 540 u16 action,
667 union acpi_generic_state **state_list); 541 union acpi_generic_state **state_list);
668 542
669#ifdef ACPI_FUTURE_USAGE 543#ifdef ACPI_FUTURE_USAGE
670acpi_status 544acpi_status
671acpi_ut_create_pkg_state_and_push ( 545acpi_ut_create_pkg_state_and_push (
672 void *internal_object, 546 void *internal_object,
673 void *external_object, 547 void *external_object,
674 u16 index, 548 u16 index,
675 union acpi_generic_state **state_list); 549 union acpi_generic_state **state_list);
676#endif 550#endif /* ACPI_FUTURE_USAGE */
677 551
678union acpi_generic_state * 552union acpi_generic_state *
679acpi_ut_create_control_state ( 553acpi_ut_create_control_state (
@@ -693,15 +567,10 @@ acpi_ut_delete_object_cache (
693 void); 567 void);
694#endif 568#endif
695 569
570
696/* 571/*
697 * utmisc 572 * utmath
698 */ 573 */
699
700void
701acpi_ut_print_string (
702 char *string,
703 u8 max_length);
704
705acpi_status 574acpi_status
706acpi_ut_divide ( 575acpi_ut_divide (
707 acpi_integer in_dividend, 576 acpi_integer in_dividend,
@@ -716,6 +585,25 @@ acpi_ut_short_divide (
716 acpi_integer *out_quotient, 585 acpi_integer *out_quotient,
717 u32 *out_remainder); 586 u32 *out_remainder);
718 587
588/*
589 * utmisc
590 */
591acpi_status
592acpi_ut_walk_package_tree (
593 union acpi_operand_object *source_object,
594 void *target_object,
595 acpi_pkg_callback walk_callback,
596 void *context);
597
598char *
599acpi_ut_strupr (
600 char *src_string);
601
602void
603acpi_ut_print_string (
604 char *string,
605 u8 max_length);
606
719u8 607u8
720acpi_ut_valid_acpi_name ( 608acpi_ut_valid_acpi_name (
721 u32 name); 609 u32 name);
@@ -734,11 +622,21 @@ acpi_ut_strtoul64 (
734 622
735#define ACPI_ANY_BASE 0 623#define ACPI_ANY_BASE 0
736 624
737#ifdef ACPI_FUTURE_USAGE 625acpi_status
738char * 626acpi_ut_mutex_initialize (
739acpi_ut_strupr ( 627 void);
740 char *src_string); 628
741#endif 629void
630acpi_ut_mutex_terminate (
631 void);
632
633acpi_status
634acpi_ut_acquire_mutex (
635 acpi_mutex_handle mutex_id);
636
637acpi_status
638acpi_ut_release_mutex (
639 acpi_mutex_handle mutex_id);
742 640
743u8 * 641u8 *
744acpi_ut_get_resource_end_tag ( 642acpi_ut_get_resource_end_tag (
@@ -768,9 +666,8 @@ acpi_ut_display_init_pathname (
768 666
769 667
770/* 668/*
771 * Utalloc - memory allocation and object caching 669 * utalloc - memory allocation and object caching
772 */ 670 */
773
774void * 671void *
775acpi_ut_acquire_from_cache ( 672acpi_ut_acquire_from_cache (
776 u32 list_id); 673 u32 list_id);
@@ -795,9 +692,6 @@ acpi_ut_initialize_buffer (
795 struct acpi_buffer *buffer, 692 struct acpi_buffer *buffer,
796 acpi_size required_length); 693 acpi_size required_length);
797 694
798
799/* Memory allocation functions */
800
801void * 695void *
802acpi_ut_allocate ( 696acpi_ut_allocate (
803 acpi_size size, 697 acpi_size size,
@@ -812,9 +706,7 @@ acpi_ut_callocate (
812 char *module, 706 char *module,
813 u32 line); 707 u32 line);
814 708
815
816#ifdef ACPI_DBG_TRACK_ALLOCATIONS 709#ifdef ACPI_DBG_TRACK_ALLOCATIONS
817
818void * 710void *
819acpi_ut_allocate_and_track ( 711acpi_ut_allocate_and_track (
820 acpi_size size, 712 acpi_size size,
@@ -836,34 +728,11 @@ acpi_ut_free_and_track (
836 char *module, 728 char *module,
837 u32 line); 729 u32 line);
838 730
839struct acpi_debug_mem_block * 731#ifdef ACPI_FUTURE_USAGE
840acpi_ut_find_allocation (
841 u32 list_id,
842 void *allocation);
843
844acpi_status
845acpi_ut_track_allocation (
846 u32 list_id,
847 struct acpi_debug_mem_block *address,
848 acpi_size size,
849 u8 alloc_type,
850 u32 component,
851 char *module,
852 u32 line);
853
854acpi_status
855acpi_ut_remove_allocation (
856 u32 list_id,
857 struct acpi_debug_mem_block *address,
858 u32 component,
859 char *module,
860 u32 line);
861
862#ifdef ACPI_FUTURE_USAGE
863void 732void
864acpi_ut_dump_allocation_info ( 733acpi_ut_dump_allocation_info (
865 void); 734 void);
866#endif 735#endif /* ACPI_FUTURE_USAGE */
867 736
868void 737void
869acpi_ut_dump_allocations ( 738acpi_ut_dump_allocations (
@@ -871,5 +740,4 @@ acpi_ut_dump_allocations (
871 char *module); 740 char *module);
872#endif 741#endif
873 742
874
875#endif /* _ACUTILS_H */ 743#endif /* _ACUTILS_H */
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index 2ec538eac58e..55e97ed29190 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -146,8 +146,7 @@
146 146
147/* prefixed opcodes */ 147/* prefixed opcodes */
148 148
149#define AML_EXTOP (u16) 0x005b 149#define AML_EXTOP (u16) 0x005b /* prefix for 2-byte opcodes */
150
151 150
152#define AML_MUTEX_OP (u16) 0x5b01 151#define AML_MUTEX_OP (u16) 0x5b01
153#define AML_EVENT_OP (u16) 0x5b02 152#define AML_EVENT_OP (u16) 0x5b02
@@ -194,7 +193,6 @@
194 * Use only "Unknown" AML opcodes, don't attempt to use 193 * Use only "Unknown" AML opcodes, don't attempt to use
195 * any valid ACPI ASCII values (A-Z, 0-9, '-') 194 * any valid ACPI ASCII values (A-Z, 0-9, '-')
196 */ 195 */
197
198#define AML_INT_NAMEPATH_OP (u16) 0x002d 196#define AML_INT_NAMEPATH_OP (u16) 0x002d
199#define AML_INT_NAMEDFIELD_OP (u16) 0x0030 197#define AML_INT_NAMEDFIELD_OP (u16) 0x0030
200#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031 198#define AML_INT_RESERVEDFIELD_OP (u16) 0x0031
@@ -214,7 +212,6 @@
214 * There can be up to 31 unique argument types 212 * There can be up to 31 unique argument types
215 * Zero is reserved as end-of-list indicator 213 * Zero is reserved as end-of-list indicator
216 */ 214 */
217
218#define ARGP_BYTEDATA 0x01 215#define ARGP_BYTEDATA 0x01
219#define ARGP_BYTELIST 0x02 216#define ARGP_BYTELIST 0x02
220#define ARGP_CHARLIST 0x03 217#define ARGP_CHARLIST 0x03
@@ -295,7 +292,6 @@
295/* 292/*
296 * opcode groups and types 293 * opcode groups and types
297 */ 294 */
298
299#define OPGRP_NAMED 0x01 295#define OPGRP_NAMED 0x01
300#define OPGRP_FIELD 0x02 296#define OPGRP_FIELD 0x02
301#define OPGRP_BYTELIST 0x04 297#define OPGRP_BYTELIST 0x04
@@ -381,6 +377,12 @@
381#define AML_TYPE_UNDEFINED 0x19 377#define AML_TYPE_UNDEFINED 0x19
382#define AML_TYPE_BOGUS 0x1A 378#define AML_TYPE_BOGUS 0x1A
383 379
380/* AML Package Length encodings */
381
382#define ACPI_AML_PACKAGE_TYPE1 0x40
383#define ACPI_AML_PACKAGE_TYPE2 0x4000
384#define ACPI_AML_PACKAGE_TYPE3 0x400000
385#define ACPI_AML_PACKAGE_TYPE4 0x40000000
384 386
385/* 387/*
386 * Opcode classes 388 * Opcode classes
diff --git a/include/acpi/pdc_intel.h b/include/acpi/pdc_intel.h
new file mode 100644
index 000000000000..fd6730e4e567
--- /dev/null
+++ b/include/acpi/pdc_intel.h
@@ -0,0 +1,29 @@
1
2/* _PDC bit definition for Intel processors */
3
4#ifndef __PDC_INTEL_H__
5#define __PDC_INTEL_H__
6
7#define ACPI_PDC_P_FFH (0x0001)
8#define ACPI_PDC_C_C1_HALT (0x0002)
9#define ACPI_PDC_T_FFH (0x0004)
10#define ACPI_PDC_SMP_C1PT (0x0008)
11#define ACPI_PDC_SMP_C2C3 (0x0010)
12#define ACPI_PDC_SMP_P_SWCOORD (0x0020)
13#define ACPI_PDC_SMP_C_SWCOORD (0x0040)
14#define ACPI_PDC_SMP_T_SWCOORD (0x0080)
15#define ACPI_PDC_C_C1_FFH (0x0100)
16
17
18#define ACPI_PDC_EST_CAPABILITY_SMP (ACPI_PDC_SMP_C1PT | \
19 ACPI_PDC_C_C1_HALT)
20
21#define ACPI_PDC_EST_CAPABILITY_SMP_MSR (ACPI_PDC_EST_CAPABILITY_SMP | \
22 ACPI_PDC_P_FFH)
23
24#define ACPI_PDC_C_CAPABILITY_SMP (ACPI_PDC_SMP_C2C3 | \
25 ACPI_PDC_SMP_C1PT | \
26 ACPI_PDC_C_C1_HALT)
27
28#endif /* __PDC_INTEL_H__ */
29
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 57bf9362335d..adf969efa510 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -198,6 +198,7 @@
198#endif 198#endif
199#endif /* !DEBUGGER_THREADING */ 199#endif /* !DEBUGGER_THREADING */
200 200
201
201/****************************************************************************** 202/******************************************************************************
202 * 203 *
203 * C library configuration 204 * C library configuration
@@ -209,7 +210,6 @@
209 * Use the standard C library headers. 210 * Use the standard C library headers.
210 * We want to keep these to a minimum. 211 * We want to keep these to a minimum.
211 */ 212 */
212
213#ifdef ACPI_USE_STANDARD_HEADERS 213#ifdef ACPI_USE_STANDARD_HEADERS
214/* 214/*
215 * Use the standard headers from the standard locations 215 * Use the standard headers from the standard locations
@@ -224,14 +224,8 @@
224/* 224/*
225 * We will be linking to the standard Clib functions 225 * We will be linking to the standard Clib functions
226 */ 226 */
227
228#define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) 227#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
229#define ACPI_STRCHR(s1,c) strchr((s1), (c)) 228#define ACPI_STRCHR(s1,c) strchr((s1), (c))
230
231#ifdef ACPI_FUTURE_USAGE
232#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
233#endif
234
235#define ACPI_STRLEN(s) (acpi_size) strlen((s)) 229#define ACPI_STRLEN(s) (acpi_size) strlen((s))
236#define ACPI_STRCPY(d,s) (void) strcpy((d), (s)) 230#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
237#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n)) 231#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (acpi_size)(n))
@@ -254,14 +248,15 @@
254#define ACPI_IS_ALPHA isalpha 248#define ACPI_IS_ALPHA isalpha
255#define ACPI_IS_ASCII isascii 249#define ACPI_IS_ASCII isascii
256 250
251#else
252
257/****************************************************************************** 253/******************************************************************************
258 * 254 *
259 * Not using native C library, use local implementations 255 * Not using native C library, use local implementations
260 * 256 *
261 *****************************************************************************/ 257 *****************************************************************************/
262#else
263 258
264/* 259 /*
265 * Use local definitions of C library macros and functions 260 * Use local definitions of C library macros and functions
266 * NOTE: The function implementations may not be as efficient 261 * NOTE: The function implementations may not be as efficient
267 * as an inline or assembly code implementation provided by a 262 * as an inline or assembly code implementation provided by a
@@ -278,14 +273,12 @@ typedef char *va_list;
278/* 273/*
279 * Storage alignment properties 274 * Storage alignment properties
280 */ 275 */
281
282#define _AUPBND (sizeof (acpi_native_int) - 1) 276#define _AUPBND (sizeof (acpi_native_int) - 1)
283#define _ADNBND (sizeof (acpi_native_int) - 1) 277#define _ADNBND (sizeof (acpi_native_int) - 1)
284 278
285/* 279/*
286 * Variable argument list macro definitions 280 * Variable argument list macro definitions
287 */ 281 */
288
289#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) 282#define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd)))
290#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) 283#define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND))))
291#define va_end(ap) (void) 0 284#define va_end(ap) (void) 0
@@ -296,11 +289,6 @@ typedef char *va_list;
296 289
297#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) 290#define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2))
298#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) 291#define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c))
299
300#ifdef ACPI_FUTURE_USAGE
301#define ACPI_STRUPR(s) (void) acpi_ut_strupr ((s))
302#endif
303
304#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) 292#define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s))
305#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s)) 293#define ACPI_STRCPY(d,s) (void) acpi_ut_strcpy ((d), (s))
306#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n)) 294#define ACPI_STRNCPY(d,s,n) (void) acpi_ut_strncpy ((d), (s), (acpi_size)(n))
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 2f50a5bb0c78..50cfea4ff6ca 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -4,6 +4,8 @@
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/config.h> 5#include <linux/config.h>
6 6
7#include <asm/acpi.h>
8
7#define ACPI_PROCESSOR_BUSY_METRIC 10 9#define ACPI_PROCESSOR_BUSY_METRIC 10
8 10
9#define ACPI_PROCESSOR_MAX_POWER 8 11#define ACPI_PROCESSOR_MAX_POWER 8
@@ -14,6 +16,8 @@
14#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */ 16#define ACPI_PROCESSOR_MAX_THROTTLE 250 /* 25% */
15#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4 17#define ACPI_PROCESSOR_MAX_DUTY_WIDTH 4
16 18
19#define ACPI_PDC_REVISION_ID 0x1
20
17/* Power Management */ 21/* Power Management */
18 22
19struct acpi_processor_cx; 23struct acpi_processor_cx;
@@ -59,6 +63,9 @@ struct acpi_processor_power {
59 u32 bm_activity; 63 u32 bm_activity;
60 int count; 64 int count;
61 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER]; 65 struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
66
67 /* the _PDC objects passed by the driver, if any */
68 struct acpi_object_list *pdc;
62}; 69};
63 70
64/* Performance Management */ 71/* Performance Management */
@@ -82,8 +89,6 @@ struct acpi_processor_px {
82 acpi_integer status; /* success indicator */ 89 acpi_integer status; /* success indicator */
83}; 90};
84 91
85#define ACPI_PDC_REVISION_ID 0x1
86
87struct acpi_processor_performance { 92struct acpi_processor_performance {
88 unsigned int state; 93 unsigned int state;
89 unsigned int platform_limit; 94 unsigned int platform_limit;
@@ -179,7 +184,32 @@ int acpi_processor_notify_smm(struct module *calling_module);
179extern struct acpi_processor *processors[NR_CPUS]; 184extern struct acpi_processor *processors[NR_CPUS];
180extern struct acpi_processor_errata errata; 185extern struct acpi_processor_errata errata;
181 186
187int acpi_processor_set_pdc(struct acpi_processor *pr,
188 struct acpi_object_list *pdc_in);
189
190#ifdef ARCH_HAS_POWER_PDC_INIT
191void acpi_processor_power_init_pdc(struct acpi_processor_power *pow,
192 unsigned int cpu);
193void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
194 unsigned int cpu);
195#else
196static inline void acpi_processor_power_init_pdc(
197 struct acpi_processor_power *pow, unsigned int cpu)
198{
199 pow->pdc = NULL;
200 return;
201}
202
203static inline void acpi_processor_power_init_bm_check(
204 struct acpi_processor_flags *flags, unsigned int cpu)
205{
206 flags->bm_check = 1;
207 return;
208}
209#endif
210
182/* in processor_perflib.c */ 211/* in processor_perflib.c */
212
183#ifdef CONFIG_CPU_FREQ 213#ifdef CONFIG_CPU_FREQ
184void acpi_processor_ppc_init(void); 214void acpi_processor_ppc_init(void);
185void acpi_processor_ppc_exit(void); 215void acpi_processor_ppc_exit(void);
diff --git a/include/asm-alpha/emergency-restart.h b/include/asm-alpha/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-alpha/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-alpha/mmzone.h b/include/asm-alpha/mmzone.h
index 726c150dcbe4..a011ef4cf3d3 100644
--- a/include/asm-alpha/mmzone.h
+++ b/include/asm-alpha/mmzone.h
@@ -57,7 +57,6 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
57 * Given a kernel address, find the home node of the underlying memory. 57 * Given a kernel address, find the home node of the underlying memory.
58 */ 58 */
59#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr)) 59#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr))
60#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
61#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 60#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
62 61
63#define local_mapnr(kvaddr) \ 62#define local_mapnr(kvaddr) \
@@ -108,7 +107,7 @@ PLAT_NODE_DATA_LOCALNR(unsigned long p, int n)
108#define pfn_to_page(pfn) \ 107#define pfn_to_page(pfn) \
109({ \ 108({ \
110 unsigned long kaddr = (unsigned long)__va((pfn) << PAGE_SHIFT); \ 109 unsigned long kaddr = (unsigned long)__va((pfn) << PAGE_SHIFT); \
111 (node_mem_map(kvaddr_to_nid(kaddr)) + local_mapnr(kaddr)); \ 110 (NODE_DATA(kvaddr_to_nid(kaddr))->node_mem_map + local_mapnr(kaddr)); \
112}) 111})
113 112
114#define page_to_pfn(page) \ 113#define page_to_pfn(page) \
diff --git a/include/asm-alpha/pci.h b/include/asm-alpha/pci.h
index 0c7b57bc043a..f681e675b823 100644
--- a/include/asm-alpha/pci.h
+++ b/include/asm-alpha/pci.h
@@ -58,7 +58,7 @@ struct pci_controller {
58 58
59extern void pcibios_set_master(struct pci_dev *dev); 59extern void pcibios_set_master(struct pci_dev *dev);
60 60
61extern inline void pcibios_penalize_isa_irq(int irq) 61extern inline void pcibios_penalize_isa_irq(int irq, int active)
62{ 62{
63 /* We don't do dynamic PCI IRQ allocation */ 63 /* We don't do dynamic PCI IRQ allocation */
64} 64}
@@ -223,6 +223,25 @@ pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr,
223 /* Nothing to do. */ 223 /* Nothing to do. */
224} 224}
225 225
226#ifdef CONFIG_PCI
227static inline void pci_dma_burst_advice(struct pci_dev *pdev,
228 enum pci_dma_burst_strategy *strat,
229 unsigned long *strategy_parameter)
230{
231 unsigned long cacheline_size;
232 u8 byte;
233
234 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
235 if (byte == 0)
236 cacheline_size = 1024;
237 else
238 cacheline_size = (int) byte * 4;
239
240 *strat = PCI_DMA_BURST_BOUNDARY;
241 *strategy_parameter = cacheline_size;
242}
243#endif
244
226/* TODO: integrate with include/asm-generic/pci.h ? */ 245/* TODO: integrate with include/asm-generic/pci.h ? */
227static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 246static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
228{ 247{
@@ -232,6 +251,9 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
232extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *, 251extern void pcibios_resource_to_bus(struct pci_dev *, struct pci_bus_region *,
233 struct resource *); 252 struct resource *);
234 253
254extern void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
255 struct pci_bus_region *region);
256
235#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index 257#define pci_domain_nr(bus) ((struct pci_controller *)(bus)->sysdata)->index
236 258
237static inline int pci_proc_domain(struct pci_bus *bus) 259static inline int pci_proc_domain(struct pci_bus *bus)
diff --git a/include/asm-alpha/pgtable.h b/include/asm-alpha/pgtable.h
index 408aea55e0cc..22b53e369f59 100644
--- a/include/asm-alpha/pgtable.h
+++ b/include/asm-alpha/pgtable.h
@@ -133,6 +133,12 @@
133#define __S111 _PAGE_S(0) 133#define __S111 _PAGE_S(0)
134 134
135/* 135/*
136 * pgprot_noncached() is only for infiniband pci support, and a real
137 * implementation for RAM would be more complicated.
138 */
139#define pgprot_noncached(prot) (prot)
140
141/*
136 * BAD_PAGETABLE is used when we need a bogus page-table, while 142 * BAD_PAGETABLE is used when we need a bogus page-table, while
137 * BAD_PAGE is used for a bogus page. 143 * BAD_PAGE is used for a bogus page.
138 * 144 *
diff --git a/include/asm-alpha/serial.h b/include/asm-alpha/serial.h
index 7b2d9ee95a44..7e4b2987d453 100644
--- a/include/asm-alpha/serial.h
+++ b/include/asm-alpha/serial.h
@@ -22,54 +22,9 @@
22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
23#endif 23#endif
24 24
25#ifdef CONFIG_SERIAL_MANY_PORTS 25#define SERIAL_PORT_DFNS \
26#define FOURPORT_FLAGS ASYNC_FOURPORT
27#define ACCENT_FLAGS 0
28#define BOCA_FLAGS 0
29#endif
30
31#define STD_SERIAL_PORT_DEFNS \
32 /* UART CLK PORT IRQ FLAGS */ \ 26 /* UART CLK PORT IRQ FLAGS */ \
33 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 27 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
34 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 28 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
35 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 29 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
36 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 30 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
37
38
39#ifdef CONFIG_SERIAL_MANY_PORTS
40#define EXTRA_SERIAL_PORT_DEFNS \
41 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
42 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
43 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
44 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
45 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
46 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
47 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
48 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
49 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
50 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
51 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
52 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
53 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
54 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
55 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
56 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
57 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
58 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
59 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
60 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
61 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
62 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
63 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
64 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
65 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
66 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
67 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
68 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
69#else
70#define EXTRA_SERIAL_PORT_DEFNS
71#endif
72
73#define SERIAL_PORT_DFNS \
74 STD_SERIAL_PORT_DEFNS \
75 EXTRA_SERIAL_PORT_DEFNS
diff --git a/include/asm-alpha/system.h b/include/asm-alpha/system.h
index c08ce970ff8c..bdb4d66418f1 100644
--- a/include/asm-alpha/system.h
+++ b/include/asm-alpha/system.h
@@ -443,22 +443,19 @@ __xchg_u64(volatile long *m, unsigned long val)
443 if something tries to do an invalid xchg(). */ 443 if something tries to do an invalid xchg(). */
444extern void __xchg_called_with_bad_pointer(void); 444extern void __xchg_called_with_bad_pointer(void);
445 445
446static inline unsigned long 446#define __xchg(ptr, x, size) \
447__xchg(volatile void *ptr, unsigned long x, int size) 447({ \
448{ 448 unsigned long __xchg__res; \
449 switch (size) { 449 volatile void *__xchg__ptr = (ptr); \
450 case 1: 450 switch (size) { \
451 return __xchg_u8(ptr, x); 451 case 1: __xchg__res = __xchg_u8(__xchg__ptr, x); break; \
452 case 2: 452 case 2: __xchg__res = __xchg_u16(__xchg__ptr, x); break; \
453 return __xchg_u16(ptr, x); 453 case 4: __xchg__res = __xchg_u32(__xchg__ptr, x); break; \
454 case 4: 454 case 8: __xchg__res = __xchg_u64(__xchg__ptr, x); break; \
455 return __xchg_u32(ptr, x); 455 default: __xchg_called_with_bad_pointer(); __xchg__res = x; \
456 case 8: 456 } \
457 return __xchg_u64(ptr, x); 457 __xchg__res; \
458 } 458})
459 __xchg_called_with_bad_pointer();
460 return x;
461}
462 459
463#define xchg(ptr,x) \ 460#define xchg(ptr,x) \
464 ({ \ 461 ({ \
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 535bc425f243..ef25b6585119 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -377,8 +377,13 @@
377#define __NR_add_key 439 377#define __NR_add_key 439
378#define __NR_request_key 440 378#define __NR_request_key 440
379#define __NR_keyctl 441 379#define __NR_keyctl 441
380#define __NR_ioprio_set 442
381#define __NR_ioprio_get 443
382#define __NR_inotify_init 444
383#define __NR_inotify_add_watch 445
384#define __NR_inotify_rm_watch 446
380 385
381#define NR_SYSCALLS 442 386#define NR_SYSCALLS 447
382 387
383#if defined(__GNUC__) 388#if defined(__GNUC__)
384 389
diff --git a/include/asm-arm/arch-imx/imxfb.h b/include/asm-arm/arch-imx/imxfb.h
index 2346d454ab9c..7dbc7bbba65d 100644
--- a/include/asm-arm/arch-imx/imxfb.h
+++ b/include/asm-arm/arch-imx/imxfb.h
@@ -25,6 +25,7 @@ struct imxfb_mach_info {
25 u_int pcr; 25 u_int pcr;
26 u_int pwmr; 26 u_int pwmr;
27 u_int lscr1; 27 u_int lscr1;
28 u_int dmacr;
28 29
29 u_char * fixed_screen_cpu; 30 u_char * fixed_screen_cpu;
30 dma_addr_t fixed_screen_dma; 31 dma_addr_t fixed_screen_dma;
diff --git a/include/asm-arm/arch-ixp2000/gpio.h b/include/asm-arm/arch-ixp2000/gpio.h
index 84634af5cc64..03cbbe1fd9d8 100644
--- a/include/asm-arm/arch-ixp2000/gpio.h
+++ b/include/asm-arm/arch-ixp2000/gpio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/asm-arm/arch-ixp2000/ixp2000-gpio.h 2 * include/asm-arm/arch-ixp2000/gpio.h
3 * 3 *
4 * Copyright (C) 2002 Intel Corporation. 4 * Copyright (C) 2002 Intel Corporation.
5 * 5 *
@@ -16,26 +16,18 @@
16 * Use this instead of directly setting the GPIO registers. 16 * Use this instead of directly setting the GPIO registers.
17 * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb) 17 * GPIOs may also be used as GPIOs (e.g. for emulating i2c/smb)
18 */ 18 */
19#ifndef _ASM_ARCH_IXP2000_GPIO_H_ 19#ifndef __ASM_ARCH_GPIO_H
20#define _ASM_ARCH_IXP2000_GPIO_H_ 20#define __ASM_ARCH_GPIO_H
21 21
22#ifndef __ASSEMBLY__ 22#ifndef __ASSEMBLY__
23#define GPIO_OUT 0x0 23
24#define GPIO_IN 0x80 24#define GPIO_IN 0
25#define GPIO_OUT 1
25 26
26#define IXP2000_GPIO_LOW 0 27#define IXP2000_GPIO_LOW 0
27#define IXP2000_GPIO_HIGH 1 28#define IXP2000_GPIO_HIGH 1
28 29
29#define GPIO_NO_EDGES 0 30extern void gpio_line_config(int line, int direction);
30#define GPIO_FALLING_EDGE 1
31#define GPIO_RISING_EDGE 2
32#define GPIO_BOTH_EDGES 3
33#define GPIO_LEVEL_LOW 4
34#define GPIO_LEVEL_HIGH 8
35
36extern void set_GPIO_IRQ_edge(int gpio_nr, int edge);
37extern void set_GPIO_IRQ_level(int gpio_nr, int level);
38extern void gpio_line_config(int line, int style);
39 31
40static inline int gpio_line_get(int line) 32static inline int gpio_line_get(int line)
41{ 33{
@@ -45,11 +37,12 @@ static inline int gpio_line_get(int line)
45static inline void gpio_line_set(int line, int value) 37static inline void gpio_line_set(int line, int value)
46{ 38{
47 if (value == IXP2000_GPIO_HIGH) { 39 if (value == IXP2000_GPIO_HIGH) {
48 ixp_reg_write(IXP2000_GPIO_POSR, BIT(line)); 40 ixp2000_reg_write(IXP2000_GPIO_POSR, 1 << line);
49 } else if (value == IXP2000_GPIO_LOW) 41 } else if (value == IXP2000_GPIO_LOW) {
50 ixp_reg_write(IXP2000_GPIO_POCR, BIT(line)); 42 ixp2000_reg_write(IXP2000_GPIO_POCR, 1 << line);
43 }
51} 44}
52 45
53#endif /* !__ASSEMBLY__ */ 46#endif /* !__ASSEMBLY__ */
54#endif /* ASM_ARCH_IXP2000_GPIO_H_ */
55 47
48#endif /* ASM_ARCH_IXP2000_GPIO_H_ */
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
index 083462668e18..3241cd6f0778 100644
--- a/include/asm-arm/arch-ixp2000/io.h
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -17,18 +17,23 @@
17 17
18#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
19#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
20#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
21 20
22/* 21/*
23 * The IXP2400 before revision B0 asserts byte lanes for PCI I/O 22 * The A? revisions of the IXP2000s assert byte lanes for PCI I/O
24 * transactions the other way round (MEM transactions don't have this 23 * transactions the other way round (MEM transactions don't have this
25 * issue), so we need to override the standard functions. B0 and later 24 * issue), so if we want to support those models, we need to override
26 * have a bit that can be set to 1 to get the 'proper' behavior, but 25 * the standard I/O functions.
27 * since that isn't available on the A? revisions we just keep doing 26 *
28 * things manually. 27 * B0 and later have a bit that can be set to 1 to get the proper
28 * behavior for I/O transactions, which then allows us to use the
29 * standard I/O functions. This is what we do if the user does not
30 * explicitly ask for support for pre-B0.
29 */ 31 */
30#define alignb(addr) (void __iomem *)((unsigned long)addr ^ 3) 32#ifdef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
31#define alignw(addr) (void __iomem *)((unsigned long)addr ^ 2) 33#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
34
35#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3)
36#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2)
32 37
33#define outb(v,p) __raw_writeb((v),alignb(___io(p))) 38#define outb(v,p) __raw_writeb((v),alignb(___io(p)))
34#define outw(v,p) __raw_writew((v),alignw(___io(p))) 39#define outw(v,p) __raw_writew((v),alignw(___io(p)))
@@ -48,6 +53,81 @@
48#define insw(p,d,l) __raw_readsw(alignw(___io(p)),d,l) 53#define insw(p,d,l) __raw_readsw(alignw(___io(p)),d,l)
49#define insl(p,d,l) __raw_readsl(___io(p),d,l) 54#define insl(p,d,l) __raw_readsl(___io(p),d,l)
50 55
56#define __is_io_address(p) ((((unsigned long)(p)) & ~(IXP2000_PCI_IO_SIZE - 1)) == IXP2000_PCI_IO_VIRT_BASE)
57
58#define ioread8(p) \
59 ({ \
60 unsigned int __v; \
61 \
62 if (__is_io_address(p)) { \
63 __v = __raw_readb(alignb(p)); \
64 } else { \
65 __v = __raw_readb(p); \
66 } \
67 \
68 __v; \
69 }) \
70
71#define ioread16(p) \
72 ({ \
73 unsigned int __v; \
74 \
75 if (__is_io_address(p)) { \
76 __v = __raw_readw(alignw(p)); \
77 } else { \
78 __v = le16_to_cpu(__raw_readw(p)); \
79 } \
80 \
81 __v; \
82 })
83
84#define ioread32(p) \
85 ({ \
86 unsigned int __v; \
87 \
88 if (__is_io_address(p)) { \
89 __v = __raw_readl(p); \
90 } else { \
91 __v = le32_to_cpu(__raw_readl(p)); \
92 } \
93 \
94 __v; \
95 })
96
97#define iowrite8(v,p) \
98 ({ \
99 if (__is_io_address(p)) { \
100 __raw_writeb((v), alignb(p)); \
101 } else { \
102 __raw_writeb((v), p); \
103 } \
104 })
105
106#define iowrite16(v,p) \
107 ({ \
108 if (__is_io_address(p)) { \
109 __raw_writew((v), alignw(p)); \
110 } else { \
111 __raw_writew(cpu_to_le16(v), p); \
112 } \
113 })
114
115#define iowrite32(v,p) \
116 ({ \
117 if (__is_io_address(p)) { \
118 __raw_writel((v), p); \
119 } else { \
120 __raw_writel(cpu_to_le32(v), p); \
121 } \
122 })
123
124#define ioport_map(port, nr) ___io(port)
125
126#define ioport_unmap(addr)
127#else
128#define __io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
129#endif
130
51 131
52#ifdef CONFIG_ARCH_IXDP2X01 132#ifdef CONFIG_ARCH_IXDP2X01
53/* 133/*
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x00.h b/include/asm-arm/arch-ixp2000/ixdp2x00.h
index 3a398dfbf125..229381c64283 100644
--- a/include/asm-arm/arch-ixp2000/ixdp2x00.h
+++ b/include/asm-arm/arch-ixp2000/ixdp2x00.h
@@ -21,8 +21,8 @@
21 * On board CPLD memory map 21 * On board CPLD memory map
22 */ 22 */
23#define IXDP2X00_PHYS_CPLD_BASE 0xc7000000 23#define IXDP2X00_PHYS_CPLD_BASE 0xc7000000
24#define IXDP2X00_VIRT_CPLD_BASE 0xfafff000 24#define IXDP2X00_VIRT_CPLD_BASE 0xfe000000
25#define IXDP2X00_CPLD_SIZE 0x00001000 25#define IXDP2X00_CPLD_SIZE 0x00100000
26 26
27 27
28#define IXDP2X00_CPLD_REG(x) \ 28#define IXDP2X00_CPLD_REG(x) \
diff --git a/include/asm-arm/arch-ixp2000/ixdp2x01.h b/include/asm-arm/arch-ixp2000/ixdp2x01.h
index b3a1bcda8d01..b768009c3a51 100644
--- a/include/asm-arm/arch-ixp2000/ixdp2x01.h
+++ b/include/asm-arm/arch-ixp2000/ixdp2x01.h
@@ -18,8 +18,8 @@
18#define __IXDP2X01_H__ 18#define __IXDP2X01_H__
19 19
20#define IXDP2X01_PHYS_CPLD_BASE 0xc6024000 20#define IXDP2X01_PHYS_CPLD_BASE 0xc6024000
21#define IXDP2X01_VIRT_CPLD_BASE 0xfafff000 21#define IXDP2X01_VIRT_CPLD_BASE 0xfe000000
22#define IXDP2X01_CPLD_REGION_SIZE 0x00001000 22#define IXDP2X01_CPLD_REGION_SIZE 0x00100000
23 23
24#define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg) 24#define IXDP2X01_CPLD_VIRT_REG(reg) (volatile unsigned long*)(IXDP2X01_VIRT_CPLD_BASE | reg)
25#define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg) 25#define IXDP2X01_CPLD_PHYS_REG(reg) (volatile u32*)(IXDP2X01_PHYS_CPLD_BASE | reg)
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
index a1d9e181b10f..75623f81ef75 100644
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -18,6 +18,21 @@
18#ifndef _IXP2000_REGS_H_ 18#ifndef _IXP2000_REGS_H_
19#define _IXP2000_REGS_H_ 19#define _IXP2000_REGS_H_
20 20
21/*
22 * IXP2000 linux memory map:
23 *
24 * virt phys size
25 * fb000000 db000000 16M PCI CFG1
26 * fc000000 da000000 16M PCI CFG0
27 * fd000000 d8000000 16M PCI I/O
28 * fe[0-7]00000 8M per-platform mappings
29 * feb00000 c8000000 1M MSF
30 * fec00000 df000000 1M PCI CSRs
31 * fed00000 de000000 1M PCI CREG
32 * fee00000 d6000000 1M INTCTL
33 * fef00000 c0000000 1M CAP
34 */
35
21/* 36/*
22 * Static I/O regions. 37 * Static I/O regions.
23 * 38 *
@@ -71,6 +86,10 @@
71#define IXP2000_PCI_CSR_VIRT_BASE 0xfec00000 86#define IXP2000_PCI_CSR_VIRT_BASE 0xfec00000
72#define IXP2000_PCI_CSR_SIZE 0x00100000 87#define IXP2000_PCI_CSR_SIZE 0x00100000
73 88
89#define IXP2000_MSF_PHYS_BASE 0xc8000000
90#define IXP2000_MSF_VIRT_BASE 0xfeb00000
91#define IXP2000_MSF_SIZE 0x00100000
92
74#define IXP2000_PCI_IO_PHYS_BASE 0xd8000000 93#define IXP2000_PCI_IO_PHYS_BASE 0xd8000000
75#define IXP2000_PCI_IO_VIRT_BASE 0xfd000000 94#define IXP2000_PCI_IO_VIRT_BASE 0xfd000000
76#define IXP2000_PCI_IO_SIZE 0x01000000 95#define IXP2000_PCI_IO_SIZE 0x01000000
@@ -241,7 +260,7 @@
241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */ 260#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */
242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */ 261#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */
243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */ 262#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */
244#define PCI_CONTROL_PNR (1 << 17) /* PCI Not Reset bit */ 263#define PCI_CONTROL_IEE (1 << 17) /* I/O cycle Endian swap Enable */
245 264
246#define IXP2000_PCI_RST_REL (1 << 2) 265#define IXP2000_PCI_RST_REL (1 << 2)
247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF) 266#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)
diff --git a/include/asm-arm/arch-ixp2000/platform.h b/include/asm-arm/arch-ixp2000/platform.h
index 901bba6d02b4..c0caf3e3e6fd 100644
--- a/include/asm-arm/arch-ixp2000/platform.h
+++ b/include/asm-arm/arch-ixp2000/platform.h
@@ -115,6 +115,7 @@ static inline unsigned int ixp2000_is_pcimaster(void)
115} 115}
116 116
117void ixp2000_map_io(void); 117void ixp2000_map_io(void);
118void ixp2000_uart_init(void);
118void ixp2000_init_irq(void); 119void ixp2000_init_irq(void);
119void ixp2000_init_time(unsigned long); 120void ixp2000_init_time(unsigned long);
120unsigned long ixp2000_gettimeoffset(void); 121unsigned long ixp2000_gettimeoffset(void);
@@ -138,30 +139,10 @@ struct ixp2000_flash_data {
138 unsigned long (*bank_setup)(unsigned long); 139 unsigned long (*bank_setup)(unsigned long);
139}; 140};
140 141
141/*
142 * GPIO helper functions
143 */
144#define GPIO_IN 0
145#define GPIO_OUT 1
146
147extern void gpio_line_config(int line, int style);
148
149static inline int gpio_line_get(int line)
150{
151 return (((*IXP2000_GPIO_PLR) >> line) & 1);
152}
153
154static inline void gpio_line_set(int line, int value)
155{
156 if (value)
157 ixp2000_reg_write(IXP2000_GPIO_POSR, (1 << line));
158 else
159 ixp2000_reg_write(IXP2000_GPIO_POCR, (1 << line));
160}
161
162struct ixp2000_i2c_pins { 142struct ixp2000_i2c_pins {
163 unsigned long sda_pin; 143 unsigned long sda_pin;
164 unsigned long scl_pin; 144 unsigned long scl_pin;
165}; 145};
166 146
147
167#endif /* !__ASSEMBLY__ */ 148#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-arm/arch-ixp2000/vmalloc.h b/include/asm-arm/arch-ixp2000/vmalloc.h
index 473dff4ec561..275136963a0c 100644
--- a/include/asm-arm/arch-ixp2000/vmalloc.h
+++ b/include/asm-arm/arch-ixp2000/vmalloc.h
@@ -17,4 +17,4 @@
17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced 17 * The vmalloc() routines leaves a hole of 4kB between each vmalloced
18 * area for the same reason. ;) 18 * area for the same reason. ;)
19 */ 19 */
20#define VMALLOC_END 0xfaffefff 20#define VMALLOC_END 0xfb000000
diff --git a/include/asm-arm/arch-ixp4xx/debug-macro.S b/include/asm-arm/arch-ixp4xx/debug-macro.S
index 4499ae8e4b44..2e23651e217f 100644
--- a/include/asm-arm/arch-ixp4xx/debug-macro.S
+++ b/include/asm-arm/arch-ixp4xx/debug-macro.S
@@ -15,6 +15,7 @@
15 tst \rx, #1 @ MMU enabled? 15 tst \rx, #1 @ MMU enabled?
16 moveq \rx, #0xc8000000 16 moveq \rx, #0xc8000000
17 movne \rx, #0xff000000 17 movne \rx, #0xff000000
18 orrne \rx, \rx, #0x00b00000
18 add \rx,\rx,#3 @ Uart regs are at off set of 3 if 19 add \rx,\rx,#3 @ Uart regs are at off set of 3 if
19 @ byte writes used - Big Endian. 20 @ byte writes used - Big Endian.
20 .endm 21 .endm
diff --git a/include/asm-arm/arch-ixp4xx/io.h b/include/asm-arm/arch-ixp4xx/io.h
index c27b9d3079a7..7495026e2c18 100644
--- a/include/asm-arm/arch-ixp4xx/io.h
+++ b/include/asm-arm/arch-ixp4xx/io.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Author: Deepak Saxena <dsaxena@plexity.net> 4 * Author: Deepak Saxena <dsaxena@plexity.net>
5 * 5 *
6 * Copyright (C) 2002-2004 MontaVista Software, Inc. 6 * Copyright (C) 2002-2005 MontaVista Software, Inc.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -383,6 +383,180 @@ __ixp4xx_insl(u32 io_addr, u32 *vaddr, u32 count)
383 *vaddr++ = inl(io_addr); 383 *vaddr++ = inl(io_addr);
384} 384}
385 385
386#define __is_io_address(p) (((unsigned long)p >= 0x0) && \
387 ((unsigned long)p <= 0x0000ffff))
388static inline unsigned int
389__ixp4xx_ioread8(void __iomem *port)
390{
391 if (__is_io_address(port))
392 return (unsigned int)__ixp4xx_inb((unsigned int)port);
393 else
394#ifndef CONFIG_IXP4XX_INDIRECT_PCI
395 return (unsigned int)__raw_readb((u32)port);
396#else
397 return (unsigned int)__ixp4xx_readb((u32)port);
398#endif
399}
400
401static inline void
402__ixp4xx_ioread8_rep(u32 port, u8 *vaddr, u32 count)
403{
404 if (__is_io_address(port))
405 __ixp4xx_insb(port, vaddr, count);
406 else
407#ifndef CONFIG_IXP4XX_INDIRECT_PCI
408 __raw_readsb((void __iomem *)port, vaddr, count);
409#else
410 __ixp4xx_readsb(port, vaddr, count);
411#endif
412}
413
414static inline unsigned int
415__ixp4xx_ioread16(void __iomem *port)
416{
417 if (__is_io_address(port))
418 return (unsigned int)__ixp4xx_inw((unsigned int)port);
419 else
420#ifndef CONFIG_IXP4XX_INDIRECT_PCI
421 return le16_to_cpu(__raw_readw((u32)port));
422#else
423 return (unsigned int)__ixp4xx_readw((u32)port);
424#endif
425}
426
427static inline void
428__ixp4xx_ioread16_rep(u32 port, u16 *vaddr, u32 count)
429{
430 if (__is_io_address(port))
431 __ixp4xx_insw(port, vaddr, count);
432 else
433#ifndef CONFIG_IXP4XX_INDIRECT_PCI
434 __raw_readsw((void __iomem *)port, vaddr, count);
435#else
436 __ixp4xx_readsw(port, vaddr, count);
437#endif
438}
439
440static inline unsigned int
441__ixp4xx_ioread32(void __iomem *port)
442{
443 if (__is_io_address(port))
444 return (unsigned int)__ixp4xx_inl((unsigned int)port);
445 else {
446#ifndef CONFIG_IXP4XX_INDIRECT_PCI
447 return le32_to_cpu(__raw_readl((u32)port));
448#else
449 return (unsigned int)__ixp4xx_readl((u32)port);
450#endif
451 }
452}
453
454static inline void
455__ixp4xx_ioread32_rep(u32 port, u32 *vaddr, u32 count)
456{
457 if (__is_io_address(port))
458 __ixp4xx_insl(port, vaddr, count);
459 else
460#ifndef CONFIG_IXP4XX_INDIRECT_PCI
461 __raw_readsl((void __iomem *)port, vaddr, count);
462#else
463 __ixp4xx_readsl(port, vaddr, count);
464#endif
465}
466
467static inline void
468__ixp4xx_iowrite8(u8 value, void __iomem *port)
469{
470 if (__is_io_address(port))
471 __ixp4xx_outb(value, (unsigned int)port);
472 else
473#ifndef CONFIG_IXP4XX_INDIRECT_PCI
474 __raw_writeb(value, (u32)port);
475#else
476 __ixp4xx_writeb(value, (u32)port);
477#endif
478}
479
480static inline void
481__ixp4xx_iowrite8_rep(u32 port, u8 *vaddr, u32 count)
482{
483 if (__is_io_address(port))
484 __ixp4xx_outsb(port, vaddr, count);
485#ifndef CONFIG_IXP4XX_INDIRECT_PCI
486 __raw_writesb((void __iomem *)port, vaddr, count);
487#else
488 __ixp4xx_writesb(port, vaddr, count);
489#endif
490}
491
492static inline void
493__ixp4xx_iowrite16(u16 value, void __iomem *port)
494{
495 if (__is_io_address(port))
496 __ixp4xx_outw(value, (unsigned int)port);
497 else
498#ifndef CONFIG_IXP4XX_INDIRECT_PCI
499 __raw_writew(cpu_to_le16(value), (u32)port);
500#else
501 __ixp4xx_writew(value, (u32)port);
502#endif
503}
504
505static inline void
506__ixp4xx_iowrite16_rep(u32 port, u16 *vaddr, u32 count)
507{
508 if (__is_io_address(port))
509 __ixp4xx_outsw(port, vaddr, count);
510#ifndef CONFIG_IXP4XX_INDIRECT_PCI
511 __raw_readsw((void __iomem *)port, vaddr, count);
512#else
513 __ixp4xx_writesw(port, vaddr, count);
514#endif
515}
516
517static inline void
518__ixp4xx_iowrite32(u32 value, void __iomem *port)
519{
520 if (__is_io_address(port))
521 __ixp4xx_outl(value, (unsigned int)port);
522 else
523#ifndef CONFIG_IXP4XX_INDIRECT_PCI
524 __raw_writel(cpu_to_le32(value), (u32)port);
525#else
526 __ixp4xx_writel(value, (u32)port);
527#endif
528}
529
530static inline void
531__ixp4xx_iowrite32_rep(u32 port, u32 *vaddr, u32 count)
532{
533 if (__is_io_address(port))
534 __ixp4xx_outsl(port, vaddr, count);
535#ifndef CONFIG_IXP4XX_INDIRECT_PCI
536 __raw_readsl((void __iomem *)port, vaddr, count);
537#else
538 __ixp4xx_outsl(port, vaddr, count);
539#endif
540}
541
542#define ioread8(p) __ixp4xx_ioread8(p)
543#define ioread16(p) __ixp4xx_ioread16(p)
544#define ioread32(p) __ixp4xx_ioread32(p)
545
546#define ioread8_rep(p, v, c) __ixp4xx_ioread8_rep(p, v, c)
547#define ioread16_rep(p, v, c) __ixp4xx_ioread16_rep(p, v, c)
548#define ioread32_rep(p, v, c) __ixp4xx_ioread32_rep(p, v, c)
549
550#define iowrite8(v,p) __ixp4xx_iowrite8(v,p)
551#define iowrite16(v,p) __ixp4xx_iowrite16(v,p)
552#define iowrite32(v,p) __ixp4xx_iowrite32(v,p)
553
554#define iowrite8_rep(p, v, c) __ixp4xx_iowrite8_rep(p, v, c)
555#define iowrite16_rep(p, v, c) __ixp4xx_iowrite16_rep(p, v, c)
556#define iowrite32_rep(p, v, c) __ixp4xx_iowrite32_rep(p, v, c)
557
558#define ioport_map(port, nr) ((void __iomem*)port)
559#define ioport_unmap(addr)
386 560
387#endif // __ASM_ARM_ARCH_IO_H 561#endif // __ASM_ARM_ARCH_IO_H
388 562
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
index 8eeb1db6309d..004696a95bdb 100644
--- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
+++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h
@@ -69,6 +69,16 @@
69#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000) 69#define IXP4XX_PERIPHERAL_BASE_VIRT (0xFFBF2000)
70#define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000) 70#define IXP4XX_PERIPHERAL_REGION_SIZE (0x0000C000)
71 71
72/*
73 * Debug UART
74 *
75 * This is basically a remap of UART1 into a region that is section
76 * aligned so that it * can be used with the low-level debug code.
77 */
78#define IXP4XX_DEBUG_UART_BASE_PHYS (0xC8000000)
79#define IXP4XX_DEBUG_UART_BASE_VIRT (0xffb00000)
80#define IXP4XX_DEBUG_UART_REGION_SIZE (0x00001000)
81
72#define IXP4XX_EXP_CS0_OFFSET 0x00 82#define IXP4XX_EXP_CS0_OFFSET 0x00
73#define IXP4XX_EXP_CS1_OFFSET 0x04 83#define IXP4XX_EXP_CS1_OFFSET 0x04
74#define IXP4XX_EXP_CS2_OFFSET 0x08 84#define IXP4XX_EXP_CS2_OFFSET 0x08
diff --git a/include/asm-arm/arch-ixp4xx/timex.h b/include/asm-arm/arch-ixp4xx/timex.h
index 38c9d77d3727..3745e35cc030 100644
--- a/include/asm-arm/arch-ixp4xx/timex.h
+++ b/include/asm-arm/arch-ixp4xx/timex.h
@@ -7,7 +7,9 @@
7 7
8/* 8/*
9 * We use IXP425 General purpose timer for our timer needs, it runs at 9 * We use IXP425 General purpose timer for our timer needs, it runs at
10 * 66.66... MHz 10 * 66.66... MHz. We do a convulted calculation of CLOCK_TICK_RATE b/c the
11 * timer register ignores the bottom 2 bits of the LATCH value.
11 */ 12 */
12#define CLOCK_TICK_RATE (66666666) 13#define FREQ 66666666
14#define CLOCK_TICK_RATE (((FREQ / HZ & ~IXP4XX_OST_RELOAD_MASK) + 1) * HZ)
13 15
diff --git a/include/asm-arm/arch-omap/board-h2.h b/include/asm-arm/arch-omap/board-h2.h
index 60f002b72983..39ca5a31aeea 100644
--- a/include/asm-arm/arch-omap/board-h2.h
+++ b/include/asm-arm/arch-omap/board-h2.h
@@ -34,11 +34,6 @@
34/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 34/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
35#define OMAP1610_ETHR_START 0x04000300 35#define OMAP1610_ETHR_START 0x04000300
36 36
37/* Intel STRATA NOR flash at CS3 or CS2B(NAND Boot) */
38#define OMAP_NOR_FLASH_SIZE SZ_32M
39#define OMAP_NOR_FLASH_START1 0x0C000000 /* CS3 */
40#define OMAP_NOR_FLASH_START2 0x0A000000 /* CS2B */
41
42/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ 37/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
43#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ 38#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
44#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ 39#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
diff --git a/include/asm-arm/arch-omap/board-h3.h b/include/asm-arm/arch-omap/board-h3.h
index e4d1cd231731..1b12c1dcc2fa 100644
--- a/include/asm-arm/arch-omap/board-h3.h
+++ b/include/asm-arm/arch-omap/board-h3.h
@@ -30,11 +30,6 @@
30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 30/* In OMAP1710 H3 the Ethernet is directly connected to CS1 */
31#define OMAP1710_ETHR_START 0x04000300 31#define OMAP1710_ETHR_START 0x04000300
32 32
33/* Intel STRATA NOR flash at CS3 or CS2B(NAND Boot) */
34#define OMAP_NOR_FLASH_SIZE SZ_32M
35#define OMAP_NOR_FLASH_START1 0x0C000000 /* CS3 */
36#define OMAP_NOR_FLASH_START2 0x0A000000 /* CS2B */
37
38/* Samsung NAND flash at CS2B or CS3(NAND Boot) */ 33/* Samsung NAND flash at CS2B or CS3(NAND Boot) */
39#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */ 34#define OMAP_NAND_FLASH_START1 0x0A000000 /* CS2B */
40#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */ 35#define OMAP_NAND_FLASH_START2 0x0C000000 /* CS3 */
diff --git a/include/asm-arm/arch-omap/board-osk.h b/include/asm-arm/arch-omap/board-osk.h
index aaa49a0fbd21..2b1a8a4fe44e 100644
--- a/include/asm-arm/arch-omap/board-osk.h
+++ b/include/asm-arm/arch-omap/board-osk.h
@@ -32,10 +32,5 @@
32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */ 32/* At OMAP5912 OSK the Ethernet is directly connected to CS1 */
33#define OMAP_OSK_ETHR_START 0x04800300 33#define OMAP_OSK_ETHR_START 0x04800300
34 34
35/* Micron NOR flash at CS3 mapped to address 0x0 if BM bit is 1 */
36#define OMAP_OSK_NOR_FLASH_BASE 0xD8000000
37#define OMAP_OSK_NOR_FLASH_SIZE SZ_32M
38#define OMAP_OSK_NOR_FLASH_START 0x00000000
39
40#endif /* __ASM_ARCH_OMAP_OSK_H */ 35#endif /* __ASM_ARCH_OMAP_OSK_H */
41 36
diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h
index 1cefd60b6f2a..95bd625480c1 100644
--- a/include/asm-arm/arch-omap/board.h
+++ b/include/asm-arm/arch-omap/board.h
@@ -16,10 +16,11 @@
16/* Different peripheral ids */ 16/* Different peripheral ids */
17#define OMAP_TAG_CLOCK 0x4f01 17#define OMAP_TAG_CLOCK 0x4f01
18#define OMAP_TAG_MMC 0x4f02 18#define OMAP_TAG_MMC 0x4f02
19#define OMAP_TAG_UART 0x4f03 19#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
20#define OMAP_TAG_USB 0x4f04 20#define OMAP_TAG_USB 0x4f04
21#define OMAP_TAG_LCD 0x4f05 21#define OMAP_TAG_LCD 0x4f05
22#define OMAP_TAG_GPIO_SWITCH 0x4f06 22#define OMAP_TAG_GPIO_SWITCH 0x4f06
23#define OMAP_TAG_UART 0x4f07
23 24
24#define OMAP_TAG_BOOT_REASON 0x4f80 25#define OMAP_TAG_BOOT_REASON 0x4f80
25#define OMAP_TAG_FLASH_PART 0x4f81 26#define OMAP_TAG_FLASH_PART 0x4f81
@@ -35,7 +36,7 @@ struct omap_mmc_config {
35 s16 mmc1_switch_pin, mmc2_switch_pin; 36 s16 mmc1_switch_pin, mmc2_switch_pin;
36}; 37};
37 38
38struct omap_uart_config { 39struct omap_serial_console_config {
39 u8 console_uart; 40 u8 console_uart;
40 u32 console_speed; 41 u32 console_speed;
41}; 42};
@@ -82,7 +83,8 @@ struct omap_lcd_config {
82 */ 83 */
83#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000 84#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
84#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001 85#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
85#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001 86#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
87#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
86struct omap_gpio_switch_config { 88struct omap_gpio_switch_config {
87 char name[12]; 89 char name[12];
88 u16 gpio; 90 u16 gpio;
@@ -99,6 +101,10 @@ struct omap_boot_reason_config {
99 char reason_str[12]; 101 char reason_str[12];
100}; 102};
101 103
104struct omap_uart_config {
105 /* Bit field of UARTs present; bit 0 --> UART1 */
106 unsigned int enabled_uarts;
107};
102 108
103struct omap_board_config_entry { 109struct omap_board_config_entry {
104 u16 tag; 110 u16 tag;
diff --git a/include/asm-arm/arch-omap/common.h b/include/asm-arm/arch-omap/common.h
new file mode 100644
index 000000000000..2a676b4f13b5
--- /dev/null
+++ b/include/asm-arm/arch-omap/common.h
@@ -0,0 +1,36 @@
1/*
2 * linux/include/asm-arm/arch-omap/common.h
3 *
4 * Header for code common to all OMAP machines.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 *
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
12 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
14 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
15 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
18 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
19 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26
27#ifndef __ARCH_ARM_MACH_OMAP_COMMON_H
28#define __ARCH_ARM_MACH_OMAP_COMMON_H
29
30struct sys_timer;
31
32extern void omap_map_common_io(void);
33extern struct sys_timer omap_timer;
34extern void omap_serial_init(int ports[]);
35
36#endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
diff --git a/include/asm-arm/arch-omap/dma.h b/include/asm-arm/arch-omap/dma.h
index d785248377db..ce114ce5af5d 100644
--- a/include/asm-arm/arch-omap/dma.h
+++ b/include/asm-arm/arch-omap/dma.h
@@ -241,6 +241,7 @@ extern void omap_dma_unlink_lch (int lch_head, int lch_queue);
241extern dma_addr_t omap_get_dma_src_pos(int lch); 241extern dma_addr_t omap_get_dma_src_pos(int lch);
242extern dma_addr_t omap_get_dma_dst_pos(int lch); 242extern dma_addr_t omap_get_dma_dst_pos(int lch);
243extern void omap_clear_dma(int lch); 243extern void omap_clear_dma(int lch);
244extern int omap_dma_running(void);
244 245
245/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ 246/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */
246extern int omap_dma_in_1510_mode(void); 247extern int omap_dma_in_1510_mode(void);
diff --git a/include/asm-arm/arch-omap/hardware.h b/include/asm-arm/arch-omap/hardware.h
index 37e06c782bdf..48258c7f6541 100644
--- a/include/asm-arm/arch-omap/hardware.h
+++ b/include/asm-arm/arch-omap/hardware.h
@@ -54,6 +54,19 @@
54 54
55/* 55/*
56 * ---------------------------------------------------------------------------- 56 * ----------------------------------------------------------------------------
57 * Timers
58 * ----------------------------------------------------------------------------
59 */
60#define OMAP_MPU_TIMER1_BASE (0xfffec500)
61#define OMAP_MPU_TIMER2_BASE (0xfffec600)
62#define OMAP_MPU_TIMER3_BASE (0xfffec700)
63#define MPU_TIMER_FREE (1 << 6)
64#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
65#define MPU_TIMER_AR (1 << 1)
66#define MPU_TIMER_ST (1 << 0)
67
68/*
69 * ----------------------------------------------------------------------------
57 * Clocks 70 * Clocks
58 * ---------------------------------------------------------------------------- 71 * ----------------------------------------------------------------------------
59 */ 72 */
@@ -78,6 +91,7 @@
78 91
79/* DSP clock control */ 92/* DSP clock control */
80#define DSP_CONFIG_REG_BASE (0xe1008000) 93#define DSP_CONFIG_REG_BASE (0xe1008000)
94#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
81#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4) 95#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
82#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8) 96#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
83 97
@@ -88,6 +102,7 @@
88 */ 102 */
89#define ULPD_REG_BASE (0xfffe0800) 103#define ULPD_REG_BASE (0xfffe0800)
90#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14) 104#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
105#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
91#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30) 106#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
92# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */ 107# define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
93# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */ 108# define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
@@ -268,17 +283,10 @@
268 * Processor specific defines 283 * Processor specific defines
269 * --------------------------------------------------------------------------- 284 * ---------------------------------------------------------------------------
270 */ 285 */
271#ifdef CONFIG_ARCH_OMAP730
272#include "omap730.h"
273#endif
274 286
275#ifdef CONFIG_ARCH_OMAP1510 287#include "omap730.h"
276#include "omap1510.h" 288#include "omap1510.h"
277#endif
278
279#ifdef CONFIG_ARCH_OMAP16XX
280#include "omap16xx.h" 289#include "omap16xx.h"
281#endif
282 290
283/* 291/*
284 * --------------------------------------------------------------------------- 292 * ---------------------------------------------------------------------------
diff --git a/include/asm-arm/arch-omap/irqs.h b/include/asm-arm/arch-omap/irqs.h
index 6701fd9e5f9b..0d05a7c957d1 100644
--- a/include/asm-arm/arch-omap/irqs.h
+++ b/include/asm-arm/arch-omap/irqs.h
@@ -159,6 +159,7 @@
159#define INT_1610_GPIO_BANK3 (41 + IH2_BASE) 159#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
160#define INT_1610_MMC2 (42 + IH2_BASE) 160#define INT_1610_MMC2 (42 + IH2_BASE)
161#define INT_1610_CF (43 + IH2_BASE) 161#define INT_1610_CF (43 + IH2_BASE)
162#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
162#define INT_1610_GPIO_BANK4 (48 + IH2_BASE) 163#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
163#define INT_1610_SPI (49 + IH2_BASE) 164#define INT_1610_SPI (49 + IH2_BASE)
164#define INT_1610_DMA_CH6 (53 + IH2_BASE) 165#define INT_1610_DMA_CH6 (53 + IH2_BASE)
@@ -238,6 +239,8 @@
238#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE) 239#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
239#define IH_BOARD_BASE (16 + IH_MPUIO_BASE) 240#define IH_BOARD_BASE (16 + IH_MPUIO_BASE)
240 241
242#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
243
241#ifndef __ASSEMBLY__ 244#ifndef __ASSEMBLY__
242extern void omap_init_irq(void); 245extern void omap_init_irq(void);
243#endif 246#endif
diff --git a/include/asm-arm/arch-omap/mux.h b/include/asm-arm/arch-omap/mux.h
index 39f99decbb7b..5bd3f0097fc6 100644
--- a/include/asm-arm/arch-omap/mux.h
+++ b/include/asm-arm/arch-omap/mux.h
@@ -231,7 +231,7 @@ typedef enum {
231 J19_1610_ETM_D6, 231 J19_1610_ETM_D6,
232 J18_1610_ETM_D7, 232 J18_1610_ETM_D7,
233 233
234 /* OMAP-1610 GPIO */ 234 /* OMAP16XX GPIO */
235 P20_1610_GPIO4, 235 P20_1610_GPIO4,
236 V9_1610_GPIO7, 236 V9_1610_GPIO7,
237 W8_1610_GPIO9, 237 W8_1610_GPIO9,
@@ -241,6 +241,9 @@ typedef enum {
241 AA20_1610_GPIO_41, 241 AA20_1610_GPIO_41,
242 W19_1610_GPIO48, 242 W19_1610_GPIO48,
243 M7_1610_GPIO62, 243 M7_1610_GPIO62,
244 V14_16XX_GPIO37,
245 R9_16XX_GPIO18,
246 L14_16XX_GPIO49,
244 247
245 /* OMAP-1610 uWire */ 248 /* OMAP-1610 uWire */
246 V19_1610_UWIRE_SCLK, 249 V19_1610_UWIRE_SCLK,
@@ -285,12 +288,13 @@ typedef enum {
285 V6_USB2_TXD, 288 V6_USB2_TXD,
286 W5_USB2_SE0, 289 W5_USB2_SE0,
287 290
288 /* UART1 1610 */ 291 /* 16XX UART */
289
290 R13_1610_UART1_TX, 292 R13_1610_UART1_TX,
291 V14_1610_UART1_RX, 293 V14_16XX_UART1_RX,
292 R14_1610_UART1_CTS, 294 R14_1610_UART1_CTS,
293 AA15_1610_UART1_RTS, 295 AA15_1610_UART1_RTS,
296 R9_16XX_UART2_RX,
297 L14_16XX_UART3_RX,
294 298
295 /* I2C OMAP-1610 */ 299 /* I2C OMAP-1610 */
296 I2C_SCL, 300 I2C_SCL,
@@ -332,7 +336,7 @@ typedef enum {
332 * Table of various FUNC_MUX and PULL_DWN combinations for each device. 336 * Table of various FUNC_MUX and PULL_DWN combinations for each device.
333 * See also reg_cfg_t above for the lookup table. 337 * See also reg_cfg_t above for the lookup table.
334 */ 338 */
335static reg_cfg_set __initdata_or_module 339static const reg_cfg_set __initdata_or_module
336reg_cfg_table[] = { 340reg_cfg_table[] = {
337/* 341/*
338 * description mux mode mux pull pull pull pu_pd pu dbg 342 * description mux mode mux pull pull pull pu_pd pu dbg
@@ -455,7 +459,7 @@ MUX_CFG("L19_1610_ETM_D0", 5, 18, 1, 0, 26, 0, 0, 0, 1)
455MUX_CFG("J19_1610_ETM_D6", 5, 0, 1, 0, 20, 0, 0, 0, 1) 459MUX_CFG("J19_1610_ETM_D6", 5, 0, 1, 0, 20, 0, 0, 0, 1)
456MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1) 460MUX_CFG("J18_1610_ETM_D7", 5, 27, 1, 0, 19, 0, 0, 0, 1)
457 461
458/* OMAP-1610 GPIO */ 462/* OMAP16XX GPIO */
459MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1) 463MUX_CFG("P20_1610_GPIO4", 6, 27, 0, 1, 7, 0, 1, 1, 1)
460MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1) 464MUX_CFG("V9_1610_GPIO7", B, 12, 1, 2, 20, 0, 2, 1, 1)
461MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1) 465MUX_CFG("W8_1610_GPIO9", B, 21, 0, 2, 23, 0, 2, 1, 1)
@@ -465,6 +469,9 @@ MUX_CFG("V5_1610_GPIO24", B, 15, 7, 2, 21, 0, 2, 1, 1)
465MUX_CFG("AA20_1610_GPIO_41", 9, 9, 7, 1, 31, 0, 1, 1, 1) 469MUX_CFG("AA20_1610_GPIO_41", 9, 9, 7, 1, 31, 0, 1, 1, 1)
466MUX_CFG("W19_1610_GPIO48", 8, 15, 7, 1, 23, 1, 1, 0, 1) 470MUX_CFG("W19_1610_GPIO48", 8, 15, 7, 1, 23, 1, 1, 0, 1)
467MUX_CFG("M7_1610_GPIO62", 10, 0, 0, 4, 24, 0, 4, 0, 1) 471MUX_CFG("M7_1610_GPIO62", 10, 0, 0, 4, 24, 0, 4, 0, 1)
472MUX_CFG("V14_16XX_GPIO37", 9, 18, 7, 2, 2, 0, 2, 2, 0)
473MUX_CFG("R9_16XX_GPIO18", C, 18, 7, 3, 0, 0, 3, 0, 0)
474MUX_CFG("L14_16XX_GPIO49", 6, 3, 7, 0, 31, 0, 0, 31, 0)
468 475
469/* OMAP-1610 uWire */ 476/* OMAP-1610 uWire */
470MUX_CFG("V19_1610_UWIRE_SCLK", 8, 6, 0, 1, 20, 0, 1, 1, 1) 477MUX_CFG("V19_1610_UWIRE_SCLK", 8, 6, 0, 1, 20, 0, 1, 1, 1)
@@ -503,16 +510,17 @@ MUX_CFG("Y10_USB0_SUSP", B, 3, 5, 2, 17, 0, 2, 0, 1)
503MUX_CFG("W9_USB2_TXEN", B, 9, 1, NA, 0, 0, NA, 0, 1) 510MUX_CFG("W9_USB2_TXEN", B, 9, 1, NA, 0, 0, NA, 0, 1)
504MUX_CFG("AA9_USB2_VP", B, 6, 1, NA, 0, 0, NA, 0, 1) 511MUX_CFG("AA9_USB2_VP", B, 6, 1, NA, 0, 0, NA, 0, 1)
505MUX_CFG("Y5_USB2_RCV", C, 21, 1, NA, 0, 0, NA, 0, 1) 512MUX_CFG("Y5_USB2_RCV", C, 21, 1, NA, 0, 0, NA, 0, 1)
506MUX_CFG("R8_USB2_VM", C, 18, 1, NA, 0, 0, NA, 0, 1) 513MUX_CFG("R9_USB2_VM", C, 18, 1, NA, 0, 0, NA, 0, 1)
507MUX_CFG("V6_USB2_TXD", C, 27, 2, NA, 0, 0, NA, 0, 1) 514MUX_CFG("V6_USB2_TXD", C, 27, 2, NA, 0, 0, NA, 0, 1)
508MUX_CFG("W5_USB2_SE0", C, 24, 2, NA, 0, 0, NA, 0, 1) 515MUX_CFG("W5_USB2_SE0", C, 24, 2, NA, 0, 0, NA, 0, 1)
509 516
510 517/* 16XX UART */
511/* UART1 */
512MUX_CFG("R13_1610_UART1_TX", A, 12, 6, 2, 10, 0, 2, 10, 1) 518MUX_CFG("R13_1610_UART1_TX", A, 12, 6, 2, 10, 0, 2, 10, 1)
513MUX_CFG("V14_1610_UART1_RX", 9, 18, 0, 2, 2, 0, 2, 2, 1) 519MUX_CFG("V14_16XX_UART1_RX", 9, 18, 0, 2, 2, 0, 2, 2, 1)
514MUX_CFG("R14_1610_UART1_CTS", 9, 15, 0, 2, 1, 0, 2, 1, 1) 520MUX_CFG("R14_1610_UART1_CTS", 9, 15, 0, 2, 1, 0, 2, 1, 1)
515MUX_CFG("AA15_1610_UART1_RTS", 9, 12, 1, 2, 0, 0, 2, 0, 1) 521MUX_CFG("AA15_1610_UART1_RTS", 9, 12, 1, 2, 0, 0, 2, 0, 1)
522MUX_CFG("R9_16XX_UART2_RX", C, 18, 0, 3, 0, 0, 3, 0, 1)
523MUX_CFG("L14_16XX_UART3_RX", 6, 3, 0, 0, 31, 0, 0, 31, 1)
516 524
517/* I2C interface */ 525/* I2C interface */
518MUX_CFG("I2C_SCL", 7, 24, 0, NA, 0, 0, NA, 0, 0) 526MUX_CFG("I2C_SCL", 7, 24, 0, NA, 0, 0, NA, 0, 0)
diff --git a/include/asm-arm/arch-omap/omap16xx.h b/include/asm-arm/arch-omap/omap16xx.h
index 88b1fe43ae9e..38a9b95e6a33 100644
--- a/include/asm-arm/arch-omap/omap16xx.h
+++ b/include/asm-arm/arch-omap/omap16xx.h
@@ -183,5 +183,37 @@
183#define OMAP16XX_PWL_ENABLE (OMAP16XX_PWL_BASE + 0x00) 183#define OMAP16XX_PWL_ENABLE (OMAP16XX_PWL_BASE + 0x00)
184#define OMAP16XX_PWL_CLK_ENABLE (OMAP16XX_PWL_BASE + 0x04) 184#define OMAP16XX_PWL_CLK_ENABLE (OMAP16XX_PWL_BASE + 0x04)
185 185
186/*
187 * ---------------------------------------------------------------------------
188 * Watchdog timer
189 * ---------------------------------------------------------------------------
190 */
191
192/* 32-bit Watchdog timer in OMAP 16XX */
193#define OMAP_16XX_WATCHDOG_BASE (0xfffeb000)
194#define OMAP_16XX_WIDR (OMAP_16XX_WATCHDOG_BASE + 0x00)
195#define OMAP_16XX_WD_SYSCONFIG (OMAP_16XX_WATCHDOG_BASE + 0x10)
196#define OMAP_16XX_WD_SYSSTATUS (OMAP_16XX_WATCHDOG_BASE + 0x14)
197#define OMAP_16XX_WCLR (OMAP_16XX_WATCHDOG_BASE + 0x24)
198#define OMAP_16XX_WCRR (OMAP_16XX_WATCHDOG_BASE + 0x28)
199#define OMAP_16XX_WLDR (OMAP_16XX_WATCHDOG_BASE + 0x2c)
200#define OMAP_16XX_WTGR (OMAP_16XX_WATCHDOG_BASE + 0x30)
201#define OMAP_16XX_WWPS (OMAP_16XX_WATCHDOG_BASE + 0x34)
202#define OMAP_16XX_WSPR (OMAP_16XX_WATCHDOG_BASE + 0x48)
203
204#define WCLR_PRE_SHIFT 5
205#define WCLR_PTV_SHIFT 2
206
207#define WWPS_W_PEND_WSPR (1 << 4)
208#define WWPS_W_PEND_WTGR (1 << 3)
209#define WWPS_W_PEND_WLDR (1 << 2)
210#define WWPS_W_PEND_WCRR (1 << 1)
211#define WWPS_W_PEND_WCLR (1 << 0)
212
213#define WSPR_ENABLE_0 (0x0000bbbb)
214#define WSPR_ENABLE_1 (0x00004444)
215#define WSPR_DISABLE_0 (0x0000aaaa)
216#define WSPR_DISABLE_1 (0x00005555)
217
186#endif /* __ASM_ARCH_OMAP16XX_H */ 218#endif /* __ASM_ARCH_OMAP16XX_H */
187 219
diff --git a/include/asm-arm/arch-omap/system.h b/include/asm-arm/arch-omap/system.h
index 17a2c4825f07..ff37bc27e603 100644
--- a/include/asm-arm/arch-omap/system.h
+++ b/include/asm-arm/arch-omap/system.h
@@ -5,7 +5,9 @@
5#ifndef __ASM_ARCH_SYSTEM_H 5#ifndef __ASM_ARCH_SYSTEM_H
6#define __ASM_ARCH_SYSTEM_H 6#define __ASM_ARCH_SYSTEM_H
7#include <linux/config.h> 7#include <linux/config.h>
8#include <asm/mach-types.h>
8#include <asm/arch/hardware.h> 9#include <asm/arch/hardware.h>
10#include <asm/mach-types.h>
9 11
10static inline void arch_idle(void) 12static inline void arch_idle(void)
11{ 13{
@@ -14,7 +16,24 @@ static inline void arch_idle(void)
14 16
15static inline void arch_reset(char mode) 17static inline void arch_reset(char mode)
16{ 18{
17 omap_writew(1, ARM_RSTCT1); 19
20#ifdef CONFIG_ARCH_OMAP16XX
21 /*
22 * Workaround for 5912/1611b bug mentioned in sprz209d.pdf p. 28
23 * "Global Software Reset Affects Traffic Controller Frequency".
24 */
25 if (cpu_is_omap5912()) {
26 omap_writew(omap_readw(DPLL_CTL) & ~(1 << 4),
27 DPLL_CTL);
28 omap_writew(0x8, ARM_RSTCT1);
29 }
30#endif
31#ifdef CONFIG_MACH_VOICEBLUE
32 if (machine_is_voiceblue())
33 voiceblue_reset();
34 else
35#endif
36 omap_writew(1, ARM_RSTCT1);
18} 37}
19 38
20#endif 39#endif
diff --git a/include/asm-arm/arch-omap/tps65010.h b/include/asm-arm/arch-omap/tps65010.h
index 0f97bb2e8fce..b9aa2b3a3909 100644
--- a/include/asm-arm/arch-omap/tps65010.h
+++ b/include/asm-arm/arch-omap/tps65010.h
@@ -30,6 +30,66 @@
30 30
31/* 31/*
32 * ---------------------------------------------------------------------------- 32 * ----------------------------------------------------------------------------
33 * Registers, all 8 bits
34 * ----------------------------------------------------------------------------
35 */
36
37#define TPS_CHGSTATUS 0x01
38# define TPS_CHG_USB (1 << 7)
39# define TPS_CHG_AC (1 << 6)
40# define TPS_CHG_THERM (1 << 5)
41# define TPS_CHG_TERM (1 << 4)
42# define TPS_CHG_TAPER_TMO (1 << 3)
43# define TPS_CHG_CHG_TMO (1 << 2)
44# define TPS_CHG_PRECHG_TMO (1 << 1)
45# define TPS_CHG_TEMP_ERR (1 << 0)
46#define TPS_REGSTATUS 0x02
47# define TPS_REG_ONOFF (1 << 7)
48# define TPS_REG_COVER (1 << 6)
49# define TPS_REG_UVLO (1 << 5)
50# define TPS_REG_NO_CHG (1 << 4) /* tps65013 */
51# define TPS_REG_PG_LD02 (1 << 3)
52# define TPS_REG_PG_LD01 (1 << 2)
53# define TPS_REG_PG_MAIN (1 << 1)
54# define TPS_REG_PG_CORE (1 << 0)
55#define TPS_MASK1 0x03
56#define TPS_MASK2 0x04
57#define TPS_ACKINT1 0x05
58#define TPS_ACKINT2 0x06
59#define TPS_CHGCONFIG 0x07
60# define TPS_CHARGE_POR (1 << 7) /* 65010/65012 */
61# define TPS65013_AUA (1 << 7) /* 65011/65013 */
62# define TPS_CHARGE_RESET (1 << 6)
63# define TPS_CHARGE_FAST (1 << 5)
64# define TPS_CHARGE_CURRENT (3 << 3)
65# define TPS_VBUS_500MA (1 << 2)
66# define TPS_VBUS_CHARGING (1 << 1)
67# define TPS_CHARGE_ENABLE (1 << 0)
68#define TPS_LED1_ON 0x08
69#define TPS_LED1_PER 0x09
70#define TPS_LED2_ON 0x0a
71#define TPS_LED2_PER 0x0b
72#define TPS_VDCDC1 0x0c
73# define TPS_ENABLE_LP (1 << 3)
74#define TPS_VDCDC2 0x0d
75#define TPS_VREGS1 0x0e
76# define TPS_LDO2_ENABLE (1 << 7)
77# define TPS_LDO2_OFF (1 << 6)
78# define TPS_VLDO2_3_0V (3 << 4)
79# define TPS_VLDO2_2_75V (2 << 4)
80# define TPS_VLDO2_2_5V (1 << 4)
81# define TPS_VLDO2_1_8V (0 << 4)
82# define TPS_LDO1_ENABLE (1 << 3)
83# define TPS_LDO1_OFF (1 << 2)
84# define TPS_VLDO1_3_0V (3 << 0)
85# define TPS_VLDO1_2_75V (2 << 0)
86# define TPS_VLDO1_2_5V (1 << 0)
87# define TPS_VLDO1_ADJ (0 << 0)
88#define TPS_MASK3 0x0f
89#define TPS_DEFGPIO 0x10
90
91/*
92 * ----------------------------------------------------------------------------
33 * Macros used by exported functions 93 * Macros used by exported functions
34 * ---------------------------------------------------------------------------- 94 * ----------------------------------------------------------------------------
35 */ 95 */
@@ -71,10 +131,26 @@ extern int tps65010_set_gpio_out_value(unsigned gpio, unsigned value);
71 */ 131 */
72extern int tps65010_set_led(unsigned led, unsigned mode); 132extern int tps65010_set_led(unsigned led, unsigned mode);
73 133
134/* tps65010_set_vib parameter:
135 * value: ON or OFF
136 */
137extern int tps65010_set_vib(unsigned value);
138
74/* tps65010_set_low_pwr parameter: 139/* tps65010_set_low_pwr parameter:
75 * mode: ON or OFF 140 * mode: ON or OFF
76 */ 141 */
77extern int tps65010_set_low_pwr(unsigned mode); 142extern int tps65010_set_low_pwr(unsigned mode);
78 143
144/* tps65010_config_vregs1 parameter:
145 * value to be written to VREGS1 register
146 * Note: The complete register is written, set all bits you need
147 */
148extern int tps65010_config_vregs1(unsigned value);
149
150/* tps65013_set_low_pwr parameter:
151 * mode: ON or OFF
152 */
153extern int tps65013_set_low_pwr(unsigned mode);
154
79#endif /* __ASM_ARCH_TPS65010_H */ 155#endif /* __ASM_ARCH_TPS65010_H */
80 156
diff --git a/include/asm-arm/arch-omap/usb.h b/include/asm-arm/arch-omap/usb.h
index 1438c6cef0ca..054fb9a8e0c6 100644
--- a/include/asm-arm/arch-omap/usb.h
+++ b/include/asm-arm/arch-omap/usb.h
@@ -47,6 +47,15 @@
47# define HMC_TLLATTACH (1 << 6) 47# define HMC_TLLATTACH (1 << 6)
48# define OTG_HMC(w) (((w)>>0)&0x3f) 48# define OTG_HMC(w) (((w)>>0)&0x3f)
49#define OTG_CTRL_REG OTG_REG32(0x0c) 49#define OTG_CTRL_REG OTG_REG32(0x0c)
50# define OTG_USB2_EN (1 << 29)
51# define OTG_USB2_DP (1 << 28)
52# define OTG_USB2_DM (1 << 27)
53# define OTG_USB1_EN (1 << 26)
54# define OTG_USB1_DP (1 << 25)
55# define OTG_USB1_DM (1 << 24)
56# define OTG_USB0_EN (1 << 23)
57# define OTG_USB0_DP (1 << 22)
58# define OTG_USB0_DM (1 << 21)
50# define OTG_ASESSVLD (1 << 20) 59# define OTG_ASESSVLD (1 << 20)
51# define OTG_BSESSEND (1 << 19) 60# define OTG_BSESSEND (1 << 19)
52# define OTG_BSESSVLD (1 << 18) 61# define OTG_BSESSVLD (1 << 18)
diff --git a/include/asm-arm/arch-pxa/debug-macro.S b/include/asm-arm/arch-pxa/debug-macro.S
index f288e74b67c2..b6ec68879176 100644
--- a/include/asm-arm/arch-pxa/debug-macro.S
+++ b/include/asm-arm/arch-pxa/debug-macro.S
@@ -11,6 +11,8 @@
11 * 11 *
12*/ 12*/
13 13
14#include "hardware.h"
15
14 .macro addruart,rx 16 .macro addruart,rx
15 mrc p15, 0, \rx, c1, c0 17 mrc p15, 0, \rx, c1, c0
16 tst \rx, #1 @ MMU enabled? 18 tst \rx, #1 @ MMU enabled?
diff --git a/include/asm-arm/arch-pxa/mtd-xip.h b/include/asm-arm/arch-pxa/mtd-xip.h
new file mode 100644
index 000000000000..8704dbceb432
--- /dev/null
+++ b/include/asm-arm/arch-pxa/mtd-xip.h
@@ -0,0 +1,37 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Author: Nicolas Pitre
7 * Created: Nov 2, 2004
8 * Copyright: (C) 2004 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
15 */
16
17#ifndef __ARCH_PXA_MTD_XIP_H__
18#define __ARCH_PXA_MTD_XIP_H__
19
20#include <asm/arch/pxa-regs.h>
21
22#define xip_irqpending() (ICIP & ICMR)
23
24/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
25#define xip_currtime() (OSCR)
26#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)
27
28/*
29 * xip_cpu_idle() is used when waiting for a delay equal or larger than
30 * the system timer tick period. This should put the CPU into idle mode
31 * to save power and to be woken up only when some interrupts are pending.
32 * As above, this should not rely upon standard kernel code.
33 */
34
35#define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))
36
37#endif /* __ARCH_PXA_MTD_XIP_H__ */
diff --git a/include/asm-arm/arch-pxa/pxa-regs.h b/include/asm-arm/arch-pxa/pxa-regs.h
index b5e54a9e9fa7..51f0fe0ac165 100644
--- a/include/asm-arm/arch-pxa/pxa-regs.h
+++ b/include/asm-arm/arch-pxa/pxa-regs.h
@@ -1505,6 +1505,7 @@
1505#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */ 1505#define PSSR_OTGPH (1 << 6) /* OTG Peripheral control Hold */
1506#define PSSR_RDH (1 << 5) /* Read Disable Hold */ 1506#define PSSR_RDH (1 << 5) /* Read Disable Hold */
1507#define PSSR_PH (1 << 4) /* Peripheral Control Hold */ 1507#define PSSR_PH (1 << 4) /* Peripheral Control Hold */
1508#define PSSR_STS (1 << 3) /* Standby Mode Status */
1508#define PSSR_VFS (1 << 2) /* VDD Fault Status */ 1509#define PSSR_VFS (1 << 2) /* VDD Fault Status */
1509#define PSSR_BFS (1 << 1) /* Battery Fault Status */ 1510#define PSSR_BFS (1 << 1) /* Battery Fault Status */
1510#define PSSR_SSS (1 << 0) /* Software Sleep Status */ 1511#define PSSR_SSS (1 << 0) /* Software Sleep Status */
@@ -1965,6 +1966,7 @@
1965#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ 1966#define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
1966#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ 1967#define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */
1967 1968
1969#define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */
1968#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ 1970#define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */
1969#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ 1971#define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */
1970#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ 1972#define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */
diff --git a/include/asm-arm/arch-s3c2410/audio.h b/include/asm-arm/arch-s3c2410/audio.h
new file mode 100644
index 000000000000..0d276e67f2fb
--- /dev/null
+++ b/include/asm-arm/arch-s3c2410/audio.h
@@ -0,0 +1,49 @@
1/* linux/include/asm-arm/arch-s3c2410/audio.h
2 *
3 * (c) 2004-2005 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX - Audio platfrom_device info
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 *
13 * Changelog:
14 * 20-Nov-2004 BJD Created file
15 * 07-Mar-2005 BJD Added suspend/resume calls
16*/
17
18#ifndef __ASM_ARCH_AUDIO_H
19#define __ASM_ARCH_AUDIO_H __FILE__
20
21/* struct s3c24xx_iis_ops
22 *
23 * called from the s3c24xx audio core to deal with the architecture
24 * or the codec's setup and control.
25 *
26 * the pointer to itself is passed through in case the caller wants to
27 * embed this in an larger structure for easy reference to it's context.
28*/
29
30struct s3c24xx_iis_ops {
31 struct module *owner;
32
33 int (*startup)(struct s3c24xx_iis_ops *me);
34 void (*shutdown)(struct s3c24xx_iis_ops *me);
35 int (*suspend)(struct s3c24xx_iis_ops *me);
36 int (*resume)(struct s3c24xx_iis_ops *me);
37
38 int (*open)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm);
39 int (*close)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm);
40 int (*prepare)(struct s3c24xx_iis_ops *me, snd_pcm_substream_t *strm, snd_pcm_runtime_t *rt);
41};
42
43struct s3c24xx_platdata_iis {
44 const char *codec_clk;
45 struct s3c24xx_iis_ops *ops;
46 int (*match_dev)(struct device *dev);
47};
48
49#endif /* __ASM_ARCH_AUDIO_H */
diff --git a/include/asm-arm/arch-s3c2410/regs-iis.h b/include/asm-arm/arch-s3c2410/regs-iis.h
index 385b07d510da..fdd62e8cd6cb 100644
--- a/include/asm-arm/arch-s3c2410/regs-iis.h
+++ b/include/asm-arm/arch-s3c2410/regs-iis.h
@@ -15,6 +15,9 @@
15 * 12-03-2004 BJD Updated include protection 15 * 12-03-2004 BJD Updated include protection
16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL 16 * 07-03-2005 BJD Added FIFO size flags and S3C2440 MPLL
17 * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400 17 * 05-04-2005 LCVR Added IISFCON definitions for the S3C2400
18 * 18-07-2005 DA Change IISCON_MPLL to IISMOD_MPLL
19 * Correct IISMOD_256FS and IISMOD_384FS
20 * Add IISCON_PSCEN
18 */ 21 */
19 22
20#ifndef __ASM_ARCH_REGS_IIS_H 23#ifndef __ASM_ARCH_REGS_IIS_H
@@ -22,7 +25,6 @@
22 25
23#define S3C2410_IISCON (0x00) 26#define S3C2410_IISCON (0x00)
24 27
25#define S3C2440_IISCON_MPLL (1<<9)
26#define S3C2410_IISCON_LRINDEX (1<<8) 28#define S3C2410_IISCON_LRINDEX (1<<8)
27#define S3C2410_IISCON_TXFIFORDY (1<<7) 29#define S3C2410_IISCON_TXFIFORDY (1<<7)
28#define S3C2410_IISCON_RXFIFORDY (1<<6) 30#define S3C2410_IISCON_RXFIFORDY (1<<6)
@@ -30,10 +32,12 @@
30#define S3C2410_IISCON_RXDMAEN (1<<4) 32#define S3C2410_IISCON_RXDMAEN (1<<4)
31#define S3C2410_IISCON_TXIDLE (1<<3) 33#define S3C2410_IISCON_TXIDLE (1<<3)
32#define S3C2410_IISCON_RXIDLE (1<<2) 34#define S3C2410_IISCON_RXIDLE (1<<2)
35#define S3C2410_IISCON_PSCEN (1<<1)
33#define S3C2410_IISCON_IISEN (1<<0) 36#define S3C2410_IISCON_IISEN (1<<0)
34 37
35#define S3C2410_IISMOD (0x04) 38#define S3C2410_IISMOD (0x04)
36 39
40#define S3C2440_IISMOD_MPLL (1<<9)
37#define S3C2410_IISMOD_SLAVE (1<<8) 41#define S3C2410_IISMOD_SLAVE (1<<8)
38#define S3C2410_IISMOD_NOXFER (0<<6) 42#define S3C2410_IISMOD_NOXFER (0<<6)
39#define S3C2410_IISMOD_RXMODE (1<<6) 43#define S3C2410_IISMOD_RXMODE (1<<6)
@@ -46,8 +50,8 @@
46#define S3C2410_IISMOD_8BIT (0<<3) 50#define S3C2410_IISMOD_8BIT (0<<3)
47#define S3C2410_IISMOD_16BIT (1<<3) 51#define S3C2410_IISMOD_16BIT (1<<3)
48#define S3C2410_IISMOD_BITMASK (1<<3) 52#define S3C2410_IISMOD_BITMASK (1<<3)
49#define S3C2410_IISMOD_256FS (0<<1) 53#define S3C2410_IISMOD_256FS (0<<2)
50#define S3C2410_IISMOD_384FS (1<<1) 54#define S3C2410_IISMOD_384FS (1<<2)
51#define S3C2410_IISMOD_16FS (0<<0) 55#define S3C2410_IISMOD_16FS (0<<0)
52#define S3C2410_IISMOD_32FS (1<<0) 56#define S3C2410_IISMOD_32FS (1<<0)
53#define S3C2410_IISMOD_48FS (2<<0) 57#define S3C2410_IISMOD_48FS (2<<0)
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h
index 1cc85a096b23..bd43b566db3e 100644
--- a/include/asm-arm/arch-s3c2410/usb-control.h
+++ b/include/asm-arm/arch-s3c2410/usb-control.h
@@ -12,6 +12,7 @@
12 * Changelog: 12 * Changelog:
13 * 11-Sep-2004 BJD Created file 13 * 11-Sep-2004 BJD Created file
14 * 21-Sep-2004 BJD Updated port info 14 * 21-Sep-2004 BJD Updated port info
15 * 09-Aug-2005 BJD Renamed s3c2410_report_oc s3c2410_usb_report_oc
15*/ 16*/
16 17
17#ifndef __ASM_ARCH_USBCONTROL_H 18#ifndef __ASM_ARCH_USBCONTROL_H
@@ -35,7 +36,7 @@ struct s3c2410_hcd_info {
35 void (*report_oc)(struct s3c2410_hcd_info *, int ports); 36 void (*report_oc)(struct s3c2410_hcd_info *, int ports);
36}; 37};
37 38
38static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports) 39static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports)
39{ 40{
40 if (info->report_oc != NULL) { 41 if (info->report_oc != NULL) {
41 (info->report_oc)(info, ports); 42 (info->report_oc)(info, ports);
diff --git a/include/asm-arm/arch-sa1100/mtd-xip.h b/include/asm-arm/arch-sa1100/mtd-xip.h
new file mode 100644
index 000000000000..80cfdac2b944
--- /dev/null
+++ b/include/asm-arm/arch-sa1100/mtd-xip.h
@@ -0,0 +1,26 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Author: Nicolas Pitre
7 * Created: Nov 2, 2004
8 * Copyright: (C) 2004 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
15 */
16
17#ifndef __ARCH_SA1100_MTD_XIP_H__
18#define __ARCH_SA1100_MTD_XIP_H__
19
20#define xip_irqpending() (ICIP & ICMR)
21
22/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
23#define xip_currtime() (OSCR)
24#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)
25
26#endif /* __ARCH_SA1100_MTD_XIP_H__ */
diff --git a/include/asm-arm/arch-shark/io.h b/include/asm-arm/arch-shark/io.h
index 1e7f26bc2e1d..5e6ed0038b2b 100644
--- a/include/asm-arm/arch-shark/io.h
+++ b/include/asm-arm/arch-shark/io.h
@@ -21,38 +21,8 @@
21 */ 21 */
22#define __PORT_PCIO(x) (!((x) & 0x80000000)) 22#define __PORT_PCIO(x) (!((x) & 0x80000000))
23 23
24/* 24#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
25 * Dynamic IO functions - let the compiler
26 * optimize the expressions
27 */
28#define DECLARE_DYN_OUT(fnsuffix,instr) \
29static inline void __out##fnsuffix (unsigned int value, unsigned int port) \
30{ \
31 unsigned long temp; \
32 __asm__ __volatile__( \
33 "tst %2, #0x80000000\n\t" \
34 "mov %0, %4\n\t" \
35 "addeq %0, %0, %3\n\t" \
36 "str" instr " %1, [%0, %2] @ out" #fnsuffix \
37 : "=&r" (temp) \
38 : "r" (value), "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
39 : "cc"); \
40}
41 25
42#define DECLARE_DYN_IN(sz,fnsuffix,instr) \
43static inline unsigned sz __in##fnsuffix (unsigned int port) \
44{ \
45 unsigned long temp, value; \
46 __asm__ __volatile__( \
47 "tst %2, #0x80000000\n\t" \
48 "mov %0, %4\n\t" \
49 "addeq %0, %0, %3\n\t" \
50 "ldr" instr " %1, [%0, %2] @ in" #fnsuffix \
51 : "=&r" (temp), "=r" (value) \
52 : "r" (port), "Ir" (PCIO_BASE - IO_BASE), "Ir" (IO_BASE) \
53 : "cc"); \
54 return (unsigned sz)value; \
55}
56 26
57static inline unsigned int __ioaddr (unsigned int port) \ 27static inline unsigned int __ioaddr (unsigned int port) \
58{ \ 28{ \
@@ -62,123 +32,8 @@ static inline unsigned int __ioaddr (unsigned int port) \
62 return (unsigned int)(IO_BASE + (port)); \ 32 return (unsigned int)(IO_BASE + (port)); \
63} 33}
64 34
65#define DECLARE_IO(sz,fnsuffix,instr) \
66 DECLARE_DYN_OUT(fnsuffix,instr) \
67 DECLARE_DYN_IN(sz,fnsuffix,instr)
68
69DECLARE_IO(char,b,"b")
70DECLARE_IO(short,w,"h")
71DECLARE_IO(long,l,"")
72
73#undef DECLARE_IO
74#undef DECLARE_DYN_OUT
75#undef DECLARE_DYN_IN
76
77/*
78 * Constant address IO functions
79 *
80 * These have to be macros for the 'J' constraint to work -
81 * +/-4096 immediate operand.
82 */
83#define __outbc(value,port) \
84({ \
85 if (__PORT_PCIO((port))) \
86 __asm__ __volatile__( \
87 "strb %0, [%1, %2] @ outbc" \
88 : : "r" (value), "r" (PCIO_BASE), "Jr" (port)); \
89 else \
90 __asm__ __volatile__( \
91 "strb %0, [%1, %2] @ outbc" \
92 : : "r" (value), "r" (IO_BASE), "r" (port)); \
93})
94
95#define __inbc(port) \
96({ \
97 unsigned char result; \
98 if (__PORT_PCIO((port))) \
99 __asm__ __volatile__( \
100 "ldrb %0, [%1, %2] @ inbc" \
101 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
102 else \
103 __asm__ __volatile__( \
104 "ldrb %0, [%1, %2] @ inbc" \
105 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
106 result; \
107})
108
109#define __outwc(value,port) \
110({ \
111 unsigned long v = value; \
112 if (__PORT_PCIO((port))) \
113 __asm__ __volatile__( \
114 "strh %0, [%1, %2] @ outwc" \
115 : : "r" (v|v<<16), "r" (PCIO_BASE), "Jr" (port)); \
116 else \
117 __asm__ __volatile__( \
118 "strh %0, [%1, %2] @ outwc" \
119 : : "r" (v|v<<16), "r" (IO_BASE), "r" (port)); \
120})
121
122#define __inwc(port) \
123({ \
124 unsigned short result; \
125 if (__PORT_PCIO((port))) \
126 __asm__ __volatile__( \
127 "ldrh %0, [%1, %2] @ inwc" \
128 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
129 else \
130 __asm__ __volatile__( \
131 "ldrh %0, [%1, %2] @ inwc" \
132 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
133 result & 0xffff; \
134})
135
136#define __outlc(value,port) \
137({ \
138 unsigned long v = value; \
139 if (__PORT_PCIO((port))) \
140 __asm__ __volatile__( \
141 "str %0, [%1, %2] @ outlc" \
142 : : "r" (v), "r" (PCIO_BASE), "Jr" (port)); \
143 else \
144 __asm__ __volatile__( \
145 "str %0, [%1, %2] @ outlc" \
146 : : "r" (v), "r" (IO_BASE), "r" (port)); \
147})
148
149#define __inlc(port) \
150({ \
151 unsigned long result; \
152 if (__PORT_PCIO((port))) \
153 __asm__ __volatile__( \
154 "ldr %0, [%1, %2] @ inlc" \
155 : "=r" (result) : "r" (PCIO_BASE), "Jr" (port)); \
156 else \
157 __asm__ __volatile__( \
158 "ldr %0, [%1, %2] @ inlc" \
159 : "=r" (result) : "r" (IO_BASE), "r" (port)); \
160 result; \
161})
162
163#define __ioaddrc(port) \
164({ \
165 unsigned long addr; \
166 if (__PORT_PCIO((port))) \
167 addr = PCIO_BASE + (port); \
168 else \
169 addr = IO_BASE + (port); \
170 addr; \
171})
172
173#define __mem_pci(addr) (addr) 35#define __mem_pci(addr) (addr)
174 36
175#define inb(p) (__builtin_constant_p((p)) ? __inbc(p) : __inb(p))
176#define inw(p) (__builtin_constant_p((p)) ? __inwc(p) : __inw(p))
177#define inl(p) (__builtin_constant_p((p)) ? __inlc(p) : __inl(p))
178#define outb(v,p) (__builtin_constant_p((p)) ? __outbc(v,p) : __outb(v,p))
179#define outw(v,p) (__builtin_constant_p((p)) ? __outwc(v,p) : __outw(v,p))
180#define outl(v,p) (__builtin_constant_p((p)) ? __outlc(v,p) : __outl(v,p))
181
182/* 37/*
183 * Translated address IO functions 38 * Translated address IO functions
184 * 39 *
diff --git a/include/asm-arm/bitops.h b/include/asm-arm/bitops.h
index 4edd4dc40c5b..aad7aad026b3 100644
--- a/include/asm-arm/bitops.h
+++ b/include/asm-arm/bitops.h
@@ -21,8 +21,8 @@
21 21
22#include <asm/system.h> 22#include <asm/system.h>
23 23
24#define smp_mb__before_clear_bit() do { } while (0) 24#define smp_mb__before_clear_bit() mb()
25#define smp_mb__after_clear_bit() do { } while (0) 25#define smp_mb__after_clear_bit() mb()
26 26
27/* 27/*
28 * These functions are the basis of our bit ops. 28 * These functions are the basis of our bit ops.
@@ -229,6 +229,7 @@ extern int _find_next_zero_bit_be(const void * p, int size, int offset);
229extern int _find_first_bit_be(const unsigned long *p, unsigned size); 229extern int _find_first_bit_be(const unsigned long *p, unsigned size);
230extern int _find_next_bit_be(const unsigned long *p, int size, int offset); 230extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
231 231
232#ifndef CONFIG_SMP
232/* 233/*
233 * The __* form of bitops are non-atomic and may be reordered. 234 * The __* form of bitops are non-atomic and may be reordered.
234 */ 235 */
@@ -241,6 +242,10 @@ extern int _find_next_bit_be(const unsigned long *p, int size, int offset);
241 (__builtin_constant_p(nr) ? \ 242 (__builtin_constant_p(nr) ? \
242 ____atomic_##name(nr, p) : \ 243 ____atomic_##name(nr, p) : \
243 _##name##_be(nr,p)) 244 _##name##_be(nr,p))
245#else
246#define ATOMIC_BITOP_LE(name,nr,p) _##name##_le(nr,p)
247#define ATOMIC_BITOP_BE(name,nr,p) _##name##_be(nr,p)
248#endif
244 249
245#define NONATOMIC_BITOP(name,nr,p) \ 250#define NONATOMIC_BITOP(name,nr,p) \
246 (____nonatomic_##name(nr, p)) 251 (____nonatomic_##name(nr, p))
diff --git a/include/asm-arm/bug.h b/include/asm-arm/bug.h
index 24d11672eb60..7fb02138f585 100644
--- a/include/asm-arm/bug.h
+++ b/include/asm-arm/bug.h
@@ -5,7 +5,7 @@
5 5
6#ifdef CONFIG_BUG 6#ifdef CONFIG_BUG
7#ifdef CONFIG_DEBUG_BUGVERBOSE 7#ifdef CONFIG_DEBUG_BUGVERBOSE
8extern volatile void __bug(const char *file, int line, void *data); 8extern void __bug(const char *file, int line, void *data) __attribute__((noreturn));
9 9
10/* give file/line information */ 10/* give file/line information */
11#define BUG() __bug(__FILE__, __LINE__, NULL) 11#define BUG() __bug(__FILE__, __LINE__, NULL)
diff --git a/include/asm-arm/cpu-multi32.h b/include/asm-arm/cpu-multi32.h
index ff48022e4720..4679f63688e9 100644
--- a/include/asm-arm/cpu-multi32.h
+++ b/include/asm-arm/cpu-multi32.h
@@ -31,7 +31,7 @@ extern struct processor {
31 /* 31 /*
32 * Special stuff for a reset 32 * Special stuff for a reset
33 */ 33 */
34 volatile void (*reset)(unsigned long addr); 34 void (*reset)(unsigned long addr) __attribute__((noreturn));
35 /* 35 /*
36 * Idle the processor 36 * Idle the processor
37 */ 37 */
diff --git a/include/asm-arm/cpu-single.h b/include/asm-arm/cpu-single.h
index b5ec5d54665d..6723e67244fa 100644
--- a/include/asm-arm/cpu-single.h
+++ b/include/asm-arm/cpu-single.h
@@ -41,4 +41,4 @@ extern int cpu_do_idle(void);
41extern void cpu_dcache_clean_area(void *, int); 41extern void cpu_dcache_clean_area(void *, int);
42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm); 42extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
43extern void cpu_set_pte(pte_t *ptep, pte_t pte); 43extern void cpu_set_pte(pte_t *ptep, pte_t pte);
44extern volatile void cpu_reset(unsigned long addr); 44extern void cpu_reset(unsigned long addr) __attribute__((noreturn));
diff --git a/include/asm-arm/emergency-restart.h b/include/asm-arm/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-arm/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-arm/hardware/arm_timer.h b/include/asm-arm/hardware/arm_timer.h
new file mode 100644
index 000000000000..04be3bdf46b8
--- /dev/null
+++ b/include/asm-arm/hardware/arm_timer.h
@@ -0,0 +1,21 @@
1#ifndef __ASM_ARM_HARDWARE_ARM_TIMER_H
2#define __ASM_ARM_HARDWARE_ARM_TIMER_H
3
4#define TIMER_LOAD 0x00
5#define TIMER_VALUE 0x04
6#define TIMER_CTRL 0x08
7#define TIMER_CTRL_ONESHOT (1 << 0)
8#define TIMER_CTRL_32BIT (1 << 1)
9#define TIMER_CTRL_DIV1 (0 << 2)
10#define TIMER_CTRL_DIV16 (1 << 2)
11#define TIMER_CTRL_DIV256 (2 << 2)
12#define TIMER_CTRL_IE (1 << 5) /* Interrupt Enable (versatile only) */
13#define TIMER_CTRL_PERIODIC (1 << 6)
14#define TIMER_CTRL_ENABLE (1 << 7)
15
16#define TIMER_INTCLR 0x0c
17#define TIMER_RIS 0x10
18#define TIMER_MIS 0x14
19#define TIMER_BGLOAD 0x18
20
21#endif
diff --git a/include/asm-arm/ide.h b/include/asm-arm/ide.h
index 2114acb3d237..4f68c8a5a199 100644
--- a/include/asm-arm/ide.h
+++ b/include/asm-arm/ide.h
@@ -5,7 +5,7 @@
5 */ 5 */
6 6
7/* 7/*
8 * This file contains the i386 architecture specific IDE code. 8 * This file contains the ARM architecture specific IDE code.
9 */ 9 */
10 10
11#ifndef __ASMARM_IDE_H 11#ifndef __ASMARM_IDE_H
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 08a46302d265..cfa71a0dffb6 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -82,7 +82,7 @@ extern void __readwrite_bug(const char *fn);
82 * only. Their primary purpose is to access PCI and ISA peripherals. 82 * only. Their primary purpose is to access PCI and ISA peripherals.
83 * 83 *
84 * Note that for a big endian machine, this implies that the following 84 * Note that for a big endian machine, this implies that the following
85 * big endian mode connectivity is in place, as described by numerious 85 * big endian mode connectivity is in place, as described by numerous
86 * ARM documents: 86 * ARM documents:
87 * 87 *
88 * PCI: D0-D7 D8-D15 D16-D23 D24-D31 88 * PCI: D0-D7 D8-D15 D16-D23 D24-D31
@@ -275,6 +275,7 @@ extern void __iounmap(void __iomem *addr);
275/* 275/*
276 * io{read,write}{8,16,32} macros 276 * io{read,write}{8,16,32} macros
277 */ 277 */
278#ifndef ioread8
278#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; }) 279#define ioread8(p) ({ unsigned int __v = __raw_readb(p); __v; })
279#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; }) 280#define ioread16(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(p)); __v; })
280#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; }) 281#define ioread32(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(p)); __v; })
@@ -293,6 +294,7 @@ extern void __iounmap(void __iomem *addr);
293 294
294extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 295extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
295extern void ioport_unmap(void __iomem *addr); 296extern void ioport_unmap(void __iomem *addr);
297#endif
296 298
297struct pci_dev; 299struct pci_dev;
298 300
diff --git a/include/asm-arm/locks.h b/include/asm-arm/locks.h
index c26298f3891f..f08dc8447913 100644
--- a/include/asm-arm/locks.h
+++ b/include/asm-arm/locks.h
@@ -28,7 +28,8 @@
28" blmi " #fail \ 28" blmi " #fail \
29 : \ 29 : \
30 : "r" (ptr), "I" (1) \ 30 : "r" (ptr), "I" (1) \
31 : "ip", "lr", "cc", "memory"); \ 31 : "ip", "lr", "cc"); \
32 smp_mb(); \
32 }) 33 })
33 34
34#define __down_op_ret(ptr,fail) \ 35#define __down_op_ret(ptr,fail) \
@@ -48,12 +49,14 @@
48" mov %0, ip" \ 49" mov %0, ip" \
49 : "=&r" (ret) \ 50 : "=&r" (ret) \
50 : "r" (ptr), "I" (1) \ 51 : "r" (ptr), "I" (1) \
51 : "ip", "lr", "cc", "memory"); \ 52 : "ip", "lr", "cc"); \
53 smp_mb(); \
52 ret; \ 54 ret; \
53 }) 55 })
54 56
55#define __up_op(ptr,wake) \ 57#define __up_op(ptr,wake) \
56 ({ \ 58 ({ \
59 smp_mb(); \
57 __asm__ __volatile__( \ 60 __asm__ __volatile__( \
58 "@ up_op\n" \ 61 "@ up_op\n" \
59"1: ldrex lr, [%0]\n" \ 62"1: ldrex lr, [%0]\n" \
@@ -61,12 +64,12 @@
61" strex ip, lr, [%0]\n" \ 64" strex ip, lr, [%0]\n" \
62" teq ip, #0\n" \ 65" teq ip, #0\n" \
63" bne 1b\n" \ 66" bne 1b\n" \
64" teq lr, #0\n" \ 67" cmp lr, #0\n" \
65" movle ip, %0\n" \ 68" movle ip, %0\n" \
66" blle " #wake \ 69" blle " #wake \
67 : \ 70 : \
68 : "r" (ptr), "I" (1) \ 71 : "r" (ptr), "I" (1) \
69 : "ip", "lr", "cc", "memory"); \ 72 : "ip", "lr", "cc"); \
70 }) 73 })
71 74
72/* 75/*
@@ -92,15 +95,17 @@
92" blne " #fail \ 95" blne " #fail \
93 : \ 96 : \
94 : "r" (ptr), "I" (RW_LOCK_BIAS) \ 97 : "r" (ptr), "I" (RW_LOCK_BIAS) \
95 : "ip", "lr", "cc", "memory"); \ 98 : "ip", "lr", "cc"); \
99 smp_mb(); \
96 }) 100 })
97 101
98#define __up_op_write(ptr,wake) \ 102#define __up_op_write(ptr,wake) \
99 ({ \ 103 ({ \
104 smp_mb(); \
100 __asm__ __volatile__( \ 105 __asm__ __volatile__( \
101 "@ up_op_read\n" \ 106 "@ up_op_read\n" \
102"1: ldrex lr, [%0]\n" \ 107"1: ldrex lr, [%0]\n" \
103" add lr, lr, %1\n" \ 108" adds lr, lr, %1\n" \
104" strex ip, lr, [%0]\n" \ 109" strex ip, lr, [%0]\n" \
105" teq ip, #0\n" \ 110" teq ip, #0\n" \
106" bne 1b\n" \ 111" bne 1b\n" \
@@ -108,7 +113,7 @@
108" blcs " #wake \ 113" blcs " #wake \
109 : \ 114 : \
110 : "r" (ptr), "I" (RW_LOCK_BIAS) \ 115 : "r" (ptr), "I" (RW_LOCK_BIAS) \
111 : "ip", "lr", "cc", "memory"); \ 116 : "ip", "lr", "cc"); \
112 }) 117 })
113 118
114#define __down_op_read(ptr,fail) \ 119#define __down_op_read(ptr,fail) \
@@ -116,6 +121,7 @@
116 121
117#define __up_op_read(ptr,wake) \ 122#define __up_op_read(ptr,wake) \
118 ({ \ 123 ({ \
124 smp_mb(); \
119 __asm__ __volatile__( \ 125 __asm__ __volatile__( \
120 "@ up_op_read\n" \ 126 "@ up_op_read\n" \
121"1: ldrex lr, [%0]\n" \ 127"1: ldrex lr, [%0]\n" \
@@ -128,7 +134,7 @@
128" bleq " #wake \ 134" bleq " #wake \
129 : \ 135 : \
130 : "r" (ptr), "I" (1) \ 136 : "r" (ptr), "I" (1) \
131 : "ip", "lr", "cc", "memory"); \ 137 : "ip", "lr", "cc"); \
132 }) 138 })
133 139
134#else 140#else
@@ -148,7 +154,8 @@
148" blmi " #fail \ 154" blmi " #fail \
149 : \ 155 : \
150 : "r" (ptr), "I" (1) \ 156 : "r" (ptr), "I" (1) \
151 : "ip", "lr", "cc", "memory"); \ 157 : "ip", "lr", "cc"); \
158 smp_mb(); \
152 }) 159 })
153 160
154#define __down_op_ret(ptr,fail) \ 161#define __down_op_ret(ptr,fail) \
@@ -169,12 +176,14 @@
169" mov %0, ip" \ 176" mov %0, ip" \
170 : "=&r" (ret) \ 177 : "=&r" (ret) \
171 : "r" (ptr), "I" (1) \ 178 : "r" (ptr), "I" (1) \
172 : "ip", "lr", "cc", "memory"); \ 179 : "ip", "lr", "cc"); \
180 smp_mb(); \
173 ret; \ 181 ret; \
174 }) 182 })
175 183
176#define __up_op(ptr,wake) \ 184#define __up_op(ptr,wake) \
177 ({ \ 185 ({ \
186 smp_mb(); \
178 __asm__ __volatile__( \ 187 __asm__ __volatile__( \
179 "@ up_op\n" \ 188 "@ up_op\n" \
180" mrs ip, cpsr\n" \ 189" mrs ip, cpsr\n" \
@@ -188,7 +197,7 @@
188" blle " #wake \ 197" blle " #wake \
189 : \ 198 : \
190 : "r" (ptr), "I" (1) \ 199 : "r" (ptr), "I" (1) \
191 : "ip", "lr", "cc", "memory"); \ 200 : "ip", "lr", "cc"); \
192 }) 201 })
193 202
194/* 203/*
@@ -215,7 +224,8 @@
215" blne " #fail \ 224" blne " #fail \
216 : \ 225 : \
217 : "r" (ptr), "I" (RW_LOCK_BIAS) \ 226 : "r" (ptr), "I" (RW_LOCK_BIAS) \
218 : "ip", "lr", "cc", "memory"); \ 227 : "ip", "lr", "cc"); \
228 smp_mb(); \
219 }) 229 })
220 230
221#define __up_op_write(ptr,wake) \ 231#define __up_op_write(ptr,wake) \
@@ -233,7 +243,8 @@
233" blcs " #wake \ 243" blcs " #wake \
234 : \ 244 : \
235 : "r" (ptr), "I" (RW_LOCK_BIAS) \ 245 : "r" (ptr), "I" (RW_LOCK_BIAS) \
236 : "ip", "lr", "cc", "memory"); \ 246 : "ip", "lr", "cc"); \
247 smp_mb(); \
237 }) 248 })
238 249
239#define __down_op_read(ptr,fail) \ 250#define __down_op_read(ptr,fail) \
@@ -241,6 +252,7 @@
241 252
242#define __up_op_read(ptr,wake) \ 253#define __up_op_read(ptr,wake) \
243 ({ \ 254 ({ \
255 smp_mb(); \
244 __asm__ __volatile__( \ 256 __asm__ __volatile__( \
245 "@ up_op_read\n" \ 257 "@ up_op_read\n" \
246" mrs ip, cpsr\n" \ 258" mrs ip, cpsr\n" \
@@ -254,7 +266,7 @@
254" bleq " #wake \ 266" bleq " #wake \
255 : \ 267 : \
256 : "r" (ptr), "I" (1) \ 268 : "r" (ptr), "I" (1) \
257 : "ip", "lr", "cc", "memory"); \ 269 : "ip", "lr", "cc"); \
258 }) 270 })
259 271
260#endif 272#endif
diff --git a/include/asm-arm/mach/arch.h b/include/asm-arm/mach/arch.h
index 3a32e929ec8c..56c6bf4ab0c3 100644
--- a/include/asm-arm/mach/arch.h
+++ b/include/asm-arm/mach/arch.h
@@ -26,7 +26,7 @@ struct machine_desc {
26 * page tabe entry */ 26 * page tabe entry */
27 27
28 const char *name; /* architecture name */ 28 const char *name; /* architecture name */
29 unsigned int param_offset; /* parameter page */ 29 unsigned long boot_params; /* tagged list */
30 30
31 unsigned int video_start; /* start of video RAM */ 31 unsigned int video_start; /* start of video RAM */
32 unsigned int video_end; /* end of video RAM */ 32 unsigned int video_end; /* end of video RAM */
@@ -54,38 +54,6 @@ const struct machine_desc __mach_desc_##_type \
54 .nr = MACH_TYPE_##_type, \ 54 .nr = MACH_TYPE_##_type, \
55 .name = _name, 55 .name = _name,
56 56
57#define MAINTAINER(n)
58
59#define BOOT_MEM(_pram,_pio,_vio) \
60 .phys_ram = _pram, \
61 .phys_io = _pio, \
62 .io_pg_offst = ((_vio)>>18)&0xfffc,
63
64#define BOOT_PARAMS(_params) \
65 .param_offset = _params,
66
67#define VIDEO(_start,_end) \
68 .video_start = _start, \
69 .video_end = _end,
70
71#define DISABLE_PARPORT(_n) \
72 .reserve_lp##_n = 1,
73
74#define SOFT_REBOOT \
75 .soft_reboot = 1,
76
77#define FIXUP(_func) \
78 .fixup = _func,
79
80#define MAPIO(_func) \
81 .map_io = _func,
82
83#define INITIRQ(_func) \
84 .init_irq = _func,
85
86#define INIT_MACHINE(_func) \
87 .init_machine = _func,
88
89#define MACHINE_END \ 57#define MACHINE_END \
90}; 58};
91 59
diff --git a/include/asm-arm/mach/time.h b/include/asm-arm/mach/time.h
index 5cf4fd659fd5..2cf279a44017 100644
--- a/include/asm-arm/mach/time.h
+++ b/include/asm-arm/mach/time.h
@@ -39,8 +39,31 @@ struct sys_timer {
39 void (*suspend)(void); 39 void (*suspend)(void);
40 void (*resume)(void); 40 void (*resume)(void);
41 unsigned long (*offset)(void); 41 unsigned long (*offset)(void);
42
43#ifdef CONFIG_NO_IDLE_HZ
44 struct dyn_tick_timer *dyn_tick;
45#endif
46};
47
48#ifdef CONFIG_NO_IDLE_HZ
49
50#define DYN_TICK_SKIPPING (1 << 2)
51#define DYN_TICK_ENABLED (1 << 1)
52#define DYN_TICK_SUITABLE (1 << 0)
53
54struct dyn_tick_timer {
55 unsigned int state; /* Current state */
56 int (*enable)(void); /* Enables dynamic tick */
57 int (*disable)(void); /* Disables dynamic tick */
58 void (*reprogram)(unsigned long); /* Reprograms the timer */
59 int (*handler)(int, void *, struct pt_regs *);
42}; 60};
43 61
62void timer_dyn_reprogram(void);
63#else
64#define timer_dyn_reprogram() do { } while (0)
65#endif
66
44extern struct sys_timer *system_timer; 67extern struct sys_timer *system_timer;
45extern void timer_tick(struct pt_regs *); 68extern void timer_tick(struct pt_regs *);
46 69
diff --git a/include/asm-arm/mtd-xip.h b/include/asm-arm/mtd-xip.h
new file mode 100644
index 000000000000..9eb127cc7db2
--- /dev/null
+++ b/include/asm-arm/mtd-xip.h
@@ -0,0 +1,26 @@
1/*
2 * MTD primitives for XIP support. Architecture specific functions
3 *
4 * Do not include this file directly. It's included from linux/mtd/xip.h
5 *
6 * Author: Nicolas Pitre
7 * Created: Nov 2, 2004
8 * Copyright: (C) 2004 MontaVista Software, Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * $Id: xip.h,v 1.2 2004/12/01 15:49:10 nico Exp $
15 */
16
17#ifndef __ARM_MTD_XIP_H__
18#define __ARM_MTD_XIP_H__
19
20#include <asm/hardware.h>
21#include <asm/arch/mtd-xip.h>
22
23/* fill instruction prefetch */
24#define xip_iprefetch() do { asm volatile (".rep 8; nop; .endr"); } while (0)
25
26#endif /* __ARM_MTD_XIP_H__ */
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index 40ffaefbeb1a..38ea5899a580 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -14,7 +14,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
14 /* No special bus mastering setup handling */ 14 /* No special bus mastering setup handling */
15} 15}
16 16
17static inline void pcibios_penalize_isa_irq(int irq) 17static inline void pcibios_penalize_isa_irq(int irq, int active)
18{ 18{
19 /* We don't do dynamic PCI IRQ allocation */ 19 /* We don't do dynamic PCI IRQ allocation */
20} 20}
@@ -42,6 +42,16 @@ static inline void pcibios_penalize_isa_irq(int irq)
42#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME) 42#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
43#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL)) 43#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
44 44
45#ifdef CONFIG_PCI
46static inline void pci_dma_burst_advice(struct pci_dev *pdev,
47 enum pci_dma_burst_strategy *strat,
48 unsigned long *strategy_parameter)
49{
50 *strat = PCI_DMA_BURST_INFINITY;
51 *strategy_parameter = ~0UL;
52}
53#endif
54
45#define HAVE_PCI_MMAP 55#define HAVE_PCI_MMAP
46extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 56extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
47 enum pci_mmap_state mmap_state, int write_combine); 57 enum pci_mmap_state mmap_state, int write_combine);
@@ -50,6 +60,10 @@ extern void
50pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 60pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
51 struct resource *res); 61 struct resource *res);
52 62
63extern void
64pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
65 struct pci_bus_region *region);
66
53static inline void pcibios_add_platform_entries(struct pci_dev *dev) 67static inline void pcibios_add_platform_entries(struct pci_dev *dev)
54{ 68{
55} 69}
diff --git a/include/asm-arm/pgalloc.h b/include/asm-arm/pgalloc.h
index e814f8144f8b..bc18ff405181 100644
--- a/include/asm-arm/pgalloc.h
+++ b/include/asm-arm/pgalloc.h
@@ -89,6 +89,13 @@ static inline void pte_free(struct page *pte)
89 __free_page(pte); 89 __free_page(pte);
90} 90}
91 91
92static inline void __pmd_populate(pmd_t *pmdp, unsigned long pmdval)
93{
94 pmdp[0] = __pmd(pmdval);
95 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
96 flush_pmd_entry(pmdp);
97}
98
92/* 99/*
93 * Populate the pmdp entry with a pointer to the pte. This pmd is part 100 * Populate the pmdp entry with a pointer to the pte. This pmd is part
94 * of the mm address space. 101 * of the mm address space.
@@ -99,32 +106,19 @@ static inline void
99pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep) 106pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *ptep)
100{ 107{
101 unsigned long pte_ptr = (unsigned long)ptep; 108 unsigned long pte_ptr = (unsigned long)ptep;
102 unsigned long pmdval;
103
104 BUG_ON(mm != &init_mm);
105 109
106 /* 110 /*
107 * The pmd must be loaded with the physical 111 * The pmd must be loaded with the physical
108 * address of the PTE table 112 * address of the PTE table
109 */ 113 */
110 pte_ptr -= PTRS_PER_PTE * sizeof(void *); 114 pte_ptr -= PTRS_PER_PTE * sizeof(void *);
111 pmdval = __pa(pte_ptr) | _PAGE_KERNEL_TABLE; 115 __pmd_populate(pmdp, __pa(pte_ptr) | _PAGE_KERNEL_TABLE);
112 pmdp[0] = __pmd(pmdval);
113 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
114 flush_pmd_entry(pmdp);
115} 116}
116 117
117static inline void 118static inline void
118pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep) 119pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *ptep)
119{ 120{
120 unsigned long pmdval; 121 __pmd_populate(pmdp, page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE);
121
122 BUG_ON(mm == &init_mm);
123
124 pmdval = page_to_pfn(ptep) << PAGE_SHIFT | _PAGE_USER_TABLE;
125 pmdp[0] = __pmd(pmdval);
126 pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
127 flush_pmd_entry(pmdp);
128} 122}
129 123
130#endif 124#endif
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h
index a9892eb42a23..478c49b56e18 100644
--- a/include/asm-arm/pgtable.h
+++ b/include/asm-arm/pgtable.h
@@ -188,12 +188,18 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
188/* 188/*
189 * - extended small page/tiny page 189 * - extended small page/tiny page
190 */ 190 */
191#define PTE_EXT_XN (1 << 0) /* v6 */
191#define PTE_EXT_AP_MASK (3 << 4) 192#define PTE_EXT_AP_MASK (3 << 4)
193#define PTE_EXT_AP0 (1 << 4)
194#define PTE_EXT_AP1 (2 << 4)
192#define PTE_EXT_AP_UNO_SRO (0 << 4) 195#define PTE_EXT_AP_UNO_SRO (0 << 4)
193#define PTE_EXT_AP_UNO_SRW (1 << 4) 196#define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0)
194#define PTE_EXT_AP_URO_SRW (2 << 4) 197#define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1)
195#define PTE_EXT_AP_URW_SRW (3 << 4) 198#define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0)
196#define PTE_EXT_TEX(x) ((x) << 6) /* v5 */ 199#define PTE_EXT_TEX(x) ((x) << 6) /* v5 */
200#define PTE_EXT_APX (1 << 9) /* v6 */
201#define PTE_EXT_SHARED (1 << 10) /* v6 */
202#define PTE_EXT_NG (1 << 11) /* v6 */
197 203
198/* 204/*
199 * - small page 205 * - small page
@@ -224,6 +230,8 @@ extern void __pgd_error(const char *file, int line, unsigned long val);
224#define L_PTE_WRITE (1 << 5) 230#define L_PTE_WRITE (1 << 5)
225#define L_PTE_EXEC (1 << 6) 231#define L_PTE_EXEC (1 << 6)
226#define L_PTE_DIRTY (1 << 7) 232#define L_PTE_DIRTY (1 << 7)
233#define L_PTE_SHARED (1 << 10) /* shared between CPUs (v6) */
234#define L_PTE_ASID (1 << 11) /* non-global (use ASID, v6) */
227 235
228#ifndef __ASSEMBLY__ 236#ifndef __ASSEMBLY__
229 237
diff --git a/include/asm-arm/signal.h b/include/asm-arm/signal.h
index 46e69ae395af..760f6e65af05 100644
--- a/include/asm-arm/signal.h
+++ b/include/asm-arm/signal.h
@@ -114,6 +114,7 @@ typedef unsigned long sigset_t;
114#define SIGSTKSZ 8192 114#define SIGSTKSZ 8192
115 115
116#ifdef __KERNEL__ 116#ifdef __KERNEL__
117#define SA_TIMER 0x40000000
117#define SA_IRQNOMASK 0x08000000 118#define SA_IRQNOMASK 0x08000000
118#endif 119#endif
119 120
diff --git a/include/asm-arm/smp.h b/include/asm-arm/smp.h
index 6c6c60adbbaa..dbb4d859c586 100644
--- a/include/asm-arm/smp.h
+++ b/include/asm-arm/smp.h
@@ -23,9 +23,6 @@
23 23
24#define raw_smp_processor_id() (current_thread_info()->cpu) 24#define raw_smp_processor_id() (current_thread_info()->cpu)
25 25
26extern cpumask_t cpu_present_mask;
27#define cpu_possible_map cpu_present_mask
28
29/* 26/*
30 * at the moment, there's not a big penalty for changing CPUs 27 * at the moment, there's not a big penalty for changing CPUs
31 * (the >big< penalty is running SMP in the first place) 28 * (the >big< penalty is running SMP in the first place)
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h
index 182323619caa..1f906d09b688 100644
--- a/include/asm-arm/spinlock.h
+++ b/include/asm-arm/spinlock.h
@@ -8,9 +8,10 @@
8/* 8/*
9 * ARMv6 Spin-locking. 9 * ARMv6 Spin-locking.
10 * 10 *
11 * We (exclusively) read the old value, and decrement it. If it 11 * We exclusively read the old value. If it is zero, we may have
12 * hits zero, we may have won the lock, so we try (exclusively) 12 * won the lock, so we try exclusively storing it. A memory barrier
13 * storing it. 13 * is required after we get a lock, and before we release it, because
14 * V6 CPUs are assumed to have weakly ordered memory.
14 * 15 *
15 * Unlocked value: 0 16 * Unlocked value: 0
16 * Locked value: 1 17 * Locked value: 1
@@ -41,7 +42,9 @@ static inline void _raw_spin_lock(spinlock_t *lock)
41" bne 1b" 42" bne 1b"
42 : "=&r" (tmp) 43 : "=&r" (tmp)
43 : "r" (&lock->lock), "r" (1) 44 : "r" (&lock->lock), "r" (1)
44 : "cc", "memory"); 45 : "cc");
46
47 smp_mb();
45} 48}
46 49
47static inline int _raw_spin_trylock(spinlock_t *lock) 50static inline int _raw_spin_trylock(spinlock_t *lock)
@@ -54,18 +57,25 @@ static inline int _raw_spin_trylock(spinlock_t *lock)
54" strexeq %0, %2, [%1]" 57" strexeq %0, %2, [%1]"
55 : "=&r" (tmp) 58 : "=&r" (tmp)
56 : "r" (&lock->lock), "r" (1) 59 : "r" (&lock->lock), "r" (1)
57 : "cc", "memory"); 60 : "cc");
58 61
59 return tmp == 0; 62 if (tmp == 0) {
63 smp_mb();
64 return 1;
65 } else {
66 return 0;
67 }
60} 68}
61 69
62static inline void _raw_spin_unlock(spinlock_t *lock) 70static inline void _raw_spin_unlock(spinlock_t *lock)
63{ 71{
72 smp_mb();
73
64 __asm__ __volatile__( 74 __asm__ __volatile__(
65" str %1, [%0]" 75" str %1, [%0]"
66 : 76 :
67 : "r" (&lock->lock), "r" (0) 77 : "r" (&lock->lock), "r" (0)
68 : "cc", "memory"); 78 : "cc");
69} 79}
70 80
71/* 81/*
@@ -79,7 +89,8 @@ typedef struct {
79} rwlock_t; 89} rwlock_t;
80 90
81#define RW_LOCK_UNLOCKED (rwlock_t) { 0 } 91#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
82#define rwlock_init(x) do { *(x) + RW_LOCK_UNLOCKED; } while (0) 92#define rwlock_init(x) do { *(x) = RW_LOCK_UNLOCKED; } while (0)
93#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0)
83 94
84/* 95/*
85 * Write locks are easy - we just set bit 31. When unlocking, we can 96 * Write locks are easy - we just set bit 31. When unlocking, we can
@@ -97,16 +108,40 @@ static inline void _raw_write_lock(rwlock_t *rw)
97" bne 1b" 108" bne 1b"
98 : "=&r" (tmp) 109 : "=&r" (tmp)
99 : "r" (&rw->lock), "r" (0x80000000) 110 : "r" (&rw->lock), "r" (0x80000000)
100 : "cc", "memory"); 111 : "cc");
112
113 smp_mb();
114}
115
116static inline int _raw_write_trylock(rwlock_t *rw)
117{
118 unsigned long tmp;
119
120 __asm__ __volatile__(
121"1: ldrex %0, [%1]\n"
122" teq %0, #0\n"
123" strexeq %0, %2, [%1]"
124 : "=&r" (tmp)
125 : "r" (&rw->lock), "r" (0x80000000)
126 : "cc");
127
128 if (tmp == 0) {
129 smp_mb();
130 return 1;
131 } else {
132 return 0;
133 }
101} 134}
102 135
103static inline void _raw_write_unlock(rwlock_t *rw) 136static inline void _raw_write_unlock(rwlock_t *rw)
104{ 137{
138 smp_mb();
139
105 __asm__ __volatile__( 140 __asm__ __volatile__(
106 "str %1, [%0]" 141 "str %1, [%0]"
107 : 142 :
108 : "r" (&rw->lock), "r" (0) 143 : "r" (&rw->lock), "r" (0)
109 : "cc", "memory"); 144 : "cc");
110} 145}
111 146
112/* 147/*
@@ -133,11 +168,17 @@ static inline void _raw_read_lock(rwlock_t *rw)
133" bmi 1b" 168" bmi 1b"
134 : "=&r" (tmp), "=&r" (tmp2) 169 : "=&r" (tmp), "=&r" (tmp2)
135 : "r" (&rw->lock) 170 : "r" (&rw->lock)
136 : "cc", "memory"); 171 : "cc");
172
173 smp_mb();
137} 174}
138 175
139static inline void _raw_read_unlock(rwlock_t *rw) 176static inline void _raw_read_unlock(rwlock_t *rw)
140{ 177{
178 unsigned long tmp, tmp2;
179
180 smp_mb();
181
141 __asm__ __volatile__( 182 __asm__ __volatile__(
142"1: ldrex %0, [%2]\n" 183"1: ldrex %0, [%2]\n"
143" sub %0, %0, #1\n" 184" sub %0, %0, #1\n"
@@ -146,24 +187,9 @@ static inline void _raw_read_unlock(rwlock_t *rw)
146" bne 1b" 187" bne 1b"
147 : "=&r" (tmp), "=&r" (tmp2) 188 : "=&r" (tmp), "=&r" (tmp2)
148 : "r" (&rw->lock) 189 : "r" (&rw->lock)
149 : "cc", "memory"); 190 : "cc");
150} 191}
151 192
152#define _raw_read_trylock(lock) generic_raw_read_trylock(lock) 193#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
153 194
154static inline int _raw_write_trylock(rwlock_t *rw)
155{
156 unsigned long tmp;
157
158 __asm__ __volatile__(
159"1: ldrex %0, [%1]\n"
160" teq %0, #0\n"
161" strexeq %0, %2, [%1]"
162 : "=&r" (tmp)
163 : "r" (&rw->lock), "r" (0x80000000)
164 : "cc", "memory");
165
166 return tmp == 0;
167}
168
169#endif /* __ASM_SPINLOCK_H */ 195#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-arm/stat.h b/include/asm-arm/stat.h
index ca8e7a8436da..ec4e2c2e3b47 100644
--- a/include/asm-arm/stat.h
+++ b/include/asm-arm/stat.h
@@ -89,6 +89,6 @@ struct stat64 {
89 unsigned long st_ctime_nsec; 89 unsigned long st_ctime_nsec;
90 90
91 unsigned long long st_ino; 91 unsigned long long st_ino;
92}; 92} __attribute__((packed));
93 93
94#endif 94#endif
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 39dd7008013c..8efa4ebdcacb 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -85,7 +85,9 @@ struct pt_regs;
85void die(const char *msg, struct pt_regs *regs, int err) 85void die(const char *msg, struct pt_regs *regs, int err)
86 __attribute__((noreturn)); 86 __attribute__((noreturn));
87 87
88void die_if_kernel(const char *str, struct pt_regs *regs, int err); 88struct siginfo;
89void notify_die(const char *str, struct pt_regs *regs, struct siginfo *info,
90 unsigned long err, unsigned long trap);
89 91
90void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int, 92void hook_fault_code(int nr, int (*fn)(unsigned long, unsigned int,
91 struct pt_regs *), 93 struct pt_regs *),
@@ -137,7 +139,12 @@ extern unsigned int user_debug;
137#define vectors_high() (0) 139#define vectors_high() (0)
138#endif 140#endif
139 141
142#if __LINUX_ARM_ARCH__ >= 6
143#define mb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
144 : : "r" (0) : "memory")
145#else
140#define mb() __asm__ __volatile__ ("" : : : "memory") 146#define mb() __asm__ __volatile__ ("" : : : "memory")
147#endif
141#define rmb() mb() 148#define rmb() mb()
142#define wmb() mb() 149#define wmb() mb()
143#define read_barrier_depends() do { } while(0) 150#define read_barrier_depends() do { } while(0)
@@ -145,34 +152,12 @@ extern unsigned int user_debug;
145#define set_wmb(var, value) do { var = value; wmb(); } while (0) 152#define set_wmb(var, value) do { var = value; wmb(); } while (0)
146#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); 153#define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t");
147 154
148#ifdef CONFIG_SMP
149/*
150 * Define our own context switch locking. This allows us to enable
151 * interrupts over the context switch, otherwise we end up with high
152 * interrupt latency. The real problem area is switch_mm() which may
153 * do a full cache flush.
154 */
155#define prepare_arch_switch(rq,next) \
156do { \
157 spin_lock(&(next)->switch_lock); \
158 spin_unlock_irq(&(rq)->lock); \
159} while (0)
160
161#define finish_arch_switch(rq,prev) \
162 spin_unlock(&(prev)->switch_lock)
163
164#define task_running(rq,p) \
165 ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
166#else
167/* 155/*
168 * Our UP-case is more simple, but we assume knowledge of how 156 * switch_mm() may do a full cache flush over the context switch,
169 * spin_unlock_irq() and friends are implemented. This avoids 157 * so enable interrupts over the context switch to avoid high
170 * us needlessly decrementing and incrementing the preempt count. 158 * latency.
171 */ 159 */
172#define prepare_arch_switch(rq,next) local_irq_enable() 160#define __ARCH_WANT_INTERRUPTS_ON_CTXSW
173#define finish_arch_switch(rq,prev) spin_unlock(&(rq)->lock)
174#define task_running(rq,p) ((rq)->curr == (p))
175#endif
176 161
177/* 162/*
178 * switch_to(prev, next) should switch from task `prev' to `next' 163 * switch_to(prev, next) should switch from task `prev' to `next'
@@ -312,7 +297,6 @@ do { \
312}) 297})
313 298
314#ifdef CONFIG_SMP 299#ifdef CONFIG_SMP
315#error SMP not supported
316 300
317#define smp_mb() mb() 301#define smp_mb() mb()
318#define smp_rmb() rmb() 302#define smp_rmb() rmb()
@@ -326,6 +310,8 @@ do { \
326#define smp_wmb() barrier() 310#define smp_wmb() barrier()
327#define smp_read_barrier_depends() do { } while(0) 311#define smp_read_barrier_depends() do { } while(0)
328 312
313#endif /* CONFIG_SMP */
314
329#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) 315#if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
330/* 316/*
331 * On the StrongARM, "swp" is terminally broken since it bypasses the 317 * On the StrongARM, "swp" is terminally broken since it bypasses the
@@ -338,6 +324,9 @@ do { \
338 * 324 *
339 * We choose (1) since its the "easiest" to achieve here and is not 325 * We choose (1) since its the "easiest" to achieve here and is not
340 * dependent on the processor type. 326 * dependent on the processor type.
327 *
328 * NOTE that this solution won't work on an SMP system, so explcitly
329 * forbid it here.
341 */ 330 */
342#define swp_is_buggy 331#define swp_is_buggy
343#endif 332#endif
@@ -349,42 +338,73 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size
349#ifdef swp_is_buggy 338#ifdef swp_is_buggy
350 unsigned long flags; 339 unsigned long flags;
351#endif 340#endif
341#if __LINUX_ARM_ARCH__ >= 6
342 unsigned int tmp;
343#endif
352 344
353 switch (size) { 345 switch (size) {
354#ifdef swp_is_buggy 346#if __LINUX_ARM_ARCH__ >= 6
355 case 1: 347 case 1:
356 local_irq_save(flags); 348 asm volatile("@ __xchg1\n"
357 ret = *(volatile unsigned char *)ptr; 349 "1: ldrexb %0, [%3]\n"
358 *(volatile unsigned char *)ptr = x; 350 " strexb %1, %2, [%3]\n"
359 local_irq_restore(flags); 351 " teq %1, #0\n"
360 break; 352 " bne 1b"
361 353 : "=&r" (ret), "=&r" (tmp)
362 case 4: 354 : "r" (x), "r" (ptr)
363 local_irq_save(flags); 355 : "memory", "cc");
364 ret = *(volatile unsigned long *)ptr; 356 break;
365 *(volatile unsigned long *)ptr = x; 357 case 4:
366 local_irq_restore(flags); 358 asm volatile("@ __xchg4\n"
367 break; 359 "1: ldrex %0, [%3]\n"
360 " strex %1, %2, [%3]\n"
361 " teq %1, #0\n"
362 " bne 1b"
363 : "=&r" (ret), "=&r" (tmp)
364 : "r" (x), "r" (ptr)
365 : "memory", "cc");
366 break;
367#elif defined(swp_is_buggy)
368#ifdef CONFIG_SMP
369#error SMP is not supported on this platform
370#endif
371 case 1:
372 local_irq_save(flags);
373 ret = *(volatile unsigned char *)ptr;
374 *(volatile unsigned char *)ptr = x;
375 local_irq_restore(flags);
376 break;
377
378 case 4:
379 local_irq_save(flags);
380 ret = *(volatile unsigned long *)ptr;
381 *(volatile unsigned long *)ptr = x;
382 local_irq_restore(flags);
383 break;
368#else 384#else
369 case 1: __asm__ __volatile__ ("swpb %0, %1, [%2]" 385 case 1:
370 : "=&r" (ret) 386 asm volatile("@ __xchg1\n"
371 : "r" (x), "r" (ptr) 387 " swpb %0, %1, [%2]"
372 : "memory", "cc"); 388 : "=&r" (ret)
373 break; 389 : "r" (x), "r" (ptr)
374 case 4: __asm__ __volatile__ ("swp %0, %1, [%2]" 390 : "memory", "cc");
375 : "=&r" (ret) 391 break;
376 : "r" (x), "r" (ptr) 392 case 4:
377 : "memory", "cc"); 393 asm volatile("@ __xchg4\n"
378 break; 394 " swp %0, %1, [%2]"
395 : "=&r" (ret)
396 : "r" (x), "r" (ptr)
397 : "memory", "cc");
398 break;
379#endif 399#endif
380 default: __bad_xchg(ptr, size), ret = 0; 400 default:
401 __bad_xchg(ptr, size), ret = 0;
402 break;
381 } 403 }
382 404
383 return ret; 405 return ret;
384} 406}
385 407
386#endif /* CONFIG_SMP */
387
388#endif /* __ASSEMBLY__ */ 408#endif /* __ASSEMBLY__ */
389 409
390#define arch_align_stack(x) (x) 410#define arch_align_stack(x) (x)
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 66c585c50cf9..8252a4cd860f 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -49,7 +49,7 @@ struct cpu_context_save {
49 */ 49 */
50struct thread_info { 50struct thread_info {
51 unsigned long flags; /* low level flags */ 51 unsigned long flags; /* low level flags */
52 __s32 preempt_count; /* 0 => preemptable, <0 => bug */ 52 int preempt_count; /* 0 => preemptable, <0 => bug */
53 mm_segment_t addr_limit; /* address limit */ 53 mm_segment_t addr_limit; /* address limit */
54 struct task_struct *task; /* main task structure */ 54 struct task_struct *task; /* main task structure */
55 struct exec_domain *exec_domain; /* execution domain */ 55 struct exec_domain *exec_domain; /* execution domain */
diff --git a/include/asm-arm/tlbflush.h b/include/asm-arm/tlbflush.h
index 8a864b118569..9387a5e1ffe0 100644
--- a/include/asm-arm/tlbflush.h
+++ b/include/asm-arm/tlbflush.h
@@ -235,7 +235,7 @@ extern struct cpu_tlb_fns cpu_tlb;
235 235
236#define tlb_flag(f) ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f))) 236#define tlb_flag(f) ((always_tlb_flags & (f)) || (__tlb_flag & possible_tlb_flags & (f)))
237 237
238static inline void flush_tlb_all(void) 238static inline void local_flush_tlb_all(void)
239{ 239{
240 const int zero = 0; 240 const int zero = 0;
241 const unsigned int __tlb_flag = __cpu_tlb_flags; 241 const unsigned int __tlb_flag = __cpu_tlb_flags;
@@ -253,7 +253,7 @@ static inline void flush_tlb_all(void)
253 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero)); 253 asm("mcr%? p15, 0, %0, c8, c5, 0" : : "r" (zero));
254} 254}
255 255
256static inline void flush_tlb_mm(struct mm_struct *mm) 256static inline void local_flush_tlb_mm(struct mm_struct *mm)
257{ 257{
258 const int zero = 0; 258 const int zero = 0;
259 const int asid = ASID(mm); 259 const int asid = ASID(mm);
@@ -282,7 +282,7 @@ static inline void flush_tlb_mm(struct mm_struct *mm)
282} 282}
283 283
284static inline void 284static inline void
285flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) 285local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
286{ 286{
287 const int zero = 0; 287 const int zero = 0;
288 const unsigned int __tlb_flag = __cpu_tlb_flags; 288 const unsigned int __tlb_flag = __cpu_tlb_flags;
@@ -313,7 +313,7 @@ flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
313 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr)); 313 asm("mcr%? p15, 0, %0, c8, c5, 1" : : "r" (uaddr));
314} 314}
315 315
316static inline void flush_tlb_kernel_page(unsigned long kaddr) 316static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
317{ 317{
318 const int zero = 0; 318 const int zero = 0;
319 const unsigned int __tlb_flag = __cpu_tlb_flags; 319 const unsigned int __tlb_flag = __cpu_tlb_flags;
@@ -384,8 +384,24 @@ static inline void clean_pmd_entry(pmd_t *pmd)
384/* 384/*
385 * Convert calls to our calling convention. 385 * Convert calls to our calling convention.
386 */ 386 */
387#define flush_tlb_range(vma,start,end) __cpu_flush_user_tlb_range(start,end,vma) 387#define local_flush_tlb_range(vma,start,end) __cpu_flush_user_tlb_range(start,end,vma)
388#define flush_tlb_kernel_range(s,e) __cpu_flush_kern_tlb_range(s,e) 388#define local_flush_tlb_kernel_range(s,e) __cpu_flush_kern_tlb_range(s,e)
389
390#ifndef CONFIG_SMP
391#define flush_tlb_all local_flush_tlb_all
392#define flush_tlb_mm local_flush_tlb_mm
393#define flush_tlb_page local_flush_tlb_page
394#define flush_tlb_kernel_page local_flush_tlb_kernel_page
395#define flush_tlb_range local_flush_tlb_range
396#define flush_tlb_kernel_range local_flush_tlb_kernel_range
397#else
398extern void flush_tlb_all(void);
399extern void flush_tlb_mm(struct mm_struct *mm);
400extern void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr);
401extern void flush_tlb_kernel_page(unsigned long kaddr);
402extern void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned long end);
403extern void flush_tlb_kernel_range(unsigned long start, unsigned long end);
404#endif
389 405
390/* 406/*
391 * if PG_dcache_dirty is set for the page, we need to ensure that any 407 * if PG_dcache_dirty is set for the page, we need to ensure that any
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index ace27480886e..abb36e54c966 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -350,6 +350,11 @@
350#endif 350#endif
351 351
352#define __NR_vserver (__NR_SYSCALL_BASE+313) 352#define __NR_vserver (__NR_SYSCALL_BASE+313)
353#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
354#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
355#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
356#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
357#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
353 358
354/* 359/*
355 * The following SWIs are ARM private. 360 * The following SWIs are ARM private.
diff --git a/include/asm-arm26/emergency-restart.h b/include/asm-arm26/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-arm26/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-arm26/serial.h b/include/asm-arm26/serial.h
index 21e1df31f086..5fc747d1b501 100644
--- a/include/asm-arm26/serial.h
+++ b/include/asm-arm26/serial.h
@@ -30,34 +30,16 @@
30#if defined(CONFIG_ARCH_A5K) 30#if defined(CONFIG_ARCH_A5K)
31 /* UART CLK PORT IRQ FLAGS */ 31 /* UART CLK PORT IRQ FLAGS */
32 32
33#define STD_SERIAL_PORT_DEFNS \ 33#define SERIAL_PORT_DFNS \
34 { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \ 34 { 0, BASE_BAUD, 0x3F8, 10, STD_COM_FLAGS }, /* ttyS0 */ \
35 { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */ 35 { 0, BASE_BAUD, 0x2F8, 10, STD_COM_FLAGS }, /* ttyS1 */
36 36
37#else 37#else
38 38
39#define STD_SERIAL_PORT_DEFNS \ 39#define SERIAL_PORT_DFNS \
40 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \ 40 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS0 */ \
41 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */ 41 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS1 */
42 42
43#endif 43#endif
44 44
45#define EXTRA_SERIAL_PORT_DEFNS \
46 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS2 */ \
47 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS3 */ \
48 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS4 */ \
49 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS5 */ \
50 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS6 */ \
51 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS7 */ \
52 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS8 */ \
53 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS9 */ \
54 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS10 */ \
55 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS11 */ \
56 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS12 */ \
57 { 0, BASE_BAUD, 0 , 0, STD_COM_FLAGS }, /* ttyS13 */
58
59#define SERIAL_PORT_DFNS \
60 STD_SERIAL_PORT_DEFNS \
61 EXTRA_SERIAL_PORT_DEFNS
62
63#endif 45#endif
diff --git a/include/asm-arm26/thread_info.h b/include/asm-arm26/thread_info.h
index 50f41b50268a..aff3e5699c64 100644
--- a/include/asm-arm26/thread_info.h
+++ b/include/asm-arm26/thread_info.h
@@ -44,7 +44,7 @@ struct cpu_context_save {
44 */ 44 */
45struct thread_info { 45struct thread_info {
46 unsigned long flags; /* low level flags */ 46 unsigned long flags; /* low level flags */
47 __s32 preempt_count; /* 0 => preemptable, <0 => bug */ 47 int preempt_count; /* 0 => preemptable, <0 => bug */
48 mm_segment_t addr_limit; /* address limit */ 48 mm_segment_t addr_limit; /* address limit */
49 struct task_struct *task; /* main task structure */ 49 struct task_struct *task; /* main task structure */
50 struct exec_domain *exec_domain; /* execution domain */ 50 struct exec_domain *exec_domain; /* execution domain */
diff --git a/include/asm-cris/arch-v10/atomic.h b/include/asm-cris/arch-v10/atomic.h
new file mode 100644
index 000000000000..6ef5e7d09024
--- /dev/null
+++ b/include/asm-cris/arch-v10/atomic.h
@@ -0,0 +1,7 @@
1#ifndef __ASM_CRIS_ARCH_ATOMIC__
2#define __ASM_CRIS_ARCH_ATOMIC__
3
4#define cris_atomic_save(addr, flags) local_irq_save(flags);
5#define cris_atomic_restore(addr, flags) local_irq_restore(flags);
6
7#endif
diff --git a/include/asm-cris/arch-v10/bitops.h b/include/asm-cris/arch-v10/bitops.h
index 21b7ae8c9bb3..b73f5396e5a6 100644
--- a/include/asm-cris/arch-v10/bitops.h
+++ b/include/asm-cris/arch-v10/bitops.h
@@ -51,7 +51,7 @@ extern inline unsigned long ffz(unsigned long w)
51 * 51 *
52 * Undefined if no bit exists, so code should check against 0 first. 52 * Undefined if no bit exists, so code should check against 0 first.
53 */ 53 */
54extern __inline__ unsigned long __ffs(unsigned long word) 54extern inline unsigned long __ffs(unsigned long word)
55{ 55{
56 return cris_swapnwbrlz(~word); 56 return cris_swapnwbrlz(~word);
57} 57}
diff --git a/include/asm-cris/arch-v10/dma.h b/include/asm-cris/arch-v10/dma.h
index 9e078b9bc934..ecb9dba6fa4f 100644
--- a/include/asm-cris/arch-v10/dma.h
+++ b/include/asm-cris/arch-v10/dma.h
@@ -44,3 +44,31 @@
44#define USB_RX_DMA_NBR 9 44#define USB_RX_DMA_NBR 9
45 45
46#endif 46#endif
47
48enum dma_owner
49{
50 dma_eth,
51 dma_ser0,
52 dma_ser1, /* Async and sync */
53 dma_ser2,
54 dma_ser3, /* Async and sync */
55 dma_ata,
56 dma_par0,
57 dma_par1,
58 dma_ext0,
59 dma_ext1,
60 dma_int6,
61 dma_int7,
62 dma_usb,
63 dma_scsi0,
64 dma_scsi1
65};
66
67/* Masks used by cris_request_dma options: */
68#define DMA_VERBOSE_ON_ERROR (1<<0)
69#define DMA_PANIC_ON_ERROR ((1<<1)|DMA_VERBOSE_ON_ERROR)
70
71int cris_request_dma(unsigned int dmanr, const char * device_id,
72 unsigned options, enum dma_owner owner);
73
74void cris_free_dma(unsigned int dmanr, const char * device_id);
diff --git a/include/asm-cris/arch-v10/elf.h b/include/asm-cris/arch-v10/elf.h
index 2a2201ca538e..1c38ee728b17 100644
--- a/include/asm-cris/arch-v10/elf.h
+++ b/include/asm-cris/arch-v10/elf.h
@@ -1,6 +1,16 @@
1#ifndef __ASMCRIS_ARCH_ELF_H 1#ifndef __ASMCRIS_ARCH_ELF_H
2#define __ASMCRIS_ARCH_ELF_H 2#define __ASMCRIS_ARCH_ELF_H
3 3
4#define ELF_MACH EF_CRIS_VARIANT_ANY_V0_V10
5
6/*
7 * This is used to ensure we don't load something for the wrong architecture.
8 */
9#define elf_check_arch(x) \
10 ((x)->e_machine == EM_CRIS \
11 && ((((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_ANY_V0_V10 \
12 || (((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_COMMON_V10_V32))))
13
4/* 14/*
5 * ELF register definitions.. 15 * ELF register definitions..
6 */ 16 */
diff --git a/include/asm-cris/arch-v10/ide.h b/include/asm-cris/arch-v10/ide.h
new file mode 100644
index 000000000000..8cf2d7cb22ac
--- /dev/null
+++ b/include/asm-cris/arch-v10/ide.h
@@ -0,0 +1,99 @@
1/*
2 * linux/include/asm-cris/ide.h
3 *
4 * Copyright (C) 2000, 2001, 2002 Axis Communications AB
5 *
6 * Authors: Bjorn Wesen
7 *
8 */
9
10/*
11 * This file contains the ETRAX 100LX specific IDE code.
12 */
13
14#ifndef __ASMCRIS_IDE_H
15#define __ASMCRIS_IDE_H
16
17#ifdef __KERNEL__
18
19#include <asm/arch/svinto.h>
20#include <asm/io.h>
21#include <asm-generic/ide_iops.h>
22
23
24/* ETRAX 100 can support 4 IDE busses on the same pins (serialized) */
25
26#define MAX_HWIFS 4
27
28extern __inline__ int ide_default_irq(unsigned long base)
29{
30 /* all IDE busses share the same IRQ, number 4.
31 * this has the side-effect that ide-probe.c will cluster our 4 interfaces
32 * together in a hwgroup, and will serialize accesses. this is good, because
33 * we can't access more than one interface at the same time on ETRAX100.
34 */
35 return 4;
36}
37
38extern __inline__ unsigned long ide_default_io_base(int index)
39{
40 /* we have no real I/O base address per interface, since all go through the
41 * same register. but in a bitfield in that register, we have the i/f number.
42 * so we can use the io_base to remember that bitfield.
43 */
44 static const unsigned long io_bases[MAX_HWIFS] = {
45 IO_FIELD(R_ATA_CTRL_DATA, sel, 0),
46 IO_FIELD(R_ATA_CTRL_DATA, sel, 1),
47 IO_FIELD(R_ATA_CTRL_DATA, sel, 2),
48 IO_FIELD(R_ATA_CTRL_DATA, sel, 3)
49 };
50 return io_bases[index];
51}
52
53/* this is called once for each interface, to setup the port addresses. data_port is the result
54 * of the ide_default_io_base call above. ctrl_port will be 0, but that is don't care for us.
55 */
56
57extern __inline__ void ide_init_hwif_ports(hw_regs_t *hw, unsigned long data_port, unsigned long ctrl_port, int *irq)
58{
59 int i;
60
61 /* fill in ports for ATA addresses 0 to 7 */
62
63 for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
64 hw->io_ports[i] = data_port |
65 IO_FIELD(R_ATA_CTRL_DATA, addr, i) |
66 IO_STATE(R_ATA_CTRL_DATA, cs0, active);
67 }
68
69 /* the IDE control register is at ATA address 6, with CS1 active instead of CS0 */
70
71 hw->io_ports[IDE_CONTROL_OFFSET] = data_port |
72 IO_FIELD(R_ATA_CTRL_DATA, addr, 6) |
73 IO_STATE(R_ATA_CTRL_DATA, cs1, active);
74
75 /* whats this for ? */
76
77 hw->io_ports[IDE_IRQ_OFFSET] = 0;
78}
79
80extern __inline__ void ide_init_default_hwifs(void)
81{
82 hw_regs_t hw;
83 int index;
84
85 for(index = 0; index < MAX_HWIFS; index++) {
86 ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL);
87 hw.irq = ide_default_irq(ide_default_io_base(index));
88 ide_register_hw(&hw, NULL);
89 }
90}
91
92/* some configuration options we don't need */
93
94#undef SUPPORT_VLB_SYNC
95#define SUPPORT_VLB_SYNC 0
96
97#endif /* __KERNEL__ */
98
99#endif /* __ASMCRIS_IDE_H */
diff --git a/include/asm-cris/arch-v10/io.h b/include/asm-cris/arch-v10/io.h
index 0bc38a0313c1..dd39198ec67d 100644
--- a/include/asm-cris/arch-v10/io.h
+++ b/include/asm-cris/arch-v10/io.h
@@ -6,6 +6,7 @@
6 6
7/* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */ 7/* Etrax shadow registers - which live in arch/cris/kernel/shadows.c */
8 8
9extern unsigned long gen_config_ii_shadow;
9extern unsigned long port_g_data_shadow; 10extern unsigned long port_g_data_shadow;
10extern unsigned char port_pa_dir_shadow; 11extern unsigned char port_pa_dir_shadow;
11extern unsigned char port_pa_data_shadow; 12extern unsigned char port_pa_data_shadow;
diff --git a/include/asm-cris/arch-v10/io_interface_mux.h b/include/asm-cris/arch-v10/io_interface_mux.h
new file mode 100644
index 000000000000..d92500080883
--- /dev/null
+++ b/include/asm-cris/arch-v10/io_interface_mux.h
@@ -0,0 +1,75 @@
1/* IO interface mux allocator for ETRAX100LX.
2 * Copyright 2004, Axis Communications AB
3 * $Id: io_interface_mux.h,v 1.1 2004/12/13 12:21:53 starvik Exp $
4 */
5
6
7#ifndef _IO_INTERFACE_MUX_H
8#define _IO_INTERFACE_MUX_H
9
10
11/* C.f. ETRAX100LX Designer's Reference 20.9 */
12
13/* The order in enum must match the order of interfaces[] in
14 * io_interface_mux.c */
15enum cris_io_interface {
16 /* Begin Non-multiplexed interfaces */
17 if_eth = 0,
18 if_serial_0,
19 /* End Non-multiplexed interfaces */
20 if_serial_1,
21 if_serial_2,
22 if_serial_3,
23 if_sync_serial_1,
24 if_sync_serial_3,
25 if_shared_ram,
26 if_shared_ram_w,
27 if_par_0,
28 if_par_1,
29 if_par_w,
30 if_scsi8_0,
31 if_scsi8_1,
32 if_scsi_w,
33 if_ata,
34 if_csp,
35 if_i2c,
36 if_usb_1,
37 if_usb_2,
38 /* GPIO pins */
39 if_gpio_grp_a,
40 if_gpio_grp_b,
41 if_gpio_grp_c,
42 if_gpio_grp_d,
43 if_gpio_grp_e,
44 if_gpio_grp_f,
45 if_max_interfaces,
46 if_unclaimed
47};
48
49int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id);
50
51void cris_free_io_interface(enum cris_io_interface ioif);
52
53/* port can be 'a', 'b' or 'g' */
54int cris_io_interface_allocate_pins(const enum cris_io_interface ioif,
55 const char port,
56 const unsigned start_bit,
57 const unsigned stop_bit);
58
59/* port can be 'a', 'b' or 'g' */
60int cris_io_interface_free_pins(const enum cris_io_interface ioif,
61 const char port,
62 const unsigned start_bit,
63 const unsigned stop_bit);
64
65int cris_io_interface_register_watcher(void (*notify)(const unsigned int gpio_in_available,
66 const unsigned int gpio_out_available,
67 const unsigned char pa_available,
68 const unsigned char pb_available));
69
70void cris_io_interface_delete_watcher(void (*notify)(const unsigned int gpio_in_available,
71 const unsigned int gpio_out_available,
72 const unsigned char pa_available,
73 const unsigned char pb_available));
74
75#endif /* _IO_INTERFACE_MUX_H */
diff --git a/include/asm-cris/arch-v10/irq.h b/include/asm-cris/arch-v10/irq.h
index a2a6e1533ea0..4fa8945b0263 100644
--- a/include/asm-cris/arch-v10/irq.h
+++ b/include/asm-cris/arch-v10/irq.h
@@ -74,12 +74,9 @@ struct etrax_interrupt_vector {
74}; 74};
75 75
76extern struct etrax_interrupt_vector *etrax_irv; 76extern struct etrax_interrupt_vector *etrax_irv;
77void set_int_vector(int n, irqvectptr addr, irqvectptr saddr); 77void set_int_vector(int n, irqvectptr addr);
78void set_break_vector(int n, irqvectptr addr); 78void set_break_vector(int n, irqvectptr addr);
79 79
80#define mask_irq(irq_nr) (*R_VECT_MASK_CLR = 1 << (irq_nr));
81#define unmask_irq(irq_nr) (*R_VECT_MASK_SET = 1 << (irq_nr));
82
83#define __STR(x) #x 80#define __STR(x) #x
84#define STR(x) __STR(x) 81#define STR(x) __STR(x)
85 82
@@ -121,26 +118,17 @@ void set_break_vector(int n, irqvectptr addr);
121 118
122#define BUILD_IRQ(nr,mask) \ 119#define BUILD_IRQ(nr,mask) \
123void IRQ_NAME(nr); \ 120void IRQ_NAME(nr); \
124void sIRQ_NAME(nr); \
125void BAD_IRQ_NAME(nr); \
126__asm__ ( \ 121__asm__ ( \
127 ".text\n\t" \ 122 ".text\n\t" \
128 "IRQ" #nr "_interrupt:\n\t" \ 123 "IRQ" #nr "_interrupt:\n\t" \
129 SAVE_ALL \ 124 SAVE_ALL \
130 "sIRQ" #nr "_interrupt:\n\t" /* shortcut for the multiple irq handler */ \
131 BLOCK_IRQ(mask,nr) /* this must be done to prevent irq loops when we ei later */ \ 125 BLOCK_IRQ(mask,nr) /* this must be done to prevent irq loops when we ei later */ \
132 "moveq "#nr",$r10\n\t" \ 126 "moveq "#nr",$r10\n\t" \
133 "move.d $sp,$r11\n\t" \ 127 "move.d $sp,$r11\n\t" \
134 "jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \ 128 "jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \
135 UNBLOCK_IRQ(mask) \ 129 UNBLOCK_IRQ(mask) \
136 "moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \ 130 "moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \
137 "jump ret_from_intr\n\t" \ 131 "jump ret_from_intr\n\t");
138 "bad_IRQ" #nr "_interrupt:\n\t" \
139 "push $r0\n\t" \
140 BLOCK_IRQ(mask,nr) \
141 "pop $r0\n\t" \
142 "reti\n\t" \
143 "nop\n");
144 132
145/* This is subtle. The timer interrupt is crucial and it should not be disabled for 133/* This is subtle. The timer interrupt is crucial and it should not be disabled for
146 * too long. However, if it had been a normal interrupt as per BUILD_IRQ, it would 134 * too long. However, if it had been a normal interrupt as per BUILD_IRQ, it would
@@ -159,23 +147,14 @@ __asm__ ( \
159 147
160#define BUILD_TIMER_IRQ(nr,mask) \ 148#define BUILD_TIMER_IRQ(nr,mask) \
161void IRQ_NAME(nr); \ 149void IRQ_NAME(nr); \
162void sIRQ_NAME(nr); \
163void BAD_IRQ_NAME(nr); \
164__asm__ ( \ 150__asm__ ( \
165 ".text\n\t" \ 151 ".text\n\t" \
166 "IRQ" #nr "_interrupt:\n\t" \ 152 "IRQ" #nr "_interrupt:\n\t" \
167 SAVE_ALL \ 153 SAVE_ALL \
168 "sIRQ" #nr "_interrupt:\n\t" /* shortcut for the multiple irq handler */ \
169 "moveq "#nr",$r10\n\t" \ 154 "moveq "#nr",$r10\n\t" \
170 "move.d $sp,$r11\n\t" \ 155 "move.d $sp,$r11\n\t" \
171 "jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \ 156 "jsr do_IRQ\n\t" /* irq.c, r10 and r11 are arguments */ \
172 "moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \ 157 "moveq 0,$r9\n\t" /* make ret_from_intr realise we came from an irq */ \
173 "jump ret_from_intr\n\t" \ 158 "jump ret_from_intr\n\t");
174 "bad_IRQ" #nr "_interrupt:\n\t" \
175 "push $r0\n\t" \
176 BLOCK_IRQ(mask,nr) \
177 "pop $r0\n\t" \
178 "reti\n\t" \
179 "nop\n");
180 159
181#endif 160#endif
diff --git a/include/asm-cris/arch-v10/memmap.h b/include/asm-cris/arch-v10/memmap.h
new file mode 100644
index 000000000000..13f3b971407f
--- /dev/null
+++ b/include/asm-cris/arch-v10/memmap.h
@@ -0,0 +1,22 @@
1#ifndef _ASM_ARCH_MEMMAP_H
2#define _ASM_ARCH_MEMMAP_H
3
4#define MEM_CSE0_START (0x00000000)
5#define MEM_CSE0_SIZE (0x04000000)
6#define MEM_CSE1_START (0x04000000)
7#define MEM_CSE1_SIZE (0x04000000)
8#define MEM_CSR0_START (0x08000000)
9#define MEM_CSR1_START (0x0c000000)
10#define MEM_CSP0_START (0x10000000)
11#define MEM_CSP1_START (0x14000000)
12#define MEM_CSP2_START (0x18000000)
13#define MEM_CSP3_START (0x1c000000)
14#define MEM_CSP4_START (0x20000000)
15#define MEM_CSP5_START (0x24000000)
16#define MEM_CSP6_START (0x28000000)
17#define MEM_CSP7_START (0x2c000000)
18#define MEM_DRAM_START (0x40000000)
19
20#define MEM_NON_CACHEABLE (0x80000000)
21
22#endif
diff --git a/include/asm-cris/arch-v10/mmu.h b/include/asm-cris/arch-v10/mmu.h
index d18aa00e50bc..df84f1716e6b 100644
--- a/include/asm-cris/arch-v10/mmu.h
+++ b/include/asm-cris/arch-v10/mmu.h
@@ -7,7 +7,10 @@
7 7
8/* type used in struct mm to couple an MMU context to an active mm */ 8/* type used in struct mm to couple an MMU context to an active mm */
9 9
10typedef unsigned int mm_context_t; 10typedef struct
11{
12 unsigned int page_id;
13} mm_context_t;
11 14
12/* kernel memory segments */ 15/* kernel memory segments */
13 16
diff --git a/include/asm-cris/arch-v10/offset.h b/include/asm-cris/arch-v10/offset.h
index fcbd77eab281..675b51d85639 100644
--- a/include/asm-cris/arch-v10/offset.h
+++ b/include/asm-cris/arch-v10/offset.h
@@ -25,7 +25,7 @@
25#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */ 25#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */
26#define THREAD_dccr 8 /* offsetof(struct thread_struct, dccr) */ 26#define THREAD_dccr 8 /* offsetof(struct thread_struct, dccr) */
27 27
28#define TASK_pid 133 /* offsetof(struct task_struct, pid) */ 28#define TASK_pid 141 /* offsetof(struct task_struct, pid) */
29 29
30#define LCLONE_VM 256 /* CLONE_VM */ 30#define LCLONE_VM 256 /* CLONE_VM */
31#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */ 31#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */
diff --git a/include/asm-cris/arch-v10/processor.h b/include/asm-cris/arch-v10/processor.h
index 9355d8675a58..e23df8dc96e8 100644
--- a/include/asm-cris/arch-v10/processor.h
+++ b/include/asm-cris/arch-v10/processor.h
@@ -59,4 +59,12 @@ struct thread_struct {
59 wrusp(usp); \ 59 wrusp(usp); \
60} while(0) 60} while(0)
61 61
62/* Called when handling a kernel bus fault fixup.
63 *
64 * After a fixup we do not want to return by restoring the CPU-state
65 * anymore, so switch frame-types (see ptrace.h)
66 */
67#define arch_fixup(regs) \
68 regs->frametype = CRIS_FRAME_NORMAL;
69
62#endif 70#endif
diff --git a/include/asm-cris/arch-v10/system.h b/include/asm-cris/arch-v10/system.h
index 781ca30229a8..6cc35642b8ab 100644
--- a/include/asm-cris/arch-v10/system.h
+++ b/include/asm-cris/arch-v10/system.h
@@ -11,6 +11,8 @@ extern inline unsigned long rdvr(void) {
11 return vr; 11 return vr;
12} 12}
13 13
14#define cris_machine_name "cris"
15
14/* read/write the user-mode stackpointer */ 16/* read/write the user-mode stackpointer */
15 17
16extern inline unsigned long rdusp(void) { 18extern inline unsigned long rdusp(void) {
diff --git a/include/asm-cris/arch-v32/arbiter.h b/include/asm-cris/arch-v32/arbiter.h
new file mode 100644
index 000000000000..dba3c285cacd
--- /dev/null
+++ b/include/asm-cris/arch-v32/arbiter.h
@@ -0,0 +1,30 @@
1#ifndef _ASM_CRIS_ARCH_ARBITER_H
2#define _ASM_CRIS_ARCH_ARBITER_H
3
4#define EXT_REGION 0
5#define INT_REGION 1
6
7typedef void (watch_callback)(void);
8
9enum
10{
11 arbiter_all_dmas = 0x3ff,
12 arbiter_cpu = 0xc00,
13 arbiter_all_clients = 0x3fff
14};
15
16enum
17{
18 arbiter_all_read = 0x55,
19 arbiter_all_write = 0xaa,
20 arbiter_all_accesses = 0xff
21};
22
23int crisv32_arbiter_allocate_bandwith(int client, int region,
24 unsigned long bandwidth);
25int crisv32_arbiter_watch(unsigned long start, unsigned long size,
26 unsigned long clients, unsigned long accesses,
27 watch_callback* cb);
28int crisv32_arbiter_unwatch(int id);
29
30#endif
diff --git a/include/asm-cris/arch-v32/atomic.h b/include/asm-cris/arch-v32/atomic.h
new file mode 100644
index 000000000000..bbfb7a5ae315
--- /dev/null
+++ b/include/asm-cris/arch-v32/atomic.h
@@ -0,0 +1,36 @@
1#ifndef __ASM_CRIS_ARCH_ATOMIC__
2#define __ASM_CRIS_ARCH_ATOMIC__
3
4#include <asm/system.h>
5
6extern void cris_spin_unlock(void *l, int val);
7extern void cris_spin_lock(void *l);
8extern int cris_spin_trylock(void* l);
9
10#ifndef CONFIG_SMP
11#define cris_atomic_save(addr, flags) local_irq_save(flags);
12#define cris_atomic_restore(addr, flags) local_irq_restore(flags);
13#else
14
15extern spinlock_t cris_atomic_locks[];
16#define LOCK_COUNT 128
17#define HASH_ADDR(a) (((int)a) & 127)
18
19#define cris_atomic_save(addr, flags) \
20 local_irq_save(flags); \
21 cris_spin_lock((void*)&cris_atomic_locks[HASH_ADDR(addr)].lock);
22
23#define cris_atomic_restore(addr, flags) \
24 { \
25 spinlock_t *lock = (void*)&cris_atomic_locks[HASH_ADDR(addr)]; \
26 __asm__ volatile ("move.d %1,%0" \
27 : "=m" (lock->lock) \
28 : "r" (1) \
29 : "memory"); \
30 local_irq_restore(flags); \
31 }
32
33#endif
34
35#endif
36
diff --git a/include/asm-cris/arch-v32/bitops.h b/include/asm-cris/arch-v32/bitops.h
new file mode 100644
index 000000000000..e40a58d3b862
--- /dev/null
+++ b/include/asm-cris/arch-v32/bitops.h
@@ -0,0 +1,64 @@
1#ifndef _ASM_CRIS_ARCH_BITOPS_H
2#define _ASM_CRIS_ARCH_BITOPS_H
3
4/*
5 * Helper functions for the core of the ff[sz] functions. They compute the
6 * number of leading zeroes of a bits-in-byte, byte-in-word and
7 * word-in-dword-swapped number. They differ in that the first function also
8 * inverts all bits in the input.
9 */
10
11extern inline unsigned long
12cris_swapnwbrlz(unsigned long w)
13{
14 unsigned long res;
15
16 __asm__ __volatile__ ("swapnwbr %0\n\t"
17 "lz %0,%0"
18 : "=r" (res) : "0" (w));
19
20 return res;
21}
22
23extern inline unsigned long
24cris_swapwbrlz(unsigned long w)
25{
26 unsigned long res;
27
28 __asm__ __volatile__ ("swapwbr %0\n\t"
29 "lz %0,%0"
30 : "=r" (res) : "0" (w));
31
32 return res;
33}
34
35/*
36 * Find First Zero in word. Undefined if no zero exist, so the caller should
37 * check against ~0 first.
38 */
39extern inline unsigned long
40ffz(unsigned long w)
41{
42 return cris_swapnwbrlz(w);
43}
44
45/*
46 * Find First Set bit in word. Undefined if no 1 exist, so the caller
47 * should check against 0 first.
48 */
49extern inline unsigned long
50__ffs(unsigned long w)
51{
52 return cris_swapnwbrlz(~w);
53}
54
55/*
56 * Find First Bit that is set.
57 */
58extern inline unsigned long
59kernel_ffs(unsigned long w)
60{
61 return w ? cris_swapwbrlz (w) + 1 : 0;
62}
63
64#endif /* _ASM_CRIS_ARCH_BITOPS_H */
diff --git a/include/asm-cris/arch-v32/byteorder.h b/include/asm-cris/arch-v32/byteorder.h
new file mode 100644
index 000000000000..74846ee6cf99
--- /dev/null
+++ b/include/asm-cris/arch-v32/byteorder.h
@@ -0,0 +1,20 @@
1#ifndef _ASM_CRIS_ARCH_BYTEORDER_H
2#define _ASM_CRIS_ARCH_BYTEORDER_H
3
4#include <asm/types.h>
5
6extern __inline__ __const__ __u32
7___arch__swab32(__u32 x)
8{
9 __asm__ __volatile__ ("swapwb %0" : "=r" (x) : "0" (x));
10 return (x);
11}
12
13extern __inline__ __const__ __u16
14___arch__swab16(__u16 x)
15{
16 __asm__ __volatile__ ("swapb %0" : "=r" (x) : "0" (x));
17 return (x);
18}
19
20#endif /* _ASM_CRIS_ARCH_BYTEORDER_H */
diff --git a/include/asm-cris/arch-v32/cache.h b/include/asm-cris/arch-v32/cache.h
new file mode 100644
index 000000000000..4fed8d62ccc8
--- /dev/null
+++ b/include/asm-cris/arch-v32/cache.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_CRIS_ARCH_CACHE_H
2#define _ASM_CRIS_ARCH_CACHE_H
3
4/* A cache-line is 32 bytes. */
5#define L1_CACHE_BYTES 32
6#define L1_CACHE_SHIFT 5
7#define L1_CACHE_SHIFT_MAX 5
8
9#endif /* _ASM_CRIS_ARCH_CACHE_H */
diff --git a/include/asm-cris/arch-v32/checksum.h b/include/asm-cris/arch-v32/checksum.h
new file mode 100644
index 000000000000..a1d6b2a6cc44
--- /dev/null
+++ b/include/asm-cris/arch-v32/checksum.h
@@ -0,0 +1,29 @@
1#ifndef _ASM_CRIS_ARCH_CHECKSUM_H
2#define _ASM_CRIS_ARCH_CHECKSUM_H
3
4/*
5 * Check values used in TCP/UDP headers.
6 *
7 * The gain of doing this in assembler instead of C, is that C doesn't
8 * generate carry-additions for the 32-bit components of the
9 * checksum. Which means it would be necessary to split all those into
10 * 16-bit components and then add.
11 */
12extern inline unsigned int
13csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr,
14 unsigned short len, unsigned short proto, unsigned int sum)
15{
16 int res;
17
18 __asm__ __volatile__ ("add.d %2, %0\n\t"
19 "addc %3, %0\n\t"
20 "addc %4, %0\n\t"
21 "addc 0, %0\n\t"
22 : "=r" (res)
23 : "0" (sum), "r" (daddr), "r" (saddr), \
24 "r" ((ntohs(len) << 16) + (proto << 8)));
25
26 return res;
27}
28
29#endif /* _ASM_CRIS_ARCH_CHECKSUM_H */
diff --git a/include/asm-cris/arch-v32/cryptocop.h b/include/asm-cris/arch-v32/cryptocop.h
new file mode 100644
index 000000000000..dfa1f66fb987
--- /dev/null
+++ b/include/asm-cris/arch-v32/cryptocop.h
@@ -0,0 +1,272 @@
1/*
2 * The device /dev/cryptocop is accessible using this driver using
3 * CRYPTOCOP_MAJOR (254) and minor number 0.
4 */
5
6#ifndef CRYPTOCOP_H
7#define CRYPTOCOP_H
8
9#include <linux/uio.h>
10
11
12#define CRYPTOCOP_SESSION_ID_NONE (0)
13
14typedef unsigned long long int cryptocop_session_id;
15
16/* cryptocop ioctls */
17#define ETRAXCRYPTOCOP_IOCTYPE (250)
18
19#define CRYPTOCOP_IO_CREATE_SESSION _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 1, struct strcop_session_op)
20#define CRYPTOCOP_IO_CLOSE_SESSION _IOW(ETRAXCRYPTOCOP_IOCTYPE, 2, struct strcop_session_op)
21#define CRYPTOCOP_IO_PROCESS_OP _IOWR(ETRAXCRYPTOCOP_IOCTYPE, 3, struct strcop_crypto_op)
22#define CRYPTOCOP_IO_MAXNR (3)
23
24typedef enum {
25 cryptocop_cipher_des = 0,
26 cryptocop_cipher_3des = 1,
27 cryptocop_cipher_aes = 2,
28 cryptocop_cipher_m2m = 3, /* mem2mem is essentially a NULL cipher with blocklength=1 */
29 cryptocop_cipher_none
30} cryptocop_cipher_type;
31
32typedef enum {
33 cryptocop_digest_sha1 = 0,
34 cryptocop_digest_md5 = 1,
35 cryptocop_digest_none
36} cryptocop_digest_type;
37
38typedef enum {
39 cryptocop_csum_le = 0,
40 cryptocop_csum_be = 1,
41 cryptocop_csum_none
42} cryptocop_csum_type;
43
44typedef enum {
45 cryptocop_cipher_mode_ecb = 0,
46 cryptocop_cipher_mode_cbc,
47 cryptocop_cipher_mode_none
48} cryptocop_cipher_mode;
49
50typedef enum {
51 cryptocop_3des_eee = 0,
52 cryptocop_3des_eed = 1,
53 cryptocop_3des_ede = 2,
54 cryptocop_3des_edd = 3,
55 cryptocop_3des_dee = 4,
56 cryptocop_3des_ded = 5,
57 cryptocop_3des_dde = 6,
58 cryptocop_3des_ddd = 7
59} cryptocop_3des_mode;
60
61/* Usermode accessible (ioctl) operations. */
62struct strcop_session_op{
63 cryptocop_session_id ses_id;
64
65 cryptocop_cipher_type cipher; /* AES, DES, 3DES, m2m, none */
66
67 cryptocop_cipher_mode cmode; /* ECB, CBC, none */
68 cryptocop_3des_mode des3_mode;
69
70 cryptocop_digest_type digest; /* MD5, SHA1, none */
71
72 cryptocop_csum_type csum; /* BE, LE, none */
73
74 unsigned char *key;
75 size_t keylen;
76};
77
78#define CRYPTOCOP_CSUM_LENGTH (2)
79#define CRYPTOCOP_MAX_DIGEST_LENGTH (20) /* SHA-1 20, MD5 16 */
80#define CRYPTOCOP_MAX_IV_LENGTH (16) /* (3)DES==8, AES == 16 */
81#define CRYPTOCOP_MAX_KEY_LENGTH (32)
82
83struct strcop_crypto_op{
84 cryptocop_session_id ses_id;
85
86 /* Indata. */
87 unsigned char *indata;
88 size_t inlen; /* Total indata length. */
89
90 /* Cipher configuration. */
91 unsigned char do_cipher:1;
92 unsigned char decrypt:1; /* 1 == decrypt, 0 == encrypt */
93 unsigned char cipher_explicit:1;
94 size_t cipher_start;
95 size_t cipher_len;
96 /* cipher_iv is used if do_cipher and cipher_explicit and the cipher
97 mode is CBC. The length is controlled by the type of cipher,
98 e.g. DES/3DES 8 octets and AES 16 octets. */
99 unsigned char cipher_iv[CRYPTOCOP_MAX_IV_LENGTH];
100 /* Outdata. */
101 unsigned char *cipher_outdata;
102 size_t cipher_outlen;
103
104 /* digest configuration. */
105 unsigned char do_digest:1;
106 size_t digest_start;
107 size_t digest_len;
108 /* Outdata. The actual length is determined by the type of the digest. */
109 unsigned char digest[CRYPTOCOP_MAX_DIGEST_LENGTH];
110
111 /* Checksum configuration. */
112 unsigned char do_csum:1;
113 size_t csum_start;
114 size_t csum_len;
115 /* Outdata. */
116 unsigned char csum[CRYPTOCOP_CSUM_LENGTH];
117};
118
119
120
121#ifdef __KERNEL__
122
123/********** The API to use from inside the kernel. ************/
124
125#include <asm/arch/hwregs/dma.h>
126
127typedef enum {
128 cryptocop_alg_csum = 0,
129 cryptocop_alg_mem2mem,
130 cryptocop_alg_md5,
131 cryptocop_alg_sha1,
132 cryptocop_alg_des,
133 cryptocop_alg_3des,
134 cryptocop_alg_aes,
135 cryptocop_no_alg,
136} cryptocop_algorithm;
137
138typedef u8 cryptocop_tfrm_id;
139
140
141struct cryptocop_operation;
142
143typedef void (cryptocop_callback)(struct cryptocop_operation*, void*);
144
145struct cryptocop_transform_init {
146 cryptocop_algorithm alg;
147 /* Keydata for ciphers. */
148 unsigned char key[CRYPTOCOP_MAX_KEY_LENGTH];
149 unsigned int keylen;
150 cryptocop_cipher_mode cipher_mode;
151 cryptocop_3des_mode tdes_mode;
152 cryptocop_csum_type csum_mode; /* cryptocop_csum_none is not allowed when alg==cryptocop_alg_csum */
153
154 cryptocop_tfrm_id tid; /* Locally unique in session; assigned by user, checked by driver. */
155 struct cryptocop_transform_init *next;
156};
157
158
159typedef enum {
160 cryptocop_source_dma = 0,
161 cryptocop_source_des,
162 cryptocop_source_3des,
163 cryptocop_source_aes,
164 cryptocop_source_md5,
165 cryptocop_source_sha1,
166 cryptocop_source_csum,
167 cryptocop_source_none,
168} cryptocop_source;
169
170
171struct cryptocop_desc_cfg {
172 cryptocop_tfrm_id tid;
173 cryptocop_source src;
174 unsigned int last:1; /* Last use of this transform in the operation. Will push outdata when encountered. */
175 struct cryptocop_desc_cfg *next;
176};
177
178struct cryptocop_desc {
179 size_t length;
180 struct cryptocop_desc_cfg *cfg;
181 struct cryptocop_desc *next;
182};
183
184
185/* Flags for cryptocop_tfrm_cfg */
186#define CRYPTOCOP_NO_FLAG (0x00)
187#define CRYPTOCOP_ENCRYPT (0x01)
188#define CRYPTOCOP_DECRYPT (0x02)
189#define CRYPTOCOP_EXPLICIT_IV (0x04)
190
191struct cryptocop_tfrm_cfg {
192 cryptocop_tfrm_id tid;
193
194 unsigned int flags; /* DECRYPT, ENCRYPT, EXPLICIT_IV */
195
196 /* CBC initialisation vector for cihers. */
197 u8 iv[CRYPTOCOP_MAX_IV_LENGTH];
198
199 /* The position in output where to write the transform output. The order
200 in which the driver writes the output is unspecified, hence if several
201 transforms write on the same positions in the output the result is
202 unspecified. */
203 size_t inject_ix;
204
205 struct cryptocop_tfrm_cfg *next;
206};
207
208
209
210struct cryptocop_dma_list_operation{
211 /* The consumer can provide DMA lists to send to the co-processor. 'use_dmalists' in
212 struct cryptocop_operation must be set for the driver to use them. outlist,
213 out_data_buf, inlist and in_data_buf must all be physical addresses since they will
214 be loaded to DMA . */
215 dma_descr_data *outlist; /* Out from memory to the co-processor. */
216 char *out_data_buf;
217 dma_descr_data *inlist; /* In from the co-processor to memory. */
218 char *in_data_buf;
219
220 cryptocop_3des_mode tdes_mode;
221 cryptocop_csum_type csum_mode;
222};
223
224
225struct cryptocop_tfrm_operation{
226 /* Operation configuration, if not 'use_dmalists' is set. */
227 struct cryptocop_tfrm_cfg *tfrm_cfg;
228 struct cryptocop_desc *desc;
229
230 struct iovec *indata;
231 size_t incount;
232 size_t inlen; /* Total inlength. */
233
234 struct iovec *outdata;
235 size_t outcount;
236 size_t outlen; /* Total outlength. */
237};
238
239
240struct cryptocop_operation {
241 cryptocop_callback *cb;
242 void *cb_data;
243
244 cryptocop_session_id sid;
245
246 /* The status of the operation when returned to consumer. */
247 int operation_status; /* 0, -EAGAIN */
248
249 /* Flags */
250 unsigned int use_dmalists:1; /* Use outlist and inlist instead of the desc/tfrm_cfg configuration. */
251 unsigned int in_interrupt:1; /* Set if inserting job from interrupt context. */
252 unsigned int fast_callback:1; /* Set if fast callback wanted, i.e. from interrupt context. */
253
254 union{
255 struct cryptocop_dma_list_operation list_op;
256 struct cryptocop_tfrm_operation tfrm_op;
257 };
258};
259
260
261int cryptocop_new_session(cryptocop_session_id *sid, struct cryptocop_transform_init *tinit, int alloc_flag);
262int cryptocop_free_session(cryptocop_session_id sid);
263
264int cryptocop_job_queue_insert_csum(struct cryptocop_operation *operation);
265
266int cryptocop_job_queue_insert_crypto(struct cryptocop_operation *operation);
267
268int cryptocop_job_queue_insert_user_job(struct cryptocop_operation *operation);
269
270#endif /* __KERNEL__ */
271
272#endif /* CRYPTOCOP_H */
diff --git a/include/asm-cris/arch-v32/delay.h b/include/asm-cris/arch-v32/delay.h
new file mode 100644
index 000000000000..f36f7f760e89
--- /dev/null
+++ b/include/asm-cris/arch-v32/delay.h
@@ -0,0 +1,18 @@
1#ifndef _ASM_CRIS_ARCH_DELAY_H
2#define _ASM_CRIS_ARCH_DELAY_H
3
4extern __inline__ void
5__delay(int loops)
6{
7 __asm__ __volatile__ (
8 "move.d %0, $r9\n\t"
9 "beq 2f\n\t"
10 "subq 1, $r9\n\t"
11 "1:\n\t"
12 "bne 1b\n\t"
13 "subq 1, $r9\n"
14 "2:"
15 : : "g" (loops) : "r9");
16}
17
18#endif /* _ASM_CRIS_ARCH_DELAY_H */
diff --git a/include/asm-cris/arch-v32/dma.h b/include/asm-cris/arch-v32/dma.h
new file mode 100644
index 000000000000..3674081389fd
--- /dev/null
+++ b/include/asm-cris/arch-v32/dma.h
@@ -0,0 +1,79 @@
1#ifndef _ASM_ARCH_CRIS_DMA_H
2#define _ASM_ARCH_CRIS_DMA_H
3
4/* Defines for using and allocating dma channels. */
5
6#define MAX_DMA_CHANNELS 10
7
8#define NETWORK_ETH0_TX_DMA_NBR 0 /* Ethernet 0 out. */
9#define NETWORK_ETH0 RX_DMA_NBR 1 /* Ethernet 0 in. */
10
11#define IO_PROC_DMA0_TX_DMA_NBR 2 /* IO processor DMA0 out. */
12#define IO_PROC_DMA0_RX_DMA_NBR 3 /* IO processor DMA0 in. */
13
14#define ATA_TX_DMA_NBR 2 /* ATA interface out. */
15#define ATA_RX_DMA_NBR 3 /* ATA interface in. */
16
17#define ASYNC_SER2_TX_DMA_NBR 2 /* Asynchronous serial port 2 out. */
18#define ASYNC_SER2_RX_DMA_NBR 3 /* Asynchronous serial port 2 in. */
19
20#define IO_PROC_DMA1_TX_DMA_NBR 4 /* IO processor DMA1 out. */
21#define IO_PROC_DMA1_RX_DMA_NBR 5 /* IO processor DMA1 in. */
22
23#define ASYNC_SER1_TX_DMA_NBR 4 /* Asynchronous serial port 1 out. */
24#define ASYNC_SER1_RX_DMA_NBR 5 /* Asynchronous serial port 1 in. */
25
26#define SYNC_SER0_TX_DMA_NBR 4 /* Synchronous serial port 0 out. */
27#define SYNC_SER0_RX_DMA_NBR 5 /* Synchronous serial port 0 in. */
28
29#define EXTDMA0_TX_DMA_NBR 6 /* External DMA 0 out. */
30#define EXTDMA1_RX_DMA_NBR 7 /* External DMA 1 in. */
31
32#define ASYNC_SER0_TX_DMA_NBR 6 /* Asynchronous serial port 0 out. */
33#define ASYNC_SER0_RX_DMA_NBR 7 /* Asynchronous serial port 0 in. */
34
35#define SYNC_SER1_TX_DMA_NBR 6 /* Synchronous serial port 1 out. */
36#define SYNC_SER1_RX_DMA_NBR 7 /* Synchronous serial port 1 in. */
37
38#define NETWORK_ETH1_TX_DMA_NBR 6 /* Ethernet 1 out. */
39#define NETWORK_ETH1_RX_DMA_NBR 7 /* Ethernet 1 in. */
40
41#define EXTDMA2_TX_DMA_NBR 8 /* External DMA 2 out. */
42#define EXTDMA3_RX_DMA_NBR 9 /* External DMA 3 in. */
43
44#define STRCOP_TX_DMA_NBR 8 /* Stream co-processor out. */
45#define STRCOP_RX_DMA_NBR 9 /* Stream co-processor in. */
46
47#define ASYNC_SER3_TX_DMA_NBR 8 /* Asynchronous serial port 3 out. */
48#define ASYNC_SER3_RX_DMA_NBR 9 /* Asynchronous serial port 3 in. */
49
50enum dma_owner
51{
52 dma_eth0,
53 dma_eth1,
54 dma_iop0,
55 dma_iop1,
56 dma_ser0,
57 dma_ser1,
58 dma_ser2,
59 dma_ser3,
60 dma_sser0,
61 dma_sser1,
62 dma_ata,
63 dma_strp,
64 dma_ext0,
65 dma_ext1,
66 dma_ext2,
67 dma_ext3
68};
69
70int crisv32_request_dma(unsigned int dmanr, const char * device_id,
71 unsigned options, unsigned bandwidth, enum dma_owner owner);
72void crisv32_free_dma(unsigned int dmanr);
73
74/* Masks used by crisv32_request_dma options: */
75#define DMA_VERBOSE_ON_ERROR 1
76#define DMA_PANIC_ON_ERROR (2|DMA_VERBOSE_ON_ERROR)
77#define DMA_INT_MEM 4
78
79#endif /* _ASM_ARCH_CRIS_DMA_H */
diff --git a/include/asm-cris/arch-v32/elf.h b/include/asm-cris/arch-v32/elf.h
new file mode 100644
index 000000000000..1324e505a4d8
--- /dev/null
+++ b/include/asm-cris/arch-v32/elf.h
@@ -0,0 +1,73 @@
1#ifndef _ASM_CRIS_ELF_H
2#define _ASM_CRIS_ELF_H
3
4#define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32
5
6/*
7 * This is used to ensure we don't load something for the wrong architecture.
8 */
9#define elf_check_arch(x) \
10 ((x)->e_machine == EM_CRIS \
11 && ((((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_V32 \
12 || (((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_COMMON_V10_V32))))
13
14/* CRISv32 ELF register definitions. */
15
16#include <asm/ptrace.h>
17
18/* Explicitly zero out registers to increase determinism. */
19#define ELF_PLAT_INIT(_r, load_addr) do { \
20 (_r)->r13 = 0; (_r)->r12 = 0; (_r)->r11 = 0; (_r)->r10 = 0; \
21 (_r)->r9 = 0; (_r)->r8 = 0; (_r)->r7 = 0; (_r)->r6 = 0; \
22 (_r)->r5 = 0; (_r)->r4 = 0; (_r)->r3 = 0; (_r)->r2 = 0; \
23 (_r)->r1 = 0; (_r)->r0 = 0; (_r)->mof = 0; (_r)->srp = 0; \
24 (_r)->acr = 0; \
25} while (0)
26
27/*
28 * An executable for which elf_read_implies_exec() returns TRUE will
29 * have the READ_IMPLIES_EXEC personality flag set automatically.
30 */
31#define elf_read_implies_exec_binary(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack))
32
33/*
34 * This is basically a pt_regs with the additional definition
35 * of the stack pointer since it's needed in a core dump.
36 * pr_regs is a elf_gregset_t and should be filled according
37 * to the layout of user_regs_struct.
38 */
39#define ELF_CORE_COPY_REGS(pr_reg, regs) \
40 pr_reg[0] = regs->r0; \
41 pr_reg[1] = regs->r1; \
42 pr_reg[2] = regs->r2; \
43 pr_reg[3] = regs->r3; \
44 pr_reg[4] = regs->r4; \
45 pr_reg[5] = regs->r5; \
46 pr_reg[6] = regs->r6; \
47 pr_reg[7] = regs->r7; \
48 pr_reg[8] = regs->r8; \
49 pr_reg[9] = regs->r9; \
50 pr_reg[10] = regs->r10; \
51 pr_reg[11] = regs->r11; \
52 pr_reg[12] = regs->r12; \
53 pr_reg[13] = regs->r13; \
54 pr_reg[14] = rdusp(); /* SP */ \
55 pr_reg[15] = regs->acr; /* ACR */ \
56 pr_reg[16] = 0; /* BZ */ \
57 pr_reg[17] = rdvr(); /* VR */ \
58 pr_reg[18] = 0; /* PID */ \
59 pr_reg[19] = regs->srs; /* SRS */ \
60 pr_reg[20] = 0; /* WZ */ \
61 pr_reg[21] = regs->exs; /* EXS */ \
62 pr_reg[22] = regs->eda; /* EDA */ \
63 pr_reg[23] = regs->mof; /* MOF */ \
64 pr_reg[24] = 0; /* DZ */ \
65 pr_reg[25] = 0; /* EBP */ \
66 pr_reg[26] = regs->erp; /* ERP */ \
67 pr_reg[27] = regs->srp; /* SRP */ \
68 pr_reg[28] = 0; /* NRP */ \
69 pr_reg[29] = regs->ccs; /* CCS */ \
70 pr_reg[30] = rdusp(); /* USP */ \
71 pr_reg[31] = regs->spc; /* SPC */ \
72
73#endif /* _ASM_CRIS_ELF_H */
diff --git a/include/asm-cris/arch-v32/hwregs/Makefile b/include/asm-cris/arch-v32/hwregs/Makefile
new file mode 100644
index 000000000000..c9160f9949a9
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/Makefile
@@ -0,0 +1,187 @@
1# $Id: Makefile,v 1.8 2004/01/07 21:16:18 johana Exp $
2# Makefile to generate or copy the latest register definitions
3# and related datastructures and helpermacros.
4# The offical place for these files is at:
5RELEASE ?= r1_alfa5
6OFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
7
8# which is updated on each new release.
9INCL_ASMFILES =
10INCL_FILES = ata_defs.h
11INCL_FILES += bif_core_defs.h
12INCL_ASMFILES += bif_core_defs_asm.h
13INCL_FILES += bif_slave_defs.h
14#INCL_FILES += bif_slave_ext_defs.h
15INCL_FILES += config_defs.h
16INCL_ASMFILES += config_defs_asm.h
17INCL_FILES += cpu_vect.h
18#INCL_FILES += cris_defs.h
19#INCL_FILES += cris_supp_reg.h # In handcrafted supp_reg.h
20INCL_FILES += dma.h
21INCL_FILES += dma_defs.h
22INCL_FILES += eth_defs.h
23INCL_FILES += extmem_defs.h
24INCL_FILES += gio_defs.h
25INCL_ASMFILES += gio_defs_asm.h
26INCL_FILES += intr_vect.h
27INCL_FILES += intr_vect_defs.h
28INCL_ASMFILES += intr_vect_defs_asm.h
29INCL_FILES += marb_bp_defs.h
30INCL_FILES += marb_defs.h
31INCL_ASMFILES += mmu_defs_asm.h
32#INCL_FILES += mmu_supp_reg.h # In handcrafted supp_reg.h
33#INCL_FILES += par_defs.h # No useful content
34INCL_FILES += pinmux_defs.h
35INCL_FILES += reg_map.h
36INCL_ASMFILES += reg_map_asm.h
37INCL_FILES += reg_rdwr.h
38INCL_FILES += ser_defs.h
39#INCL_FILES += spec_reg.h # In handcrafted supp_reg.h
40INCL_FILES += sser_defs.h
41INCL_FILES += strcop_defs.h
42#INCL_FILES += strcop.h # Where is this?
43INCL_FILES += strmux_defs.h
44#INCL_FILES += supp_reg.h # Handcrafted instead
45INCL_FILES += timer_defs.h
46
47REGDESC =
48REGDESC += $(BASEDIR)/io/ata/rtl/ata_regs.r
49REGDESC += $(BASEDIR)/io/bif/rtl/bif_core_regs.r
50REGDESC += $(BASEDIR)/io/bif/rtl/bif_slave_regs.r
51#REGDESC += $(BASEDIR)/io/bif/sw/bif_slave_ext_regs.r
52REGDESC += $(DESIGNDIR)/top/rtl/config_regs.r
53REGDESC += $(BASEDIR)/mod/dma_common/rtl/dma_regdes.r
54REGDESC += $(BASEDIR)/io/eth/rtl/eth_regs.r
55REGDESC += $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
56REGDESC += $(DESIGNDIR)/gio/rtl/gio_regs.r
57REGDESC += $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
58REGDESC += $(BASEDIR)/core/memarb/rtl/guinness/marb_top.r
59REGDESC += $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
60#REGDESC += $(BASEDIR)/io/par_port/rtl/par_regs.r
61REGDESC += $(BASEDIR)/io/pinmux/rtl/guinness/pinmux_regs.r
62REGDESC += $(BASEDIR)/io/ser/rtl/ser_regs.r
63REGDESC += $(BASEDIR)/core/strcop/rtl/strcop_regs.r
64REGDESC += $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
65REGDESC += $(BASEDIR)/io/timer/rtl/timer_regs.r
66#REGDESC += $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
67
68
69BASEDIR = /n/asic/design
70DESIGNDIR = /n/asic/projects/guinness/design
71RDES2C = /n/asic/bin/rdes2c
72RDES2C = /n/asic/design/tools/rdesc/rdes2c
73RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
74RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
75
76## all - Just print help - you probably want to do 'make gen'
77all: help
78
79# Disable implicit rule that may generate deleted files from RCS/ directory.
80%.r:
81
82%.h:
83
84## help - This help
85help:
86 @grep '^## ' Makefile
87
88## gen - Generate include files
89gen: $(INCL_FILES) $(INCL_ASMFILES)
90
91ata_defs.h: $(BASEDIR)/io/ata/rtl/ata_regs.r
92 $(RDES2C) $<
93config_defs.h: $(DESIGNDIR)/top/rtl/config_regs.r
94 $(RDES2C) $<
95config_defs_asm.h: $(DESIGNDIR)/top/rtl/config_regs.r
96 $(RDES2C) -asm $<
97# Can't generate cpu_vect.h yet
98#cpu_vect.h: $(DESIGNDIR)/top/rtl/cpu_vect.r # ????
99# $(RDES2INTR) $<
100cpu_vect.h: $(OFFICIAL_INCDIR)cpu_vect.h
101 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
102dma_defs.h: $(BASEDIR)/core/dma/rtl/common/dma_regdes.r
103 $(RDES2C) $<
104$(BASEDIR)/core/dma/sw/dma.h:
105dma.h: $(BASEDIR)/core/dma/sw/dma.h
106 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
107eth_defs.h: $(BASEDIR)/io/eth/rtl/eth_regs.r
108 $(RDES2C) $<
109extmem_defs.h: $(BASEDIR)/io/bif/mod/extmem/extmem_regs.r
110 $(RDES2C) $<
111gio_defs.h: $(DESIGNDIR)/gio/rtl/gio_regs.r
112 $(RDES2C) $<
113intr_vect_defs.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
114 $(RDES2C) $<
115intr_vect_defs_asm.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
116 $(RDES2C) -asm $<
117# Can't generate intr_vect.h yet
118#intr_vect.h: $(BASEDIR)/core/cpu/intr_vect/rtl/guinness/ivmask.config.r
119# $(RDES2INTR) $<
120intr_vect.h: $(OFFICIAL_INCDIR)intr_vect.h
121 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
122mmu_defs_asm.h: $(BASEDIR)/core/cpu/mmu/doc/mmu_regs.r
123 $(RDES2C) -asm $<
124par_defs.h: $(BASEDIR)/io/par_port/rtl/par_regs.r
125 $(RDES2C) $<
126
127# From /n/asic/projects/guinness/design/
128reg_map.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
129 $(RDES2C) -base 0xb0000000 $^
130reg_map_asm.h: $(DESIGNDIR)/top/rtl/global.rmap $(DESIGNDIR)/top/mod/modreg.rmap
131 $(RDES2C) -base 0xb0000000 -asm -outfile $@ $^
132
133reg_rdwr.h: $(DESIGNDIR)/top/sw/include/reg_rdwr.h
134 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
135
136ser_defs.h: $(BASEDIR)/io/ser/rtl/ser_regs.r
137 $(RDES2C) $<
138strcop_defs.h: $(BASEDIR)/core/strcop/rtl/strcop_regs.r
139 $(RDES2C) $<
140strcop.h: $(BASEDIR)/core/strcop/rtl/strcop.h
141 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
142strmux_defs.h: $(BASEDIR)/io/strmux/rtl/guinness/strmux_regs.r
143 $(RDES2C) $<
144timer_defs.h: $(BASEDIR)/io/timer/rtl/timer_regs.r
145 $(RDES2C) $<
146usb_defs.h: $(BASEDIR)/io/usb/usb1_1/rtl/usb_regs.r
147 $(RDES2C) $<
148
149## copy - Copy files from official location
150copy:
151 @for HFILE in $(INCL_FILES); do \
152 echo " $$HFILE"; \
153 cat $(OFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
154 done
155 @for HFILE in $(INCL_ASMFILES); do \
156 echo " $$HFILE"; \
157 cat $(OFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
158 done
159## ls_official - List official location
160ls_official:
161 (cd $(OFFICIAL_INCDIR); ls -l *.h )
162
163## diff_official - Diff current directory with official location
164diff_official:
165 diff . $(OFFICIAL_INCDIR)
166
167## doc - Generate .axw files from register description.
168doc: $(REGDESC)
169 for RDES in $^; do \
170 $(RDES2TXT) $$RDES; \
171 done
172
173.PHONY: axw
174## %.axw - Generate the specified .axw file (doesn't work for all files
175## due to inconsistent naming ir .r files.
176%.axw: axw
177 @for RDES in $(REGDESC); do \
178 if echo "$$RDES" | grep $* ; then \
179 $(RDES2TXT) $$RDES; \
180 fi \
181 done
182
183.PHONY: clean
184## clean - Remove .h files and .axw files.
185clean:
186 rm -rf $(INCL_FILES) *.axw
187
diff --git a/include/asm-cris/arch-v32/hwregs/asm/ata_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/ata_defs_asm.h
new file mode 100644
index 000000000000..866191418f9c
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/ata_defs_asm.h
@@ -0,0 +1,222 @@
1#ifndef __ata_defs_asm_h
2#define __ata_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/ata/rtl/ata_regs.r
7 * id: ata_regs.r,v 1.11 2005/02/09 08:27:36 kriskn Exp
8 * last modfied: Mon Apr 11 16:06:25 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/ata_defs_asm.h ../../inst/ata/rtl/ata_regs.r
11 * id: $Id: ata_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_ctrl0, scope ata, type rw */
57#define reg_ata_rw_ctrl0___pio_hold___lsb 0
58#define reg_ata_rw_ctrl0___pio_hold___width 6
59#define reg_ata_rw_ctrl0___pio_strb___lsb 6
60#define reg_ata_rw_ctrl0___pio_strb___width 6
61#define reg_ata_rw_ctrl0___pio_setup___lsb 12
62#define reg_ata_rw_ctrl0___pio_setup___width 6
63#define reg_ata_rw_ctrl0___dma_hold___lsb 18
64#define reg_ata_rw_ctrl0___dma_hold___width 6
65#define reg_ata_rw_ctrl0___dma_strb___lsb 24
66#define reg_ata_rw_ctrl0___dma_strb___width 6
67#define reg_ata_rw_ctrl0___rst___lsb 30
68#define reg_ata_rw_ctrl0___rst___width 1
69#define reg_ata_rw_ctrl0___rst___bit 30
70#define reg_ata_rw_ctrl0___en___lsb 31
71#define reg_ata_rw_ctrl0___en___width 1
72#define reg_ata_rw_ctrl0___en___bit 31
73#define reg_ata_rw_ctrl0_offset 12
74
75/* Register rw_ctrl1, scope ata, type rw */
76#define reg_ata_rw_ctrl1___udma_tcyc___lsb 0
77#define reg_ata_rw_ctrl1___udma_tcyc___width 4
78#define reg_ata_rw_ctrl1___udma_tdvs___lsb 4
79#define reg_ata_rw_ctrl1___udma_tdvs___width 4
80#define reg_ata_rw_ctrl1_offset 16
81
82/* Register rw_ctrl2, scope ata, type rw */
83#define reg_ata_rw_ctrl2___data___lsb 0
84#define reg_ata_rw_ctrl2___data___width 16
85#define reg_ata_rw_ctrl2___dma_size___lsb 19
86#define reg_ata_rw_ctrl2___dma_size___width 1
87#define reg_ata_rw_ctrl2___dma_size___bit 19
88#define reg_ata_rw_ctrl2___multi___lsb 20
89#define reg_ata_rw_ctrl2___multi___width 1
90#define reg_ata_rw_ctrl2___multi___bit 20
91#define reg_ata_rw_ctrl2___hsh___lsb 21
92#define reg_ata_rw_ctrl2___hsh___width 2
93#define reg_ata_rw_ctrl2___trf_mode___lsb 23
94#define reg_ata_rw_ctrl2___trf_mode___width 1
95#define reg_ata_rw_ctrl2___trf_mode___bit 23
96#define reg_ata_rw_ctrl2___rw___lsb 24
97#define reg_ata_rw_ctrl2___rw___width 1
98#define reg_ata_rw_ctrl2___rw___bit 24
99#define reg_ata_rw_ctrl2___addr___lsb 25
100#define reg_ata_rw_ctrl2___addr___width 3
101#define reg_ata_rw_ctrl2___cs0___lsb 28
102#define reg_ata_rw_ctrl2___cs0___width 1
103#define reg_ata_rw_ctrl2___cs0___bit 28
104#define reg_ata_rw_ctrl2___cs1___lsb 29
105#define reg_ata_rw_ctrl2___cs1___width 1
106#define reg_ata_rw_ctrl2___cs1___bit 29
107#define reg_ata_rw_ctrl2___sel___lsb 30
108#define reg_ata_rw_ctrl2___sel___width 2
109#define reg_ata_rw_ctrl2_offset 0
110
111/* Register rs_stat_data, scope ata, type rs */
112#define reg_ata_rs_stat_data___data___lsb 0
113#define reg_ata_rs_stat_data___data___width 16
114#define reg_ata_rs_stat_data___dav___lsb 16
115#define reg_ata_rs_stat_data___dav___width 1
116#define reg_ata_rs_stat_data___dav___bit 16
117#define reg_ata_rs_stat_data___busy___lsb 17
118#define reg_ata_rs_stat_data___busy___width 1
119#define reg_ata_rs_stat_data___busy___bit 17
120#define reg_ata_rs_stat_data_offset 4
121
122/* Register r_stat_data, scope ata, type r */
123#define reg_ata_r_stat_data___data___lsb 0
124#define reg_ata_r_stat_data___data___width 16
125#define reg_ata_r_stat_data___dav___lsb 16
126#define reg_ata_r_stat_data___dav___width 1
127#define reg_ata_r_stat_data___dav___bit 16
128#define reg_ata_r_stat_data___busy___lsb 17
129#define reg_ata_r_stat_data___busy___width 1
130#define reg_ata_r_stat_data___busy___bit 17
131#define reg_ata_r_stat_data_offset 8
132
133/* Register rw_trf_cnt, scope ata, type rw */
134#define reg_ata_rw_trf_cnt___cnt___lsb 0
135#define reg_ata_rw_trf_cnt___cnt___width 17
136#define reg_ata_rw_trf_cnt_offset 20
137
138/* Register r_stat_misc, scope ata, type r */
139#define reg_ata_r_stat_misc___crc___lsb 0
140#define reg_ata_r_stat_misc___crc___width 16
141#define reg_ata_r_stat_misc_offset 24
142
143/* Register rw_intr_mask, scope ata, type rw */
144#define reg_ata_rw_intr_mask___bus0___lsb 0
145#define reg_ata_rw_intr_mask___bus0___width 1
146#define reg_ata_rw_intr_mask___bus0___bit 0
147#define reg_ata_rw_intr_mask___bus1___lsb 1
148#define reg_ata_rw_intr_mask___bus1___width 1
149#define reg_ata_rw_intr_mask___bus1___bit 1
150#define reg_ata_rw_intr_mask___bus2___lsb 2
151#define reg_ata_rw_intr_mask___bus2___width 1
152#define reg_ata_rw_intr_mask___bus2___bit 2
153#define reg_ata_rw_intr_mask___bus3___lsb 3
154#define reg_ata_rw_intr_mask___bus3___width 1
155#define reg_ata_rw_intr_mask___bus3___bit 3
156#define reg_ata_rw_intr_mask_offset 28
157
158/* Register rw_ack_intr, scope ata, type rw */
159#define reg_ata_rw_ack_intr___bus0___lsb 0
160#define reg_ata_rw_ack_intr___bus0___width 1
161#define reg_ata_rw_ack_intr___bus0___bit 0
162#define reg_ata_rw_ack_intr___bus1___lsb 1
163#define reg_ata_rw_ack_intr___bus1___width 1
164#define reg_ata_rw_ack_intr___bus1___bit 1
165#define reg_ata_rw_ack_intr___bus2___lsb 2
166#define reg_ata_rw_ack_intr___bus2___width 1
167#define reg_ata_rw_ack_intr___bus2___bit 2
168#define reg_ata_rw_ack_intr___bus3___lsb 3
169#define reg_ata_rw_ack_intr___bus3___width 1
170#define reg_ata_rw_ack_intr___bus3___bit 3
171#define reg_ata_rw_ack_intr_offset 32
172
173/* Register r_intr, scope ata, type r */
174#define reg_ata_r_intr___bus0___lsb 0
175#define reg_ata_r_intr___bus0___width 1
176#define reg_ata_r_intr___bus0___bit 0
177#define reg_ata_r_intr___bus1___lsb 1
178#define reg_ata_r_intr___bus1___width 1
179#define reg_ata_r_intr___bus1___bit 1
180#define reg_ata_r_intr___bus2___lsb 2
181#define reg_ata_r_intr___bus2___width 1
182#define reg_ata_r_intr___bus2___bit 2
183#define reg_ata_r_intr___bus3___lsb 3
184#define reg_ata_r_intr___bus3___width 1
185#define reg_ata_r_intr___bus3___bit 3
186#define reg_ata_r_intr_offset 36
187
188/* Register r_masked_intr, scope ata, type r */
189#define reg_ata_r_masked_intr___bus0___lsb 0
190#define reg_ata_r_masked_intr___bus0___width 1
191#define reg_ata_r_masked_intr___bus0___bit 0
192#define reg_ata_r_masked_intr___bus1___lsb 1
193#define reg_ata_r_masked_intr___bus1___width 1
194#define reg_ata_r_masked_intr___bus1___bit 1
195#define reg_ata_r_masked_intr___bus2___lsb 2
196#define reg_ata_r_masked_intr___bus2___width 1
197#define reg_ata_r_masked_intr___bus2___bit 2
198#define reg_ata_r_masked_intr___bus3___lsb 3
199#define reg_ata_r_masked_intr___bus3___width 1
200#define reg_ata_r_masked_intr___bus3___bit 3
201#define reg_ata_r_masked_intr_offset 40
202
203
204/* Constants */
205#define regk_ata_active 0x00000001
206#define regk_ata_byte 0x00000001
207#define regk_ata_data 0x00000001
208#define regk_ata_dma 0x00000001
209#define regk_ata_inactive 0x00000000
210#define regk_ata_no 0x00000000
211#define regk_ata_nodata 0x00000000
212#define regk_ata_pio 0x00000000
213#define regk_ata_rd 0x00000001
214#define regk_ata_reg 0x00000000
215#define regk_ata_rw_ctrl0_default 0x00000000
216#define regk_ata_rw_ctrl2_default 0x00000000
217#define regk_ata_rw_intr_mask_default 0x00000000
218#define regk_ata_udma 0x00000002
219#define regk_ata_word 0x00000000
220#define regk_ata_wr 0x00000000
221#define regk_ata_yes 0x00000001
222#endif /* __ata_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/bif_core_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/bif_core_defs_asm.h
new file mode 100644
index 000000000000..c686cb335621
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/bif_core_defs_asm.h
@@ -0,0 +1,319 @@
1#ifndef __bif_core_defs_asm_h
2#define __bif_core_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_core_regs.r
7 * id: bif_core_regs.r,v 1.17 2005/02/04 13:28:22 np Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/bif_core_defs_asm.h ../../inst/bif/rtl/bif_core_regs.r
11 * id: $Id: bif_core_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_grp1_cfg, scope bif_core, type rw */
57#define reg_bif_core_rw_grp1_cfg___lw___lsb 0
58#define reg_bif_core_rw_grp1_cfg___lw___width 6
59#define reg_bif_core_rw_grp1_cfg___ew___lsb 6
60#define reg_bif_core_rw_grp1_cfg___ew___width 3
61#define reg_bif_core_rw_grp1_cfg___zw___lsb 9
62#define reg_bif_core_rw_grp1_cfg___zw___width 3
63#define reg_bif_core_rw_grp1_cfg___aw___lsb 12
64#define reg_bif_core_rw_grp1_cfg___aw___width 2
65#define reg_bif_core_rw_grp1_cfg___dw___lsb 14
66#define reg_bif_core_rw_grp1_cfg___dw___width 2
67#define reg_bif_core_rw_grp1_cfg___ewb___lsb 16
68#define reg_bif_core_rw_grp1_cfg___ewb___width 2
69#define reg_bif_core_rw_grp1_cfg___bw___lsb 18
70#define reg_bif_core_rw_grp1_cfg___bw___width 1
71#define reg_bif_core_rw_grp1_cfg___bw___bit 18
72#define reg_bif_core_rw_grp1_cfg___wr_extend___lsb 19
73#define reg_bif_core_rw_grp1_cfg___wr_extend___width 1
74#define reg_bif_core_rw_grp1_cfg___wr_extend___bit 19
75#define reg_bif_core_rw_grp1_cfg___erc_en___lsb 20
76#define reg_bif_core_rw_grp1_cfg___erc_en___width 1
77#define reg_bif_core_rw_grp1_cfg___erc_en___bit 20
78#define reg_bif_core_rw_grp1_cfg___mode___lsb 21
79#define reg_bif_core_rw_grp1_cfg___mode___width 1
80#define reg_bif_core_rw_grp1_cfg___mode___bit 21
81#define reg_bif_core_rw_grp1_cfg_offset 0
82
83/* Register rw_grp2_cfg, scope bif_core, type rw */
84#define reg_bif_core_rw_grp2_cfg___lw___lsb 0
85#define reg_bif_core_rw_grp2_cfg___lw___width 6
86#define reg_bif_core_rw_grp2_cfg___ew___lsb 6
87#define reg_bif_core_rw_grp2_cfg___ew___width 3
88#define reg_bif_core_rw_grp2_cfg___zw___lsb 9
89#define reg_bif_core_rw_grp2_cfg___zw___width 3
90#define reg_bif_core_rw_grp2_cfg___aw___lsb 12
91#define reg_bif_core_rw_grp2_cfg___aw___width 2
92#define reg_bif_core_rw_grp2_cfg___dw___lsb 14
93#define reg_bif_core_rw_grp2_cfg___dw___width 2
94#define reg_bif_core_rw_grp2_cfg___ewb___lsb 16
95#define reg_bif_core_rw_grp2_cfg___ewb___width 2
96#define reg_bif_core_rw_grp2_cfg___bw___lsb 18
97#define reg_bif_core_rw_grp2_cfg___bw___width 1
98#define reg_bif_core_rw_grp2_cfg___bw___bit 18
99#define reg_bif_core_rw_grp2_cfg___wr_extend___lsb 19
100#define reg_bif_core_rw_grp2_cfg___wr_extend___width 1
101#define reg_bif_core_rw_grp2_cfg___wr_extend___bit 19
102#define reg_bif_core_rw_grp2_cfg___erc_en___lsb 20
103#define reg_bif_core_rw_grp2_cfg___erc_en___width 1
104#define reg_bif_core_rw_grp2_cfg___erc_en___bit 20
105#define reg_bif_core_rw_grp2_cfg___mode___lsb 21
106#define reg_bif_core_rw_grp2_cfg___mode___width 1
107#define reg_bif_core_rw_grp2_cfg___mode___bit 21
108#define reg_bif_core_rw_grp2_cfg_offset 4
109
110/* Register rw_grp3_cfg, scope bif_core, type rw */
111#define reg_bif_core_rw_grp3_cfg___lw___lsb 0
112#define reg_bif_core_rw_grp3_cfg___lw___width 6
113#define reg_bif_core_rw_grp3_cfg___ew___lsb 6
114#define reg_bif_core_rw_grp3_cfg___ew___width 3
115#define reg_bif_core_rw_grp3_cfg___zw___lsb 9
116#define reg_bif_core_rw_grp3_cfg___zw___width 3
117#define reg_bif_core_rw_grp3_cfg___aw___lsb 12
118#define reg_bif_core_rw_grp3_cfg___aw___width 2
119#define reg_bif_core_rw_grp3_cfg___dw___lsb 14
120#define reg_bif_core_rw_grp3_cfg___dw___width 2
121#define reg_bif_core_rw_grp3_cfg___ewb___lsb 16
122#define reg_bif_core_rw_grp3_cfg___ewb___width 2
123#define reg_bif_core_rw_grp3_cfg___bw___lsb 18
124#define reg_bif_core_rw_grp3_cfg___bw___width 1
125#define reg_bif_core_rw_grp3_cfg___bw___bit 18
126#define reg_bif_core_rw_grp3_cfg___wr_extend___lsb 19
127#define reg_bif_core_rw_grp3_cfg___wr_extend___width 1
128#define reg_bif_core_rw_grp3_cfg___wr_extend___bit 19
129#define reg_bif_core_rw_grp3_cfg___erc_en___lsb 20
130#define reg_bif_core_rw_grp3_cfg___erc_en___width 1
131#define reg_bif_core_rw_grp3_cfg___erc_en___bit 20
132#define reg_bif_core_rw_grp3_cfg___mode___lsb 21
133#define reg_bif_core_rw_grp3_cfg___mode___width 1
134#define reg_bif_core_rw_grp3_cfg___mode___bit 21
135#define reg_bif_core_rw_grp3_cfg___gated_csp0___lsb 24
136#define reg_bif_core_rw_grp3_cfg___gated_csp0___width 2
137#define reg_bif_core_rw_grp3_cfg___gated_csp1___lsb 26
138#define reg_bif_core_rw_grp3_cfg___gated_csp1___width 2
139#define reg_bif_core_rw_grp3_cfg___gated_csp2___lsb 28
140#define reg_bif_core_rw_grp3_cfg___gated_csp2___width 2
141#define reg_bif_core_rw_grp3_cfg___gated_csp3___lsb 30
142#define reg_bif_core_rw_grp3_cfg___gated_csp3___width 2
143#define reg_bif_core_rw_grp3_cfg_offset 8
144
145/* Register rw_grp4_cfg, scope bif_core, type rw */
146#define reg_bif_core_rw_grp4_cfg___lw___lsb 0
147#define reg_bif_core_rw_grp4_cfg___lw___width 6
148#define reg_bif_core_rw_grp4_cfg___ew___lsb 6
149#define reg_bif_core_rw_grp4_cfg___ew___width 3
150#define reg_bif_core_rw_grp4_cfg___zw___lsb 9
151#define reg_bif_core_rw_grp4_cfg___zw___width 3
152#define reg_bif_core_rw_grp4_cfg___aw___lsb 12
153#define reg_bif_core_rw_grp4_cfg___aw___width 2
154#define reg_bif_core_rw_grp4_cfg___dw___lsb 14
155#define reg_bif_core_rw_grp4_cfg___dw___width 2
156#define reg_bif_core_rw_grp4_cfg___ewb___lsb 16
157#define reg_bif_core_rw_grp4_cfg___ewb___width 2
158#define reg_bif_core_rw_grp4_cfg___bw___lsb 18
159#define reg_bif_core_rw_grp4_cfg___bw___width 1
160#define reg_bif_core_rw_grp4_cfg___bw___bit 18
161#define reg_bif_core_rw_grp4_cfg___wr_extend___lsb 19
162#define reg_bif_core_rw_grp4_cfg___wr_extend___width 1
163#define reg_bif_core_rw_grp4_cfg___wr_extend___bit 19
164#define reg_bif_core_rw_grp4_cfg___erc_en___lsb 20
165#define reg_bif_core_rw_grp4_cfg___erc_en___width 1
166#define reg_bif_core_rw_grp4_cfg___erc_en___bit 20
167#define reg_bif_core_rw_grp4_cfg___mode___lsb 21
168#define reg_bif_core_rw_grp4_cfg___mode___width 1
169#define reg_bif_core_rw_grp4_cfg___mode___bit 21
170#define reg_bif_core_rw_grp4_cfg___gated_csp4___lsb 26
171#define reg_bif_core_rw_grp4_cfg___gated_csp4___width 2
172#define reg_bif_core_rw_grp4_cfg___gated_csp5___lsb 28
173#define reg_bif_core_rw_grp4_cfg___gated_csp5___width 2
174#define reg_bif_core_rw_grp4_cfg___gated_csp6___lsb 30
175#define reg_bif_core_rw_grp4_cfg___gated_csp6___width 2
176#define reg_bif_core_rw_grp4_cfg_offset 12
177
178/* Register rw_sdram_cfg_grp0, scope bif_core, type rw */
179#define reg_bif_core_rw_sdram_cfg_grp0___bank_sel___lsb 0
180#define reg_bif_core_rw_sdram_cfg_grp0___bank_sel___width 5
181#define reg_bif_core_rw_sdram_cfg_grp0___ca___lsb 5
182#define reg_bif_core_rw_sdram_cfg_grp0___ca___width 3
183#define reg_bif_core_rw_sdram_cfg_grp0___type___lsb 8
184#define reg_bif_core_rw_sdram_cfg_grp0___type___width 1
185#define reg_bif_core_rw_sdram_cfg_grp0___type___bit 8
186#define reg_bif_core_rw_sdram_cfg_grp0___bw___lsb 9
187#define reg_bif_core_rw_sdram_cfg_grp0___bw___width 1
188#define reg_bif_core_rw_sdram_cfg_grp0___bw___bit 9
189#define reg_bif_core_rw_sdram_cfg_grp0___sh___lsb 10
190#define reg_bif_core_rw_sdram_cfg_grp0___sh___width 3
191#define reg_bif_core_rw_sdram_cfg_grp0___wmm___lsb 13
192#define reg_bif_core_rw_sdram_cfg_grp0___wmm___width 1
193#define reg_bif_core_rw_sdram_cfg_grp0___wmm___bit 13
194#define reg_bif_core_rw_sdram_cfg_grp0___sh16___lsb 14
195#define reg_bif_core_rw_sdram_cfg_grp0___sh16___width 1
196#define reg_bif_core_rw_sdram_cfg_grp0___sh16___bit 14
197#define reg_bif_core_rw_sdram_cfg_grp0___grp_sel___lsb 15
198#define reg_bif_core_rw_sdram_cfg_grp0___grp_sel___width 5
199#define reg_bif_core_rw_sdram_cfg_grp0_offset 16
200
201/* Register rw_sdram_cfg_grp1, scope bif_core, type rw */
202#define reg_bif_core_rw_sdram_cfg_grp1___bank_sel___lsb 0
203#define reg_bif_core_rw_sdram_cfg_grp1___bank_sel___width 5
204#define reg_bif_core_rw_sdram_cfg_grp1___ca___lsb 5
205#define reg_bif_core_rw_sdram_cfg_grp1___ca___width 3
206#define reg_bif_core_rw_sdram_cfg_grp1___type___lsb 8
207#define reg_bif_core_rw_sdram_cfg_grp1___type___width 1
208#define reg_bif_core_rw_sdram_cfg_grp1___type___bit 8
209#define reg_bif_core_rw_sdram_cfg_grp1___bw___lsb 9
210#define reg_bif_core_rw_sdram_cfg_grp1___bw___width 1
211#define reg_bif_core_rw_sdram_cfg_grp1___bw___bit 9
212#define reg_bif_core_rw_sdram_cfg_grp1___sh___lsb 10
213#define reg_bif_core_rw_sdram_cfg_grp1___sh___width 3
214#define reg_bif_core_rw_sdram_cfg_grp1___wmm___lsb 13
215#define reg_bif_core_rw_sdram_cfg_grp1___wmm___width 1
216#define reg_bif_core_rw_sdram_cfg_grp1___wmm___bit 13
217#define reg_bif_core_rw_sdram_cfg_grp1___sh16___lsb 14
218#define reg_bif_core_rw_sdram_cfg_grp1___sh16___width 1
219#define reg_bif_core_rw_sdram_cfg_grp1___sh16___bit 14
220#define reg_bif_core_rw_sdram_cfg_grp1_offset 20
221
222/* Register rw_sdram_timing, scope bif_core, type rw */
223#define reg_bif_core_rw_sdram_timing___cl___lsb 0
224#define reg_bif_core_rw_sdram_timing___cl___width 3
225#define reg_bif_core_rw_sdram_timing___rcd___lsb 3
226#define reg_bif_core_rw_sdram_timing___rcd___width 3
227#define reg_bif_core_rw_sdram_timing___rp___lsb 6
228#define reg_bif_core_rw_sdram_timing___rp___width 3
229#define reg_bif_core_rw_sdram_timing___rc___lsb 9
230#define reg_bif_core_rw_sdram_timing___rc___width 2
231#define reg_bif_core_rw_sdram_timing___dpl___lsb 11
232#define reg_bif_core_rw_sdram_timing___dpl___width 2
233#define reg_bif_core_rw_sdram_timing___pde___lsb 13
234#define reg_bif_core_rw_sdram_timing___pde___width 1
235#define reg_bif_core_rw_sdram_timing___pde___bit 13
236#define reg_bif_core_rw_sdram_timing___ref___lsb 14
237#define reg_bif_core_rw_sdram_timing___ref___width 2
238#define reg_bif_core_rw_sdram_timing___cpd___lsb 16
239#define reg_bif_core_rw_sdram_timing___cpd___width 1
240#define reg_bif_core_rw_sdram_timing___cpd___bit 16
241#define reg_bif_core_rw_sdram_timing___sdcke___lsb 17
242#define reg_bif_core_rw_sdram_timing___sdcke___width 1
243#define reg_bif_core_rw_sdram_timing___sdcke___bit 17
244#define reg_bif_core_rw_sdram_timing___sdclk___lsb 18
245#define reg_bif_core_rw_sdram_timing___sdclk___width 1
246#define reg_bif_core_rw_sdram_timing___sdclk___bit 18
247#define reg_bif_core_rw_sdram_timing_offset 24
248
249/* Register rw_sdram_cmd, scope bif_core, type rw */
250#define reg_bif_core_rw_sdram_cmd___cmd___lsb 0
251#define reg_bif_core_rw_sdram_cmd___cmd___width 3
252#define reg_bif_core_rw_sdram_cmd___mrs_data___lsb 3
253#define reg_bif_core_rw_sdram_cmd___mrs_data___width 15
254#define reg_bif_core_rw_sdram_cmd_offset 28
255
256/* Register rs_sdram_ref_stat, scope bif_core, type rs */
257#define reg_bif_core_rs_sdram_ref_stat___ok___lsb 0
258#define reg_bif_core_rs_sdram_ref_stat___ok___width 1
259#define reg_bif_core_rs_sdram_ref_stat___ok___bit 0
260#define reg_bif_core_rs_sdram_ref_stat_offset 32
261
262/* Register r_sdram_ref_stat, scope bif_core, type r */
263#define reg_bif_core_r_sdram_ref_stat___ok___lsb 0
264#define reg_bif_core_r_sdram_ref_stat___ok___width 1
265#define reg_bif_core_r_sdram_ref_stat___ok___bit 0
266#define reg_bif_core_r_sdram_ref_stat_offset 36
267
268
269/* Constants */
270#define regk_bif_core_bank2 0x00000000
271#define regk_bif_core_bank4 0x00000001
272#define regk_bif_core_bit10 0x0000000a
273#define regk_bif_core_bit11 0x0000000b
274#define regk_bif_core_bit12 0x0000000c
275#define regk_bif_core_bit13 0x0000000d
276#define regk_bif_core_bit14 0x0000000e
277#define regk_bif_core_bit15 0x0000000f
278#define regk_bif_core_bit16 0x00000010
279#define regk_bif_core_bit17 0x00000011
280#define regk_bif_core_bit18 0x00000012
281#define regk_bif_core_bit19 0x00000013
282#define regk_bif_core_bit20 0x00000014
283#define regk_bif_core_bit21 0x00000015
284#define regk_bif_core_bit22 0x00000016
285#define regk_bif_core_bit23 0x00000017
286#define regk_bif_core_bit24 0x00000018
287#define regk_bif_core_bit25 0x00000019
288#define regk_bif_core_bit26 0x0000001a
289#define regk_bif_core_bit27 0x0000001b
290#define regk_bif_core_bit28 0x0000001c
291#define regk_bif_core_bit29 0x0000001d
292#define regk_bif_core_bit9 0x00000009
293#define regk_bif_core_bw16 0x00000001
294#define regk_bif_core_bw32 0x00000000
295#define regk_bif_core_bwe 0x00000000
296#define regk_bif_core_cwe 0x00000001
297#define regk_bif_core_e15us 0x00000001
298#define regk_bif_core_e7800ns 0x00000002
299#define regk_bif_core_grp0 0x00000000
300#define regk_bif_core_grp1 0x00000001
301#define regk_bif_core_mrs 0x00000003
302#define regk_bif_core_no 0x00000000
303#define regk_bif_core_none 0x00000000
304#define regk_bif_core_nop 0x00000000
305#define regk_bif_core_off 0x00000000
306#define regk_bif_core_pre 0x00000002
307#define regk_bif_core_r_sdram_ref_stat_default 0x00000001
308#define regk_bif_core_rd 0x00000002
309#define regk_bif_core_ref 0x00000001
310#define regk_bif_core_rs_sdram_ref_stat_default 0x00000001
311#define regk_bif_core_rw_grp1_cfg_default 0x000006cf
312#define regk_bif_core_rw_grp2_cfg_default 0x000006cf
313#define regk_bif_core_rw_grp3_cfg_default 0x000006cf
314#define regk_bif_core_rw_grp4_cfg_default 0x000006cf
315#define regk_bif_core_rw_sdram_cfg_grp1_default 0x00000000
316#define regk_bif_core_slf 0x00000004
317#define regk_bif_core_wr 0x00000001
318#define regk_bif_core_yes 0x00000001
319#endif /* __bif_core_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/bif_dma_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/bif_dma_defs_asm.h
new file mode 100644
index 000000000000..71532aa18168
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/bif_dma_defs_asm.h
@@ -0,0 +1,495 @@
1#ifndef __bif_dma_defs_asm_h
2#define __bif_dma_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_dma_regs.r
7 * id: bif_dma_regs.r,v 1.6 2005/02/04 13:28:31 perz Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/bif_dma_defs_asm.h ../../inst/bif/rtl/bif_dma_regs.r
11 * id: $Id: bif_dma_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_ch0_ctrl, scope bif_dma, type rw */
57#define reg_bif_dma_rw_ch0_ctrl___bw___lsb 0
58#define reg_bif_dma_rw_ch0_ctrl___bw___width 2
59#define reg_bif_dma_rw_ch0_ctrl___burst_len___lsb 2
60#define reg_bif_dma_rw_ch0_ctrl___burst_len___width 1
61#define reg_bif_dma_rw_ch0_ctrl___burst_len___bit 2
62#define reg_bif_dma_rw_ch0_ctrl___cont___lsb 3
63#define reg_bif_dma_rw_ch0_ctrl___cont___width 1
64#define reg_bif_dma_rw_ch0_ctrl___cont___bit 3
65#define reg_bif_dma_rw_ch0_ctrl___end_pad___lsb 4
66#define reg_bif_dma_rw_ch0_ctrl___end_pad___width 1
67#define reg_bif_dma_rw_ch0_ctrl___end_pad___bit 4
68#define reg_bif_dma_rw_ch0_ctrl___cnt___lsb 5
69#define reg_bif_dma_rw_ch0_ctrl___cnt___width 1
70#define reg_bif_dma_rw_ch0_ctrl___cnt___bit 5
71#define reg_bif_dma_rw_ch0_ctrl___dreq_pin___lsb 6
72#define reg_bif_dma_rw_ch0_ctrl___dreq_pin___width 3
73#define reg_bif_dma_rw_ch0_ctrl___dreq_mode___lsb 9
74#define reg_bif_dma_rw_ch0_ctrl___dreq_mode___width 2
75#define reg_bif_dma_rw_ch0_ctrl___tc_in_pin___lsb 11
76#define reg_bif_dma_rw_ch0_ctrl___tc_in_pin___width 3
77#define reg_bif_dma_rw_ch0_ctrl___tc_in_mode___lsb 14
78#define reg_bif_dma_rw_ch0_ctrl___tc_in_mode___width 2
79#define reg_bif_dma_rw_ch0_ctrl___bus_mode___lsb 16
80#define reg_bif_dma_rw_ch0_ctrl___bus_mode___width 2
81#define reg_bif_dma_rw_ch0_ctrl___rate_en___lsb 18
82#define reg_bif_dma_rw_ch0_ctrl___rate_en___width 1
83#define reg_bif_dma_rw_ch0_ctrl___rate_en___bit 18
84#define reg_bif_dma_rw_ch0_ctrl___wr_all___lsb 19
85#define reg_bif_dma_rw_ch0_ctrl___wr_all___width 1
86#define reg_bif_dma_rw_ch0_ctrl___wr_all___bit 19
87#define reg_bif_dma_rw_ch0_ctrl_offset 0
88
89/* Register rw_ch0_addr, scope bif_dma, type rw */
90#define reg_bif_dma_rw_ch0_addr___addr___lsb 0
91#define reg_bif_dma_rw_ch0_addr___addr___width 32
92#define reg_bif_dma_rw_ch0_addr_offset 4
93
94/* Register rw_ch0_start, scope bif_dma, type rw */
95#define reg_bif_dma_rw_ch0_start___run___lsb 0
96#define reg_bif_dma_rw_ch0_start___run___width 1
97#define reg_bif_dma_rw_ch0_start___run___bit 0
98#define reg_bif_dma_rw_ch0_start_offset 8
99
100/* Register rw_ch0_cnt, scope bif_dma, type rw */
101#define reg_bif_dma_rw_ch0_cnt___start_cnt___lsb 0
102#define reg_bif_dma_rw_ch0_cnt___start_cnt___width 16
103#define reg_bif_dma_rw_ch0_cnt_offset 12
104
105/* Register r_ch0_stat, scope bif_dma, type r */
106#define reg_bif_dma_r_ch0_stat___cnt___lsb 0
107#define reg_bif_dma_r_ch0_stat___cnt___width 16
108#define reg_bif_dma_r_ch0_stat___run___lsb 31
109#define reg_bif_dma_r_ch0_stat___run___width 1
110#define reg_bif_dma_r_ch0_stat___run___bit 31
111#define reg_bif_dma_r_ch0_stat_offset 16
112
113/* Register rw_ch1_ctrl, scope bif_dma, type rw */
114#define reg_bif_dma_rw_ch1_ctrl___bw___lsb 0
115#define reg_bif_dma_rw_ch1_ctrl___bw___width 2
116#define reg_bif_dma_rw_ch1_ctrl___burst_len___lsb 2
117#define reg_bif_dma_rw_ch1_ctrl___burst_len___width 1
118#define reg_bif_dma_rw_ch1_ctrl___burst_len___bit 2
119#define reg_bif_dma_rw_ch1_ctrl___cont___lsb 3
120#define reg_bif_dma_rw_ch1_ctrl___cont___width 1
121#define reg_bif_dma_rw_ch1_ctrl___cont___bit 3
122#define reg_bif_dma_rw_ch1_ctrl___end_discard___lsb 4
123#define reg_bif_dma_rw_ch1_ctrl___end_discard___width 1
124#define reg_bif_dma_rw_ch1_ctrl___end_discard___bit 4
125#define reg_bif_dma_rw_ch1_ctrl___cnt___lsb 5
126#define reg_bif_dma_rw_ch1_ctrl___cnt___width 1
127#define reg_bif_dma_rw_ch1_ctrl___cnt___bit 5
128#define reg_bif_dma_rw_ch1_ctrl___dreq_pin___lsb 6
129#define reg_bif_dma_rw_ch1_ctrl___dreq_pin___width 3
130#define reg_bif_dma_rw_ch1_ctrl___dreq_mode___lsb 9
131#define reg_bif_dma_rw_ch1_ctrl___dreq_mode___width 2
132#define reg_bif_dma_rw_ch1_ctrl___tc_in_pin___lsb 11
133#define reg_bif_dma_rw_ch1_ctrl___tc_in_pin___width 3
134#define reg_bif_dma_rw_ch1_ctrl___tc_in_mode___lsb 14
135#define reg_bif_dma_rw_ch1_ctrl___tc_in_mode___width 2
136#define reg_bif_dma_rw_ch1_ctrl___bus_mode___lsb 16
137#define reg_bif_dma_rw_ch1_ctrl___bus_mode___width 2
138#define reg_bif_dma_rw_ch1_ctrl___rate_en___lsb 18
139#define reg_bif_dma_rw_ch1_ctrl___rate_en___width 1
140#define reg_bif_dma_rw_ch1_ctrl___rate_en___bit 18
141#define reg_bif_dma_rw_ch1_ctrl_offset 32
142
143/* Register rw_ch1_addr, scope bif_dma, type rw */
144#define reg_bif_dma_rw_ch1_addr___addr___lsb 0
145#define reg_bif_dma_rw_ch1_addr___addr___width 32
146#define reg_bif_dma_rw_ch1_addr_offset 36
147
148/* Register rw_ch1_start, scope bif_dma, type rw */
149#define reg_bif_dma_rw_ch1_start___run___lsb 0
150#define reg_bif_dma_rw_ch1_start___run___width 1
151#define reg_bif_dma_rw_ch1_start___run___bit 0
152#define reg_bif_dma_rw_ch1_start_offset 40
153
154/* Register rw_ch1_cnt, scope bif_dma, type rw */
155#define reg_bif_dma_rw_ch1_cnt___start_cnt___lsb 0
156#define reg_bif_dma_rw_ch1_cnt___start_cnt___width 16
157#define reg_bif_dma_rw_ch1_cnt_offset 44
158
159/* Register r_ch1_stat, scope bif_dma, type r */
160#define reg_bif_dma_r_ch1_stat___cnt___lsb 0
161#define reg_bif_dma_r_ch1_stat___cnt___width 16
162#define reg_bif_dma_r_ch1_stat___run___lsb 31
163#define reg_bif_dma_r_ch1_stat___run___width 1
164#define reg_bif_dma_r_ch1_stat___run___bit 31
165#define reg_bif_dma_r_ch1_stat_offset 48
166
167/* Register rw_ch2_ctrl, scope bif_dma, type rw */
168#define reg_bif_dma_rw_ch2_ctrl___bw___lsb 0
169#define reg_bif_dma_rw_ch2_ctrl___bw___width 2
170#define reg_bif_dma_rw_ch2_ctrl___burst_len___lsb 2
171#define reg_bif_dma_rw_ch2_ctrl___burst_len___width 1
172#define reg_bif_dma_rw_ch2_ctrl___burst_len___bit 2
173#define reg_bif_dma_rw_ch2_ctrl___cont___lsb 3
174#define reg_bif_dma_rw_ch2_ctrl___cont___width 1
175#define reg_bif_dma_rw_ch2_ctrl___cont___bit 3
176#define reg_bif_dma_rw_ch2_ctrl___end_pad___lsb 4
177#define reg_bif_dma_rw_ch2_ctrl___end_pad___width 1
178#define reg_bif_dma_rw_ch2_ctrl___end_pad___bit 4
179#define reg_bif_dma_rw_ch2_ctrl___cnt___lsb 5
180#define reg_bif_dma_rw_ch2_ctrl___cnt___width 1
181#define reg_bif_dma_rw_ch2_ctrl___cnt___bit 5
182#define reg_bif_dma_rw_ch2_ctrl___dreq_pin___lsb 6
183#define reg_bif_dma_rw_ch2_ctrl___dreq_pin___width 3
184#define reg_bif_dma_rw_ch2_ctrl___dreq_mode___lsb 9
185#define reg_bif_dma_rw_ch2_ctrl___dreq_mode___width 2
186#define reg_bif_dma_rw_ch2_ctrl___tc_in_pin___lsb 11
187#define reg_bif_dma_rw_ch2_ctrl___tc_in_pin___width 3
188#define reg_bif_dma_rw_ch2_ctrl___tc_in_mode___lsb 14
189#define reg_bif_dma_rw_ch2_ctrl___tc_in_mode___width 2
190#define reg_bif_dma_rw_ch2_ctrl___bus_mode___lsb 16
191#define reg_bif_dma_rw_ch2_ctrl___bus_mode___width 2
192#define reg_bif_dma_rw_ch2_ctrl___rate_en___lsb 18
193#define reg_bif_dma_rw_ch2_ctrl___rate_en___width 1
194#define reg_bif_dma_rw_ch2_ctrl___rate_en___bit 18
195#define reg_bif_dma_rw_ch2_ctrl___wr_all___lsb 19
196#define reg_bif_dma_rw_ch2_ctrl___wr_all___width 1
197#define reg_bif_dma_rw_ch2_ctrl___wr_all___bit 19
198#define reg_bif_dma_rw_ch2_ctrl_offset 64
199
200/* Register rw_ch2_addr, scope bif_dma, type rw */
201#define reg_bif_dma_rw_ch2_addr___addr___lsb 0
202#define reg_bif_dma_rw_ch2_addr___addr___width 32
203#define reg_bif_dma_rw_ch2_addr_offset 68
204
205/* Register rw_ch2_start, scope bif_dma, type rw */
206#define reg_bif_dma_rw_ch2_start___run___lsb 0
207#define reg_bif_dma_rw_ch2_start___run___width 1
208#define reg_bif_dma_rw_ch2_start___run___bit 0
209#define reg_bif_dma_rw_ch2_start_offset 72
210
211/* Register rw_ch2_cnt, scope bif_dma, type rw */
212#define reg_bif_dma_rw_ch2_cnt___start_cnt___lsb 0
213#define reg_bif_dma_rw_ch2_cnt___start_cnt___width 16
214#define reg_bif_dma_rw_ch2_cnt_offset 76
215
216/* Register r_ch2_stat, scope bif_dma, type r */
217#define reg_bif_dma_r_ch2_stat___cnt___lsb 0
218#define reg_bif_dma_r_ch2_stat___cnt___width 16
219#define reg_bif_dma_r_ch2_stat___run___lsb 31
220#define reg_bif_dma_r_ch2_stat___run___width 1
221#define reg_bif_dma_r_ch2_stat___run___bit 31
222#define reg_bif_dma_r_ch2_stat_offset 80
223
224/* Register rw_ch3_ctrl, scope bif_dma, type rw */
225#define reg_bif_dma_rw_ch3_ctrl___bw___lsb 0
226#define reg_bif_dma_rw_ch3_ctrl___bw___width 2
227#define reg_bif_dma_rw_ch3_ctrl___burst_len___lsb 2
228#define reg_bif_dma_rw_ch3_ctrl___burst_len___width 1
229#define reg_bif_dma_rw_ch3_ctrl___burst_len___bit 2
230#define reg_bif_dma_rw_ch3_ctrl___cont___lsb 3
231#define reg_bif_dma_rw_ch3_ctrl___cont___width 1
232#define reg_bif_dma_rw_ch3_ctrl___cont___bit 3
233#define reg_bif_dma_rw_ch3_ctrl___end_discard___lsb 4
234#define reg_bif_dma_rw_ch3_ctrl___end_discard___width 1
235#define reg_bif_dma_rw_ch3_ctrl___end_discard___bit 4
236#define reg_bif_dma_rw_ch3_ctrl___cnt___lsb 5
237#define reg_bif_dma_rw_ch3_ctrl___cnt___width 1
238#define reg_bif_dma_rw_ch3_ctrl___cnt___bit 5
239#define reg_bif_dma_rw_ch3_ctrl___dreq_pin___lsb 6
240#define reg_bif_dma_rw_ch3_ctrl___dreq_pin___width 3
241#define reg_bif_dma_rw_ch3_ctrl___dreq_mode___lsb 9
242#define reg_bif_dma_rw_ch3_ctrl___dreq_mode___width 2
243#define reg_bif_dma_rw_ch3_ctrl___tc_in_pin___lsb 11
244#define reg_bif_dma_rw_ch3_ctrl___tc_in_pin___width 3
245#define reg_bif_dma_rw_ch3_ctrl___tc_in_mode___lsb 14
246#define reg_bif_dma_rw_ch3_ctrl___tc_in_mode___width 2
247#define reg_bif_dma_rw_ch3_ctrl___bus_mode___lsb 16
248#define reg_bif_dma_rw_ch3_ctrl___bus_mode___width 2
249#define reg_bif_dma_rw_ch3_ctrl___rate_en___lsb 18
250#define reg_bif_dma_rw_ch3_ctrl___rate_en___width 1
251#define reg_bif_dma_rw_ch3_ctrl___rate_en___bit 18
252#define reg_bif_dma_rw_ch3_ctrl_offset 96
253
254/* Register rw_ch3_addr, scope bif_dma, type rw */
255#define reg_bif_dma_rw_ch3_addr___addr___lsb 0
256#define reg_bif_dma_rw_ch3_addr___addr___width 32
257#define reg_bif_dma_rw_ch3_addr_offset 100
258
259/* Register rw_ch3_start, scope bif_dma, type rw */
260#define reg_bif_dma_rw_ch3_start___run___lsb 0
261#define reg_bif_dma_rw_ch3_start___run___width 1
262#define reg_bif_dma_rw_ch3_start___run___bit 0
263#define reg_bif_dma_rw_ch3_start_offset 104
264
265/* Register rw_ch3_cnt, scope bif_dma, type rw */
266#define reg_bif_dma_rw_ch3_cnt___start_cnt___lsb 0
267#define reg_bif_dma_rw_ch3_cnt___start_cnt___width 16
268#define reg_bif_dma_rw_ch3_cnt_offset 108
269
270/* Register r_ch3_stat, scope bif_dma, type r */
271#define reg_bif_dma_r_ch3_stat___cnt___lsb 0
272#define reg_bif_dma_r_ch3_stat___cnt___width 16
273#define reg_bif_dma_r_ch3_stat___run___lsb 31
274#define reg_bif_dma_r_ch3_stat___run___width 1
275#define reg_bif_dma_r_ch3_stat___run___bit 31
276#define reg_bif_dma_r_ch3_stat_offset 112
277
278/* Register rw_intr_mask, scope bif_dma, type rw */
279#define reg_bif_dma_rw_intr_mask___ext_dma0___lsb 0
280#define reg_bif_dma_rw_intr_mask___ext_dma0___width 1
281#define reg_bif_dma_rw_intr_mask___ext_dma0___bit 0
282#define reg_bif_dma_rw_intr_mask___ext_dma1___lsb 1
283#define reg_bif_dma_rw_intr_mask___ext_dma1___width 1
284#define reg_bif_dma_rw_intr_mask___ext_dma1___bit 1
285#define reg_bif_dma_rw_intr_mask___ext_dma2___lsb 2
286#define reg_bif_dma_rw_intr_mask___ext_dma2___width 1
287#define reg_bif_dma_rw_intr_mask___ext_dma2___bit 2
288#define reg_bif_dma_rw_intr_mask___ext_dma3___lsb 3
289#define reg_bif_dma_rw_intr_mask___ext_dma3___width 1
290#define reg_bif_dma_rw_intr_mask___ext_dma3___bit 3
291#define reg_bif_dma_rw_intr_mask_offset 128
292
293/* Register rw_ack_intr, scope bif_dma, type rw */
294#define reg_bif_dma_rw_ack_intr___ext_dma0___lsb 0
295#define reg_bif_dma_rw_ack_intr___ext_dma0___width 1
296#define reg_bif_dma_rw_ack_intr___ext_dma0___bit 0
297#define reg_bif_dma_rw_ack_intr___ext_dma1___lsb 1
298#define reg_bif_dma_rw_ack_intr___ext_dma1___width 1
299#define reg_bif_dma_rw_ack_intr___ext_dma1___bit 1
300#define reg_bif_dma_rw_ack_intr___ext_dma2___lsb 2
301#define reg_bif_dma_rw_ack_intr___ext_dma2___width 1
302#define reg_bif_dma_rw_ack_intr___ext_dma2___bit 2
303#define reg_bif_dma_rw_ack_intr___ext_dma3___lsb 3
304#define reg_bif_dma_rw_ack_intr___ext_dma3___width 1
305#define reg_bif_dma_rw_ack_intr___ext_dma3___bit 3
306#define reg_bif_dma_rw_ack_intr_offset 132
307
308/* Register r_intr, scope bif_dma, type r */
309#define reg_bif_dma_r_intr___ext_dma0___lsb 0
310#define reg_bif_dma_r_intr___ext_dma0___width 1
311#define reg_bif_dma_r_intr___ext_dma0___bit 0
312#define reg_bif_dma_r_intr___ext_dma1___lsb 1
313#define reg_bif_dma_r_intr___ext_dma1___width 1
314#define reg_bif_dma_r_intr___ext_dma1___bit 1
315#define reg_bif_dma_r_intr___ext_dma2___lsb 2
316#define reg_bif_dma_r_intr___ext_dma2___width 1
317#define reg_bif_dma_r_intr___ext_dma2___bit 2
318#define reg_bif_dma_r_intr___ext_dma3___lsb 3
319#define reg_bif_dma_r_intr___ext_dma3___width 1
320#define reg_bif_dma_r_intr___ext_dma3___bit 3
321#define reg_bif_dma_r_intr_offset 136
322
323/* Register r_masked_intr, scope bif_dma, type r */
324#define reg_bif_dma_r_masked_intr___ext_dma0___lsb 0
325#define reg_bif_dma_r_masked_intr___ext_dma0___width 1
326#define reg_bif_dma_r_masked_intr___ext_dma0___bit 0
327#define reg_bif_dma_r_masked_intr___ext_dma1___lsb 1
328#define reg_bif_dma_r_masked_intr___ext_dma1___width 1
329#define reg_bif_dma_r_masked_intr___ext_dma1___bit 1
330#define reg_bif_dma_r_masked_intr___ext_dma2___lsb 2
331#define reg_bif_dma_r_masked_intr___ext_dma2___width 1
332#define reg_bif_dma_r_masked_intr___ext_dma2___bit 2
333#define reg_bif_dma_r_masked_intr___ext_dma3___lsb 3
334#define reg_bif_dma_r_masked_intr___ext_dma3___width 1
335#define reg_bif_dma_r_masked_intr___ext_dma3___bit 3
336#define reg_bif_dma_r_masked_intr_offset 140
337
338/* Register rw_pin0_cfg, scope bif_dma, type rw */
339#define reg_bif_dma_rw_pin0_cfg___master_ch___lsb 0
340#define reg_bif_dma_rw_pin0_cfg___master_ch___width 2
341#define reg_bif_dma_rw_pin0_cfg___master_mode___lsb 2
342#define reg_bif_dma_rw_pin0_cfg___master_mode___width 3
343#define reg_bif_dma_rw_pin0_cfg___slave_ch___lsb 5
344#define reg_bif_dma_rw_pin0_cfg___slave_ch___width 2
345#define reg_bif_dma_rw_pin0_cfg___slave_mode___lsb 7
346#define reg_bif_dma_rw_pin0_cfg___slave_mode___width 3
347#define reg_bif_dma_rw_pin0_cfg_offset 160
348
349/* Register rw_pin1_cfg, scope bif_dma, type rw */
350#define reg_bif_dma_rw_pin1_cfg___master_ch___lsb 0
351#define reg_bif_dma_rw_pin1_cfg___master_ch___width 2
352#define reg_bif_dma_rw_pin1_cfg___master_mode___lsb 2
353#define reg_bif_dma_rw_pin1_cfg___master_mode___width 3
354#define reg_bif_dma_rw_pin1_cfg___slave_ch___lsb 5
355#define reg_bif_dma_rw_pin1_cfg___slave_ch___width 2
356#define reg_bif_dma_rw_pin1_cfg___slave_mode___lsb 7
357#define reg_bif_dma_rw_pin1_cfg___slave_mode___width 3
358#define reg_bif_dma_rw_pin1_cfg_offset 164
359
360/* Register rw_pin2_cfg, scope bif_dma, type rw */
361#define reg_bif_dma_rw_pin2_cfg___master_ch___lsb 0
362#define reg_bif_dma_rw_pin2_cfg___master_ch___width 2
363#define reg_bif_dma_rw_pin2_cfg___master_mode___lsb 2
364#define reg_bif_dma_rw_pin2_cfg___master_mode___width 3
365#define reg_bif_dma_rw_pin2_cfg___slave_ch___lsb 5
366#define reg_bif_dma_rw_pin2_cfg___slave_ch___width 2
367#define reg_bif_dma_rw_pin2_cfg___slave_mode___lsb 7
368#define reg_bif_dma_rw_pin2_cfg___slave_mode___width 3
369#define reg_bif_dma_rw_pin2_cfg_offset 168
370
371/* Register rw_pin3_cfg, scope bif_dma, type rw */
372#define reg_bif_dma_rw_pin3_cfg___master_ch___lsb 0
373#define reg_bif_dma_rw_pin3_cfg___master_ch___width 2
374#define reg_bif_dma_rw_pin3_cfg___master_mode___lsb 2
375#define reg_bif_dma_rw_pin3_cfg___master_mode___width 3
376#define reg_bif_dma_rw_pin3_cfg___slave_ch___lsb 5
377#define reg_bif_dma_rw_pin3_cfg___slave_ch___width 2
378#define reg_bif_dma_rw_pin3_cfg___slave_mode___lsb 7
379#define reg_bif_dma_rw_pin3_cfg___slave_mode___width 3
380#define reg_bif_dma_rw_pin3_cfg_offset 172
381
382/* Register rw_pin4_cfg, scope bif_dma, type rw */
383#define reg_bif_dma_rw_pin4_cfg___master_ch___lsb 0
384#define reg_bif_dma_rw_pin4_cfg___master_ch___width 2
385#define reg_bif_dma_rw_pin4_cfg___master_mode___lsb 2
386#define reg_bif_dma_rw_pin4_cfg___master_mode___width 3
387#define reg_bif_dma_rw_pin4_cfg___slave_ch___lsb 5
388#define reg_bif_dma_rw_pin4_cfg___slave_ch___width 2
389#define reg_bif_dma_rw_pin4_cfg___slave_mode___lsb 7
390#define reg_bif_dma_rw_pin4_cfg___slave_mode___width 3
391#define reg_bif_dma_rw_pin4_cfg_offset 176
392
393/* Register rw_pin5_cfg, scope bif_dma, type rw */
394#define reg_bif_dma_rw_pin5_cfg___master_ch___lsb 0
395#define reg_bif_dma_rw_pin5_cfg___master_ch___width 2
396#define reg_bif_dma_rw_pin5_cfg___master_mode___lsb 2
397#define reg_bif_dma_rw_pin5_cfg___master_mode___width 3
398#define reg_bif_dma_rw_pin5_cfg___slave_ch___lsb 5
399#define reg_bif_dma_rw_pin5_cfg___slave_ch___width 2
400#define reg_bif_dma_rw_pin5_cfg___slave_mode___lsb 7
401#define reg_bif_dma_rw_pin5_cfg___slave_mode___width 3
402#define reg_bif_dma_rw_pin5_cfg_offset 180
403
404/* Register rw_pin6_cfg, scope bif_dma, type rw */
405#define reg_bif_dma_rw_pin6_cfg___master_ch___lsb 0
406#define reg_bif_dma_rw_pin6_cfg___master_ch___width 2
407#define reg_bif_dma_rw_pin6_cfg___master_mode___lsb 2
408#define reg_bif_dma_rw_pin6_cfg___master_mode___width 3
409#define reg_bif_dma_rw_pin6_cfg___slave_ch___lsb 5
410#define reg_bif_dma_rw_pin6_cfg___slave_ch___width 2
411#define reg_bif_dma_rw_pin6_cfg___slave_mode___lsb 7
412#define reg_bif_dma_rw_pin6_cfg___slave_mode___width 3
413#define reg_bif_dma_rw_pin6_cfg_offset 184
414
415/* Register rw_pin7_cfg, scope bif_dma, type rw */
416#define reg_bif_dma_rw_pin7_cfg___master_ch___lsb 0
417#define reg_bif_dma_rw_pin7_cfg___master_ch___width 2
418#define reg_bif_dma_rw_pin7_cfg___master_mode___lsb 2
419#define reg_bif_dma_rw_pin7_cfg___master_mode___width 3
420#define reg_bif_dma_rw_pin7_cfg___slave_ch___lsb 5
421#define reg_bif_dma_rw_pin7_cfg___slave_ch___width 2
422#define reg_bif_dma_rw_pin7_cfg___slave_mode___lsb 7
423#define reg_bif_dma_rw_pin7_cfg___slave_mode___width 3
424#define reg_bif_dma_rw_pin7_cfg_offset 188
425
426/* Register r_pin_stat, scope bif_dma, type r */
427#define reg_bif_dma_r_pin_stat___pin0___lsb 0
428#define reg_bif_dma_r_pin_stat___pin0___width 1
429#define reg_bif_dma_r_pin_stat___pin0___bit 0
430#define reg_bif_dma_r_pin_stat___pin1___lsb 1
431#define reg_bif_dma_r_pin_stat___pin1___width 1
432#define reg_bif_dma_r_pin_stat___pin1___bit 1
433#define reg_bif_dma_r_pin_stat___pin2___lsb 2
434#define reg_bif_dma_r_pin_stat___pin2___width 1
435#define reg_bif_dma_r_pin_stat___pin2___bit 2
436#define reg_bif_dma_r_pin_stat___pin3___lsb 3
437#define reg_bif_dma_r_pin_stat___pin3___width 1
438#define reg_bif_dma_r_pin_stat___pin3___bit 3
439#define reg_bif_dma_r_pin_stat___pin4___lsb 4
440#define reg_bif_dma_r_pin_stat___pin4___width 1
441#define reg_bif_dma_r_pin_stat___pin4___bit 4
442#define reg_bif_dma_r_pin_stat___pin5___lsb 5
443#define reg_bif_dma_r_pin_stat___pin5___width 1
444#define reg_bif_dma_r_pin_stat___pin5___bit 5
445#define reg_bif_dma_r_pin_stat___pin6___lsb 6
446#define reg_bif_dma_r_pin_stat___pin6___width 1
447#define reg_bif_dma_r_pin_stat___pin6___bit 6
448#define reg_bif_dma_r_pin_stat___pin7___lsb 7
449#define reg_bif_dma_r_pin_stat___pin7___width 1
450#define reg_bif_dma_r_pin_stat___pin7___bit 7
451#define reg_bif_dma_r_pin_stat_offset 192
452
453
454/* Constants */
455#define regk_bif_dma_as_master 0x00000001
456#define regk_bif_dma_as_slave 0x00000001
457#define regk_bif_dma_burst1 0x00000000
458#define regk_bif_dma_burst8 0x00000001
459#define regk_bif_dma_bw16 0x00000001
460#define regk_bif_dma_bw32 0x00000002
461#define regk_bif_dma_bw8 0x00000000
462#define regk_bif_dma_dack 0x00000006
463#define regk_bif_dma_dack_inv 0x00000007
464#define regk_bif_dma_force 0x00000001
465#define regk_bif_dma_hi 0x00000003
466#define regk_bif_dma_inv 0x00000003
467#define regk_bif_dma_lo 0x00000002
468#define regk_bif_dma_master 0x00000001
469#define regk_bif_dma_no 0x00000000
470#define regk_bif_dma_norm 0x00000002
471#define regk_bif_dma_off 0x00000000
472#define regk_bif_dma_rw_ch0_ctrl_default 0x00000000
473#define regk_bif_dma_rw_ch0_start_default 0x00000000
474#define regk_bif_dma_rw_ch1_ctrl_default 0x00000000
475#define regk_bif_dma_rw_ch1_start_default 0x00000000
476#define regk_bif_dma_rw_ch2_ctrl_default 0x00000000
477#define regk_bif_dma_rw_ch2_start_default 0x00000000
478#define regk_bif_dma_rw_ch3_ctrl_default 0x00000000
479#define regk_bif_dma_rw_ch3_start_default 0x00000000
480#define regk_bif_dma_rw_intr_mask_default 0x00000000
481#define regk_bif_dma_rw_pin0_cfg_default 0x00000000
482#define regk_bif_dma_rw_pin1_cfg_default 0x00000000
483#define regk_bif_dma_rw_pin2_cfg_default 0x00000000
484#define regk_bif_dma_rw_pin3_cfg_default 0x00000000
485#define regk_bif_dma_rw_pin4_cfg_default 0x00000000
486#define regk_bif_dma_rw_pin5_cfg_default 0x00000000
487#define regk_bif_dma_rw_pin6_cfg_default 0x00000000
488#define regk_bif_dma_rw_pin7_cfg_default 0x00000000
489#define regk_bif_dma_slave 0x00000002
490#define regk_bif_dma_sreq 0x00000006
491#define regk_bif_dma_sreq_inv 0x00000007
492#define regk_bif_dma_tc 0x00000004
493#define regk_bif_dma_tc_inv 0x00000005
494#define regk_bif_dma_yes 0x00000001
495#endif /* __bif_dma_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/bif_slave_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/bif_slave_defs_asm.h
new file mode 100644
index 000000000000..031f33a365bb
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/bif_slave_defs_asm.h
@@ -0,0 +1,249 @@
1#ifndef __bif_slave_defs_asm_h
2#define __bif_slave_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_slave_regs.r
7 * id: bif_slave_regs.r,v 1.5 2005/02/04 13:55:28 perz Exp
8 * last modfied: Mon Apr 11 16:06:34 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/bif_slave_defs_asm.h ../../inst/bif/rtl/bif_slave_regs.r
11 * id: $Id: bif_slave_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_slave_cfg, scope bif_slave, type rw */
57#define reg_bif_slave_rw_slave_cfg___slave_id___lsb 0
58#define reg_bif_slave_rw_slave_cfg___slave_id___width 3
59#define reg_bif_slave_rw_slave_cfg___use_slave_id___lsb 3
60#define reg_bif_slave_rw_slave_cfg___use_slave_id___width 1
61#define reg_bif_slave_rw_slave_cfg___use_slave_id___bit 3
62#define reg_bif_slave_rw_slave_cfg___boot_rdy___lsb 4
63#define reg_bif_slave_rw_slave_cfg___boot_rdy___width 1
64#define reg_bif_slave_rw_slave_cfg___boot_rdy___bit 4
65#define reg_bif_slave_rw_slave_cfg___loopback___lsb 5
66#define reg_bif_slave_rw_slave_cfg___loopback___width 1
67#define reg_bif_slave_rw_slave_cfg___loopback___bit 5
68#define reg_bif_slave_rw_slave_cfg___dis___lsb 6
69#define reg_bif_slave_rw_slave_cfg___dis___width 1
70#define reg_bif_slave_rw_slave_cfg___dis___bit 6
71#define reg_bif_slave_rw_slave_cfg_offset 0
72
73/* Register r_slave_mode, scope bif_slave, type r */
74#define reg_bif_slave_r_slave_mode___ch0_mode___lsb 0
75#define reg_bif_slave_r_slave_mode___ch0_mode___width 1
76#define reg_bif_slave_r_slave_mode___ch0_mode___bit 0
77#define reg_bif_slave_r_slave_mode___ch1_mode___lsb 1
78#define reg_bif_slave_r_slave_mode___ch1_mode___width 1
79#define reg_bif_slave_r_slave_mode___ch1_mode___bit 1
80#define reg_bif_slave_r_slave_mode___ch2_mode___lsb 2
81#define reg_bif_slave_r_slave_mode___ch2_mode___width 1
82#define reg_bif_slave_r_slave_mode___ch2_mode___bit 2
83#define reg_bif_slave_r_slave_mode___ch3_mode___lsb 3
84#define reg_bif_slave_r_slave_mode___ch3_mode___width 1
85#define reg_bif_slave_r_slave_mode___ch3_mode___bit 3
86#define reg_bif_slave_r_slave_mode_offset 4
87
88/* Register rw_ch0_cfg, scope bif_slave, type rw */
89#define reg_bif_slave_rw_ch0_cfg___rd_hold___lsb 0
90#define reg_bif_slave_rw_ch0_cfg___rd_hold___width 2
91#define reg_bif_slave_rw_ch0_cfg___access_mode___lsb 2
92#define reg_bif_slave_rw_ch0_cfg___access_mode___width 1
93#define reg_bif_slave_rw_ch0_cfg___access_mode___bit 2
94#define reg_bif_slave_rw_ch0_cfg___access_ctrl___lsb 3
95#define reg_bif_slave_rw_ch0_cfg___access_ctrl___width 1
96#define reg_bif_slave_rw_ch0_cfg___access_ctrl___bit 3
97#define reg_bif_slave_rw_ch0_cfg___data_cs___lsb 4
98#define reg_bif_slave_rw_ch0_cfg___data_cs___width 2
99#define reg_bif_slave_rw_ch0_cfg_offset 16
100
101/* Register rw_ch1_cfg, scope bif_slave, type rw */
102#define reg_bif_slave_rw_ch1_cfg___rd_hold___lsb 0
103#define reg_bif_slave_rw_ch1_cfg___rd_hold___width 2
104#define reg_bif_slave_rw_ch1_cfg___access_mode___lsb 2
105#define reg_bif_slave_rw_ch1_cfg___access_mode___width 1
106#define reg_bif_slave_rw_ch1_cfg___access_mode___bit 2
107#define reg_bif_slave_rw_ch1_cfg___access_ctrl___lsb 3
108#define reg_bif_slave_rw_ch1_cfg___access_ctrl___width 1
109#define reg_bif_slave_rw_ch1_cfg___access_ctrl___bit 3
110#define reg_bif_slave_rw_ch1_cfg___data_cs___lsb 4
111#define reg_bif_slave_rw_ch1_cfg___data_cs___width 2
112#define reg_bif_slave_rw_ch1_cfg_offset 20
113
114/* Register rw_ch2_cfg, scope bif_slave, type rw */
115#define reg_bif_slave_rw_ch2_cfg___rd_hold___lsb 0
116#define reg_bif_slave_rw_ch2_cfg___rd_hold___width 2
117#define reg_bif_slave_rw_ch2_cfg___access_mode___lsb 2
118#define reg_bif_slave_rw_ch2_cfg___access_mode___width 1
119#define reg_bif_slave_rw_ch2_cfg___access_mode___bit 2
120#define reg_bif_slave_rw_ch2_cfg___access_ctrl___lsb 3
121#define reg_bif_slave_rw_ch2_cfg___access_ctrl___width 1
122#define reg_bif_slave_rw_ch2_cfg___access_ctrl___bit 3
123#define reg_bif_slave_rw_ch2_cfg___data_cs___lsb 4
124#define reg_bif_slave_rw_ch2_cfg___data_cs___width 2
125#define reg_bif_slave_rw_ch2_cfg_offset 24
126
127/* Register rw_ch3_cfg, scope bif_slave, type rw */
128#define reg_bif_slave_rw_ch3_cfg___rd_hold___lsb 0
129#define reg_bif_slave_rw_ch3_cfg___rd_hold___width 2
130#define reg_bif_slave_rw_ch3_cfg___access_mode___lsb 2
131#define reg_bif_slave_rw_ch3_cfg___access_mode___width 1
132#define reg_bif_slave_rw_ch3_cfg___access_mode___bit 2
133#define reg_bif_slave_rw_ch3_cfg___access_ctrl___lsb 3
134#define reg_bif_slave_rw_ch3_cfg___access_ctrl___width 1
135#define reg_bif_slave_rw_ch3_cfg___access_ctrl___bit 3
136#define reg_bif_slave_rw_ch3_cfg___data_cs___lsb 4
137#define reg_bif_slave_rw_ch3_cfg___data_cs___width 2
138#define reg_bif_slave_rw_ch3_cfg_offset 28
139
140/* Register rw_arb_cfg, scope bif_slave, type rw */
141#define reg_bif_slave_rw_arb_cfg___brin_mode___lsb 0
142#define reg_bif_slave_rw_arb_cfg___brin_mode___width 1
143#define reg_bif_slave_rw_arb_cfg___brin_mode___bit 0
144#define reg_bif_slave_rw_arb_cfg___brout_mode___lsb 1
145#define reg_bif_slave_rw_arb_cfg___brout_mode___width 3
146#define reg_bif_slave_rw_arb_cfg___bg_mode___lsb 4
147#define reg_bif_slave_rw_arb_cfg___bg_mode___width 3
148#define reg_bif_slave_rw_arb_cfg___release___lsb 7
149#define reg_bif_slave_rw_arb_cfg___release___width 2
150#define reg_bif_slave_rw_arb_cfg___acquire___lsb 9
151#define reg_bif_slave_rw_arb_cfg___acquire___width 1
152#define reg_bif_slave_rw_arb_cfg___acquire___bit 9
153#define reg_bif_slave_rw_arb_cfg___settle_time___lsb 10
154#define reg_bif_slave_rw_arb_cfg___settle_time___width 2
155#define reg_bif_slave_rw_arb_cfg___dram_ctrl___lsb 12
156#define reg_bif_slave_rw_arb_cfg___dram_ctrl___width 1
157#define reg_bif_slave_rw_arb_cfg___dram_ctrl___bit 12
158#define reg_bif_slave_rw_arb_cfg_offset 32
159
160/* Register r_arb_stat, scope bif_slave, type r */
161#define reg_bif_slave_r_arb_stat___init_mode___lsb 0
162#define reg_bif_slave_r_arb_stat___init_mode___width 1
163#define reg_bif_slave_r_arb_stat___init_mode___bit 0
164#define reg_bif_slave_r_arb_stat___mode___lsb 1
165#define reg_bif_slave_r_arb_stat___mode___width 1
166#define reg_bif_slave_r_arb_stat___mode___bit 1
167#define reg_bif_slave_r_arb_stat___brin___lsb 2
168#define reg_bif_slave_r_arb_stat___brin___width 1
169#define reg_bif_slave_r_arb_stat___brin___bit 2
170#define reg_bif_slave_r_arb_stat___brout___lsb 3
171#define reg_bif_slave_r_arb_stat___brout___width 1
172#define reg_bif_slave_r_arb_stat___brout___bit 3
173#define reg_bif_slave_r_arb_stat___bg___lsb 4
174#define reg_bif_slave_r_arb_stat___bg___width 1
175#define reg_bif_slave_r_arb_stat___bg___bit 4
176#define reg_bif_slave_r_arb_stat_offset 36
177
178/* Register rw_intr_mask, scope bif_slave, type rw */
179#define reg_bif_slave_rw_intr_mask___bus_release___lsb 0
180#define reg_bif_slave_rw_intr_mask___bus_release___width 1
181#define reg_bif_slave_rw_intr_mask___bus_release___bit 0
182#define reg_bif_slave_rw_intr_mask___bus_acquire___lsb 1
183#define reg_bif_slave_rw_intr_mask___bus_acquire___width 1
184#define reg_bif_slave_rw_intr_mask___bus_acquire___bit 1
185#define reg_bif_slave_rw_intr_mask_offset 64
186
187/* Register rw_ack_intr, scope bif_slave, type rw */
188#define reg_bif_slave_rw_ack_intr___bus_release___lsb 0
189#define reg_bif_slave_rw_ack_intr___bus_release___width 1
190#define reg_bif_slave_rw_ack_intr___bus_release___bit 0
191#define reg_bif_slave_rw_ack_intr___bus_acquire___lsb 1
192#define reg_bif_slave_rw_ack_intr___bus_acquire___width 1
193#define reg_bif_slave_rw_ack_intr___bus_acquire___bit 1
194#define reg_bif_slave_rw_ack_intr_offset 68
195
196/* Register r_intr, scope bif_slave, type r */
197#define reg_bif_slave_r_intr___bus_release___lsb 0
198#define reg_bif_slave_r_intr___bus_release___width 1
199#define reg_bif_slave_r_intr___bus_release___bit 0
200#define reg_bif_slave_r_intr___bus_acquire___lsb 1
201#define reg_bif_slave_r_intr___bus_acquire___width 1
202#define reg_bif_slave_r_intr___bus_acquire___bit 1
203#define reg_bif_slave_r_intr_offset 72
204
205/* Register r_masked_intr, scope bif_slave, type r */
206#define reg_bif_slave_r_masked_intr___bus_release___lsb 0
207#define reg_bif_slave_r_masked_intr___bus_release___width 1
208#define reg_bif_slave_r_masked_intr___bus_release___bit 0
209#define reg_bif_slave_r_masked_intr___bus_acquire___lsb 1
210#define reg_bif_slave_r_masked_intr___bus_acquire___width 1
211#define reg_bif_slave_r_masked_intr___bus_acquire___bit 1
212#define reg_bif_slave_r_masked_intr_offset 76
213
214
215/* Constants */
216#define regk_bif_slave_active_hi 0x00000003
217#define regk_bif_slave_active_lo 0x00000002
218#define regk_bif_slave_addr 0x00000000
219#define regk_bif_slave_always 0x00000001
220#define regk_bif_slave_at_idle 0x00000002
221#define regk_bif_slave_burst_end 0x00000003
222#define regk_bif_slave_dma 0x00000001
223#define regk_bif_slave_hi 0x00000003
224#define regk_bif_slave_inv 0x00000001
225#define regk_bif_slave_lo 0x00000002
226#define regk_bif_slave_local 0x00000001
227#define regk_bif_slave_master 0x00000000
228#define regk_bif_slave_mode_reg 0x00000001
229#define regk_bif_slave_no 0x00000000
230#define regk_bif_slave_norm 0x00000000
231#define regk_bif_slave_on_access 0x00000000
232#define regk_bif_slave_rw_arb_cfg_default 0x00000000
233#define regk_bif_slave_rw_ch0_cfg_default 0x00000000
234#define regk_bif_slave_rw_ch1_cfg_default 0x00000000
235#define regk_bif_slave_rw_ch2_cfg_default 0x00000000
236#define regk_bif_slave_rw_ch3_cfg_default 0x00000000
237#define regk_bif_slave_rw_intr_mask_default 0x00000000
238#define regk_bif_slave_rw_slave_cfg_default 0x00000000
239#define regk_bif_slave_shared 0x00000000
240#define regk_bif_slave_slave 0x00000001
241#define regk_bif_slave_t0ns 0x00000003
242#define regk_bif_slave_t10ns 0x00000002
243#define regk_bif_slave_t20ns 0x00000003
244#define regk_bif_slave_t30ns 0x00000002
245#define regk_bif_slave_t40ns 0x00000001
246#define regk_bif_slave_t50ns 0x00000000
247#define regk_bif_slave_yes 0x00000001
248#define regk_bif_slave_z 0x00000004
249#endif /* __bif_slave_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/config_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/config_defs_asm.h
new file mode 100644
index 000000000000..e98476332e1f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/config_defs_asm.h
@@ -0,0 +1,131 @@
1#ifndef __config_defs_asm_h
2#define __config_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../rtl/config_regs.r
7 * id: config_regs.r,v 1.23 2004/03/04 11:34:42 mikaeln Exp
8 * last modfied: Thu Mar 4 12:34:39 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/config_defs_asm.h ../../rtl/config_regs.r
11 * id: $Id: config_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register r_bootsel, scope config, type r */
57#define reg_config_r_bootsel___boot_mode___lsb 0
58#define reg_config_r_bootsel___boot_mode___width 3
59#define reg_config_r_bootsel___full_duplex___lsb 3
60#define reg_config_r_bootsel___full_duplex___width 1
61#define reg_config_r_bootsel___full_duplex___bit 3
62#define reg_config_r_bootsel___user___lsb 4
63#define reg_config_r_bootsel___user___width 1
64#define reg_config_r_bootsel___user___bit 4
65#define reg_config_r_bootsel___pll___lsb 5
66#define reg_config_r_bootsel___pll___width 1
67#define reg_config_r_bootsel___pll___bit 5
68#define reg_config_r_bootsel___flash_bw___lsb 6
69#define reg_config_r_bootsel___flash_bw___width 1
70#define reg_config_r_bootsel___flash_bw___bit 6
71#define reg_config_r_bootsel_offset 0
72
73/* Register rw_clk_ctrl, scope config, type rw */
74#define reg_config_rw_clk_ctrl___pll___lsb 0
75#define reg_config_rw_clk_ctrl___pll___width 1
76#define reg_config_rw_clk_ctrl___pll___bit 0
77#define reg_config_rw_clk_ctrl___cpu___lsb 1
78#define reg_config_rw_clk_ctrl___cpu___width 1
79#define reg_config_rw_clk_ctrl___cpu___bit 1
80#define reg_config_rw_clk_ctrl___iop___lsb 2
81#define reg_config_rw_clk_ctrl___iop___width 1
82#define reg_config_rw_clk_ctrl___iop___bit 2
83#define reg_config_rw_clk_ctrl___dma01_eth0___lsb 3
84#define reg_config_rw_clk_ctrl___dma01_eth0___width 1
85#define reg_config_rw_clk_ctrl___dma01_eth0___bit 3
86#define reg_config_rw_clk_ctrl___dma23___lsb 4
87#define reg_config_rw_clk_ctrl___dma23___width 1
88#define reg_config_rw_clk_ctrl___dma23___bit 4
89#define reg_config_rw_clk_ctrl___dma45___lsb 5
90#define reg_config_rw_clk_ctrl___dma45___width 1
91#define reg_config_rw_clk_ctrl___dma45___bit 5
92#define reg_config_rw_clk_ctrl___dma67___lsb 6
93#define reg_config_rw_clk_ctrl___dma67___width 1
94#define reg_config_rw_clk_ctrl___dma67___bit 6
95#define reg_config_rw_clk_ctrl___dma89_strcop___lsb 7
96#define reg_config_rw_clk_ctrl___dma89_strcop___width 1
97#define reg_config_rw_clk_ctrl___dma89_strcop___bit 7
98#define reg_config_rw_clk_ctrl___bif___lsb 8
99#define reg_config_rw_clk_ctrl___bif___width 1
100#define reg_config_rw_clk_ctrl___bif___bit 8
101#define reg_config_rw_clk_ctrl___fix_io___lsb 9
102#define reg_config_rw_clk_ctrl___fix_io___width 1
103#define reg_config_rw_clk_ctrl___fix_io___bit 9
104#define reg_config_rw_clk_ctrl_offset 4
105
106/* Register rw_pad_ctrl, scope config, type rw */
107#define reg_config_rw_pad_ctrl___usb_susp___lsb 0
108#define reg_config_rw_pad_ctrl___usb_susp___width 1
109#define reg_config_rw_pad_ctrl___usb_susp___bit 0
110#define reg_config_rw_pad_ctrl___phyrst_n___lsb 1
111#define reg_config_rw_pad_ctrl___phyrst_n___width 1
112#define reg_config_rw_pad_ctrl___phyrst_n___bit 1
113#define reg_config_rw_pad_ctrl_offset 8
114
115
116/* Constants */
117#define regk_config_bw16 0x00000000
118#define regk_config_bw32 0x00000001
119#define regk_config_master 0x00000005
120#define regk_config_nand 0x00000003
121#define regk_config_net_rx 0x00000001
122#define regk_config_net_tx_rx 0x00000002
123#define regk_config_no 0x00000000
124#define regk_config_none 0x00000007
125#define regk_config_nor 0x00000000
126#define regk_config_rw_clk_ctrl_default 0x00000002
127#define regk_config_rw_pad_ctrl_default 0x00000000
128#define regk_config_ser 0x00000004
129#define regk_config_slave 0x00000006
130#define regk_config_yes 0x00000001
131#endif /* __config_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/cpu_vect.h b/include/asm-cris/arch-v32/hwregs/asm/cpu_vect.h
new file mode 100644
index 000000000000..8370aee8a14a
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/cpu_vect.h
@@ -0,0 +1,41 @@
1/* Interrupt vector numbers autogenerated by /n/asic/design/tools/rdesc/src/rdes2intr version
2 from ../../inst/crisp/doc/cpu_vect.r
3version . */
4
5#ifndef _______INST_CRISP_DOC_CPU_VECT_R
6#define _______INST_CRISP_DOC_CPU_VECT_R
7#define NMI_INTR_VECT 0x00
8#define RESERVED_1_INTR_VECT 0x01
9#define RESERVED_2_INTR_VECT 0x02
10#define SINGLE_STEP_INTR_VECT 0x03
11#define INSTR_TLB_REFILL_INTR_VECT 0x04
12#define INSTR_TLB_INV_INTR_VECT 0x05
13#define INSTR_TLB_ACC_INTR_VECT 0x06
14#define TLB_EX_INTR_VECT 0x07
15#define DATA_TLB_REFILL_INTR_VECT 0x08
16#define DATA_TLB_INV_INTR_VECT 0x09
17#define DATA_TLB_ACC_INTR_VECT 0x0a
18#define DATA_TLB_WE_INTR_VECT 0x0b
19#define HW_BP_INTR_VECT 0x0c
20#define RESERVED_D_INTR_VECT 0x0d
21#define RESERVED_E_INTR_VECT 0x0e
22#define RESERVED_F_INTR_VECT 0x0f
23#define BREAK_0_INTR_VECT 0x10
24#define BREAK_1_INTR_VECT 0x11
25#define BREAK_2_INTR_VECT 0x12
26#define BREAK_3_INTR_VECT 0x13
27#define BREAK_4_INTR_VECT 0x14
28#define BREAK_5_INTR_VECT 0x15
29#define BREAK_6_INTR_VECT 0x16
30#define BREAK_7_INTR_VECT 0x17
31#define BREAK_8_INTR_VECT 0x18
32#define BREAK_9_INTR_VECT 0x19
33#define BREAK_10_INTR_VECT 0x1a
34#define BREAK_11_INTR_VECT 0x1b
35#define BREAK_12_INTR_VECT 0x1c
36#define BREAK_13_INTR_VECT 0x1d
37#define BREAK_14_INTR_VECT 0x1e
38#define BREAK_15_INTR_VECT 0x1f
39#define MULTIPLE_INTR_VECT 0x30
40
41#endif
diff --git a/include/asm-cris/arch-v32/hwregs/asm/cris_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/cris_defs_asm.h
new file mode 100644
index 000000000000..7f768db272e2
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/cris_defs_asm.h
@@ -0,0 +1,114 @@
1#ifndef __cris_defs_asm_h
2#define __cris_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/crisp/doc/cris.r
7 * id: cris.r,v 1.6 2004/05/05 07:41:12 perz Exp
8 * last modfied: Mon Apr 11 16:06:39 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/cris_defs_asm.h ../../inst/crisp/doc/cris.r
11 * id: $Id: cris_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_gc_cfg, scope cris, type rw */
57#define reg_cris_rw_gc_cfg___ic___lsb 0
58#define reg_cris_rw_gc_cfg___ic___width 1
59#define reg_cris_rw_gc_cfg___ic___bit 0
60#define reg_cris_rw_gc_cfg___dc___lsb 1
61#define reg_cris_rw_gc_cfg___dc___width 1
62#define reg_cris_rw_gc_cfg___dc___bit 1
63#define reg_cris_rw_gc_cfg___im___lsb 2
64#define reg_cris_rw_gc_cfg___im___width 1
65#define reg_cris_rw_gc_cfg___im___bit 2
66#define reg_cris_rw_gc_cfg___dm___lsb 3
67#define reg_cris_rw_gc_cfg___dm___width 1
68#define reg_cris_rw_gc_cfg___dm___bit 3
69#define reg_cris_rw_gc_cfg___gb___lsb 4
70#define reg_cris_rw_gc_cfg___gb___width 1
71#define reg_cris_rw_gc_cfg___gb___bit 4
72#define reg_cris_rw_gc_cfg___gk___lsb 5
73#define reg_cris_rw_gc_cfg___gk___width 1
74#define reg_cris_rw_gc_cfg___gk___bit 5
75#define reg_cris_rw_gc_cfg___gp___lsb 6
76#define reg_cris_rw_gc_cfg___gp___width 1
77#define reg_cris_rw_gc_cfg___gp___bit 6
78#define reg_cris_rw_gc_cfg_offset 0
79
80/* Register rw_gc_ccs, scope cris, type rw */
81#define reg_cris_rw_gc_ccs_offset 4
82
83/* Register rw_gc_srs, scope cris, type rw */
84#define reg_cris_rw_gc_srs___srs___lsb 0
85#define reg_cris_rw_gc_srs___srs___width 8
86#define reg_cris_rw_gc_srs_offset 8
87
88/* Register rw_gc_nrp, scope cris, type rw */
89#define reg_cris_rw_gc_nrp_offset 12
90
91/* Register rw_gc_exs, scope cris, type rw */
92#define reg_cris_rw_gc_exs_offset 16
93
94/* Register rw_gc_eda, scope cris, type rw */
95#define reg_cris_rw_gc_eda_offset 20
96
97/* Register rw_gc_r0, scope cris, type rw */
98#define reg_cris_rw_gc_r0_offset 32
99
100/* Register rw_gc_r1, scope cris, type rw */
101#define reg_cris_rw_gc_r1_offset 36
102
103/* Register rw_gc_r2, scope cris, type rw */
104#define reg_cris_rw_gc_r2_offset 40
105
106/* Register rw_gc_r3, scope cris, type rw */
107#define reg_cris_rw_gc_r3_offset 44
108
109
110/* Constants */
111#define regk_cris_no 0x00000000
112#define regk_cris_rw_gc_cfg_default 0x00000000
113#define regk_cris_yes 0x00000001
114#endif /* __cris_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/cris_supp_reg.h b/include/asm-cris/arch-v32/hwregs/asm/cris_supp_reg.h
new file mode 100644
index 000000000000..7d3689a6f80d
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/cris_supp_reg.h
@@ -0,0 +1,10 @@
1#define RW_GC_CFG 0
2#define RW_GC_CCS 1
3#define RW_GC_SRS 2
4#define RW_GC_NRP 3
5#define RW_GC_EXS 4
6#define RW_GC_EDA 5
7#define RW_GC_R0 8
8#define RW_GC_R1 9
9#define RW_GC_R2 10
10#define RW_GC_R3 11
diff --git a/include/asm-cris/arch-v32/hwregs/asm/dma_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/dma_defs_asm.h
new file mode 100644
index 000000000000..0cb71bc127ae
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/dma_defs_asm.h
@@ -0,0 +1,368 @@
1#ifndef __dma_defs_asm_h
2#define __dma_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/dma/inst/dma_common/rtl/dma_regdes.r
7 * id: dma_regdes.r,v 1.39 2005/02/10 14:07:23 janb Exp
8 * last modfied: Mon Apr 11 16:06:51 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/dma_defs_asm.h ../../inst/dma/inst/dma_common/rtl/dma_regdes.r
11 * id: $Id: dma_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_data, scope dma, type rw */
57#define reg_dma_rw_data_offset 0
58
59/* Register rw_data_next, scope dma, type rw */
60#define reg_dma_rw_data_next_offset 4
61
62/* Register rw_data_buf, scope dma, type rw */
63#define reg_dma_rw_data_buf_offset 8
64
65/* Register rw_data_ctrl, scope dma, type rw */
66#define reg_dma_rw_data_ctrl___eol___lsb 0
67#define reg_dma_rw_data_ctrl___eol___width 1
68#define reg_dma_rw_data_ctrl___eol___bit 0
69#define reg_dma_rw_data_ctrl___out_eop___lsb 3
70#define reg_dma_rw_data_ctrl___out_eop___width 1
71#define reg_dma_rw_data_ctrl___out_eop___bit 3
72#define reg_dma_rw_data_ctrl___intr___lsb 4
73#define reg_dma_rw_data_ctrl___intr___width 1
74#define reg_dma_rw_data_ctrl___intr___bit 4
75#define reg_dma_rw_data_ctrl___wait___lsb 5
76#define reg_dma_rw_data_ctrl___wait___width 1
77#define reg_dma_rw_data_ctrl___wait___bit 5
78#define reg_dma_rw_data_ctrl_offset 12
79
80/* Register rw_data_stat, scope dma, type rw */
81#define reg_dma_rw_data_stat___in_eop___lsb 3
82#define reg_dma_rw_data_stat___in_eop___width 1
83#define reg_dma_rw_data_stat___in_eop___bit 3
84#define reg_dma_rw_data_stat_offset 16
85
86/* Register rw_data_md, scope dma, type rw */
87#define reg_dma_rw_data_md___md___lsb 0
88#define reg_dma_rw_data_md___md___width 16
89#define reg_dma_rw_data_md_offset 20
90
91/* Register rw_data_md_s, scope dma, type rw */
92#define reg_dma_rw_data_md_s___md_s___lsb 0
93#define reg_dma_rw_data_md_s___md_s___width 16
94#define reg_dma_rw_data_md_s_offset 24
95
96/* Register rw_data_after, scope dma, type rw */
97#define reg_dma_rw_data_after_offset 28
98
99/* Register rw_ctxt, scope dma, type rw */
100#define reg_dma_rw_ctxt_offset 32
101
102/* Register rw_ctxt_next, scope dma, type rw */
103#define reg_dma_rw_ctxt_next_offset 36
104
105/* Register rw_ctxt_ctrl, scope dma, type rw */
106#define reg_dma_rw_ctxt_ctrl___eol___lsb 0
107#define reg_dma_rw_ctxt_ctrl___eol___width 1
108#define reg_dma_rw_ctxt_ctrl___eol___bit 0
109#define reg_dma_rw_ctxt_ctrl___intr___lsb 4
110#define reg_dma_rw_ctxt_ctrl___intr___width 1
111#define reg_dma_rw_ctxt_ctrl___intr___bit 4
112#define reg_dma_rw_ctxt_ctrl___store_mode___lsb 6
113#define reg_dma_rw_ctxt_ctrl___store_mode___width 1
114#define reg_dma_rw_ctxt_ctrl___store_mode___bit 6
115#define reg_dma_rw_ctxt_ctrl___en___lsb 7
116#define reg_dma_rw_ctxt_ctrl___en___width 1
117#define reg_dma_rw_ctxt_ctrl___en___bit 7
118#define reg_dma_rw_ctxt_ctrl_offset 40
119
120/* Register rw_ctxt_stat, scope dma, type rw */
121#define reg_dma_rw_ctxt_stat___dis___lsb 7
122#define reg_dma_rw_ctxt_stat___dis___width 1
123#define reg_dma_rw_ctxt_stat___dis___bit 7
124#define reg_dma_rw_ctxt_stat_offset 44
125
126/* Register rw_ctxt_md0, scope dma, type rw */
127#define reg_dma_rw_ctxt_md0___md0___lsb 0
128#define reg_dma_rw_ctxt_md0___md0___width 16
129#define reg_dma_rw_ctxt_md0_offset 48
130
131/* Register rw_ctxt_md0_s, scope dma, type rw */
132#define reg_dma_rw_ctxt_md0_s___md0_s___lsb 0
133#define reg_dma_rw_ctxt_md0_s___md0_s___width 16
134#define reg_dma_rw_ctxt_md0_s_offset 52
135
136/* Register rw_ctxt_md1, scope dma, type rw */
137#define reg_dma_rw_ctxt_md1_offset 56
138
139/* Register rw_ctxt_md1_s, scope dma, type rw */
140#define reg_dma_rw_ctxt_md1_s_offset 60
141
142/* Register rw_ctxt_md2, scope dma, type rw */
143#define reg_dma_rw_ctxt_md2_offset 64
144
145/* Register rw_ctxt_md2_s, scope dma, type rw */
146#define reg_dma_rw_ctxt_md2_s_offset 68
147
148/* Register rw_ctxt_md3, scope dma, type rw */
149#define reg_dma_rw_ctxt_md3_offset 72
150
151/* Register rw_ctxt_md3_s, scope dma, type rw */
152#define reg_dma_rw_ctxt_md3_s_offset 76
153
154/* Register rw_ctxt_md4, scope dma, type rw */
155#define reg_dma_rw_ctxt_md4_offset 80
156
157/* Register rw_ctxt_md4_s, scope dma, type rw */
158#define reg_dma_rw_ctxt_md4_s_offset 84
159
160/* Register rw_saved_data, scope dma, type rw */
161#define reg_dma_rw_saved_data_offset 88
162
163/* Register rw_saved_data_buf, scope dma, type rw */
164#define reg_dma_rw_saved_data_buf_offset 92
165
166/* Register rw_group, scope dma, type rw */
167#define reg_dma_rw_group_offset 96
168
169/* Register rw_group_next, scope dma, type rw */
170#define reg_dma_rw_group_next_offset 100
171
172/* Register rw_group_ctrl, scope dma, type rw */
173#define reg_dma_rw_group_ctrl___eol___lsb 0
174#define reg_dma_rw_group_ctrl___eol___width 1
175#define reg_dma_rw_group_ctrl___eol___bit 0
176#define reg_dma_rw_group_ctrl___tol___lsb 1
177#define reg_dma_rw_group_ctrl___tol___width 1
178#define reg_dma_rw_group_ctrl___tol___bit 1
179#define reg_dma_rw_group_ctrl___bol___lsb 2
180#define reg_dma_rw_group_ctrl___bol___width 1
181#define reg_dma_rw_group_ctrl___bol___bit 2
182#define reg_dma_rw_group_ctrl___intr___lsb 4
183#define reg_dma_rw_group_ctrl___intr___width 1
184#define reg_dma_rw_group_ctrl___intr___bit 4
185#define reg_dma_rw_group_ctrl___en___lsb 7
186#define reg_dma_rw_group_ctrl___en___width 1
187#define reg_dma_rw_group_ctrl___en___bit 7
188#define reg_dma_rw_group_ctrl_offset 104
189
190/* Register rw_group_stat, scope dma, type rw */
191#define reg_dma_rw_group_stat___dis___lsb 7
192#define reg_dma_rw_group_stat___dis___width 1
193#define reg_dma_rw_group_stat___dis___bit 7
194#define reg_dma_rw_group_stat_offset 108
195
196/* Register rw_group_md, scope dma, type rw */
197#define reg_dma_rw_group_md___md___lsb 0
198#define reg_dma_rw_group_md___md___width 16
199#define reg_dma_rw_group_md_offset 112
200
201/* Register rw_group_md_s, scope dma, type rw */
202#define reg_dma_rw_group_md_s___md_s___lsb 0
203#define reg_dma_rw_group_md_s___md_s___width 16
204#define reg_dma_rw_group_md_s_offset 116
205
206/* Register rw_group_up, scope dma, type rw */
207#define reg_dma_rw_group_up_offset 120
208
209/* Register rw_group_down, scope dma, type rw */
210#define reg_dma_rw_group_down_offset 124
211
212/* Register rw_cmd, scope dma, type rw */
213#define reg_dma_rw_cmd___cont_data___lsb 0
214#define reg_dma_rw_cmd___cont_data___width 1
215#define reg_dma_rw_cmd___cont_data___bit 0
216#define reg_dma_rw_cmd_offset 128
217
218/* Register rw_cfg, scope dma, type rw */
219#define reg_dma_rw_cfg___en___lsb 0
220#define reg_dma_rw_cfg___en___width 1
221#define reg_dma_rw_cfg___en___bit 0
222#define reg_dma_rw_cfg___stop___lsb 1
223#define reg_dma_rw_cfg___stop___width 1
224#define reg_dma_rw_cfg___stop___bit 1
225#define reg_dma_rw_cfg_offset 132
226
227/* Register rw_stat, scope dma, type rw */
228#define reg_dma_rw_stat___mode___lsb 0
229#define reg_dma_rw_stat___mode___width 5
230#define reg_dma_rw_stat___list_state___lsb 5
231#define reg_dma_rw_stat___list_state___width 3
232#define reg_dma_rw_stat___stream_cmd_src___lsb 8
233#define reg_dma_rw_stat___stream_cmd_src___width 8
234#define reg_dma_rw_stat___buf___lsb 24
235#define reg_dma_rw_stat___buf___width 8
236#define reg_dma_rw_stat_offset 136
237
238/* Register rw_intr_mask, scope dma, type rw */
239#define reg_dma_rw_intr_mask___group___lsb 0
240#define reg_dma_rw_intr_mask___group___width 1
241#define reg_dma_rw_intr_mask___group___bit 0
242#define reg_dma_rw_intr_mask___ctxt___lsb 1
243#define reg_dma_rw_intr_mask___ctxt___width 1
244#define reg_dma_rw_intr_mask___ctxt___bit 1
245#define reg_dma_rw_intr_mask___data___lsb 2
246#define reg_dma_rw_intr_mask___data___width 1
247#define reg_dma_rw_intr_mask___data___bit 2
248#define reg_dma_rw_intr_mask___in_eop___lsb 3
249#define reg_dma_rw_intr_mask___in_eop___width 1
250#define reg_dma_rw_intr_mask___in_eop___bit 3
251#define reg_dma_rw_intr_mask___stream_cmd___lsb 4
252#define reg_dma_rw_intr_mask___stream_cmd___width 1
253#define reg_dma_rw_intr_mask___stream_cmd___bit 4
254#define reg_dma_rw_intr_mask_offset 140
255
256/* Register rw_ack_intr, scope dma, type rw */
257#define reg_dma_rw_ack_intr___group___lsb 0
258#define reg_dma_rw_ack_intr___group___width 1
259#define reg_dma_rw_ack_intr___group___bit 0
260#define reg_dma_rw_ack_intr___ctxt___lsb 1
261#define reg_dma_rw_ack_intr___ctxt___width 1
262#define reg_dma_rw_ack_intr___ctxt___bit 1
263#define reg_dma_rw_ack_intr___data___lsb 2
264#define reg_dma_rw_ack_intr___data___width 1
265#define reg_dma_rw_ack_intr___data___bit 2
266#define reg_dma_rw_ack_intr___in_eop___lsb 3
267#define reg_dma_rw_ack_intr___in_eop___width 1
268#define reg_dma_rw_ack_intr___in_eop___bit 3
269#define reg_dma_rw_ack_intr___stream_cmd___lsb 4
270#define reg_dma_rw_ack_intr___stream_cmd___width 1
271#define reg_dma_rw_ack_intr___stream_cmd___bit 4
272#define reg_dma_rw_ack_intr_offset 144
273
274/* Register r_intr, scope dma, type r */
275#define reg_dma_r_intr___group___lsb 0
276#define reg_dma_r_intr___group___width 1
277#define reg_dma_r_intr___group___bit 0
278#define reg_dma_r_intr___ctxt___lsb 1
279#define reg_dma_r_intr___ctxt___width 1
280#define reg_dma_r_intr___ctxt___bit 1
281#define reg_dma_r_intr___data___lsb 2
282#define reg_dma_r_intr___data___width 1
283#define reg_dma_r_intr___data___bit 2
284#define reg_dma_r_intr___in_eop___lsb 3
285#define reg_dma_r_intr___in_eop___width 1
286#define reg_dma_r_intr___in_eop___bit 3
287#define reg_dma_r_intr___stream_cmd___lsb 4
288#define reg_dma_r_intr___stream_cmd___width 1
289#define reg_dma_r_intr___stream_cmd___bit 4
290#define reg_dma_r_intr_offset 148
291
292/* Register r_masked_intr, scope dma, type r */
293#define reg_dma_r_masked_intr___group___lsb 0
294#define reg_dma_r_masked_intr___group___width 1
295#define reg_dma_r_masked_intr___group___bit 0
296#define reg_dma_r_masked_intr___ctxt___lsb 1
297#define reg_dma_r_masked_intr___ctxt___width 1
298#define reg_dma_r_masked_intr___ctxt___bit 1
299#define reg_dma_r_masked_intr___data___lsb 2
300#define reg_dma_r_masked_intr___data___width 1
301#define reg_dma_r_masked_intr___data___bit 2
302#define reg_dma_r_masked_intr___in_eop___lsb 3
303#define reg_dma_r_masked_intr___in_eop___width 1
304#define reg_dma_r_masked_intr___in_eop___bit 3
305#define reg_dma_r_masked_intr___stream_cmd___lsb 4
306#define reg_dma_r_masked_intr___stream_cmd___width 1
307#define reg_dma_r_masked_intr___stream_cmd___bit 4
308#define reg_dma_r_masked_intr_offset 152
309
310/* Register rw_stream_cmd, scope dma, type rw */
311#define reg_dma_rw_stream_cmd___cmd___lsb 0
312#define reg_dma_rw_stream_cmd___cmd___width 10
313#define reg_dma_rw_stream_cmd___n___lsb 16
314#define reg_dma_rw_stream_cmd___n___width 8
315#define reg_dma_rw_stream_cmd___busy___lsb 31
316#define reg_dma_rw_stream_cmd___busy___width 1
317#define reg_dma_rw_stream_cmd___busy___bit 31
318#define reg_dma_rw_stream_cmd_offset 156
319
320
321/* Constants */
322#define regk_dma_ack_pkt 0x00000100
323#define regk_dma_anytime 0x00000001
324#define regk_dma_array 0x00000008
325#define regk_dma_burst 0x00000020
326#define regk_dma_client 0x00000002
327#define regk_dma_copy_next 0x00000010
328#define regk_dma_copy_up 0x00000020
329#define regk_dma_data_at_eol 0x00000001
330#define regk_dma_dis_c 0x00000010
331#define regk_dma_dis_g 0x00000020
332#define regk_dma_idle 0x00000001
333#define regk_dma_intern 0x00000004
334#define regk_dma_load_c 0x00000200
335#define regk_dma_load_c_n 0x00000280
336#define regk_dma_load_c_next 0x00000240
337#define regk_dma_load_d 0x00000140
338#define regk_dma_load_g 0x00000300
339#define regk_dma_load_g_down 0x000003c0
340#define regk_dma_load_g_next 0x00000340
341#define regk_dma_load_g_up 0x00000380
342#define regk_dma_next_en 0x00000010
343#define regk_dma_next_pkt 0x00000010
344#define regk_dma_no 0x00000000
345#define regk_dma_only_at_wait 0x00000000
346#define regk_dma_restore 0x00000020
347#define regk_dma_rst 0x00000001
348#define regk_dma_running 0x00000004
349#define regk_dma_rw_cfg_default 0x00000000
350#define regk_dma_rw_cmd_default 0x00000000
351#define regk_dma_rw_intr_mask_default 0x00000000
352#define regk_dma_rw_stat_default 0x00000101
353#define regk_dma_rw_stream_cmd_default 0x00000000
354#define regk_dma_save_down 0x00000020
355#define regk_dma_save_up 0x00000020
356#define regk_dma_set_reg 0x00000050
357#define regk_dma_set_w_size1 0x00000190
358#define regk_dma_set_w_size2 0x000001a0
359#define regk_dma_set_w_size4 0x000001c0
360#define regk_dma_stopped 0x00000002
361#define regk_dma_store_c 0x00000002
362#define regk_dma_store_descr 0x00000000
363#define regk_dma_store_g 0x00000004
364#define regk_dma_store_md 0x00000001
365#define regk_dma_sw 0x00000008
366#define regk_dma_update_down 0x00000020
367#define regk_dma_yes 0x00000001
368#endif /* __dma_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/eth_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/eth_defs_asm.h
new file mode 100644
index 000000000000..c9f49864831b
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/eth_defs_asm.h
@@ -0,0 +1,498 @@
1#ifndef __eth_defs_asm_h
2#define __eth_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/eth/rtl/eth_regs.r
7 * id: eth_regs.r,v 1.11 2005/02/09 10:48:38 kriskn Exp
8 * last modfied: Mon Apr 11 16:07:03 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/eth_defs_asm.h ../../inst/eth/rtl/eth_regs.r
11 * id: $Id: eth_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_ma0_lo, scope eth, type rw */
57#define reg_eth_rw_ma0_lo___addr___lsb 0
58#define reg_eth_rw_ma0_lo___addr___width 32
59#define reg_eth_rw_ma0_lo_offset 0
60
61/* Register rw_ma0_hi, scope eth, type rw */
62#define reg_eth_rw_ma0_hi___addr___lsb 0
63#define reg_eth_rw_ma0_hi___addr___width 16
64#define reg_eth_rw_ma0_hi_offset 4
65
66/* Register rw_ma1_lo, scope eth, type rw */
67#define reg_eth_rw_ma1_lo___addr___lsb 0
68#define reg_eth_rw_ma1_lo___addr___width 32
69#define reg_eth_rw_ma1_lo_offset 8
70
71/* Register rw_ma1_hi, scope eth, type rw */
72#define reg_eth_rw_ma1_hi___addr___lsb 0
73#define reg_eth_rw_ma1_hi___addr___width 16
74#define reg_eth_rw_ma1_hi_offset 12
75
76/* Register rw_ga_lo, scope eth, type rw */
77#define reg_eth_rw_ga_lo___table___lsb 0
78#define reg_eth_rw_ga_lo___table___width 32
79#define reg_eth_rw_ga_lo_offset 16
80
81/* Register rw_ga_hi, scope eth, type rw */
82#define reg_eth_rw_ga_hi___table___lsb 0
83#define reg_eth_rw_ga_hi___table___width 32
84#define reg_eth_rw_ga_hi_offset 20
85
86/* Register rw_gen_ctrl, scope eth, type rw */
87#define reg_eth_rw_gen_ctrl___en___lsb 0
88#define reg_eth_rw_gen_ctrl___en___width 1
89#define reg_eth_rw_gen_ctrl___en___bit 0
90#define reg_eth_rw_gen_ctrl___phy___lsb 1
91#define reg_eth_rw_gen_ctrl___phy___width 2
92#define reg_eth_rw_gen_ctrl___protocol___lsb 3
93#define reg_eth_rw_gen_ctrl___protocol___width 1
94#define reg_eth_rw_gen_ctrl___protocol___bit 3
95#define reg_eth_rw_gen_ctrl___loopback___lsb 4
96#define reg_eth_rw_gen_ctrl___loopback___width 1
97#define reg_eth_rw_gen_ctrl___loopback___bit 4
98#define reg_eth_rw_gen_ctrl___flow_ctrl_dis___lsb 5
99#define reg_eth_rw_gen_ctrl___flow_ctrl_dis___width 1
100#define reg_eth_rw_gen_ctrl___flow_ctrl_dis___bit 5
101#define reg_eth_rw_gen_ctrl_offset 24
102
103/* Register rw_rec_ctrl, scope eth, type rw */
104#define reg_eth_rw_rec_ctrl___ma0___lsb 0
105#define reg_eth_rw_rec_ctrl___ma0___width 1
106#define reg_eth_rw_rec_ctrl___ma0___bit 0
107#define reg_eth_rw_rec_ctrl___ma1___lsb 1
108#define reg_eth_rw_rec_ctrl___ma1___width 1
109#define reg_eth_rw_rec_ctrl___ma1___bit 1
110#define reg_eth_rw_rec_ctrl___individual___lsb 2
111#define reg_eth_rw_rec_ctrl___individual___width 1
112#define reg_eth_rw_rec_ctrl___individual___bit 2
113#define reg_eth_rw_rec_ctrl___broadcast___lsb 3
114#define reg_eth_rw_rec_ctrl___broadcast___width 1
115#define reg_eth_rw_rec_ctrl___broadcast___bit 3
116#define reg_eth_rw_rec_ctrl___undersize___lsb 4
117#define reg_eth_rw_rec_ctrl___undersize___width 1
118#define reg_eth_rw_rec_ctrl___undersize___bit 4
119#define reg_eth_rw_rec_ctrl___oversize___lsb 5
120#define reg_eth_rw_rec_ctrl___oversize___width 1
121#define reg_eth_rw_rec_ctrl___oversize___bit 5
122#define reg_eth_rw_rec_ctrl___bad_crc___lsb 6
123#define reg_eth_rw_rec_ctrl___bad_crc___width 1
124#define reg_eth_rw_rec_ctrl___bad_crc___bit 6
125#define reg_eth_rw_rec_ctrl___duplex___lsb 7
126#define reg_eth_rw_rec_ctrl___duplex___width 1
127#define reg_eth_rw_rec_ctrl___duplex___bit 7
128#define reg_eth_rw_rec_ctrl___max_size___lsb 8
129#define reg_eth_rw_rec_ctrl___max_size___width 1
130#define reg_eth_rw_rec_ctrl___max_size___bit 8
131#define reg_eth_rw_rec_ctrl_offset 28
132
133/* Register rw_tr_ctrl, scope eth, type rw */
134#define reg_eth_rw_tr_ctrl___crc___lsb 0
135#define reg_eth_rw_tr_ctrl___crc___width 1
136#define reg_eth_rw_tr_ctrl___crc___bit 0
137#define reg_eth_rw_tr_ctrl___pad___lsb 1
138#define reg_eth_rw_tr_ctrl___pad___width 1
139#define reg_eth_rw_tr_ctrl___pad___bit 1
140#define reg_eth_rw_tr_ctrl___retry___lsb 2
141#define reg_eth_rw_tr_ctrl___retry___width 1
142#define reg_eth_rw_tr_ctrl___retry___bit 2
143#define reg_eth_rw_tr_ctrl___ignore_col___lsb 3
144#define reg_eth_rw_tr_ctrl___ignore_col___width 1
145#define reg_eth_rw_tr_ctrl___ignore_col___bit 3
146#define reg_eth_rw_tr_ctrl___cancel___lsb 4
147#define reg_eth_rw_tr_ctrl___cancel___width 1
148#define reg_eth_rw_tr_ctrl___cancel___bit 4
149#define reg_eth_rw_tr_ctrl___hsh_delay___lsb 5
150#define reg_eth_rw_tr_ctrl___hsh_delay___width 1
151#define reg_eth_rw_tr_ctrl___hsh_delay___bit 5
152#define reg_eth_rw_tr_ctrl___ignore_crs___lsb 6
153#define reg_eth_rw_tr_ctrl___ignore_crs___width 1
154#define reg_eth_rw_tr_ctrl___ignore_crs___bit 6
155#define reg_eth_rw_tr_ctrl_offset 32
156
157/* Register rw_clr_err, scope eth, type rw */
158#define reg_eth_rw_clr_err___clr___lsb 0
159#define reg_eth_rw_clr_err___clr___width 1
160#define reg_eth_rw_clr_err___clr___bit 0
161#define reg_eth_rw_clr_err_offset 36
162
163/* Register rw_mgm_ctrl, scope eth, type rw */
164#define reg_eth_rw_mgm_ctrl___mdio___lsb 0
165#define reg_eth_rw_mgm_ctrl___mdio___width 1
166#define reg_eth_rw_mgm_ctrl___mdio___bit 0
167#define reg_eth_rw_mgm_ctrl___mdoe___lsb 1
168#define reg_eth_rw_mgm_ctrl___mdoe___width 1
169#define reg_eth_rw_mgm_ctrl___mdoe___bit 1
170#define reg_eth_rw_mgm_ctrl___mdc___lsb 2
171#define reg_eth_rw_mgm_ctrl___mdc___width 1
172#define reg_eth_rw_mgm_ctrl___mdc___bit 2
173#define reg_eth_rw_mgm_ctrl___phyclk___lsb 3
174#define reg_eth_rw_mgm_ctrl___phyclk___width 1
175#define reg_eth_rw_mgm_ctrl___phyclk___bit 3
176#define reg_eth_rw_mgm_ctrl___txdata___lsb 4
177#define reg_eth_rw_mgm_ctrl___txdata___width 4
178#define reg_eth_rw_mgm_ctrl___txen___lsb 8
179#define reg_eth_rw_mgm_ctrl___txen___width 1
180#define reg_eth_rw_mgm_ctrl___txen___bit 8
181#define reg_eth_rw_mgm_ctrl_offset 40
182
183/* Register r_stat, scope eth, type r */
184#define reg_eth_r_stat___mdio___lsb 0
185#define reg_eth_r_stat___mdio___width 1
186#define reg_eth_r_stat___mdio___bit 0
187#define reg_eth_r_stat___exc_col___lsb 1
188#define reg_eth_r_stat___exc_col___width 1
189#define reg_eth_r_stat___exc_col___bit 1
190#define reg_eth_r_stat___urun___lsb 2
191#define reg_eth_r_stat___urun___width 1
192#define reg_eth_r_stat___urun___bit 2
193#define reg_eth_r_stat___phyclk___lsb 3
194#define reg_eth_r_stat___phyclk___width 1
195#define reg_eth_r_stat___phyclk___bit 3
196#define reg_eth_r_stat___txdata___lsb 4
197#define reg_eth_r_stat___txdata___width 4
198#define reg_eth_r_stat___txen___lsb 8
199#define reg_eth_r_stat___txen___width 1
200#define reg_eth_r_stat___txen___bit 8
201#define reg_eth_r_stat___col___lsb 9
202#define reg_eth_r_stat___col___width 1
203#define reg_eth_r_stat___col___bit 9
204#define reg_eth_r_stat___crs___lsb 10
205#define reg_eth_r_stat___crs___width 1
206#define reg_eth_r_stat___crs___bit 10
207#define reg_eth_r_stat___txclk___lsb 11
208#define reg_eth_r_stat___txclk___width 1
209#define reg_eth_r_stat___txclk___bit 11
210#define reg_eth_r_stat___rxdata___lsb 12
211#define reg_eth_r_stat___rxdata___width 4
212#define reg_eth_r_stat___rxer___lsb 16
213#define reg_eth_r_stat___rxer___width 1
214#define reg_eth_r_stat___rxer___bit 16
215#define reg_eth_r_stat___rxdv___lsb 17
216#define reg_eth_r_stat___rxdv___width 1
217#define reg_eth_r_stat___rxdv___bit 17
218#define reg_eth_r_stat___rxclk___lsb 18
219#define reg_eth_r_stat___rxclk___width 1
220#define reg_eth_r_stat___rxclk___bit 18
221#define reg_eth_r_stat_offset 44
222
223/* Register rs_rec_cnt, scope eth, type rs */
224#define reg_eth_rs_rec_cnt___crc_err___lsb 0
225#define reg_eth_rs_rec_cnt___crc_err___width 8
226#define reg_eth_rs_rec_cnt___align_err___lsb 8
227#define reg_eth_rs_rec_cnt___align_err___width 8
228#define reg_eth_rs_rec_cnt___oversize___lsb 16
229#define reg_eth_rs_rec_cnt___oversize___width 8
230#define reg_eth_rs_rec_cnt___congestion___lsb 24
231#define reg_eth_rs_rec_cnt___congestion___width 8
232#define reg_eth_rs_rec_cnt_offset 48
233
234/* Register r_rec_cnt, scope eth, type r */
235#define reg_eth_r_rec_cnt___crc_err___lsb 0
236#define reg_eth_r_rec_cnt___crc_err___width 8
237#define reg_eth_r_rec_cnt___align_err___lsb 8
238#define reg_eth_r_rec_cnt___align_err___width 8
239#define reg_eth_r_rec_cnt___oversize___lsb 16
240#define reg_eth_r_rec_cnt___oversize___width 8
241#define reg_eth_r_rec_cnt___congestion___lsb 24
242#define reg_eth_r_rec_cnt___congestion___width 8
243#define reg_eth_r_rec_cnt_offset 52
244
245/* Register rs_tr_cnt, scope eth, type rs */
246#define reg_eth_rs_tr_cnt___single_col___lsb 0
247#define reg_eth_rs_tr_cnt___single_col___width 8
248#define reg_eth_rs_tr_cnt___mult_col___lsb 8
249#define reg_eth_rs_tr_cnt___mult_col___width 8
250#define reg_eth_rs_tr_cnt___late_col___lsb 16
251#define reg_eth_rs_tr_cnt___late_col___width 8
252#define reg_eth_rs_tr_cnt___deferred___lsb 24
253#define reg_eth_rs_tr_cnt___deferred___width 8
254#define reg_eth_rs_tr_cnt_offset 56
255
256/* Register r_tr_cnt, scope eth, type r */
257#define reg_eth_r_tr_cnt___single_col___lsb 0
258#define reg_eth_r_tr_cnt___single_col___width 8
259#define reg_eth_r_tr_cnt___mult_col___lsb 8
260#define reg_eth_r_tr_cnt___mult_col___width 8
261#define reg_eth_r_tr_cnt___late_col___lsb 16
262#define reg_eth_r_tr_cnt___late_col___width 8
263#define reg_eth_r_tr_cnt___deferred___lsb 24
264#define reg_eth_r_tr_cnt___deferred___width 8
265#define reg_eth_r_tr_cnt_offset 60
266
267/* Register rs_phy_cnt, scope eth, type rs */
268#define reg_eth_rs_phy_cnt___carrier_loss___lsb 0
269#define reg_eth_rs_phy_cnt___carrier_loss___width 8
270#define reg_eth_rs_phy_cnt___sqe_err___lsb 8
271#define reg_eth_rs_phy_cnt___sqe_err___width 8
272#define reg_eth_rs_phy_cnt_offset 64
273
274/* Register r_phy_cnt, scope eth, type r */
275#define reg_eth_r_phy_cnt___carrier_loss___lsb 0
276#define reg_eth_r_phy_cnt___carrier_loss___width 8
277#define reg_eth_r_phy_cnt___sqe_err___lsb 8
278#define reg_eth_r_phy_cnt___sqe_err___width 8
279#define reg_eth_r_phy_cnt_offset 68
280
281/* Register rw_test_ctrl, scope eth, type rw */
282#define reg_eth_rw_test_ctrl___snmp_inc___lsb 0
283#define reg_eth_rw_test_ctrl___snmp_inc___width 1
284#define reg_eth_rw_test_ctrl___snmp_inc___bit 0
285#define reg_eth_rw_test_ctrl___snmp___lsb 1
286#define reg_eth_rw_test_ctrl___snmp___width 1
287#define reg_eth_rw_test_ctrl___snmp___bit 1
288#define reg_eth_rw_test_ctrl___backoff___lsb 2
289#define reg_eth_rw_test_ctrl___backoff___width 1
290#define reg_eth_rw_test_ctrl___backoff___bit 2
291#define reg_eth_rw_test_ctrl_offset 72
292
293/* Register rw_intr_mask, scope eth, type rw */
294#define reg_eth_rw_intr_mask___crc___lsb 0
295#define reg_eth_rw_intr_mask___crc___width 1
296#define reg_eth_rw_intr_mask___crc___bit 0
297#define reg_eth_rw_intr_mask___align___lsb 1
298#define reg_eth_rw_intr_mask___align___width 1
299#define reg_eth_rw_intr_mask___align___bit 1
300#define reg_eth_rw_intr_mask___oversize___lsb 2
301#define reg_eth_rw_intr_mask___oversize___width 1
302#define reg_eth_rw_intr_mask___oversize___bit 2
303#define reg_eth_rw_intr_mask___congestion___lsb 3
304#define reg_eth_rw_intr_mask___congestion___width 1
305#define reg_eth_rw_intr_mask___congestion___bit 3
306#define reg_eth_rw_intr_mask___single_col___lsb 4
307#define reg_eth_rw_intr_mask___single_col___width 1
308#define reg_eth_rw_intr_mask___single_col___bit 4
309#define reg_eth_rw_intr_mask___mult_col___lsb 5
310#define reg_eth_rw_intr_mask___mult_col___width 1
311#define reg_eth_rw_intr_mask___mult_col___bit 5
312#define reg_eth_rw_intr_mask___late_col___lsb 6
313#define reg_eth_rw_intr_mask___late_col___width 1
314#define reg_eth_rw_intr_mask___late_col___bit 6
315#define reg_eth_rw_intr_mask___deferred___lsb 7
316#define reg_eth_rw_intr_mask___deferred___width 1
317#define reg_eth_rw_intr_mask___deferred___bit 7
318#define reg_eth_rw_intr_mask___carrier_loss___lsb 8
319#define reg_eth_rw_intr_mask___carrier_loss___width 1
320#define reg_eth_rw_intr_mask___carrier_loss___bit 8
321#define reg_eth_rw_intr_mask___sqe_test_err___lsb 9
322#define reg_eth_rw_intr_mask___sqe_test_err___width 1
323#define reg_eth_rw_intr_mask___sqe_test_err___bit 9
324#define reg_eth_rw_intr_mask___orun___lsb 10
325#define reg_eth_rw_intr_mask___orun___width 1
326#define reg_eth_rw_intr_mask___orun___bit 10
327#define reg_eth_rw_intr_mask___urun___lsb 11
328#define reg_eth_rw_intr_mask___urun___width 1
329#define reg_eth_rw_intr_mask___urun___bit 11
330#define reg_eth_rw_intr_mask___excessive_col___lsb 12
331#define reg_eth_rw_intr_mask___excessive_col___width 1
332#define reg_eth_rw_intr_mask___excessive_col___bit 12
333#define reg_eth_rw_intr_mask___mdio___lsb 13
334#define reg_eth_rw_intr_mask___mdio___width 1
335#define reg_eth_rw_intr_mask___mdio___bit 13
336#define reg_eth_rw_intr_mask_offset 76
337
338/* Register rw_ack_intr, scope eth, type rw */
339#define reg_eth_rw_ack_intr___crc___lsb 0
340#define reg_eth_rw_ack_intr___crc___width 1
341#define reg_eth_rw_ack_intr___crc___bit 0
342#define reg_eth_rw_ack_intr___align___lsb 1
343#define reg_eth_rw_ack_intr___align___width 1
344#define reg_eth_rw_ack_intr___align___bit 1
345#define reg_eth_rw_ack_intr___oversize___lsb 2
346#define reg_eth_rw_ack_intr___oversize___width 1
347#define reg_eth_rw_ack_intr___oversize___bit 2
348#define reg_eth_rw_ack_intr___congestion___lsb 3
349#define reg_eth_rw_ack_intr___congestion___width 1
350#define reg_eth_rw_ack_intr___congestion___bit 3
351#define reg_eth_rw_ack_intr___single_col___lsb 4
352#define reg_eth_rw_ack_intr___single_col___width 1
353#define reg_eth_rw_ack_intr___single_col___bit 4
354#define reg_eth_rw_ack_intr___mult_col___lsb 5
355#define reg_eth_rw_ack_intr___mult_col___width 1
356#define reg_eth_rw_ack_intr___mult_col___bit 5
357#define reg_eth_rw_ack_intr___late_col___lsb 6
358#define reg_eth_rw_ack_intr___late_col___width 1
359#define reg_eth_rw_ack_intr___late_col___bit 6
360#define reg_eth_rw_ack_intr___deferred___lsb 7
361#define reg_eth_rw_ack_intr___deferred___width 1
362#define reg_eth_rw_ack_intr___deferred___bit 7
363#define reg_eth_rw_ack_intr___carrier_loss___lsb 8
364#define reg_eth_rw_ack_intr___carrier_loss___width 1
365#define reg_eth_rw_ack_intr___carrier_loss___bit 8
366#define reg_eth_rw_ack_intr___sqe_test_err___lsb 9
367#define reg_eth_rw_ack_intr___sqe_test_err___width 1
368#define reg_eth_rw_ack_intr___sqe_test_err___bit 9
369#define reg_eth_rw_ack_intr___orun___lsb 10
370#define reg_eth_rw_ack_intr___orun___width 1
371#define reg_eth_rw_ack_intr___orun___bit 10
372#define reg_eth_rw_ack_intr___urun___lsb 11
373#define reg_eth_rw_ack_intr___urun___width 1
374#define reg_eth_rw_ack_intr___urun___bit 11
375#define reg_eth_rw_ack_intr___excessive_col___lsb 12
376#define reg_eth_rw_ack_intr___excessive_col___width 1
377#define reg_eth_rw_ack_intr___excessive_col___bit 12
378#define reg_eth_rw_ack_intr___mdio___lsb 13
379#define reg_eth_rw_ack_intr___mdio___width 1
380#define reg_eth_rw_ack_intr___mdio___bit 13
381#define reg_eth_rw_ack_intr_offset 80
382
383/* Register r_intr, scope eth, type r */
384#define reg_eth_r_intr___crc___lsb 0
385#define reg_eth_r_intr___crc___width 1
386#define reg_eth_r_intr___crc___bit 0
387#define reg_eth_r_intr___align___lsb 1
388#define reg_eth_r_intr___align___width 1
389#define reg_eth_r_intr___align___bit 1
390#define reg_eth_r_intr___oversize___lsb 2
391#define reg_eth_r_intr___oversize___width 1
392#define reg_eth_r_intr___oversize___bit 2
393#define reg_eth_r_intr___congestion___lsb 3
394#define reg_eth_r_intr___congestion___width 1
395#define reg_eth_r_intr___congestion___bit 3
396#define reg_eth_r_intr___single_col___lsb 4
397#define reg_eth_r_intr___single_col___width 1
398#define reg_eth_r_intr___single_col___bit 4
399#define reg_eth_r_intr___mult_col___lsb 5
400#define reg_eth_r_intr___mult_col___width 1
401#define reg_eth_r_intr___mult_col___bit 5
402#define reg_eth_r_intr___late_col___lsb 6
403#define reg_eth_r_intr___late_col___width 1
404#define reg_eth_r_intr___late_col___bit 6
405#define reg_eth_r_intr___deferred___lsb 7
406#define reg_eth_r_intr___deferred___width 1
407#define reg_eth_r_intr___deferred___bit 7
408#define reg_eth_r_intr___carrier_loss___lsb 8
409#define reg_eth_r_intr___carrier_loss___width 1
410#define reg_eth_r_intr___carrier_loss___bit 8
411#define reg_eth_r_intr___sqe_test_err___lsb 9
412#define reg_eth_r_intr___sqe_test_err___width 1
413#define reg_eth_r_intr___sqe_test_err___bit 9
414#define reg_eth_r_intr___orun___lsb 10
415#define reg_eth_r_intr___orun___width 1
416#define reg_eth_r_intr___orun___bit 10
417#define reg_eth_r_intr___urun___lsb 11
418#define reg_eth_r_intr___urun___width 1
419#define reg_eth_r_intr___urun___bit 11
420#define reg_eth_r_intr___excessive_col___lsb 12
421#define reg_eth_r_intr___excessive_col___width 1
422#define reg_eth_r_intr___excessive_col___bit 12
423#define reg_eth_r_intr___mdio___lsb 13
424#define reg_eth_r_intr___mdio___width 1
425#define reg_eth_r_intr___mdio___bit 13
426#define reg_eth_r_intr_offset 84
427
428/* Register r_masked_intr, scope eth, type r */
429#define reg_eth_r_masked_intr___crc___lsb 0
430#define reg_eth_r_masked_intr___crc___width 1
431#define reg_eth_r_masked_intr___crc___bit 0
432#define reg_eth_r_masked_intr___align___lsb 1
433#define reg_eth_r_masked_intr___align___width 1
434#define reg_eth_r_masked_intr___align___bit 1
435#define reg_eth_r_masked_intr___oversize___lsb 2
436#define reg_eth_r_masked_intr___oversize___width 1
437#define reg_eth_r_masked_intr___oversize___bit 2
438#define reg_eth_r_masked_intr___congestion___lsb 3
439#define reg_eth_r_masked_intr___congestion___width 1
440#define reg_eth_r_masked_intr___congestion___bit 3
441#define reg_eth_r_masked_intr___single_col___lsb 4
442#define reg_eth_r_masked_intr___single_col___width 1
443#define reg_eth_r_masked_intr___single_col___bit 4
444#define reg_eth_r_masked_intr___mult_col___lsb 5
445#define reg_eth_r_masked_intr___mult_col___width 1
446#define reg_eth_r_masked_intr___mult_col___bit 5
447#define reg_eth_r_masked_intr___late_col___lsb 6
448#define reg_eth_r_masked_intr___late_col___width 1
449#define reg_eth_r_masked_intr___late_col___bit 6
450#define reg_eth_r_masked_intr___deferred___lsb 7
451#define reg_eth_r_masked_intr___deferred___width 1
452#define reg_eth_r_masked_intr___deferred___bit 7
453#define reg_eth_r_masked_intr___carrier_loss___lsb 8
454#define reg_eth_r_masked_intr___carrier_loss___width 1
455#define reg_eth_r_masked_intr___carrier_loss___bit 8
456#define reg_eth_r_masked_intr___sqe_test_err___lsb 9
457#define reg_eth_r_masked_intr___sqe_test_err___width 1
458#define reg_eth_r_masked_intr___sqe_test_err___bit 9
459#define reg_eth_r_masked_intr___orun___lsb 10
460#define reg_eth_r_masked_intr___orun___width 1
461#define reg_eth_r_masked_intr___orun___bit 10
462#define reg_eth_r_masked_intr___urun___lsb 11
463#define reg_eth_r_masked_intr___urun___width 1
464#define reg_eth_r_masked_intr___urun___bit 11
465#define reg_eth_r_masked_intr___excessive_col___lsb 12
466#define reg_eth_r_masked_intr___excessive_col___width 1
467#define reg_eth_r_masked_intr___excessive_col___bit 12
468#define reg_eth_r_masked_intr___mdio___lsb 13
469#define reg_eth_r_masked_intr___mdio___width 1
470#define reg_eth_r_masked_intr___mdio___bit 13
471#define reg_eth_r_masked_intr_offset 88
472
473
474/* Constants */
475#define regk_eth_discard 0x00000000
476#define regk_eth_ether 0x00000000
477#define regk_eth_full 0x00000001
478#define regk_eth_half 0x00000000
479#define regk_eth_hsh 0x00000001
480#define regk_eth_mii 0x00000001
481#define regk_eth_mii_clk 0x00000000
482#define regk_eth_mii_rec 0x00000002
483#define regk_eth_no 0x00000000
484#define regk_eth_rec 0x00000001
485#define regk_eth_rw_ga_hi_default 0x00000000
486#define regk_eth_rw_ga_lo_default 0x00000000
487#define regk_eth_rw_gen_ctrl_default 0x00000000
488#define regk_eth_rw_intr_mask_default 0x00000000
489#define regk_eth_rw_ma0_hi_default 0x00000000
490#define regk_eth_rw_ma0_lo_default 0x00000000
491#define regk_eth_rw_ma1_hi_default 0x00000000
492#define regk_eth_rw_ma1_lo_default 0x00000000
493#define regk_eth_rw_mgm_ctrl_default 0x00000000
494#define regk_eth_rw_test_ctrl_default 0x00000000
495#define regk_eth_size1518 0x00000000
496#define regk_eth_size1522 0x00000001
497#define regk_eth_yes 0x00000001
498#endif /* __eth_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/gio_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/gio_defs_asm.h
new file mode 100644
index 000000000000..35356bc08629
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/gio_defs_asm.h
@@ -0,0 +1,276 @@
1#ifndef __gio_defs_asm_h
2#define __gio_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/gio/rtl/gio_regs.r
7 * id: gio_regs.r,v 1.5 2005/02/04 09:43:21 perz Exp
8 * last modfied: Mon Apr 11 16:07:47 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/gio_defs_asm.h ../../inst/gio/rtl/gio_regs.r
11 * id: $Id: gio_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_pa_dout, scope gio, type rw */
57#define reg_gio_rw_pa_dout___data___lsb 0
58#define reg_gio_rw_pa_dout___data___width 8
59#define reg_gio_rw_pa_dout_offset 0
60
61/* Register r_pa_din, scope gio, type r */
62#define reg_gio_r_pa_din___data___lsb 0
63#define reg_gio_r_pa_din___data___width 8
64#define reg_gio_r_pa_din_offset 4
65
66/* Register rw_pa_oe, scope gio, type rw */
67#define reg_gio_rw_pa_oe___oe___lsb 0
68#define reg_gio_rw_pa_oe___oe___width 8
69#define reg_gio_rw_pa_oe_offset 8
70
71/* Register rw_intr_cfg, scope gio, type rw */
72#define reg_gio_rw_intr_cfg___pa0___lsb 0
73#define reg_gio_rw_intr_cfg___pa0___width 3
74#define reg_gio_rw_intr_cfg___pa1___lsb 3
75#define reg_gio_rw_intr_cfg___pa1___width 3
76#define reg_gio_rw_intr_cfg___pa2___lsb 6
77#define reg_gio_rw_intr_cfg___pa2___width 3
78#define reg_gio_rw_intr_cfg___pa3___lsb 9
79#define reg_gio_rw_intr_cfg___pa3___width 3
80#define reg_gio_rw_intr_cfg___pa4___lsb 12
81#define reg_gio_rw_intr_cfg___pa4___width 3
82#define reg_gio_rw_intr_cfg___pa5___lsb 15
83#define reg_gio_rw_intr_cfg___pa5___width 3
84#define reg_gio_rw_intr_cfg___pa6___lsb 18
85#define reg_gio_rw_intr_cfg___pa6___width 3
86#define reg_gio_rw_intr_cfg___pa7___lsb 21
87#define reg_gio_rw_intr_cfg___pa7___width 3
88#define reg_gio_rw_intr_cfg_offset 12
89
90/* Register rw_intr_mask, scope gio, type rw */
91#define reg_gio_rw_intr_mask___pa0___lsb 0
92#define reg_gio_rw_intr_mask___pa0___width 1
93#define reg_gio_rw_intr_mask___pa0___bit 0
94#define reg_gio_rw_intr_mask___pa1___lsb 1
95#define reg_gio_rw_intr_mask___pa1___width 1
96#define reg_gio_rw_intr_mask___pa1___bit 1
97#define reg_gio_rw_intr_mask___pa2___lsb 2
98#define reg_gio_rw_intr_mask___pa2___width 1
99#define reg_gio_rw_intr_mask___pa2___bit 2
100#define reg_gio_rw_intr_mask___pa3___lsb 3
101#define reg_gio_rw_intr_mask___pa3___width 1
102#define reg_gio_rw_intr_mask___pa3___bit 3
103#define reg_gio_rw_intr_mask___pa4___lsb 4
104#define reg_gio_rw_intr_mask___pa4___width 1
105#define reg_gio_rw_intr_mask___pa4___bit 4
106#define reg_gio_rw_intr_mask___pa5___lsb 5
107#define reg_gio_rw_intr_mask___pa5___width 1
108#define reg_gio_rw_intr_mask___pa5___bit 5
109#define reg_gio_rw_intr_mask___pa6___lsb 6
110#define reg_gio_rw_intr_mask___pa6___width 1
111#define reg_gio_rw_intr_mask___pa6___bit 6
112#define reg_gio_rw_intr_mask___pa7___lsb 7
113#define reg_gio_rw_intr_mask___pa7___width 1
114#define reg_gio_rw_intr_mask___pa7___bit 7
115#define reg_gio_rw_intr_mask_offset 16
116
117/* Register rw_ack_intr, scope gio, type rw */
118#define reg_gio_rw_ack_intr___pa0___lsb 0
119#define reg_gio_rw_ack_intr___pa0___width 1
120#define reg_gio_rw_ack_intr___pa0___bit 0
121#define reg_gio_rw_ack_intr___pa1___lsb 1
122#define reg_gio_rw_ack_intr___pa1___width 1
123#define reg_gio_rw_ack_intr___pa1___bit 1
124#define reg_gio_rw_ack_intr___pa2___lsb 2
125#define reg_gio_rw_ack_intr___pa2___width 1
126#define reg_gio_rw_ack_intr___pa2___bit 2
127#define reg_gio_rw_ack_intr___pa3___lsb 3
128#define reg_gio_rw_ack_intr___pa3___width 1
129#define reg_gio_rw_ack_intr___pa3___bit 3
130#define reg_gio_rw_ack_intr___pa4___lsb 4
131#define reg_gio_rw_ack_intr___pa4___width 1
132#define reg_gio_rw_ack_intr___pa4___bit 4
133#define reg_gio_rw_ack_intr___pa5___lsb 5
134#define reg_gio_rw_ack_intr___pa5___width 1
135#define reg_gio_rw_ack_intr___pa5___bit 5
136#define reg_gio_rw_ack_intr___pa6___lsb 6
137#define reg_gio_rw_ack_intr___pa6___width 1
138#define reg_gio_rw_ack_intr___pa6___bit 6
139#define reg_gio_rw_ack_intr___pa7___lsb 7
140#define reg_gio_rw_ack_intr___pa7___width 1
141#define reg_gio_rw_ack_intr___pa7___bit 7
142#define reg_gio_rw_ack_intr_offset 20
143
144/* Register r_intr, scope gio, type r */
145#define reg_gio_r_intr___pa0___lsb 0
146#define reg_gio_r_intr___pa0___width 1
147#define reg_gio_r_intr___pa0___bit 0
148#define reg_gio_r_intr___pa1___lsb 1
149#define reg_gio_r_intr___pa1___width 1
150#define reg_gio_r_intr___pa1___bit 1
151#define reg_gio_r_intr___pa2___lsb 2
152#define reg_gio_r_intr___pa2___width 1
153#define reg_gio_r_intr___pa2___bit 2
154#define reg_gio_r_intr___pa3___lsb 3
155#define reg_gio_r_intr___pa3___width 1
156#define reg_gio_r_intr___pa3___bit 3
157#define reg_gio_r_intr___pa4___lsb 4
158#define reg_gio_r_intr___pa4___width 1
159#define reg_gio_r_intr___pa4___bit 4
160#define reg_gio_r_intr___pa5___lsb 5
161#define reg_gio_r_intr___pa5___width 1
162#define reg_gio_r_intr___pa5___bit 5
163#define reg_gio_r_intr___pa6___lsb 6
164#define reg_gio_r_intr___pa6___width 1
165#define reg_gio_r_intr___pa6___bit 6
166#define reg_gio_r_intr___pa7___lsb 7
167#define reg_gio_r_intr___pa7___width 1
168#define reg_gio_r_intr___pa7___bit 7
169#define reg_gio_r_intr_offset 24
170
171/* Register r_masked_intr, scope gio, type r */
172#define reg_gio_r_masked_intr___pa0___lsb 0
173#define reg_gio_r_masked_intr___pa0___width 1
174#define reg_gio_r_masked_intr___pa0___bit 0
175#define reg_gio_r_masked_intr___pa1___lsb 1
176#define reg_gio_r_masked_intr___pa1___width 1
177#define reg_gio_r_masked_intr___pa1___bit 1
178#define reg_gio_r_masked_intr___pa2___lsb 2
179#define reg_gio_r_masked_intr___pa2___width 1
180#define reg_gio_r_masked_intr___pa2___bit 2
181#define reg_gio_r_masked_intr___pa3___lsb 3
182#define reg_gio_r_masked_intr___pa3___width 1
183#define reg_gio_r_masked_intr___pa3___bit 3
184#define reg_gio_r_masked_intr___pa4___lsb 4
185#define reg_gio_r_masked_intr___pa4___width 1
186#define reg_gio_r_masked_intr___pa4___bit 4
187#define reg_gio_r_masked_intr___pa5___lsb 5
188#define reg_gio_r_masked_intr___pa5___width 1
189#define reg_gio_r_masked_intr___pa5___bit 5
190#define reg_gio_r_masked_intr___pa6___lsb 6
191#define reg_gio_r_masked_intr___pa6___width 1
192#define reg_gio_r_masked_intr___pa6___bit 6
193#define reg_gio_r_masked_intr___pa7___lsb 7
194#define reg_gio_r_masked_intr___pa7___width 1
195#define reg_gio_r_masked_intr___pa7___bit 7
196#define reg_gio_r_masked_intr_offset 28
197
198/* Register rw_pb_dout, scope gio, type rw */
199#define reg_gio_rw_pb_dout___data___lsb 0
200#define reg_gio_rw_pb_dout___data___width 18
201#define reg_gio_rw_pb_dout_offset 32
202
203/* Register r_pb_din, scope gio, type r */
204#define reg_gio_r_pb_din___data___lsb 0
205#define reg_gio_r_pb_din___data___width 18
206#define reg_gio_r_pb_din_offset 36
207
208/* Register rw_pb_oe, scope gio, type rw */
209#define reg_gio_rw_pb_oe___oe___lsb 0
210#define reg_gio_rw_pb_oe___oe___width 18
211#define reg_gio_rw_pb_oe_offset 40
212
213/* Register rw_pc_dout, scope gio, type rw */
214#define reg_gio_rw_pc_dout___data___lsb 0
215#define reg_gio_rw_pc_dout___data___width 18
216#define reg_gio_rw_pc_dout_offset 48
217
218/* Register r_pc_din, scope gio, type r */
219#define reg_gio_r_pc_din___data___lsb 0
220#define reg_gio_r_pc_din___data___width 18
221#define reg_gio_r_pc_din_offset 52
222
223/* Register rw_pc_oe, scope gio, type rw */
224#define reg_gio_rw_pc_oe___oe___lsb 0
225#define reg_gio_rw_pc_oe___oe___width 18
226#define reg_gio_rw_pc_oe_offset 56
227
228/* Register rw_pd_dout, scope gio, type rw */
229#define reg_gio_rw_pd_dout___data___lsb 0
230#define reg_gio_rw_pd_dout___data___width 18
231#define reg_gio_rw_pd_dout_offset 64
232
233/* Register r_pd_din, scope gio, type r */
234#define reg_gio_r_pd_din___data___lsb 0
235#define reg_gio_r_pd_din___data___width 18
236#define reg_gio_r_pd_din_offset 68
237
238/* Register rw_pd_oe, scope gio, type rw */
239#define reg_gio_rw_pd_oe___oe___lsb 0
240#define reg_gio_rw_pd_oe___oe___width 18
241#define reg_gio_rw_pd_oe_offset 72
242
243/* Register rw_pe_dout, scope gio, type rw */
244#define reg_gio_rw_pe_dout___data___lsb 0
245#define reg_gio_rw_pe_dout___data___width 18
246#define reg_gio_rw_pe_dout_offset 80
247
248/* Register r_pe_din, scope gio, type r */
249#define reg_gio_r_pe_din___data___lsb 0
250#define reg_gio_r_pe_din___data___width 18
251#define reg_gio_r_pe_din_offset 84
252
253/* Register rw_pe_oe, scope gio, type rw */
254#define reg_gio_rw_pe_oe___oe___lsb 0
255#define reg_gio_rw_pe_oe___oe___width 18
256#define reg_gio_rw_pe_oe_offset 88
257
258
259/* Constants */
260#define regk_gio_anyedge 0x00000007
261#define regk_gio_hi 0x00000001
262#define regk_gio_lo 0x00000002
263#define regk_gio_negedge 0x00000006
264#define regk_gio_no 0x00000000
265#define regk_gio_off 0x00000000
266#define regk_gio_posedge 0x00000005
267#define regk_gio_rw_intr_cfg_default 0x00000000
268#define regk_gio_rw_intr_mask_default 0x00000000
269#define regk_gio_rw_pa_oe_default 0x00000000
270#define regk_gio_rw_pb_oe_default 0x00000000
271#define regk_gio_rw_pc_oe_default 0x00000000
272#define regk_gio_rw_pd_oe_default 0x00000000
273#define regk_gio_rw_pe_oe_default 0x00000000
274#define regk_gio_set 0x00000003
275#define regk_gio_yes 0x00000001
276#endif /* __gio_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/intr_vect.h b/include/asm-cris/arch-v32/hwregs/asm/intr_vect.h
new file mode 100644
index 000000000000..c8315905c571
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/intr_vect.h
@@ -0,0 +1,38 @@
1/* Interrupt vector numbers autogenerated by /n/asic/design/tools/rdesc/src/rdes2intr version
2 from ../../inst/intr_vect/rtl/guinness/ivmask.config.r
3version . */
4
5#ifndef _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
6#define _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
7#define MEMARB_INTR_VECT 0x31
8#define GEN_IO_INTR_VECT 0x32
9#define IOP0_INTR_VECT 0x33
10#define IOP1_INTR_VECT 0x34
11#define IOP2_INTR_VECT 0x35
12#define IOP3_INTR_VECT 0x36
13#define DMA0_INTR_VECT 0x37
14#define DMA1_INTR_VECT 0x38
15#define DMA2_INTR_VECT 0x39
16#define DMA3_INTR_VECT 0x3a
17#define DMA4_INTR_VECT 0x3b
18#define DMA5_INTR_VECT 0x3c
19#define DMA6_INTR_VECT 0x3d
20#define DMA7_INTR_VECT 0x3e
21#define DMA8_INTR_VECT 0x3f
22#define DMA9_INTR_VECT 0x40
23#define ATA_INTR_VECT 0x41
24#define SSER0_INTR_VECT 0x42
25#define SSER1_INTR_VECT 0x43
26#define SER0_INTR_VECT 0x44
27#define SER1_INTR_VECT 0x45
28#define SER2_INTR_VECT 0x46
29#define SER3_INTR_VECT 0x47
30#define P21_INTR_VECT 0x48
31#define ETH0_INTR_VECT 0x49
32#define ETH1_INTR_VECT 0x4a
33#define TIMER_INTR_VECT 0x4b
34#define BIF_ARB_INTR_VECT 0x4c
35#define BIF_DMA_INTR_VECT 0x4d
36#define EXT_INTR_VECT 0x4e
37
38#endif
diff --git a/include/asm-cris/arch-v32/hwregs/asm/intr_vect_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/intr_vect_defs_asm.h
new file mode 100644
index 000000000000..6df2a433b02d
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/intr_vect_defs_asm.h
@@ -0,0 +1,355 @@
1#ifndef __intr_vect_defs_asm_h
2#define __intr_vect_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/intr_vect/rtl/guinness/ivmask.config.r
7 * id: ivmask.config.r,v 1.4 2005/02/15 16:05:38 stefans Exp
8 * last modfied: Mon Apr 11 16:08:03 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/intr_vect_defs_asm.h ../../inst/intr_vect/rtl/guinness/ivmask.config.r
11 * id: $Id: intr_vect_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_mask, scope intr_vect, type rw */
57#define reg_intr_vect_rw_mask___memarb___lsb 0
58#define reg_intr_vect_rw_mask___memarb___width 1
59#define reg_intr_vect_rw_mask___memarb___bit 0
60#define reg_intr_vect_rw_mask___gen_io___lsb 1
61#define reg_intr_vect_rw_mask___gen_io___width 1
62#define reg_intr_vect_rw_mask___gen_io___bit 1
63#define reg_intr_vect_rw_mask___iop0___lsb 2
64#define reg_intr_vect_rw_mask___iop0___width 1
65#define reg_intr_vect_rw_mask___iop0___bit 2
66#define reg_intr_vect_rw_mask___iop1___lsb 3
67#define reg_intr_vect_rw_mask___iop1___width 1
68#define reg_intr_vect_rw_mask___iop1___bit 3
69#define reg_intr_vect_rw_mask___iop2___lsb 4
70#define reg_intr_vect_rw_mask___iop2___width 1
71#define reg_intr_vect_rw_mask___iop2___bit 4
72#define reg_intr_vect_rw_mask___iop3___lsb 5
73#define reg_intr_vect_rw_mask___iop3___width 1
74#define reg_intr_vect_rw_mask___iop3___bit 5
75#define reg_intr_vect_rw_mask___dma0___lsb 6
76#define reg_intr_vect_rw_mask___dma0___width 1
77#define reg_intr_vect_rw_mask___dma0___bit 6
78#define reg_intr_vect_rw_mask___dma1___lsb 7
79#define reg_intr_vect_rw_mask___dma1___width 1
80#define reg_intr_vect_rw_mask___dma1___bit 7
81#define reg_intr_vect_rw_mask___dma2___lsb 8
82#define reg_intr_vect_rw_mask___dma2___width 1
83#define reg_intr_vect_rw_mask___dma2___bit 8
84#define reg_intr_vect_rw_mask___dma3___lsb 9
85#define reg_intr_vect_rw_mask___dma3___width 1
86#define reg_intr_vect_rw_mask___dma3___bit 9
87#define reg_intr_vect_rw_mask___dma4___lsb 10
88#define reg_intr_vect_rw_mask___dma4___width 1
89#define reg_intr_vect_rw_mask___dma4___bit 10
90#define reg_intr_vect_rw_mask___dma5___lsb 11
91#define reg_intr_vect_rw_mask___dma5___width 1
92#define reg_intr_vect_rw_mask___dma5___bit 11
93#define reg_intr_vect_rw_mask___dma6___lsb 12
94#define reg_intr_vect_rw_mask___dma6___width 1
95#define reg_intr_vect_rw_mask___dma6___bit 12
96#define reg_intr_vect_rw_mask___dma7___lsb 13
97#define reg_intr_vect_rw_mask___dma7___width 1
98#define reg_intr_vect_rw_mask___dma7___bit 13
99#define reg_intr_vect_rw_mask___dma8___lsb 14
100#define reg_intr_vect_rw_mask___dma8___width 1
101#define reg_intr_vect_rw_mask___dma8___bit 14
102#define reg_intr_vect_rw_mask___dma9___lsb 15
103#define reg_intr_vect_rw_mask___dma9___width 1
104#define reg_intr_vect_rw_mask___dma9___bit 15
105#define reg_intr_vect_rw_mask___ata___lsb 16
106#define reg_intr_vect_rw_mask___ata___width 1
107#define reg_intr_vect_rw_mask___ata___bit 16
108#define reg_intr_vect_rw_mask___sser0___lsb 17
109#define reg_intr_vect_rw_mask___sser0___width 1
110#define reg_intr_vect_rw_mask___sser0___bit 17
111#define reg_intr_vect_rw_mask___sser1___lsb 18
112#define reg_intr_vect_rw_mask___sser1___width 1
113#define reg_intr_vect_rw_mask___sser1___bit 18
114#define reg_intr_vect_rw_mask___ser0___lsb 19
115#define reg_intr_vect_rw_mask___ser0___width 1
116#define reg_intr_vect_rw_mask___ser0___bit 19
117#define reg_intr_vect_rw_mask___ser1___lsb 20
118#define reg_intr_vect_rw_mask___ser1___width 1
119#define reg_intr_vect_rw_mask___ser1___bit 20
120#define reg_intr_vect_rw_mask___ser2___lsb 21
121#define reg_intr_vect_rw_mask___ser2___width 1
122#define reg_intr_vect_rw_mask___ser2___bit 21
123#define reg_intr_vect_rw_mask___ser3___lsb 22
124#define reg_intr_vect_rw_mask___ser3___width 1
125#define reg_intr_vect_rw_mask___ser3___bit 22
126#define reg_intr_vect_rw_mask___p21___lsb 23
127#define reg_intr_vect_rw_mask___p21___width 1
128#define reg_intr_vect_rw_mask___p21___bit 23
129#define reg_intr_vect_rw_mask___eth0___lsb 24
130#define reg_intr_vect_rw_mask___eth0___width 1
131#define reg_intr_vect_rw_mask___eth0___bit 24
132#define reg_intr_vect_rw_mask___eth1___lsb 25
133#define reg_intr_vect_rw_mask___eth1___width 1
134#define reg_intr_vect_rw_mask___eth1___bit 25
135#define reg_intr_vect_rw_mask___timer___lsb 26
136#define reg_intr_vect_rw_mask___timer___width 1
137#define reg_intr_vect_rw_mask___timer___bit 26
138#define reg_intr_vect_rw_mask___bif_arb___lsb 27
139#define reg_intr_vect_rw_mask___bif_arb___width 1
140#define reg_intr_vect_rw_mask___bif_arb___bit 27
141#define reg_intr_vect_rw_mask___bif_dma___lsb 28
142#define reg_intr_vect_rw_mask___bif_dma___width 1
143#define reg_intr_vect_rw_mask___bif_dma___bit 28
144#define reg_intr_vect_rw_mask___ext___lsb 29
145#define reg_intr_vect_rw_mask___ext___width 1
146#define reg_intr_vect_rw_mask___ext___bit 29
147#define reg_intr_vect_rw_mask_offset 0
148
149/* Register r_vect, scope intr_vect, type r */
150#define reg_intr_vect_r_vect___memarb___lsb 0
151#define reg_intr_vect_r_vect___memarb___width 1
152#define reg_intr_vect_r_vect___memarb___bit 0
153#define reg_intr_vect_r_vect___gen_io___lsb 1
154#define reg_intr_vect_r_vect___gen_io___width 1
155#define reg_intr_vect_r_vect___gen_io___bit 1
156#define reg_intr_vect_r_vect___iop0___lsb 2
157#define reg_intr_vect_r_vect___iop0___width 1
158#define reg_intr_vect_r_vect___iop0___bit 2
159#define reg_intr_vect_r_vect___iop1___lsb 3
160#define reg_intr_vect_r_vect___iop1___width 1
161#define reg_intr_vect_r_vect___iop1___bit 3
162#define reg_intr_vect_r_vect___iop2___lsb 4
163#define reg_intr_vect_r_vect___iop2___width 1
164#define reg_intr_vect_r_vect___iop2___bit 4
165#define reg_intr_vect_r_vect___iop3___lsb 5
166#define reg_intr_vect_r_vect___iop3___width 1
167#define reg_intr_vect_r_vect___iop3___bit 5
168#define reg_intr_vect_r_vect___dma0___lsb 6
169#define reg_intr_vect_r_vect___dma0___width 1
170#define reg_intr_vect_r_vect___dma0___bit 6
171#define reg_intr_vect_r_vect___dma1___lsb 7
172#define reg_intr_vect_r_vect___dma1___width 1
173#define reg_intr_vect_r_vect___dma1___bit 7
174#define reg_intr_vect_r_vect___dma2___lsb 8
175#define reg_intr_vect_r_vect___dma2___width 1
176#define reg_intr_vect_r_vect___dma2___bit 8
177#define reg_intr_vect_r_vect___dma3___lsb 9
178#define reg_intr_vect_r_vect___dma3___width 1
179#define reg_intr_vect_r_vect___dma3___bit 9
180#define reg_intr_vect_r_vect___dma4___lsb 10
181#define reg_intr_vect_r_vect___dma4___width 1
182#define reg_intr_vect_r_vect___dma4___bit 10
183#define reg_intr_vect_r_vect___dma5___lsb 11
184#define reg_intr_vect_r_vect___dma5___width 1
185#define reg_intr_vect_r_vect___dma5___bit 11
186#define reg_intr_vect_r_vect___dma6___lsb 12
187#define reg_intr_vect_r_vect___dma6___width 1
188#define reg_intr_vect_r_vect___dma6___bit 12
189#define reg_intr_vect_r_vect___dma7___lsb 13
190#define reg_intr_vect_r_vect___dma7___width 1
191#define reg_intr_vect_r_vect___dma7___bit 13
192#define reg_intr_vect_r_vect___dma8___lsb 14
193#define reg_intr_vect_r_vect___dma8___width 1
194#define reg_intr_vect_r_vect___dma8___bit 14
195#define reg_intr_vect_r_vect___dma9___lsb 15
196#define reg_intr_vect_r_vect___dma9___width 1
197#define reg_intr_vect_r_vect___dma9___bit 15
198#define reg_intr_vect_r_vect___ata___lsb 16
199#define reg_intr_vect_r_vect___ata___width 1
200#define reg_intr_vect_r_vect___ata___bit 16
201#define reg_intr_vect_r_vect___sser0___lsb 17
202#define reg_intr_vect_r_vect___sser0___width 1
203#define reg_intr_vect_r_vect___sser0___bit 17
204#define reg_intr_vect_r_vect___sser1___lsb 18
205#define reg_intr_vect_r_vect___sser1___width 1
206#define reg_intr_vect_r_vect___sser1___bit 18
207#define reg_intr_vect_r_vect___ser0___lsb 19
208#define reg_intr_vect_r_vect___ser0___width 1
209#define reg_intr_vect_r_vect___ser0___bit 19
210#define reg_intr_vect_r_vect___ser1___lsb 20
211#define reg_intr_vect_r_vect___ser1___width 1
212#define reg_intr_vect_r_vect___ser1___bit 20
213#define reg_intr_vect_r_vect___ser2___lsb 21
214#define reg_intr_vect_r_vect___ser2___width 1
215#define reg_intr_vect_r_vect___ser2___bit 21
216#define reg_intr_vect_r_vect___ser3___lsb 22
217#define reg_intr_vect_r_vect___ser3___width 1
218#define reg_intr_vect_r_vect___ser3___bit 22
219#define reg_intr_vect_r_vect___p21___lsb 23
220#define reg_intr_vect_r_vect___p21___width 1
221#define reg_intr_vect_r_vect___p21___bit 23
222#define reg_intr_vect_r_vect___eth0___lsb 24
223#define reg_intr_vect_r_vect___eth0___width 1
224#define reg_intr_vect_r_vect___eth0___bit 24
225#define reg_intr_vect_r_vect___eth1___lsb 25
226#define reg_intr_vect_r_vect___eth1___width 1
227#define reg_intr_vect_r_vect___eth1___bit 25
228#define reg_intr_vect_r_vect___timer___lsb 26
229#define reg_intr_vect_r_vect___timer___width 1
230#define reg_intr_vect_r_vect___timer___bit 26
231#define reg_intr_vect_r_vect___bif_arb___lsb 27
232#define reg_intr_vect_r_vect___bif_arb___width 1
233#define reg_intr_vect_r_vect___bif_arb___bit 27
234#define reg_intr_vect_r_vect___bif_dma___lsb 28
235#define reg_intr_vect_r_vect___bif_dma___width 1
236#define reg_intr_vect_r_vect___bif_dma___bit 28
237#define reg_intr_vect_r_vect___ext___lsb 29
238#define reg_intr_vect_r_vect___ext___width 1
239#define reg_intr_vect_r_vect___ext___bit 29
240#define reg_intr_vect_r_vect_offset 4
241
242/* Register r_masked_vect, scope intr_vect, type r */
243#define reg_intr_vect_r_masked_vect___memarb___lsb 0
244#define reg_intr_vect_r_masked_vect___memarb___width 1
245#define reg_intr_vect_r_masked_vect___memarb___bit 0
246#define reg_intr_vect_r_masked_vect___gen_io___lsb 1
247#define reg_intr_vect_r_masked_vect___gen_io___width 1
248#define reg_intr_vect_r_masked_vect___gen_io___bit 1
249#define reg_intr_vect_r_masked_vect___iop0___lsb 2
250#define reg_intr_vect_r_masked_vect___iop0___width 1
251#define reg_intr_vect_r_masked_vect___iop0___bit 2
252#define reg_intr_vect_r_masked_vect___iop1___lsb 3
253#define reg_intr_vect_r_masked_vect___iop1___width 1
254#define reg_intr_vect_r_masked_vect___iop1___bit 3
255#define reg_intr_vect_r_masked_vect___iop2___lsb 4
256#define reg_intr_vect_r_masked_vect___iop2___width 1
257#define reg_intr_vect_r_masked_vect___iop2___bit 4
258#define reg_intr_vect_r_masked_vect___iop3___lsb 5
259#define reg_intr_vect_r_masked_vect___iop3___width 1
260#define reg_intr_vect_r_masked_vect___iop3___bit 5
261#define reg_intr_vect_r_masked_vect___dma0___lsb 6
262#define reg_intr_vect_r_masked_vect___dma0___width 1
263#define reg_intr_vect_r_masked_vect___dma0___bit 6
264#define reg_intr_vect_r_masked_vect___dma1___lsb 7
265#define reg_intr_vect_r_masked_vect___dma1___width 1
266#define reg_intr_vect_r_masked_vect___dma1___bit 7
267#define reg_intr_vect_r_masked_vect___dma2___lsb 8
268#define reg_intr_vect_r_masked_vect___dma2___width 1
269#define reg_intr_vect_r_masked_vect___dma2___bit 8
270#define reg_intr_vect_r_masked_vect___dma3___lsb 9
271#define reg_intr_vect_r_masked_vect___dma3___width 1
272#define reg_intr_vect_r_masked_vect___dma3___bit 9
273#define reg_intr_vect_r_masked_vect___dma4___lsb 10
274#define reg_intr_vect_r_masked_vect___dma4___width 1
275#define reg_intr_vect_r_masked_vect___dma4___bit 10
276#define reg_intr_vect_r_masked_vect___dma5___lsb 11
277#define reg_intr_vect_r_masked_vect___dma5___width 1
278#define reg_intr_vect_r_masked_vect___dma5___bit 11
279#define reg_intr_vect_r_masked_vect___dma6___lsb 12
280#define reg_intr_vect_r_masked_vect___dma6___width 1
281#define reg_intr_vect_r_masked_vect___dma6___bit 12
282#define reg_intr_vect_r_masked_vect___dma7___lsb 13
283#define reg_intr_vect_r_masked_vect___dma7___width 1
284#define reg_intr_vect_r_masked_vect___dma7___bit 13
285#define reg_intr_vect_r_masked_vect___dma8___lsb 14
286#define reg_intr_vect_r_masked_vect___dma8___width 1
287#define reg_intr_vect_r_masked_vect___dma8___bit 14
288#define reg_intr_vect_r_masked_vect___dma9___lsb 15
289#define reg_intr_vect_r_masked_vect___dma9___width 1
290#define reg_intr_vect_r_masked_vect___dma9___bit 15
291#define reg_intr_vect_r_masked_vect___ata___lsb 16
292#define reg_intr_vect_r_masked_vect___ata___width 1
293#define reg_intr_vect_r_masked_vect___ata___bit 16
294#define reg_intr_vect_r_masked_vect___sser0___lsb 17
295#define reg_intr_vect_r_masked_vect___sser0___width 1
296#define reg_intr_vect_r_masked_vect___sser0___bit 17
297#define reg_intr_vect_r_masked_vect___sser1___lsb 18
298#define reg_intr_vect_r_masked_vect___sser1___width 1
299#define reg_intr_vect_r_masked_vect___sser1___bit 18
300#define reg_intr_vect_r_masked_vect___ser0___lsb 19
301#define reg_intr_vect_r_masked_vect___ser0___width 1
302#define reg_intr_vect_r_masked_vect___ser0___bit 19
303#define reg_intr_vect_r_masked_vect___ser1___lsb 20
304#define reg_intr_vect_r_masked_vect___ser1___width 1
305#define reg_intr_vect_r_masked_vect___ser1___bit 20
306#define reg_intr_vect_r_masked_vect___ser2___lsb 21
307#define reg_intr_vect_r_masked_vect___ser2___width 1
308#define reg_intr_vect_r_masked_vect___ser2___bit 21
309#define reg_intr_vect_r_masked_vect___ser3___lsb 22
310#define reg_intr_vect_r_masked_vect___ser3___width 1
311#define reg_intr_vect_r_masked_vect___ser3___bit 22
312#define reg_intr_vect_r_masked_vect___p21___lsb 23
313#define reg_intr_vect_r_masked_vect___p21___width 1
314#define reg_intr_vect_r_masked_vect___p21___bit 23
315#define reg_intr_vect_r_masked_vect___eth0___lsb 24
316#define reg_intr_vect_r_masked_vect___eth0___width 1
317#define reg_intr_vect_r_masked_vect___eth0___bit 24
318#define reg_intr_vect_r_masked_vect___eth1___lsb 25
319#define reg_intr_vect_r_masked_vect___eth1___width 1
320#define reg_intr_vect_r_masked_vect___eth1___bit 25
321#define reg_intr_vect_r_masked_vect___timer___lsb 26
322#define reg_intr_vect_r_masked_vect___timer___width 1
323#define reg_intr_vect_r_masked_vect___timer___bit 26
324#define reg_intr_vect_r_masked_vect___bif_arb___lsb 27
325#define reg_intr_vect_r_masked_vect___bif_arb___width 1
326#define reg_intr_vect_r_masked_vect___bif_arb___bit 27
327#define reg_intr_vect_r_masked_vect___bif_dma___lsb 28
328#define reg_intr_vect_r_masked_vect___bif_dma___width 1
329#define reg_intr_vect_r_masked_vect___bif_dma___bit 28
330#define reg_intr_vect_r_masked_vect___ext___lsb 29
331#define reg_intr_vect_r_masked_vect___ext___width 1
332#define reg_intr_vect_r_masked_vect___ext___bit 29
333#define reg_intr_vect_r_masked_vect_offset 8
334
335/* Register r_nmi, scope intr_vect, type r */
336#define reg_intr_vect_r_nmi___ext___lsb 0
337#define reg_intr_vect_r_nmi___ext___width 1
338#define reg_intr_vect_r_nmi___ext___bit 0
339#define reg_intr_vect_r_nmi___watchdog___lsb 1
340#define reg_intr_vect_r_nmi___watchdog___width 1
341#define reg_intr_vect_r_nmi___watchdog___bit 1
342#define reg_intr_vect_r_nmi_offset 12
343
344/* Register r_guru, scope intr_vect, type r */
345#define reg_intr_vect_r_guru___jtag___lsb 0
346#define reg_intr_vect_r_guru___jtag___width 1
347#define reg_intr_vect_r_guru___jtag___bit 0
348#define reg_intr_vect_r_guru_offset 16
349
350
351/* Constants */
352#define regk_intr_vect_off 0x00000000
353#define regk_intr_vect_on 0x00000001
354#define regk_intr_vect_rw_mask_default 0x00000000
355#endif /* __intr_vect_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/irq_nmi_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/irq_nmi_defs_asm.h
new file mode 100644
index 000000000000..0c8084054840
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/irq_nmi_defs_asm.h
@@ -0,0 +1,69 @@
1#ifndef __irq_nmi_defs_asm_h
2#define __irq_nmi_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../mod/irq_nmi.r
7 * id: <not found>
8 * last modfied: Thu Jan 22 09:22:43 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/irq_nmi_defs_asm.h ../../mod/irq_nmi.r
11 * id: $Id: irq_nmi_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cmd, scope irq_nmi, type rw */
57#define reg_irq_nmi_rw_cmd___delay___lsb 0
58#define reg_irq_nmi_rw_cmd___delay___width 16
59#define reg_irq_nmi_rw_cmd___op___lsb 16
60#define reg_irq_nmi_rw_cmd___op___width 2
61#define reg_irq_nmi_rw_cmd_offset 0
62
63
64/* Constants */
65#define regk_irq_nmi_ack_irq 0x00000002
66#define regk_irq_nmi_ack_nmi 0x00000003
67#define regk_irq_nmi_irq 0x00000000
68#define regk_irq_nmi_nmi 0x00000001
69#endif /* __irq_nmi_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/marb_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/marb_defs_asm.h
new file mode 100644
index 000000000000..45400eb8d389
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/marb_defs_asm.h
@@ -0,0 +1,579 @@
1#ifndef __marb_defs_asm_h
2#define __marb_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/memarb/rtl/guinness/marb_top.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:12:16 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/marb_defs_asm.h ../../inst/memarb/rtl/guinness/marb_top.r
11 * id: $Id: marb_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56#define STRIDE_marb_rw_int_slots 4
57/* Register rw_int_slots, scope marb, type rw */
58#define reg_marb_rw_int_slots___owner___lsb 0
59#define reg_marb_rw_int_slots___owner___width 4
60#define reg_marb_rw_int_slots_offset 0
61
62#define STRIDE_marb_rw_ext_slots 4
63/* Register rw_ext_slots, scope marb, type rw */
64#define reg_marb_rw_ext_slots___owner___lsb 0
65#define reg_marb_rw_ext_slots___owner___width 4
66#define reg_marb_rw_ext_slots_offset 256
67
68#define STRIDE_marb_rw_regs_slots 4
69/* Register rw_regs_slots, scope marb, type rw */
70#define reg_marb_rw_regs_slots___owner___lsb 0
71#define reg_marb_rw_regs_slots___owner___width 4
72#define reg_marb_rw_regs_slots_offset 512
73
74/* Register rw_intr_mask, scope marb, type rw */
75#define reg_marb_rw_intr_mask___bp0___lsb 0
76#define reg_marb_rw_intr_mask___bp0___width 1
77#define reg_marb_rw_intr_mask___bp0___bit 0
78#define reg_marb_rw_intr_mask___bp1___lsb 1
79#define reg_marb_rw_intr_mask___bp1___width 1
80#define reg_marb_rw_intr_mask___bp1___bit 1
81#define reg_marb_rw_intr_mask___bp2___lsb 2
82#define reg_marb_rw_intr_mask___bp2___width 1
83#define reg_marb_rw_intr_mask___bp2___bit 2
84#define reg_marb_rw_intr_mask___bp3___lsb 3
85#define reg_marb_rw_intr_mask___bp3___width 1
86#define reg_marb_rw_intr_mask___bp3___bit 3
87#define reg_marb_rw_intr_mask_offset 528
88
89/* Register rw_ack_intr, scope marb, type rw */
90#define reg_marb_rw_ack_intr___bp0___lsb 0
91#define reg_marb_rw_ack_intr___bp0___width 1
92#define reg_marb_rw_ack_intr___bp0___bit 0
93#define reg_marb_rw_ack_intr___bp1___lsb 1
94#define reg_marb_rw_ack_intr___bp1___width 1
95#define reg_marb_rw_ack_intr___bp1___bit 1
96#define reg_marb_rw_ack_intr___bp2___lsb 2
97#define reg_marb_rw_ack_intr___bp2___width 1
98#define reg_marb_rw_ack_intr___bp2___bit 2
99#define reg_marb_rw_ack_intr___bp3___lsb 3
100#define reg_marb_rw_ack_intr___bp3___width 1
101#define reg_marb_rw_ack_intr___bp3___bit 3
102#define reg_marb_rw_ack_intr_offset 532
103
104/* Register r_intr, scope marb, type r */
105#define reg_marb_r_intr___bp0___lsb 0
106#define reg_marb_r_intr___bp0___width 1
107#define reg_marb_r_intr___bp0___bit 0
108#define reg_marb_r_intr___bp1___lsb 1
109#define reg_marb_r_intr___bp1___width 1
110#define reg_marb_r_intr___bp1___bit 1
111#define reg_marb_r_intr___bp2___lsb 2
112#define reg_marb_r_intr___bp2___width 1
113#define reg_marb_r_intr___bp2___bit 2
114#define reg_marb_r_intr___bp3___lsb 3
115#define reg_marb_r_intr___bp3___width 1
116#define reg_marb_r_intr___bp3___bit 3
117#define reg_marb_r_intr_offset 536
118
119/* Register r_masked_intr, scope marb, type r */
120#define reg_marb_r_masked_intr___bp0___lsb 0
121#define reg_marb_r_masked_intr___bp0___width 1
122#define reg_marb_r_masked_intr___bp0___bit 0
123#define reg_marb_r_masked_intr___bp1___lsb 1
124#define reg_marb_r_masked_intr___bp1___width 1
125#define reg_marb_r_masked_intr___bp1___bit 1
126#define reg_marb_r_masked_intr___bp2___lsb 2
127#define reg_marb_r_masked_intr___bp2___width 1
128#define reg_marb_r_masked_intr___bp2___bit 2
129#define reg_marb_r_masked_intr___bp3___lsb 3
130#define reg_marb_r_masked_intr___bp3___width 1
131#define reg_marb_r_masked_intr___bp3___bit 3
132#define reg_marb_r_masked_intr_offset 540
133
134/* Register rw_stop_mask, scope marb, type rw */
135#define reg_marb_rw_stop_mask___dma0___lsb 0
136#define reg_marb_rw_stop_mask___dma0___width 1
137#define reg_marb_rw_stop_mask___dma0___bit 0
138#define reg_marb_rw_stop_mask___dma1___lsb 1
139#define reg_marb_rw_stop_mask___dma1___width 1
140#define reg_marb_rw_stop_mask___dma1___bit 1
141#define reg_marb_rw_stop_mask___dma2___lsb 2
142#define reg_marb_rw_stop_mask___dma2___width 1
143#define reg_marb_rw_stop_mask___dma2___bit 2
144#define reg_marb_rw_stop_mask___dma3___lsb 3
145#define reg_marb_rw_stop_mask___dma3___width 1
146#define reg_marb_rw_stop_mask___dma3___bit 3
147#define reg_marb_rw_stop_mask___dma4___lsb 4
148#define reg_marb_rw_stop_mask___dma4___width 1
149#define reg_marb_rw_stop_mask___dma4___bit 4
150#define reg_marb_rw_stop_mask___dma5___lsb 5
151#define reg_marb_rw_stop_mask___dma5___width 1
152#define reg_marb_rw_stop_mask___dma5___bit 5
153#define reg_marb_rw_stop_mask___dma6___lsb 6
154#define reg_marb_rw_stop_mask___dma6___width 1
155#define reg_marb_rw_stop_mask___dma6___bit 6
156#define reg_marb_rw_stop_mask___dma7___lsb 7
157#define reg_marb_rw_stop_mask___dma7___width 1
158#define reg_marb_rw_stop_mask___dma7___bit 7
159#define reg_marb_rw_stop_mask___dma8___lsb 8
160#define reg_marb_rw_stop_mask___dma8___width 1
161#define reg_marb_rw_stop_mask___dma8___bit 8
162#define reg_marb_rw_stop_mask___dma9___lsb 9
163#define reg_marb_rw_stop_mask___dma9___width 1
164#define reg_marb_rw_stop_mask___dma9___bit 9
165#define reg_marb_rw_stop_mask___cpui___lsb 10
166#define reg_marb_rw_stop_mask___cpui___width 1
167#define reg_marb_rw_stop_mask___cpui___bit 10
168#define reg_marb_rw_stop_mask___cpud___lsb 11
169#define reg_marb_rw_stop_mask___cpud___width 1
170#define reg_marb_rw_stop_mask___cpud___bit 11
171#define reg_marb_rw_stop_mask___iop___lsb 12
172#define reg_marb_rw_stop_mask___iop___width 1
173#define reg_marb_rw_stop_mask___iop___bit 12
174#define reg_marb_rw_stop_mask___slave___lsb 13
175#define reg_marb_rw_stop_mask___slave___width 1
176#define reg_marb_rw_stop_mask___slave___bit 13
177#define reg_marb_rw_stop_mask_offset 544
178
179/* Register r_stopped, scope marb, type r */
180#define reg_marb_r_stopped___dma0___lsb 0
181#define reg_marb_r_stopped___dma0___width 1
182#define reg_marb_r_stopped___dma0___bit 0
183#define reg_marb_r_stopped___dma1___lsb 1
184#define reg_marb_r_stopped___dma1___width 1
185#define reg_marb_r_stopped___dma1___bit 1
186#define reg_marb_r_stopped___dma2___lsb 2
187#define reg_marb_r_stopped___dma2___width 1
188#define reg_marb_r_stopped___dma2___bit 2
189#define reg_marb_r_stopped___dma3___lsb 3
190#define reg_marb_r_stopped___dma3___width 1
191#define reg_marb_r_stopped___dma3___bit 3
192#define reg_marb_r_stopped___dma4___lsb 4
193#define reg_marb_r_stopped___dma4___width 1
194#define reg_marb_r_stopped___dma4___bit 4
195#define reg_marb_r_stopped___dma5___lsb 5
196#define reg_marb_r_stopped___dma5___width 1
197#define reg_marb_r_stopped___dma5___bit 5
198#define reg_marb_r_stopped___dma6___lsb 6
199#define reg_marb_r_stopped___dma6___width 1
200#define reg_marb_r_stopped___dma6___bit 6
201#define reg_marb_r_stopped___dma7___lsb 7
202#define reg_marb_r_stopped___dma7___width 1
203#define reg_marb_r_stopped___dma7___bit 7
204#define reg_marb_r_stopped___dma8___lsb 8
205#define reg_marb_r_stopped___dma8___width 1
206#define reg_marb_r_stopped___dma8___bit 8
207#define reg_marb_r_stopped___dma9___lsb 9
208#define reg_marb_r_stopped___dma9___width 1
209#define reg_marb_r_stopped___dma9___bit 9
210#define reg_marb_r_stopped___cpui___lsb 10
211#define reg_marb_r_stopped___cpui___width 1
212#define reg_marb_r_stopped___cpui___bit 10
213#define reg_marb_r_stopped___cpud___lsb 11
214#define reg_marb_r_stopped___cpud___width 1
215#define reg_marb_r_stopped___cpud___bit 11
216#define reg_marb_r_stopped___iop___lsb 12
217#define reg_marb_r_stopped___iop___width 1
218#define reg_marb_r_stopped___iop___bit 12
219#define reg_marb_r_stopped___slave___lsb 13
220#define reg_marb_r_stopped___slave___width 1
221#define reg_marb_r_stopped___slave___bit 13
222#define reg_marb_r_stopped_offset 548
223
224/* Register rw_no_snoop, scope marb, type rw */
225#define reg_marb_rw_no_snoop___dma0___lsb 0
226#define reg_marb_rw_no_snoop___dma0___width 1
227#define reg_marb_rw_no_snoop___dma0___bit 0
228#define reg_marb_rw_no_snoop___dma1___lsb 1
229#define reg_marb_rw_no_snoop___dma1___width 1
230#define reg_marb_rw_no_snoop___dma1___bit 1
231#define reg_marb_rw_no_snoop___dma2___lsb 2
232#define reg_marb_rw_no_snoop___dma2___width 1
233#define reg_marb_rw_no_snoop___dma2___bit 2
234#define reg_marb_rw_no_snoop___dma3___lsb 3
235#define reg_marb_rw_no_snoop___dma3___width 1
236#define reg_marb_rw_no_snoop___dma3___bit 3
237#define reg_marb_rw_no_snoop___dma4___lsb 4
238#define reg_marb_rw_no_snoop___dma4___width 1
239#define reg_marb_rw_no_snoop___dma4___bit 4
240#define reg_marb_rw_no_snoop___dma5___lsb 5
241#define reg_marb_rw_no_snoop___dma5___width 1
242#define reg_marb_rw_no_snoop___dma5___bit 5
243#define reg_marb_rw_no_snoop___dma6___lsb 6
244#define reg_marb_rw_no_snoop___dma6___width 1
245#define reg_marb_rw_no_snoop___dma6___bit 6
246#define reg_marb_rw_no_snoop___dma7___lsb 7
247#define reg_marb_rw_no_snoop___dma7___width 1
248#define reg_marb_rw_no_snoop___dma7___bit 7
249#define reg_marb_rw_no_snoop___dma8___lsb 8
250#define reg_marb_rw_no_snoop___dma8___width 1
251#define reg_marb_rw_no_snoop___dma8___bit 8
252#define reg_marb_rw_no_snoop___dma9___lsb 9
253#define reg_marb_rw_no_snoop___dma9___width 1
254#define reg_marb_rw_no_snoop___dma9___bit 9
255#define reg_marb_rw_no_snoop___cpui___lsb 10
256#define reg_marb_rw_no_snoop___cpui___width 1
257#define reg_marb_rw_no_snoop___cpui___bit 10
258#define reg_marb_rw_no_snoop___cpud___lsb 11
259#define reg_marb_rw_no_snoop___cpud___width 1
260#define reg_marb_rw_no_snoop___cpud___bit 11
261#define reg_marb_rw_no_snoop___iop___lsb 12
262#define reg_marb_rw_no_snoop___iop___width 1
263#define reg_marb_rw_no_snoop___iop___bit 12
264#define reg_marb_rw_no_snoop___slave___lsb 13
265#define reg_marb_rw_no_snoop___slave___width 1
266#define reg_marb_rw_no_snoop___slave___bit 13
267#define reg_marb_rw_no_snoop_offset 832
268
269/* Register rw_no_snoop_rq, scope marb, type rw */
270#define reg_marb_rw_no_snoop_rq___cpui___lsb 10
271#define reg_marb_rw_no_snoop_rq___cpui___width 1
272#define reg_marb_rw_no_snoop_rq___cpui___bit 10
273#define reg_marb_rw_no_snoop_rq___cpud___lsb 11
274#define reg_marb_rw_no_snoop_rq___cpud___width 1
275#define reg_marb_rw_no_snoop_rq___cpud___bit 11
276#define reg_marb_rw_no_snoop_rq_offset 836
277
278
279/* Constants */
280#define regk_marb_cpud 0x0000000b
281#define regk_marb_cpui 0x0000000a
282#define regk_marb_dma0 0x00000000
283#define regk_marb_dma1 0x00000001
284#define regk_marb_dma2 0x00000002
285#define regk_marb_dma3 0x00000003
286#define regk_marb_dma4 0x00000004
287#define regk_marb_dma5 0x00000005
288#define regk_marb_dma6 0x00000006
289#define regk_marb_dma7 0x00000007
290#define regk_marb_dma8 0x00000008
291#define regk_marb_dma9 0x00000009
292#define regk_marb_iop 0x0000000c
293#define regk_marb_no 0x00000000
294#define regk_marb_r_stopped_default 0x00000000
295#define regk_marb_rw_ext_slots_default 0x00000000
296#define regk_marb_rw_ext_slots_size 0x00000040
297#define regk_marb_rw_int_slots_default 0x00000000
298#define regk_marb_rw_int_slots_size 0x00000040
299#define regk_marb_rw_intr_mask_default 0x00000000
300#define regk_marb_rw_no_snoop_default 0x00000000
301#define regk_marb_rw_no_snoop_rq_default 0x00000000
302#define regk_marb_rw_regs_slots_default 0x00000000
303#define regk_marb_rw_regs_slots_size 0x00000004
304#define regk_marb_rw_stop_mask_default 0x00000000
305#define regk_marb_slave 0x0000000d
306#define regk_marb_yes 0x00000001
307#endif /* __marb_defs_asm_h */
308#ifndef __marb_bp_defs_asm_h
309#define __marb_bp_defs_asm_h
310
311/*
312 * This file is autogenerated from
313 * file: ../../inst/memarb/rtl/guinness/marb_top.r
314 * id: <not found>
315 * last modfied: Mon Apr 11 16:12:16 2005
316 *
317 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/marb_defs_asm.h ../../inst/memarb/rtl/guinness/marb_top.r
318 * id: $Id: marb_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
319 * Any changes here will be lost.
320 *
321 * -*- buffer-read-only: t -*-
322 */
323
324#ifndef REG_FIELD
325#define REG_FIELD( scope, reg, field, value ) \
326 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
327#define REG_FIELD_X_( value, shift ) ((value) << shift)
328#endif
329
330#ifndef REG_STATE
331#define REG_STATE( scope, reg, field, symbolic_value ) \
332 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
333#define REG_STATE_X_( k, shift ) (k << shift)
334#endif
335
336#ifndef REG_MASK
337#define REG_MASK( scope, reg, field ) \
338 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
339#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
340#endif
341
342#ifndef REG_LSB
343#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
344#endif
345
346#ifndef REG_BIT
347#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
348#endif
349
350#ifndef REG_ADDR
351#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
352#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
353#endif
354
355#ifndef REG_ADDR_VECT
356#define REG_ADDR_VECT( scope, inst, reg, index ) \
357 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
358 STRIDE_##scope##_##reg )
359#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
360 ((inst) + offs + (index) * stride)
361#endif
362
363/* Register rw_first_addr, scope marb_bp, type rw */
364#define reg_marb_bp_rw_first_addr_offset 0
365
366/* Register rw_last_addr, scope marb_bp, type rw */
367#define reg_marb_bp_rw_last_addr_offset 4
368
369/* Register rw_op, scope marb_bp, type rw */
370#define reg_marb_bp_rw_op___rd___lsb 0
371#define reg_marb_bp_rw_op___rd___width 1
372#define reg_marb_bp_rw_op___rd___bit 0
373#define reg_marb_bp_rw_op___wr___lsb 1
374#define reg_marb_bp_rw_op___wr___width 1
375#define reg_marb_bp_rw_op___wr___bit 1
376#define reg_marb_bp_rw_op___rd_excl___lsb 2
377#define reg_marb_bp_rw_op___rd_excl___width 1
378#define reg_marb_bp_rw_op___rd_excl___bit 2
379#define reg_marb_bp_rw_op___pri_wr___lsb 3
380#define reg_marb_bp_rw_op___pri_wr___width 1
381#define reg_marb_bp_rw_op___pri_wr___bit 3
382#define reg_marb_bp_rw_op___us_rd___lsb 4
383#define reg_marb_bp_rw_op___us_rd___width 1
384#define reg_marb_bp_rw_op___us_rd___bit 4
385#define reg_marb_bp_rw_op___us_wr___lsb 5
386#define reg_marb_bp_rw_op___us_wr___width 1
387#define reg_marb_bp_rw_op___us_wr___bit 5
388#define reg_marb_bp_rw_op___us_rd_excl___lsb 6
389#define reg_marb_bp_rw_op___us_rd_excl___width 1
390#define reg_marb_bp_rw_op___us_rd_excl___bit 6
391#define reg_marb_bp_rw_op___us_pri_wr___lsb 7
392#define reg_marb_bp_rw_op___us_pri_wr___width 1
393#define reg_marb_bp_rw_op___us_pri_wr___bit 7
394#define reg_marb_bp_rw_op_offset 8
395
396/* Register rw_clients, scope marb_bp, type rw */
397#define reg_marb_bp_rw_clients___dma0___lsb 0
398#define reg_marb_bp_rw_clients___dma0___width 1
399#define reg_marb_bp_rw_clients___dma0___bit 0
400#define reg_marb_bp_rw_clients___dma1___lsb 1
401#define reg_marb_bp_rw_clients___dma1___width 1
402#define reg_marb_bp_rw_clients___dma1___bit 1
403#define reg_marb_bp_rw_clients___dma2___lsb 2
404#define reg_marb_bp_rw_clients___dma2___width 1
405#define reg_marb_bp_rw_clients___dma2___bit 2
406#define reg_marb_bp_rw_clients___dma3___lsb 3
407#define reg_marb_bp_rw_clients___dma3___width 1
408#define reg_marb_bp_rw_clients___dma3___bit 3
409#define reg_marb_bp_rw_clients___dma4___lsb 4
410#define reg_marb_bp_rw_clients___dma4___width 1
411#define reg_marb_bp_rw_clients___dma4___bit 4
412#define reg_marb_bp_rw_clients___dma5___lsb 5
413#define reg_marb_bp_rw_clients___dma5___width 1
414#define reg_marb_bp_rw_clients___dma5___bit 5
415#define reg_marb_bp_rw_clients___dma6___lsb 6
416#define reg_marb_bp_rw_clients___dma6___width 1
417#define reg_marb_bp_rw_clients___dma6___bit 6
418#define reg_marb_bp_rw_clients___dma7___lsb 7
419#define reg_marb_bp_rw_clients___dma7___width 1
420#define reg_marb_bp_rw_clients___dma7___bit 7
421#define reg_marb_bp_rw_clients___dma8___lsb 8
422#define reg_marb_bp_rw_clients___dma8___width 1
423#define reg_marb_bp_rw_clients___dma8___bit 8
424#define reg_marb_bp_rw_clients___dma9___lsb 9
425#define reg_marb_bp_rw_clients___dma9___width 1
426#define reg_marb_bp_rw_clients___dma9___bit 9
427#define reg_marb_bp_rw_clients___cpui___lsb 10
428#define reg_marb_bp_rw_clients___cpui___width 1
429#define reg_marb_bp_rw_clients___cpui___bit 10
430#define reg_marb_bp_rw_clients___cpud___lsb 11
431#define reg_marb_bp_rw_clients___cpud___width 1
432#define reg_marb_bp_rw_clients___cpud___bit 11
433#define reg_marb_bp_rw_clients___iop___lsb 12
434#define reg_marb_bp_rw_clients___iop___width 1
435#define reg_marb_bp_rw_clients___iop___bit 12
436#define reg_marb_bp_rw_clients___slave___lsb 13
437#define reg_marb_bp_rw_clients___slave___width 1
438#define reg_marb_bp_rw_clients___slave___bit 13
439#define reg_marb_bp_rw_clients_offset 12
440
441/* Register rw_options, scope marb_bp, type rw */
442#define reg_marb_bp_rw_options___wrap___lsb 0
443#define reg_marb_bp_rw_options___wrap___width 1
444#define reg_marb_bp_rw_options___wrap___bit 0
445#define reg_marb_bp_rw_options_offset 16
446
447/* Register r_brk_addr, scope marb_bp, type r */
448#define reg_marb_bp_r_brk_addr_offset 20
449
450/* Register r_brk_op, scope marb_bp, type r */
451#define reg_marb_bp_r_brk_op___rd___lsb 0
452#define reg_marb_bp_r_brk_op___rd___width 1
453#define reg_marb_bp_r_brk_op___rd___bit 0
454#define reg_marb_bp_r_brk_op___wr___lsb 1
455#define reg_marb_bp_r_brk_op___wr___width 1
456#define reg_marb_bp_r_brk_op___wr___bit 1
457#define reg_marb_bp_r_brk_op___rd_excl___lsb 2
458#define reg_marb_bp_r_brk_op___rd_excl___width 1
459#define reg_marb_bp_r_brk_op___rd_excl___bit 2
460#define reg_marb_bp_r_brk_op___pri_wr___lsb 3
461#define reg_marb_bp_r_brk_op___pri_wr___width 1
462#define reg_marb_bp_r_brk_op___pri_wr___bit 3
463#define reg_marb_bp_r_brk_op___us_rd___lsb 4
464#define reg_marb_bp_r_brk_op___us_rd___width 1
465#define reg_marb_bp_r_brk_op___us_rd___bit 4
466#define reg_marb_bp_r_brk_op___us_wr___lsb 5
467#define reg_marb_bp_r_brk_op___us_wr___width 1
468#define reg_marb_bp_r_brk_op___us_wr___bit 5
469#define reg_marb_bp_r_brk_op___us_rd_excl___lsb 6
470#define reg_marb_bp_r_brk_op___us_rd_excl___width 1
471#define reg_marb_bp_r_brk_op___us_rd_excl___bit 6
472#define reg_marb_bp_r_brk_op___us_pri_wr___lsb 7
473#define reg_marb_bp_r_brk_op___us_pri_wr___width 1
474#define reg_marb_bp_r_brk_op___us_pri_wr___bit 7
475#define reg_marb_bp_r_brk_op_offset 24
476
477/* Register r_brk_clients, scope marb_bp, type r */
478#define reg_marb_bp_r_brk_clients___dma0___lsb 0
479#define reg_marb_bp_r_brk_clients___dma0___width 1
480#define reg_marb_bp_r_brk_clients___dma0___bit 0
481#define reg_marb_bp_r_brk_clients___dma1___lsb 1
482#define reg_marb_bp_r_brk_clients___dma1___width 1
483#define reg_marb_bp_r_brk_clients___dma1___bit 1
484#define reg_marb_bp_r_brk_clients___dma2___lsb 2
485#define reg_marb_bp_r_brk_clients___dma2___width 1
486#define reg_marb_bp_r_brk_clients___dma2___bit 2
487#define reg_marb_bp_r_brk_clients___dma3___lsb 3
488#define reg_marb_bp_r_brk_clients___dma3___width 1
489#define reg_marb_bp_r_brk_clients___dma3___bit 3
490#define reg_marb_bp_r_brk_clients___dma4___lsb 4
491#define reg_marb_bp_r_brk_clients___dma4___width 1
492#define reg_marb_bp_r_brk_clients___dma4___bit 4
493#define reg_marb_bp_r_brk_clients___dma5___lsb 5
494#define reg_marb_bp_r_brk_clients___dma5___width 1
495#define reg_marb_bp_r_brk_clients___dma5___bit 5
496#define reg_marb_bp_r_brk_clients___dma6___lsb 6
497#define reg_marb_bp_r_brk_clients___dma6___width 1
498#define reg_marb_bp_r_brk_clients___dma6___bit 6
499#define reg_marb_bp_r_brk_clients___dma7___lsb 7
500#define reg_marb_bp_r_brk_clients___dma7___width 1
501#define reg_marb_bp_r_brk_clients___dma7___bit 7
502#define reg_marb_bp_r_brk_clients___dma8___lsb 8
503#define reg_marb_bp_r_brk_clients___dma8___width 1
504#define reg_marb_bp_r_brk_clients___dma8___bit 8
505#define reg_marb_bp_r_brk_clients___dma9___lsb 9
506#define reg_marb_bp_r_brk_clients___dma9___width 1
507#define reg_marb_bp_r_brk_clients___dma9___bit 9
508#define reg_marb_bp_r_brk_clients___cpui___lsb 10
509#define reg_marb_bp_r_brk_clients___cpui___width 1
510#define reg_marb_bp_r_brk_clients___cpui___bit 10
511#define reg_marb_bp_r_brk_clients___cpud___lsb 11
512#define reg_marb_bp_r_brk_clients___cpud___width 1
513#define reg_marb_bp_r_brk_clients___cpud___bit 11
514#define reg_marb_bp_r_brk_clients___iop___lsb 12
515#define reg_marb_bp_r_brk_clients___iop___width 1
516#define reg_marb_bp_r_brk_clients___iop___bit 12
517#define reg_marb_bp_r_brk_clients___slave___lsb 13
518#define reg_marb_bp_r_brk_clients___slave___width 1
519#define reg_marb_bp_r_brk_clients___slave___bit 13
520#define reg_marb_bp_r_brk_clients_offset 28
521
522/* Register r_brk_first_client, scope marb_bp, type r */
523#define reg_marb_bp_r_brk_first_client___dma0___lsb 0
524#define reg_marb_bp_r_brk_first_client___dma0___width 1
525#define reg_marb_bp_r_brk_first_client___dma0___bit 0
526#define reg_marb_bp_r_brk_first_client___dma1___lsb 1
527#define reg_marb_bp_r_brk_first_client___dma1___width 1
528#define reg_marb_bp_r_brk_first_client___dma1___bit 1
529#define reg_marb_bp_r_brk_first_client___dma2___lsb 2
530#define reg_marb_bp_r_brk_first_client___dma2___width 1
531#define reg_marb_bp_r_brk_first_client___dma2___bit 2
532#define reg_marb_bp_r_brk_first_client___dma3___lsb 3
533#define reg_marb_bp_r_brk_first_client___dma3___width 1
534#define reg_marb_bp_r_brk_first_client___dma3___bit 3
535#define reg_marb_bp_r_brk_first_client___dma4___lsb 4
536#define reg_marb_bp_r_brk_first_client___dma4___width 1
537#define reg_marb_bp_r_brk_first_client___dma4___bit 4
538#define reg_marb_bp_r_brk_first_client___dma5___lsb 5
539#define reg_marb_bp_r_brk_first_client___dma5___width 1
540#define reg_marb_bp_r_brk_first_client___dma5___bit 5
541#define reg_marb_bp_r_brk_first_client___dma6___lsb 6
542#define reg_marb_bp_r_brk_first_client___dma6___width 1
543#define reg_marb_bp_r_brk_first_client___dma6___bit 6
544#define reg_marb_bp_r_brk_first_client___dma7___lsb 7
545#define reg_marb_bp_r_brk_first_client___dma7___width 1
546#define reg_marb_bp_r_brk_first_client___dma7___bit 7
547#define reg_marb_bp_r_brk_first_client___dma8___lsb 8
548#define reg_marb_bp_r_brk_first_client___dma8___width 1
549#define reg_marb_bp_r_brk_first_client___dma8___bit 8
550#define reg_marb_bp_r_brk_first_client___dma9___lsb 9
551#define reg_marb_bp_r_brk_first_client___dma9___width 1
552#define reg_marb_bp_r_brk_first_client___dma9___bit 9
553#define reg_marb_bp_r_brk_first_client___cpui___lsb 10
554#define reg_marb_bp_r_brk_first_client___cpui___width 1
555#define reg_marb_bp_r_brk_first_client___cpui___bit 10
556#define reg_marb_bp_r_brk_first_client___cpud___lsb 11
557#define reg_marb_bp_r_brk_first_client___cpud___width 1
558#define reg_marb_bp_r_brk_first_client___cpud___bit 11
559#define reg_marb_bp_r_brk_first_client___iop___lsb 12
560#define reg_marb_bp_r_brk_first_client___iop___width 1
561#define reg_marb_bp_r_brk_first_client___iop___bit 12
562#define reg_marb_bp_r_brk_first_client___slave___lsb 13
563#define reg_marb_bp_r_brk_first_client___slave___width 1
564#define reg_marb_bp_r_brk_first_client___slave___bit 13
565#define reg_marb_bp_r_brk_first_client_offset 32
566
567/* Register r_brk_size, scope marb_bp, type r */
568#define reg_marb_bp_r_brk_size_offset 36
569
570/* Register rw_ack, scope marb_bp, type rw */
571#define reg_marb_bp_rw_ack_offset 40
572
573
574/* Constants */
575#define regk_marb_bp_no 0x00000000
576#define regk_marb_bp_rw_op_default 0x00000000
577#define regk_marb_bp_rw_options_default 0x00000000
578#define regk_marb_bp_yes 0x00000001
579#endif /* __marb_bp_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/mmu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/mmu_defs_asm.h
new file mode 100644
index 000000000000..505b7a16d878
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/mmu_defs_asm.h
@@ -0,0 +1,212 @@
1#ifndef __mmu_defs_asm_h
2#define __mmu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/mmu/doc/mmu_regs.r
7 * id: mmu_regs.r,v 1.12 2004/05/06 13:48:45 mikaeln Exp
8 * last modfied: Mon Apr 11 17:03:20 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/mmu_defs_asm.h ../../inst/mmu/doc/mmu_regs.r
11 * id: $Id: mmu_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_mm_cfg, scope mmu, type rw */
57#define reg_mmu_rw_mm_cfg___seg_0___lsb 0
58#define reg_mmu_rw_mm_cfg___seg_0___width 1
59#define reg_mmu_rw_mm_cfg___seg_0___bit 0
60#define reg_mmu_rw_mm_cfg___seg_1___lsb 1
61#define reg_mmu_rw_mm_cfg___seg_1___width 1
62#define reg_mmu_rw_mm_cfg___seg_1___bit 1
63#define reg_mmu_rw_mm_cfg___seg_2___lsb 2
64#define reg_mmu_rw_mm_cfg___seg_2___width 1
65#define reg_mmu_rw_mm_cfg___seg_2___bit 2
66#define reg_mmu_rw_mm_cfg___seg_3___lsb 3
67#define reg_mmu_rw_mm_cfg___seg_3___width 1
68#define reg_mmu_rw_mm_cfg___seg_3___bit 3
69#define reg_mmu_rw_mm_cfg___seg_4___lsb 4
70#define reg_mmu_rw_mm_cfg___seg_4___width 1
71#define reg_mmu_rw_mm_cfg___seg_4___bit 4
72#define reg_mmu_rw_mm_cfg___seg_5___lsb 5
73#define reg_mmu_rw_mm_cfg___seg_5___width 1
74#define reg_mmu_rw_mm_cfg___seg_5___bit 5
75#define reg_mmu_rw_mm_cfg___seg_6___lsb 6
76#define reg_mmu_rw_mm_cfg___seg_6___width 1
77#define reg_mmu_rw_mm_cfg___seg_6___bit 6
78#define reg_mmu_rw_mm_cfg___seg_7___lsb 7
79#define reg_mmu_rw_mm_cfg___seg_7___width 1
80#define reg_mmu_rw_mm_cfg___seg_7___bit 7
81#define reg_mmu_rw_mm_cfg___seg_8___lsb 8
82#define reg_mmu_rw_mm_cfg___seg_8___width 1
83#define reg_mmu_rw_mm_cfg___seg_8___bit 8
84#define reg_mmu_rw_mm_cfg___seg_9___lsb 9
85#define reg_mmu_rw_mm_cfg___seg_9___width 1
86#define reg_mmu_rw_mm_cfg___seg_9___bit 9
87#define reg_mmu_rw_mm_cfg___seg_a___lsb 10
88#define reg_mmu_rw_mm_cfg___seg_a___width 1
89#define reg_mmu_rw_mm_cfg___seg_a___bit 10
90#define reg_mmu_rw_mm_cfg___seg_b___lsb 11
91#define reg_mmu_rw_mm_cfg___seg_b___width 1
92#define reg_mmu_rw_mm_cfg___seg_b___bit 11
93#define reg_mmu_rw_mm_cfg___seg_c___lsb 12
94#define reg_mmu_rw_mm_cfg___seg_c___width 1
95#define reg_mmu_rw_mm_cfg___seg_c___bit 12
96#define reg_mmu_rw_mm_cfg___seg_d___lsb 13
97#define reg_mmu_rw_mm_cfg___seg_d___width 1
98#define reg_mmu_rw_mm_cfg___seg_d___bit 13
99#define reg_mmu_rw_mm_cfg___seg_e___lsb 14
100#define reg_mmu_rw_mm_cfg___seg_e___width 1
101#define reg_mmu_rw_mm_cfg___seg_e___bit 14
102#define reg_mmu_rw_mm_cfg___seg_f___lsb 15
103#define reg_mmu_rw_mm_cfg___seg_f___width 1
104#define reg_mmu_rw_mm_cfg___seg_f___bit 15
105#define reg_mmu_rw_mm_cfg___inv___lsb 16
106#define reg_mmu_rw_mm_cfg___inv___width 1
107#define reg_mmu_rw_mm_cfg___inv___bit 16
108#define reg_mmu_rw_mm_cfg___ex___lsb 17
109#define reg_mmu_rw_mm_cfg___ex___width 1
110#define reg_mmu_rw_mm_cfg___ex___bit 17
111#define reg_mmu_rw_mm_cfg___acc___lsb 18
112#define reg_mmu_rw_mm_cfg___acc___width 1
113#define reg_mmu_rw_mm_cfg___acc___bit 18
114#define reg_mmu_rw_mm_cfg___we___lsb 19
115#define reg_mmu_rw_mm_cfg___we___width 1
116#define reg_mmu_rw_mm_cfg___we___bit 19
117#define reg_mmu_rw_mm_cfg_offset 0
118
119/* Register rw_mm_kbase_lo, scope mmu, type rw */
120#define reg_mmu_rw_mm_kbase_lo___base_0___lsb 0
121#define reg_mmu_rw_mm_kbase_lo___base_0___width 4
122#define reg_mmu_rw_mm_kbase_lo___base_1___lsb 4
123#define reg_mmu_rw_mm_kbase_lo___base_1___width 4
124#define reg_mmu_rw_mm_kbase_lo___base_2___lsb 8
125#define reg_mmu_rw_mm_kbase_lo___base_2___width 4
126#define reg_mmu_rw_mm_kbase_lo___base_3___lsb 12
127#define reg_mmu_rw_mm_kbase_lo___base_3___width 4
128#define reg_mmu_rw_mm_kbase_lo___base_4___lsb 16
129#define reg_mmu_rw_mm_kbase_lo___base_4___width 4
130#define reg_mmu_rw_mm_kbase_lo___base_5___lsb 20
131#define reg_mmu_rw_mm_kbase_lo___base_5___width 4
132#define reg_mmu_rw_mm_kbase_lo___base_6___lsb 24
133#define reg_mmu_rw_mm_kbase_lo___base_6___width 4
134#define reg_mmu_rw_mm_kbase_lo___base_7___lsb 28
135#define reg_mmu_rw_mm_kbase_lo___base_7___width 4
136#define reg_mmu_rw_mm_kbase_lo_offset 4
137
138/* Register rw_mm_kbase_hi, scope mmu, type rw */
139#define reg_mmu_rw_mm_kbase_hi___base_8___lsb 0
140#define reg_mmu_rw_mm_kbase_hi___base_8___width 4
141#define reg_mmu_rw_mm_kbase_hi___base_9___lsb 4
142#define reg_mmu_rw_mm_kbase_hi___base_9___width 4
143#define reg_mmu_rw_mm_kbase_hi___base_a___lsb 8
144#define reg_mmu_rw_mm_kbase_hi___base_a___width 4
145#define reg_mmu_rw_mm_kbase_hi___base_b___lsb 12
146#define reg_mmu_rw_mm_kbase_hi___base_b___width 4
147#define reg_mmu_rw_mm_kbase_hi___base_c___lsb 16
148#define reg_mmu_rw_mm_kbase_hi___base_c___width 4
149#define reg_mmu_rw_mm_kbase_hi___base_d___lsb 20
150#define reg_mmu_rw_mm_kbase_hi___base_d___width 4
151#define reg_mmu_rw_mm_kbase_hi___base_e___lsb 24
152#define reg_mmu_rw_mm_kbase_hi___base_e___width 4
153#define reg_mmu_rw_mm_kbase_hi___base_f___lsb 28
154#define reg_mmu_rw_mm_kbase_hi___base_f___width 4
155#define reg_mmu_rw_mm_kbase_hi_offset 8
156
157/* Register r_mm_cause, scope mmu, type r */
158#define reg_mmu_r_mm_cause___pid___lsb 0
159#define reg_mmu_r_mm_cause___pid___width 8
160#define reg_mmu_r_mm_cause___op___lsb 8
161#define reg_mmu_r_mm_cause___op___width 2
162#define reg_mmu_r_mm_cause___vpn___lsb 13
163#define reg_mmu_r_mm_cause___vpn___width 19
164#define reg_mmu_r_mm_cause_offset 12
165
166/* Register rw_mm_tlb_sel, scope mmu, type rw */
167#define reg_mmu_rw_mm_tlb_sel___idx___lsb 0
168#define reg_mmu_rw_mm_tlb_sel___idx___width 4
169#define reg_mmu_rw_mm_tlb_sel___set___lsb 4
170#define reg_mmu_rw_mm_tlb_sel___set___width 2
171#define reg_mmu_rw_mm_tlb_sel_offset 16
172
173/* Register rw_mm_tlb_lo, scope mmu, type rw */
174#define reg_mmu_rw_mm_tlb_lo___x___lsb 0
175#define reg_mmu_rw_mm_tlb_lo___x___width 1
176#define reg_mmu_rw_mm_tlb_lo___x___bit 0
177#define reg_mmu_rw_mm_tlb_lo___w___lsb 1
178#define reg_mmu_rw_mm_tlb_lo___w___width 1
179#define reg_mmu_rw_mm_tlb_lo___w___bit 1
180#define reg_mmu_rw_mm_tlb_lo___k___lsb 2
181#define reg_mmu_rw_mm_tlb_lo___k___width 1
182#define reg_mmu_rw_mm_tlb_lo___k___bit 2
183#define reg_mmu_rw_mm_tlb_lo___v___lsb 3
184#define reg_mmu_rw_mm_tlb_lo___v___width 1
185#define reg_mmu_rw_mm_tlb_lo___v___bit 3
186#define reg_mmu_rw_mm_tlb_lo___g___lsb 4
187#define reg_mmu_rw_mm_tlb_lo___g___width 1
188#define reg_mmu_rw_mm_tlb_lo___g___bit 4
189#define reg_mmu_rw_mm_tlb_lo___pfn___lsb 13
190#define reg_mmu_rw_mm_tlb_lo___pfn___width 19
191#define reg_mmu_rw_mm_tlb_lo_offset 20
192
193/* Register rw_mm_tlb_hi, scope mmu, type rw */
194#define reg_mmu_rw_mm_tlb_hi___pid___lsb 0
195#define reg_mmu_rw_mm_tlb_hi___pid___width 8
196#define reg_mmu_rw_mm_tlb_hi___vpn___lsb 13
197#define reg_mmu_rw_mm_tlb_hi___vpn___width 19
198#define reg_mmu_rw_mm_tlb_hi_offset 24
199
200
201/* Constants */
202#define regk_mmu_execute 0x00000000
203#define regk_mmu_flush 0x00000003
204#define regk_mmu_linear 0x00000001
205#define regk_mmu_no 0x00000000
206#define regk_mmu_off 0x00000000
207#define regk_mmu_on 0x00000001
208#define regk_mmu_page 0x00000000
209#define regk_mmu_read 0x00000001
210#define regk_mmu_write 0x00000002
211#define regk_mmu_yes 0x00000001
212#endif /* __mmu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/mmu_supp_reg.h b/include/asm-cris/arch-v32/hwregs/asm/mmu_supp_reg.h
new file mode 100644
index 000000000000..339500bf3bc0
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/mmu_supp_reg.h
@@ -0,0 +1,7 @@
1#define RW_MM_CFG 0
2#define RW_MM_KBASE_LO 1
3#define RW_MM_KBASE_HI 2
4#define R_MM_CAUSE 3
5#define RW_MM_TLB_SEL 4
6#define RW_MM_TLB_LO 5
7#define RW_MM_TLB_HI 6
diff --git a/include/asm-cris/arch-v32/hwregs/asm/pinmux_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/pinmux_defs_asm.h
new file mode 100644
index 000000000000..13c725e4c774
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/pinmux_defs_asm.h
@@ -0,0 +1,632 @@
1#ifndef __pinmux_defs_asm_h
2#define __pinmux_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/pinmux/rtl/guinness/pinmux_regs.r
7 * id: pinmux_regs.r,v 1.40 2005/02/09 16:22:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:11 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/pinmux_defs_asm.h ../../inst/pinmux/rtl/guinness/pinmux_regs.r
11 * id: $Id: pinmux_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_pa, scope pinmux, type rw */
57#define reg_pinmux_rw_pa___pa0___lsb 0
58#define reg_pinmux_rw_pa___pa0___width 1
59#define reg_pinmux_rw_pa___pa0___bit 0
60#define reg_pinmux_rw_pa___pa1___lsb 1
61#define reg_pinmux_rw_pa___pa1___width 1
62#define reg_pinmux_rw_pa___pa1___bit 1
63#define reg_pinmux_rw_pa___pa2___lsb 2
64#define reg_pinmux_rw_pa___pa2___width 1
65#define reg_pinmux_rw_pa___pa2___bit 2
66#define reg_pinmux_rw_pa___pa3___lsb 3
67#define reg_pinmux_rw_pa___pa3___width 1
68#define reg_pinmux_rw_pa___pa3___bit 3
69#define reg_pinmux_rw_pa___pa4___lsb 4
70#define reg_pinmux_rw_pa___pa4___width 1
71#define reg_pinmux_rw_pa___pa4___bit 4
72#define reg_pinmux_rw_pa___pa5___lsb 5
73#define reg_pinmux_rw_pa___pa5___width 1
74#define reg_pinmux_rw_pa___pa5___bit 5
75#define reg_pinmux_rw_pa___pa6___lsb 6
76#define reg_pinmux_rw_pa___pa6___width 1
77#define reg_pinmux_rw_pa___pa6___bit 6
78#define reg_pinmux_rw_pa___pa7___lsb 7
79#define reg_pinmux_rw_pa___pa7___width 1
80#define reg_pinmux_rw_pa___pa7___bit 7
81#define reg_pinmux_rw_pa___csp2_n___lsb 8
82#define reg_pinmux_rw_pa___csp2_n___width 1
83#define reg_pinmux_rw_pa___csp2_n___bit 8
84#define reg_pinmux_rw_pa___csp3_n___lsb 9
85#define reg_pinmux_rw_pa___csp3_n___width 1
86#define reg_pinmux_rw_pa___csp3_n___bit 9
87#define reg_pinmux_rw_pa___csp5_n___lsb 10
88#define reg_pinmux_rw_pa___csp5_n___width 1
89#define reg_pinmux_rw_pa___csp5_n___bit 10
90#define reg_pinmux_rw_pa___csp6_n___lsb 11
91#define reg_pinmux_rw_pa___csp6_n___width 1
92#define reg_pinmux_rw_pa___csp6_n___bit 11
93#define reg_pinmux_rw_pa___hsh4___lsb 12
94#define reg_pinmux_rw_pa___hsh4___width 1
95#define reg_pinmux_rw_pa___hsh4___bit 12
96#define reg_pinmux_rw_pa___hsh5___lsb 13
97#define reg_pinmux_rw_pa___hsh5___width 1
98#define reg_pinmux_rw_pa___hsh5___bit 13
99#define reg_pinmux_rw_pa___hsh6___lsb 14
100#define reg_pinmux_rw_pa___hsh6___width 1
101#define reg_pinmux_rw_pa___hsh6___bit 14
102#define reg_pinmux_rw_pa___hsh7___lsb 15
103#define reg_pinmux_rw_pa___hsh7___width 1
104#define reg_pinmux_rw_pa___hsh7___bit 15
105#define reg_pinmux_rw_pa_offset 0
106
107/* Register rw_hwprot, scope pinmux, type rw */
108#define reg_pinmux_rw_hwprot___ser1___lsb 0
109#define reg_pinmux_rw_hwprot___ser1___width 1
110#define reg_pinmux_rw_hwprot___ser1___bit 0
111#define reg_pinmux_rw_hwprot___ser2___lsb 1
112#define reg_pinmux_rw_hwprot___ser2___width 1
113#define reg_pinmux_rw_hwprot___ser2___bit 1
114#define reg_pinmux_rw_hwprot___ser3___lsb 2
115#define reg_pinmux_rw_hwprot___ser3___width 1
116#define reg_pinmux_rw_hwprot___ser3___bit 2
117#define reg_pinmux_rw_hwprot___sser0___lsb 3
118#define reg_pinmux_rw_hwprot___sser0___width 1
119#define reg_pinmux_rw_hwprot___sser0___bit 3
120#define reg_pinmux_rw_hwprot___sser1___lsb 4
121#define reg_pinmux_rw_hwprot___sser1___width 1
122#define reg_pinmux_rw_hwprot___sser1___bit 4
123#define reg_pinmux_rw_hwprot___ata0___lsb 5
124#define reg_pinmux_rw_hwprot___ata0___width 1
125#define reg_pinmux_rw_hwprot___ata0___bit 5
126#define reg_pinmux_rw_hwprot___ata1___lsb 6
127#define reg_pinmux_rw_hwprot___ata1___width 1
128#define reg_pinmux_rw_hwprot___ata1___bit 6
129#define reg_pinmux_rw_hwprot___ata2___lsb 7
130#define reg_pinmux_rw_hwprot___ata2___width 1
131#define reg_pinmux_rw_hwprot___ata2___bit 7
132#define reg_pinmux_rw_hwprot___ata3___lsb 8
133#define reg_pinmux_rw_hwprot___ata3___width 1
134#define reg_pinmux_rw_hwprot___ata3___bit 8
135#define reg_pinmux_rw_hwprot___ata___lsb 9
136#define reg_pinmux_rw_hwprot___ata___width 1
137#define reg_pinmux_rw_hwprot___ata___bit 9
138#define reg_pinmux_rw_hwprot___eth1___lsb 10
139#define reg_pinmux_rw_hwprot___eth1___width 1
140#define reg_pinmux_rw_hwprot___eth1___bit 10
141#define reg_pinmux_rw_hwprot___eth1_mgm___lsb 11
142#define reg_pinmux_rw_hwprot___eth1_mgm___width 1
143#define reg_pinmux_rw_hwprot___eth1_mgm___bit 11
144#define reg_pinmux_rw_hwprot___timer___lsb 12
145#define reg_pinmux_rw_hwprot___timer___width 1
146#define reg_pinmux_rw_hwprot___timer___bit 12
147#define reg_pinmux_rw_hwprot___p21___lsb 13
148#define reg_pinmux_rw_hwprot___p21___width 1
149#define reg_pinmux_rw_hwprot___p21___bit 13
150#define reg_pinmux_rw_hwprot_offset 4
151
152/* Register rw_pb_gio, scope pinmux, type rw */
153#define reg_pinmux_rw_pb_gio___pb0___lsb 0
154#define reg_pinmux_rw_pb_gio___pb0___width 1
155#define reg_pinmux_rw_pb_gio___pb0___bit 0
156#define reg_pinmux_rw_pb_gio___pb1___lsb 1
157#define reg_pinmux_rw_pb_gio___pb1___width 1
158#define reg_pinmux_rw_pb_gio___pb1___bit 1
159#define reg_pinmux_rw_pb_gio___pb2___lsb 2
160#define reg_pinmux_rw_pb_gio___pb2___width 1
161#define reg_pinmux_rw_pb_gio___pb2___bit 2
162#define reg_pinmux_rw_pb_gio___pb3___lsb 3
163#define reg_pinmux_rw_pb_gio___pb3___width 1
164#define reg_pinmux_rw_pb_gio___pb3___bit 3
165#define reg_pinmux_rw_pb_gio___pb4___lsb 4
166#define reg_pinmux_rw_pb_gio___pb4___width 1
167#define reg_pinmux_rw_pb_gio___pb4___bit 4
168#define reg_pinmux_rw_pb_gio___pb5___lsb 5
169#define reg_pinmux_rw_pb_gio___pb5___width 1
170#define reg_pinmux_rw_pb_gio___pb5___bit 5
171#define reg_pinmux_rw_pb_gio___pb6___lsb 6
172#define reg_pinmux_rw_pb_gio___pb6___width 1
173#define reg_pinmux_rw_pb_gio___pb6___bit 6
174#define reg_pinmux_rw_pb_gio___pb7___lsb 7
175#define reg_pinmux_rw_pb_gio___pb7___width 1
176#define reg_pinmux_rw_pb_gio___pb7___bit 7
177#define reg_pinmux_rw_pb_gio___pb8___lsb 8
178#define reg_pinmux_rw_pb_gio___pb8___width 1
179#define reg_pinmux_rw_pb_gio___pb8___bit 8
180#define reg_pinmux_rw_pb_gio___pb9___lsb 9
181#define reg_pinmux_rw_pb_gio___pb9___width 1
182#define reg_pinmux_rw_pb_gio___pb9___bit 9
183#define reg_pinmux_rw_pb_gio___pb10___lsb 10
184#define reg_pinmux_rw_pb_gio___pb10___width 1
185#define reg_pinmux_rw_pb_gio___pb10___bit 10
186#define reg_pinmux_rw_pb_gio___pb11___lsb 11
187#define reg_pinmux_rw_pb_gio___pb11___width 1
188#define reg_pinmux_rw_pb_gio___pb11___bit 11
189#define reg_pinmux_rw_pb_gio___pb12___lsb 12
190#define reg_pinmux_rw_pb_gio___pb12___width 1
191#define reg_pinmux_rw_pb_gio___pb12___bit 12
192#define reg_pinmux_rw_pb_gio___pb13___lsb 13
193#define reg_pinmux_rw_pb_gio___pb13___width 1
194#define reg_pinmux_rw_pb_gio___pb13___bit 13
195#define reg_pinmux_rw_pb_gio___pb14___lsb 14
196#define reg_pinmux_rw_pb_gio___pb14___width 1
197#define reg_pinmux_rw_pb_gio___pb14___bit 14
198#define reg_pinmux_rw_pb_gio___pb15___lsb 15
199#define reg_pinmux_rw_pb_gio___pb15___width 1
200#define reg_pinmux_rw_pb_gio___pb15___bit 15
201#define reg_pinmux_rw_pb_gio___pb16___lsb 16
202#define reg_pinmux_rw_pb_gio___pb16___width 1
203#define reg_pinmux_rw_pb_gio___pb16___bit 16
204#define reg_pinmux_rw_pb_gio___pb17___lsb 17
205#define reg_pinmux_rw_pb_gio___pb17___width 1
206#define reg_pinmux_rw_pb_gio___pb17___bit 17
207#define reg_pinmux_rw_pb_gio_offset 8
208
209/* Register rw_pb_iop, scope pinmux, type rw */
210#define reg_pinmux_rw_pb_iop___pb0___lsb 0
211#define reg_pinmux_rw_pb_iop___pb0___width 1
212#define reg_pinmux_rw_pb_iop___pb0___bit 0
213#define reg_pinmux_rw_pb_iop___pb1___lsb 1
214#define reg_pinmux_rw_pb_iop___pb1___width 1
215#define reg_pinmux_rw_pb_iop___pb1___bit 1
216#define reg_pinmux_rw_pb_iop___pb2___lsb 2
217#define reg_pinmux_rw_pb_iop___pb2___width 1
218#define reg_pinmux_rw_pb_iop___pb2___bit 2
219#define reg_pinmux_rw_pb_iop___pb3___lsb 3
220#define reg_pinmux_rw_pb_iop___pb3___width 1
221#define reg_pinmux_rw_pb_iop___pb3___bit 3
222#define reg_pinmux_rw_pb_iop___pb4___lsb 4
223#define reg_pinmux_rw_pb_iop___pb4___width 1
224#define reg_pinmux_rw_pb_iop___pb4___bit 4
225#define reg_pinmux_rw_pb_iop___pb5___lsb 5
226#define reg_pinmux_rw_pb_iop___pb5___width 1
227#define reg_pinmux_rw_pb_iop___pb5___bit 5
228#define reg_pinmux_rw_pb_iop___pb6___lsb 6
229#define reg_pinmux_rw_pb_iop___pb6___width 1
230#define reg_pinmux_rw_pb_iop___pb6___bit 6
231#define reg_pinmux_rw_pb_iop___pb7___lsb 7
232#define reg_pinmux_rw_pb_iop___pb7___width 1
233#define reg_pinmux_rw_pb_iop___pb7___bit 7
234#define reg_pinmux_rw_pb_iop___pb8___lsb 8
235#define reg_pinmux_rw_pb_iop___pb8___width 1
236#define reg_pinmux_rw_pb_iop___pb8___bit 8
237#define reg_pinmux_rw_pb_iop___pb9___lsb 9
238#define reg_pinmux_rw_pb_iop___pb9___width 1
239#define reg_pinmux_rw_pb_iop___pb9___bit 9
240#define reg_pinmux_rw_pb_iop___pb10___lsb 10
241#define reg_pinmux_rw_pb_iop___pb10___width 1
242#define reg_pinmux_rw_pb_iop___pb10___bit 10
243#define reg_pinmux_rw_pb_iop___pb11___lsb 11
244#define reg_pinmux_rw_pb_iop___pb11___width 1
245#define reg_pinmux_rw_pb_iop___pb11___bit 11
246#define reg_pinmux_rw_pb_iop___pb12___lsb 12
247#define reg_pinmux_rw_pb_iop___pb12___width 1
248#define reg_pinmux_rw_pb_iop___pb12___bit 12
249#define reg_pinmux_rw_pb_iop___pb13___lsb 13
250#define reg_pinmux_rw_pb_iop___pb13___width 1
251#define reg_pinmux_rw_pb_iop___pb13___bit 13
252#define reg_pinmux_rw_pb_iop___pb14___lsb 14
253#define reg_pinmux_rw_pb_iop___pb14___width 1
254#define reg_pinmux_rw_pb_iop___pb14___bit 14
255#define reg_pinmux_rw_pb_iop___pb15___lsb 15
256#define reg_pinmux_rw_pb_iop___pb15___width 1
257#define reg_pinmux_rw_pb_iop___pb15___bit 15
258#define reg_pinmux_rw_pb_iop___pb16___lsb 16
259#define reg_pinmux_rw_pb_iop___pb16___width 1
260#define reg_pinmux_rw_pb_iop___pb16___bit 16
261#define reg_pinmux_rw_pb_iop___pb17___lsb 17
262#define reg_pinmux_rw_pb_iop___pb17___width 1
263#define reg_pinmux_rw_pb_iop___pb17___bit 17
264#define reg_pinmux_rw_pb_iop_offset 12
265
266/* Register rw_pc_gio, scope pinmux, type rw */
267#define reg_pinmux_rw_pc_gio___pc0___lsb 0
268#define reg_pinmux_rw_pc_gio___pc0___width 1
269#define reg_pinmux_rw_pc_gio___pc0___bit 0
270#define reg_pinmux_rw_pc_gio___pc1___lsb 1
271#define reg_pinmux_rw_pc_gio___pc1___width 1
272#define reg_pinmux_rw_pc_gio___pc1___bit 1
273#define reg_pinmux_rw_pc_gio___pc2___lsb 2
274#define reg_pinmux_rw_pc_gio___pc2___width 1
275#define reg_pinmux_rw_pc_gio___pc2___bit 2
276#define reg_pinmux_rw_pc_gio___pc3___lsb 3
277#define reg_pinmux_rw_pc_gio___pc3___width 1
278#define reg_pinmux_rw_pc_gio___pc3___bit 3
279#define reg_pinmux_rw_pc_gio___pc4___lsb 4
280#define reg_pinmux_rw_pc_gio___pc4___width 1
281#define reg_pinmux_rw_pc_gio___pc4___bit 4
282#define reg_pinmux_rw_pc_gio___pc5___lsb 5
283#define reg_pinmux_rw_pc_gio___pc5___width 1
284#define reg_pinmux_rw_pc_gio___pc5___bit 5
285#define reg_pinmux_rw_pc_gio___pc6___lsb 6
286#define reg_pinmux_rw_pc_gio___pc6___width 1
287#define reg_pinmux_rw_pc_gio___pc6___bit 6
288#define reg_pinmux_rw_pc_gio___pc7___lsb 7
289#define reg_pinmux_rw_pc_gio___pc7___width 1
290#define reg_pinmux_rw_pc_gio___pc7___bit 7
291#define reg_pinmux_rw_pc_gio___pc8___lsb 8
292#define reg_pinmux_rw_pc_gio___pc8___width 1
293#define reg_pinmux_rw_pc_gio___pc8___bit 8
294#define reg_pinmux_rw_pc_gio___pc9___lsb 9
295#define reg_pinmux_rw_pc_gio___pc9___width 1
296#define reg_pinmux_rw_pc_gio___pc9___bit 9
297#define reg_pinmux_rw_pc_gio___pc10___lsb 10
298#define reg_pinmux_rw_pc_gio___pc10___width 1
299#define reg_pinmux_rw_pc_gio___pc10___bit 10
300#define reg_pinmux_rw_pc_gio___pc11___lsb 11
301#define reg_pinmux_rw_pc_gio___pc11___width 1
302#define reg_pinmux_rw_pc_gio___pc11___bit 11
303#define reg_pinmux_rw_pc_gio___pc12___lsb 12
304#define reg_pinmux_rw_pc_gio___pc12___width 1
305#define reg_pinmux_rw_pc_gio___pc12___bit 12
306#define reg_pinmux_rw_pc_gio___pc13___lsb 13
307#define reg_pinmux_rw_pc_gio___pc13___width 1
308#define reg_pinmux_rw_pc_gio___pc13___bit 13
309#define reg_pinmux_rw_pc_gio___pc14___lsb 14
310#define reg_pinmux_rw_pc_gio___pc14___width 1
311#define reg_pinmux_rw_pc_gio___pc14___bit 14
312#define reg_pinmux_rw_pc_gio___pc15___lsb 15
313#define reg_pinmux_rw_pc_gio___pc15___width 1
314#define reg_pinmux_rw_pc_gio___pc15___bit 15
315#define reg_pinmux_rw_pc_gio___pc16___lsb 16
316#define reg_pinmux_rw_pc_gio___pc16___width 1
317#define reg_pinmux_rw_pc_gio___pc16___bit 16
318#define reg_pinmux_rw_pc_gio___pc17___lsb 17
319#define reg_pinmux_rw_pc_gio___pc17___width 1
320#define reg_pinmux_rw_pc_gio___pc17___bit 17
321#define reg_pinmux_rw_pc_gio_offset 16
322
323/* Register rw_pc_iop, scope pinmux, type rw */
324#define reg_pinmux_rw_pc_iop___pc0___lsb 0
325#define reg_pinmux_rw_pc_iop___pc0___width 1
326#define reg_pinmux_rw_pc_iop___pc0___bit 0
327#define reg_pinmux_rw_pc_iop___pc1___lsb 1
328#define reg_pinmux_rw_pc_iop___pc1___width 1
329#define reg_pinmux_rw_pc_iop___pc1___bit 1
330#define reg_pinmux_rw_pc_iop___pc2___lsb 2
331#define reg_pinmux_rw_pc_iop___pc2___width 1
332#define reg_pinmux_rw_pc_iop___pc2___bit 2
333#define reg_pinmux_rw_pc_iop___pc3___lsb 3
334#define reg_pinmux_rw_pc_iop___pc3___width 1
335#define reg_pinmux_rw_pc_iop___pc3___bit 3
336#define reg_pinmux_rw_pc_iop___pc4___lsb 4
337#define reg_pinmux_rw_pc_iop___pc4___width 1
338#define reg_pinmux_rw_pc_iop___pc4___bit 4
339#define reg_pinmux_rw_pc_iop___pc5___lsb 5
340#define reg_pinmux_rw_pc_iop___pc5___width 1
341#define reg_pinmux_rw_pc_iop___pc5___bit 5
342#define reg_pinmux_rw_pc_iop___pc6___lsb 6
343#define reg_pinmux_rw_pc_iop___pc6___width 1
344#define reg_pinmux_rw_pc_iop___pc6___bit 6
345#define reg_pinmux_rw_pc_iop___pc7___lsb 7
346#define reg_pinmux_rw_pc_iop___pc7___width 1
347#define reg_pinmux_rw_pc_iop___pc7___bit 7
348#define reg_pinmux_rw_pc_iop___pc8___lsb 8
349#define reg_pinmux_rw_pc_iop___pc8___width 1
350#define reg_pinmux_rw_pc_iop___pc8___bit 8
351#define reg_pinmux_rw_pc_iop___pc9___lsb 9
352#define reg_pinmux_rw_pc_iop___pc9___width 1
353#define reg_pinmux_rw_pc_iop___pc9___bit 9
354#define reg_pinmux_rw_pc_iop___pc10___lsb 10
355#define reg_pinmux_rw_pc_iop___pc10___width 1
356#define reg_pinmux_rw_pc_iop___pc10___bit 10
357#define reg_pinmux_rw_pc_iop___pc11___lsb 11
358#define reg_pinmux_rw_pc_iop___pc11___width 1
359#define reg_pinmux_rw_pc_iop___pc11___bit 11
360#define reg_pinmux_rw_pc_iop___pc12___lsb 12
361#define reg_pinmux_rw_pc_iop___pc12___width 1
362#define reg_pinmux_rw_pc_iop___pc12___bit 12
363#define reg_pinmux_rw_pc_iop___pc13___lsb 13
364#define reg_pinmux_rw_pc_iop___pc13___width 1
365#define reg_pinmux_rw_pc_iop___pc13___bit 13
366#define reg_pinmux_rw_pc_iop___pc14___lsb 14
367#define reg_pinmux_rw_pc_iop___pc14___width 1
368#define reg_pinmux_rw_pc_iop___pc14___bit 14
369#define reg_pinmux_rw_pc_iop___pc15___lsb 15
370#define reg_pinmux_rw_pc_iop___pc15___width 1
371#define reg_pinmux_rw_pc_iop___pc15___bit 15
372#define reg_pinmux_rw_pc_iop___pc16___lsb 16
373#define reg_pinmux_rw_pc_iop___pc16___width 1
374#define reg_pinmux_rw_pc_iop___pc16___bit 16
375#define reg_pinmux_rw_pc_iop___pc17___lsb 17
376#define reg_pinmux_rw_pc_iop___pc17___width 1
377#define reg_pinmux_rw_pc_iop___pc17___bit 17
378#define reg_pinmux_rw_pc_iop_offset 20
379
380/* Register rw_pd_gio, scope pinmux, type rw */
381#define reg_pinmux_rw_pd_gio___pd0___lsb 0
382#define reg_pinmux_rw_pd_gio___pd0___width 1
383#define reg_pinmux_rw_pd_gio___pd0___bit 0
384#define reg_pinmux_rw_pd_gio___pd1___lsb 1
385#define reg_pinmux_rw_pd_gio___pd1___width 1
386#define reg_pinmux_rw_pd_gio___pd1___bit 1
387#define reg_pinmux_rw_pd_gio___pd2___lsb 2
388#define reg_pinmux_rw_pd_gio___pd2___width 1
389#define reg_pinmux_rw_pd_gio___pd2___bit 2
390#define reg_pinmux_rw_pd_gio___pd3___lsb 3
391#define reg_pinmux_rw_pd_gio___pd3___width 1
392#define reg_pinmux_rw_pd_gio___pd3___bit 3
393#define reg_pinmux_rw_pd_gio___pd4___lsb 4
394#define reg_pinmux_rw_pd_gio___pd4___width 1
395#define reg_pinmux_rw_pd_gio___pd4___bit 4
396#define reg_pinmux_rw_pd_gio___pd5___lsb 5
397#define reg_pinmux_rw_pd_gio___pd5___width 1
398#define reg_pinmux_rw_pd_gio___pd5___bit 5
399#define reg_pinmux_rw_pd_gio___pd6___lsb 6
400#define reg_pinmux_rw_pd_gio___pd6___width 1
401#define reg_pinmux_rw_pd_gio___pd6___bit 6
402#define reg_pinmux_rw_pd_gio___pd7___lsb 7
403#define reg_pinmux_rw_pd_gio___pd7___width 1
404#define reg_pinmux_rw_pd_gio___pd7___bit 7
405#define reg_pinmux_rw_pd_gio___pd8___lsb 8
406#define reg_pinmux_rw_pd_gio___pd8___width 1
407#define reg_pinmux_rw_pd_gio___pd8___bit 8
408#define reg_pinmux_rw_pd_gio___pd9___lsb 9
409#define reg_pinmux_rw_pd_gio___pd9___width 1
410#define reg_pinmux_rw_pd_gio___pd9___bit 9
411#define reg_pinmux_rw_pd_gio___pd10___lsb 10
412#define reg_pinmux_rw_pd_gio___pd10___width 1
413#define reg_pinmux_rw_pd_gio___pd10___bit 10
414#define reg_pinmux_rw_pd_gio___pd11___lsb 11
415#define reg_pinmux_rw_pd_gio___pd11___width 1
416#define reg_pinmux_rw_pd_gio___pd11___bit 11
417#define reg_pinmux_rw_pd_gio___pd12___lsb 12
418#define reg_pinmux_rw_pd_gio___pd12___width 1
419#define reg_pinmux_rw_pd_gio___pd12___bit 12
420#define reg_pinmux_rw_pd_gio___pd13___lsb 13
421#define reg_pinmux_rw_pd_gio___pd13___width 1
422#define reg_pinmux_rw_pd_gio___pd13___bit 13
423#define reg_pinmux_rw_pd_gio___pd14___lsb 14
424#define reg_pinmux_rw_pd_gio___pd14___width 1
425#define reg_pinmux_rw_pd_gio___pd14___bit 14
426#define reg_pinmux_rw_pd_gio___pd15___lsb 15
427#define reg_pinmux_rw_pd_gio___pd15___width 1
428#define reg_pinmux_rw_pd_gio___pd15___bit 15
429#define reg_pinmux_rw_pd_gio___pd16___lsb 16
430#define reg_pinmux_rw_pd_gio___pd16___width 1
431#define reg_pinmux_rw_pd_gio___pd16___bit 16
432#define reg_pinmux_rw_pd_gio___pd17___lsb 17
433#define reg_pinmux_rw_pd_gio___pd17___width 1
434#define reg_pinmux_rw_pd_gio___pd17___bit 17
435#define reg_pinmux_rw_pd_gio_offset 24
436
437/* Register rw_pd_iop, scope pinmux, type rw */
438#define reg_pinmux_rw_pd_iop___pd0___lsb 0
439#define reg_pinmux_rw_pd_iop___pd0___width 1
440#define reg_pinmux_rw_pd_iop___pd0___bit 0
441#define reg_pinmux_rw_pd_iop___pd1___lsb 1
442#define reg_pinmux_rw_pd_iop___pd1___width 1
443#define reg_pinmux_rw_pd_iop___pd1___bit 1
444#define reg_pinmux_rw_pd_iop___pd2___lsb 2
445#define reg_pinmux_rw_pd_iop___pd2___width 1
446#define reg_pinmux_rw_pd_iop___pd2___bit 2
447#define reg_pinmux_rw_pd_iop___pd3___lsb 3
448#define reg_pinmux_rw_pd_iop___pd3___width 1
449#define reg_pinmux_rw_pd_iop___pd3___bit 3
450#define reg_pinmux_rw_pd_iop___pd4___lsb 4
451#define reg_pinmux_rw_pd_iop___pd4___width 1
452#define reg_pinmux_rw_pd_iop___pd4___bit 4
453#define reg_pinmux_rw_pd_iop___pd5___lsb 5
454#define reg_pinmux_rw_pd_iop___pd5___width 1
455#define reg_pinmux_rw_pd_iop___pd5___bit 5
456#define reg_pinmux_rw_pd_iop___pd6___lsb 6
457#define reg_pinmux_rw_pd_iop___pd6___width 1
458#define reg_pinmux_rw_pd_iop___pd6___bit 6
459#define reg_pinmux_rw_pd_iop___pd7___lsb 7
460#define reg_pinmux_rw_pd_iop___pd7___width 1
461#define reg_pinmux_rw_pd_iop___pd7___bit 7
462#define reg_pinmux_rw_pd_iop___pd8___lsb 8
463#define reg_pinmux_rw_pd_iop___pd8___width 1
464#define reg_pinmux_rw_pd_iop___pd8___bit 8
465#define reg_pinmux_rw_pd_iop___pd9___lsb 9
466#define reg_pinmux_rw_pd_iop___pd9___width 1
467#define reg_pinmux_rw_pd_iop___pd9___bit 9
468#define reg_pinmux_rw_pd_iop___pd10___lsb 10
469#define reg_pinmux_rw_pd_iop___pd10___width 1
470#define reg_pinmux_rw_pd_iop___pd10___bit 10
471#define reg_pinmux_rw_pd_iop___pd11___lsb 11
472#define reg_pinmux_rw_pd_iop___pd11___width 1
473#define reg_pinmux_rw_pd_iop___pd11___bit 11
474#define reg_pinmux_rw_pd_iop___pd12___lsb 12
475#define reg_pinmux_rw_pd_iop___pd12___width 1
476#define reg_pinmux_rw_pd_iop___pd12___bit 12
477#define reg_pinmux_rw_pd_iop___pd13___lsb 13
478#define reg_pinmux_rw_pd_iop___pd13___width 1
479#define reg_pinmux_rw_pd_iop___pd13___bit 13
480#define reg_pinmux_rw_pd_iop___pd14___lsb 14
481#define reg_pinmux_rw_pd_iop___pd14___width 1
482#define reg_pinmux_rw_pd_iop___pd14___bit 14
483#define reg_pinmux_rw_pd_iop___pd15___lsb 15
484#define reg_pinmux_rw_pd_iop___pd15___width 1
485#define reg_pinmux_rw_pd_iop___pd15___bit 15
486#define reg_pinmux_rw_pd_iop___pd16___lsb 16
487#define reg_pinmux_rw_pd_iop___pd16___width 1
488#define reg_pinmux_rw_pd_iop___pd16___bit 16
489#define reg_pinmux_rw_pd_iop___pd17___lsb 17
490#define reg_pinmux_rw_pd_iop___pd17___width 1
491#define reg_pinmux_rw_pd_iop___pd17___bit 17
492#define reg_pinmux_rw_pd_iop_offset 28
493
494/* Register rw_pe_gio, scope pinmux, type rw */
495#define reg_pinmux_rw_pe_gio___pe0___lsb 0
496#define reg_pinmux_rw_pe_gio___pe0___width 1
497#define reg_pinmux_rw_pe_gio___pe0___bit 0
498#define reg_pinmux_rw_pe_gio___pe1___lsb 1
499#define reg_pinmux_rw_pe_gio___pe1___width 1
500#define reg_pinmux_rw_pe_gio___pe1___bit 1
501#define reg_pinmux_rw_pe_gio___pe2___lsb 2
502#define reg_pinmux_rw_pe_gio___pe2___width 1
503#define reg_pinmux_rw_pe_gio___pe2___bit 2
504#define reg_pinmux_rw_pe_gio___pe3___lsb 3
505#define reg_pinmux_rw_pe_gio___pe3___width 1
506#define reg_pinmux_rw_pe_gio___pe3___bit 3
507#define reg_pinmux_rw_pe_gio___pe4___lsb 4
508#define reg_pinmux_rw_pe_gio___pe4___width 1
509#define reg_pinmux_rw_pe_gio___pe4___bit 4
510#define reg_pinmux_rw_pe_gio___pe5___lsb 5
511#define reg_pinmux_rw_pe_gio___pe5___width 1
512#define reg_pinmux_rw_pe_gio___pe5___bit 5
513#define reg_pinmux_rw_pe_gio___pe6___lsb 6
514#define reg_pinmux_rw_pe_gio___pe6___width 1
515#define reg_pinmux_rw_pe_gio___pe6___bit 6
516#define reg_pinmux_rw_pe_gio___pe7___lsb 7
517#define reg_pinmux_rw_pe_gio___pe7___width 1
518#define reg_pinmux_rw_pe_gio___pe7___bit 7
519#define reg_pinmux_rw_pe_gio___pe8___lsb 8
520#define reg_pinmux_rw_pe_gio___pe8___width 1
521#define reg_pinmux_rw_pe_gio___pe8___bit 8
522#define reg_pinmux_rw_pe_gio___pe9___lsb 9
523#define reg_pinmux_rw_pe_gio___pe9___width 1
524#define reg_pinmux_rw_pe_gio___pe9___bit 9
525#define reg_pinmux_rw_pe_gio___pe10___lsb 10
526#define reg_pinmux_rw_pe_gio___pe10___width 1
527#define reg_pinmux_rw_pe_gio___pe10___bit 10
528#define reg_pinmux_rw_pe_gio___pe11___lsb 11
529#define reg_pinmux_rw_pe_gio___pe11___width 1
530#define reg_pinmux_rw_pe_gio___pe11___bit 11
531#define reg_pinmux_rw_pe_gio___pe12___lsb 12
532#define reg_pinmux_rw_pe_gio___pe12___width 1
533#define reg_pinmux_rw_pe_gio___pe12___bit 12
534#define reg_pinmux_rw_pe_gio___pe13___lsb 13
535#define reg_pinmux_rw_pe_gio___pe13___width 1
536#define reg_pinmux_rw_pe_gio___pe13___bit 13
537#define reg_pinmux_rw_pe_gio___pe14___lsb 14
538#define reg_pinmux_rw_pe_gio___pe14___width 1
539#define reg_pinmux_rw_pe_gio___pe14___bit 14
540#define reg_pinmux_rw_pe_gio___pe15___lsb 15
541#define reg_pinmux_rw_pe_gio___pe15___width 1
542#define reg_pinmux_rw_pe_gio___pe15___bit 15
543#define reg_pinmux_rw_pe_gio___pe16___lsb 16
544#define reg_pinmux_rw_pe_gio___pe16___width 1
545#define reg_pinmux_rw_pe_gio___pe16___bit 16
546#define reg_pinmux_rw_pe_gio___pe17___lsb 17
547#define reg_pinmux_rw_pe_gio___pe17___width 1
548#define reg_pinmux_rw_pe_gio___pe17___bit 17
549#define reg_pinmux_rw_pe_gio_offset 32
550
551/* Register rw_pe_iop, scope pinmux, type rw */
552#define reg_pinmux_rw_pe_iop___pe0___lsb 0
553#define reg_pinmux_rw_pe_iop___pe0___width 1
554#define reg_pinmux_rw_pe_iop___pe0___bit 0
555#define reg_pinmux_rw_pe_iop___pe1___lsb 1
556#define reg_pinmux_rw_pe_iop___pe1___width 1
557#define reg_pinmux_rw_pe_iop___pe1___bit 1
558#define reg_pinmux_rw_pe_iop___pe2___lsb 2
559#define reg_pinmux_rw_pe_iop___pe2___width 1
560#define reg_pinmux_rw_pe_iop___pe2___bit 2
561#define reg_pinmux_rw_pe_iop___pe3___lsb 3
562#define reg_pinmux_rw_pe_iop___pe3___width 1
563#define reg_pinmux_rw_pe_iop___pe3___bit 3
564#define reg_pinmux_rw_pe_iop___pe4___lsb 4
565#define reg_pinmux_rw_pe_iop___pe4___width 1
566#define reg_pinmux_rw_pe_iop___pe4___bit 4
567#define reg_pinmux_rw_pe_iop___pe5___lsb 5
568#define reg_pinmux_rw_pe_iop___pe5___width 1
569#define reg_pinmux_rw_pe_iop___pe5___bit 5
570#define reg_pinmux_rw_pe_iop___pe6___lsb 6
571#define reg_pinmux_rw_pe_iop___pe6___width 1
572#define reg_pinmux_rw_pe_iop___pe6___bit 6
573#define reg_pinmux_rw_pe_iop___pe7___lsb 7
574#define reg_pinmux_rw_pe_iop___pe7___width 1
575#define reg_pinmux_rw_pe_iop___pe7___bit 7
576#define reg_pinmux_rw_pe_iop___pe8___lsb 8
577#define reg_pinmux_rw_pe_iop___pe8___width 1
578#define reg_pinmux_rw_pe_iop___pe8___bit 8
579#define reg_pinmux_rw_pe_iop___pe9___lsb 9
580#define reg_pinmux_rw_pe_iop___pe9___width 1
581#define reg_pinmux_rw_pe_iop___pe9___bit 9
582#define reg_pinmux_rw_pe_iop___pe10___lsb 10
583#define reg_pinmux_rw_pe_iop___pe10___width 1
584#define reg_pinmux_rw_pe_iop___pe10___bit 10
585#define reg_pinmux_rw_pe_iop___pe11___lsb 11
586#define reg_pinmux_rw_pe_iop___pe11___width 1
587#define reg_pinmux_rw_pe_iop___pe11___bit 11
588#define reg_pinmux_rw_pe_iop___pe12___lsb 12
589#define reg_pinmux_rw_pe_iop___pe12___width 1
590#define reg_pinmux_rw_pe_iop___pe12___bit 12
591#define reg_pinmux_rw_pe_iop___pe13___lsb 13
592#define reg_pinmux_rw_pe_iop___pe13___width 1
593#define reg_pinmux_rw_pe_iop___pe13___bit 13
594#define reg_pinmux_rw_pe_iop___pe14___lsb 14
595#define reg_pinmux_rw_pe_iop___pe14___width 1
596#define reg_pinmux_rw_pe_iop___pe14___bit 14
597#define reg_pinmux_rw_pe_iop___pe15___lsb 15
598#define reg_pinmux_rw_pe_iop___pe15___width 1
599#define reg_pinmux_rw_pe_iop___pe15___bit 15
600#define reg_pinmux_rw_pe_iop___pe16___lsb 16
601#define reg_pinmux_rw_pe_iop___pe16___width 1
602#define reg_pinmux_rw_pe_iop___pe16___bit 16
603#define reg_pinmux_rw_pe_iop___pe17___lsb 17
604#define reg_pinmux_rw_pe_iop___pe17___width 1
605#define reg_pinmux_rw_pe_iop___pe17___bit 17
606#define reg_pinmux_rw_pe_iop_offset 36
607
608/* Register rw_usb_phy, scope pinmux, type rw */
609#define reg_pinmux_rw_usb_phy___en_usb0___lsb 0
610#define reg_pinmux_rw_usb_phy___en_usb0___width 1
611#define reg_pinmux_rw_usb_phy___en_usb0___bit 0
612#define reg_pinmux_rw_usb_phy___en_usb1___lsb 1
613#define reg_pinmux_rw_usb_phy___en_usb1___width 1
614#define reg_pinmux_rw_usb_phy___en_usb1___bit 1
615#define reg_pinmux_rw_usb_phy_offset 40
616
617
618/* Constants */
619#define regk_pinmux_no 0x00000000
620#define regk_pinmux_rw_hwprot_default 0x00000000
621#define regk_pinmux_rw_pa_default 0x00000000
622#define regk_pinmux_rw_pb_gio_default 0x00000000
623#define regk_pinmux_rw_pb_iop_default 0x00000000
624#define regk_pinmux_rw_pc_gio_default 0x00000000
625#define regk_pinmux_rw_pc_iop_default 0x00000000
626#define regk_pinmux_rw_pd_gio_default 0x00000000
627#define regk_pinmux_rw_pd_iop_default 0x00000000
628#define regk_pinmux_rw_pe_gio_default 0x00000000
629#define regk_pinmux_rw_pe_iop_default 0x00000000
630#define regk_pinmux_rw_usb_phy_default 0x00000000
631#define regk_pinmux_yes 0x00000001
632#endif /* __pinmux_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/reg_map_asm.h b/include/asm-cris/arch-v32/hwregs/asm/reg_map_asm.h
new file mode 100644
index 000000000000..76959b70cd2c
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/reg_map_asm.h
@@ -0,0 +1,96 @@
1#ifndef __reg_map_h
2#define __reg_map_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../mod/fakereg.rmap
7 * id: fakereg.rmap,v 1.3 2004/02/11 19:53:22 ronny Exp
8 * last modified: Wed Feb 11 20:53:25 2004
9 * file: ../../rtl/global.rmap
10 * id: global.rmap,v 1.3 2003/08/18 15:08:23 mikaeln Exp
11 * last modified: Mon Aug 18 17:08:23 2003
12 * file: ../../mod/modreg.rmap
13 * id: modreg.rmap,v 1.31 2004/02/20 15:40:04 stefans Exp
14 * last modified: Fri Feb 20 16:40:04 2004
15 *
16 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/reg_map_asm.h -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
17 * id: $Id: reg_map_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
18 * Any changes here will be lost.
19 *
20 * -*- buffer-read-only: t -*-
21 */
22#define regi_artpec_mod 0xb7044000
23#define regi_ata 0xb0032000
24#define regi_ata_mod 0xb7006000
25#define regi_barber 0xb701a000
26#define regi_bif_core 0xb0014000
27#define regi_bif_dma 0xb0016000
28#define regi_bif_slave 0xb0018000
29#define regi_bif_slave_ext 0xac000000
30#define regi_bus_master 0xb703c000
31#define regi_config 0xb003c000
32#define regi_dma0 0xb0000000
33#define regi_dma1 0xb0002000
34#define regi_dma2 0xb0004000
35#define regi_dma3 0xb0006000
36#define regi_dma4 0xb0008000
37#define regi_dma5 0xb000a000
38#define regi_dma6 0xb000c000
39#define regi_dma7 0xb000e000
40#define regi_dma8 0xb0010000
41#define regi_dma9 0xb0012000
42#define regi_eth0 0xb0034000
43#define regi_eth1 0xb0036000
44#define regi_eth_mod 0xb7004000
45#define regi_eth_mod1 0xb701c000
46#define regi_eth_strmod 0xb7008000
47#define regi_eth_strmod1 0xb7032000
48#define regi_ext_dma 0xb703a000
49#define regi_ext_mem 0xb7046000
50#define regi_gen_io 0xb7016000
51#define regi_gio 0xb001a000
52#define regi_hook 0xb7000000
53#define regi_iop 0xb0020000
54#define regi_irq 0xb001c000
55#define regi_irq_nmi 0xb701e000
56#define regi_marb 0xb003e000
57#define regi_marb_bp0 0xb003e240
58#define regi_marb_bp1 0xb003e280
59#define regi_marb_bp2 0xb003e2c0
60#define regi_marb_bp3 0xb003e300
61#define regi_nand_mod 0xb7014000
62#define regi_p21 0xb002e000
63#define regi_p21_mod 0xb7042000
64#define regi_pci_mod 0xb7010000
65#define regi_pin_test 0xb7018000
66#define regi_pinmux 0xb0038000
67#define regi_sdram_chk 0xb703e000
68#define regi_sdram_mod 0xb7012000
69#define regi_ser0 0xb0026000
70#define regi_ser1 0xb0028000
71#define regi_ser2 0xb002a000
72#define regi_ser3 0xb002c000
73#define regi_ser_mod0 0xb7020000
74#define regi_ser_mod1 0xb7022000
75#define regi_ser_mod2 0xb7024000
76#define regi_ser_mod3 0xb7026000
77#define regi_smif_stat 0xb700e000
78#define regi_sser0 0xb0022000
79#define regi_sser1 0xb0024000
80#define regi_sser_mod0 0xb700a000
81#define regi_sser_mod1 0xb700c000
82#define regi_strcop 0xb0030000
83#define regi_strmux 0xb003a000
84#define regi_strmux_tst 0xb7040000
85#define regi_tap 0xb7002000
86#define regi_timer 0xb001e000
87#define regi_timer_mod 0xb7034000
88#define regi_trace 0xb0040000
89#define regi_usb0 0xb7028000
90#define regi_usb1 0xb702a000
91#define regi_usb2 0xb702c000
92#define regi_usb3 0xb702e000
93#define regi_usb_dev 0xb7030000
94#define regi_utmi_mod0 0xb7036000
95#define regi_utmi_mod1 0xb7038000
96#endif /* __reg_map_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/rt_trace_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/rt_trace_defs_asm.h
new file mode 100644
index 000000000000..10246f49fb28
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/rt_trace_defs_asm.h
@@ -0,0 +1,142 @@
1#ifndef __rt_trace_defs_asm_h
2#define __rt_trace_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/rt_trace/rtl/rt_regs.r
7 * id: rt_regs.r,v 1.18 2005/02/08 15:45:00 stefans Exp
8 * last modfied: Mon Apr 11 16:09:14 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/rt_trace_defs_asm.h ../../inst/rt_trace/rtl/rt_regs.r
11 * id: $Id: rt_trace_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope rt_trace, type rw */
57#define reg_rt_trace_rw_cfg___en___lsb 0
58#define reg_rt_trace_rw_cfg___en___width 1
59#define reg_rt_trace_rw_cfg___en___bit 0
60#define reg_rt_trace_rw_cfg___mode___lsb 1
61#define reg_rt_trace_rw_cfg___mode___width 1
62#define reg_rt_trace_rw_cfg___mode___bit 1
63#define reg_rt_trace_rw_cfg___owner___lsb 2
64#define reg_rt_trace_rw_cfg___owner___width 1
65#define reg_rt_trace_rw_cfg___owner___bit 2
66#define reg_rt_trace_rw_cfg___wp___lsb 3
67#define reg_rt_trace_rw_cfg___wp___width 1
68#define reg_rt_trace_rw_cfg___wp___bit 3
69#define reg_rt_trace_rw_cfg___stall___lsb 4
70#define reg_rt_trace_rw_cfg___stall___width 1
71#define reg_rt_trace_rw_cfg___stall___bit 4
72#define reg_rt_trace_rw_cfg___wp_start___lsb 8
73#define reg_rt_trace_rw_cfg___wp_start___width 7
74#define reg_rt_trace_rw_cfg___wp_stop___lsb 16
75#define reg_rt_trace_rw_cfg___wp_stop___width 7
76#define reg_rt_trace_rw_cfg_offset 0
77
78/* Register rw_tap_ctrl, scope rt_trace, type rw */
79#define reg_rt_trace_rw_tap_ctrl___ack_data___lsb 0
80#define reg_rt_trace_rw_tap_ctrl___ack_data___width 1
81#define reg_rt_trace_rw_tap_ctrl___ack_data___bit 0
82#define reg_rt_trace_rw_tap_ctrl___ack_guru___lsb 1
83#define reg_rt_trace_rw_tap_ctrl___ack_guru___width 1
84#define reg_rt_trace_rw_tap_ctrl___ack_guru___bit 1
85#define reg_rt_trace_rw_tap_ctrl_offset 4
86
87/* Register r_tap_stat, scope rt_trace, type r */
88#define reg_rt_trace_r_tap_stat___dav___lsb 0
89#define reg_rt_trace_r_tap_stat___dav___width 1
90#define reg_rt_trace_r_tap_stat___dav___bit 0
91#define reg_rt_trace_r_tap_stat___empty___lsb 1
92#define reg_rt_trace_r_tap_stat___empty___width 1
93#define reg_rt_trace_r_tap_stat___empty___bit 1
94#define reg_rt_trace_r_tap_stat_offset 8
95
96/* Register rw_tap_data, scope rt_trace, type rw */
97#define reg_rt_trace_rw_tap_data_offset 12
98
99/* Register rw_tap_hdata, scope rt_trace, type rw */
100#define reg_rt_trace_rw_tap_hdata___op___lsb 0
101#define reg_rt_trace_rw_tap_hdata___op___width 4
102#define reg_rt_trace_rw_tap_hdata___sub_op___lsb 4
103#define reg_rt_trace_rw_tap_hdata___sub_op___width 4
104#define reg_rt_trace_rw_tap_hdata_offset 16
105
106/* Register r_redir, scope rt_trace, type r */
107#define reg_rt_trace_r_redir_offset 20
108
109
110/* Constants */
111#define regk_rt_trace_brk 0x0000000c
112#define regk_rt_trace_dbg 0x00000003
113#define regk_rt_trace_dbgdi 0x00000004
114#define regk_rt_trace_dbgdo 0x00000005
115#define regk_rt_trace_gmode 0x00000000
116#define regk_rt_trace_no 0x00000000
117#define regk_rt_trace_nop 0x00000000
118#define regk_rt_trace_normal 0x00000000
119#define regk_rt_trace_rdmem 0x00000007
120#define regk_rt_trace_rdmemb 0x00000009
121#define regk_rt_trace_rdpreg 0x00000002
122#define regk_rt_trace_rdreg 0x00000001
123#define regk_rt_trace_rdsreg 0x00000003
124#define regk_rt_trace_redir 0x00000006
125#define regk_rt_trace_ret 0x0000000b
126#define regk_rt_trace_rw_cfg_default 0x00000000
127#define regk_rt_trace_trcfg 0x00000001
128#define regk_rt_trace_wp 0x00000001
129#define regk_rt_trace_wp0 0x00000001
130#define regk_rt_trace_wp1 0x00000002
131#define regk_rt_trace_wp2 0x00000004
132#define regk_rt_trace_wp3 0x00000008
133#define regk_rt_trace_wp4 0x00000010
134#define regk_rt_trace_wp5 0x00000020
135#define regk_rt_trace_wp6 0x00000040
136#define regk_rt_trace_wrmem 0x00000008
137#define regk_rt_trace_wrmemb 0x0000000a
138#define regk_rt_trace_wrpreg 0x00000005
139#define regk_rt_trace_wrreg 0x00000004
140#define regk_rt_trace_wrsreg 0x00000006
141#define regk_rt_trace_yes 0x00000001
142#endif /* __rt_trace_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/ser_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/ser_defs_asm.h
new file mode 100644
index 000000000000..4a2808bdf390
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/ser_defs_asm.h
@@ -0,0 +1,359 @@
1#ifndef __ser_defs_asm_h
2#define __ser_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/ser/rtl/ser_regs.r
7 * id: ser_regs.r,v 1.23 2005/02/08 13:58:35 perz Exp
8 * last modfied: Mon Apr 11 16:09:21 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/ser_defs_asm.h ../../inst/ser/rtl/ser_regs.r
11 * id: $Id: ser_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_tr_ctrl, scope ser, type rw */
57#define reg_ser_rw_tr_ctrl___base_freq___lsb 0
58#define reg_ser_rw_tr_ctrl___base_freq___width 3
59#define reg_ser_rw_tr_ctrl___en___lsb 3
60#define reg_ser_rw_tr_ctrl___en___width 1
61#define reg_ser_rw_tr_ctrl___en___bit 3
62#define reg_ser_rw_tr_ctrl___par___lsb 4
63#define reg_ser_rw_tr_ctrl___par___width 2
64#define reg_ser_rw_tr_ctrl___par_en___lsb 6
65#define reg_ser_rw_tr_ctrl___par_en___width 1
66#define reg_ser_rw_tr_ctrl___par_en___bit 6
67#define reg_ser_rw_tr_ctrl___data_bits___lsb 7
68#define reg_ser_rw_tr_ctrl___data_bits___width 1
69#define reg_ser_rw_tr_ctrl___data_bits___bit 7
70#define reg_ser_rw_tr_ctrl___stop_bits___lsb 8
71#define reg_ser_rw_tr_ctrl___stop_bits___width 1
72#define reg_ser_rw_tr_ctrl___stop_bits___bit 8
73#define reg_ser_rw_tr_ctrl___stop___lsb 9
74#define reg_ser_rw_tr_ctrl___stop___width 1
75#define reg_ser_rw_tr_ctrl___stop___bit 9
76#define reg_ser_rw_tr_ctrl___rts_delay___lsb 10
77#define reg_ser_rw_tr_ctrl___rts_delay___width 3
78#define reg_ser_rw_tr_ctrl___rts_setup___lsb 13
79#define reg_ser_rw_tr_ctrl___rts_setup___width 1
80#define reg_ser_rw_tr_ctrl___rts_setup___bit 13
81#define reg_ser_rw_tr_ctrl___auto_rts___lsb 14
82#define reg_ser_rw_tr_ctrl___auto_rts___width 1
83#define reg_ser_rw_tr_ctrl___auto_rts___bit 14
84#define reg_ser_rw_tr_ctrl___txd___lsb 15
85#define reg_ser_rw_tr_ctrl___txd___width 1
86#define reg_ser_rw_tr_ctrl___txd___bit 15
87#define reg_ser_rw_tr_ctrl___auto_cts___lsb 16
88#define reg_ser_rw_tr_ctrl___auto_cts___width 1
89#define reg_ser_rw_tr_ctrl___auto_cts___bit 16
90#define reg_ser_rw_tr_ctrl_offset 0
91
92/* Register rw_tr_dma_en, scope ser, type rw */
93#define reg_ser_rw_tr_dma_en___en___lsb 0
94#define reg_ser_rw_tr_dma_en___en___width 1
95#define reg_ser_rw_tr_dma_en___en___bit 0
96#define reg_ser_rw_tr_dma_en_offset 4
97
98/* Register rw_rec_ctrl, scope ser, type rw */
99#define reg_ser_rw_rec_ctrl___base_freq___lsb 0
100#define reg_ser_rw_rec_ctrl___base_freq___width 3
101#define reg_ser_rw_rec_ctrl___en___lsb 3
102#define reg_ser_rw_rec_ctrl___en___width 1
103#define reg_ser_rw_rec_ctrl___en___bit 3
104#define reg_ser_rw_rec_ctrl___par___lsb 4
105#define reg_ser_rw_rec_ctrl___par___width 2
106#define reg_ser_rw_rec_ctrl___par_en___lsb 6
107#define reg_ser_rw_rec_ctrl___par_en___width 1
108#define reg_ser_rw_rec_ctrl___par_en___bit 6
109#define reg_ser_rw_rec_ctrl___data_bits___lsb 7
110#define reg_ser_rw_rec_ctrl___data_bits___width 1
111#define reg_ser_rw_rec_ctrl___data_bits___bit 7
112#define reg_ser_rw_rec_ctrl___dma_mode___lsb 8
113#define reg_ser_rw_rec_ctrl___dma_mode___width 1
114#define reg_ser_rw_rec_ctrl___dma_mode___bit 8
115#define reg_ser_rw_rec_ctrl___dma_err___lsb 9
116#define reg_ser_rw_rec_ctrl___dma_err___width 1
117#define reg_ser_rw_rec_ctrl___dma_err___bit 9
118#define reg_ser_rw_rec_ctrl___sampling___lsb 10
119#define reg_ser_rw_rec_ctrl___sampling___width 1
120#define reg_ser_rw_rec_ctrl___sampling___bit 10
121#define reg_ser_rw_rec_ctrl___timeout___lsb 11
122#define reg_ser_rw_rec_ctrl___timeout___width 3
123#define reg_ser_rw_rec_ctrl___auto_eop___lsb 14
124#define reg_ser_rw_rec_ctrl___auto_eop___width 1
125#define reg_ser_rw_rec_ctrl___auto_eop___bit 14
126#define reg_ser_rw_rec_ctrl___half_duplex___lsb 15
127#define reg_ser_rw_rec_ctrl___half_duplex___width 1
128#define reg_ser_rw_rec_ctrl___half_duplex___bit 15
129#define reg_ser_rw_rec_ctrl___rts_n___lsb 16
130#define reg_ser_rw_rec_ctrl___rts_n___width 1
131#define reg_ser_rw_rec_ctrl___rts_n___bit 16
132#define reg_ser_rw_rec_ctrl___loopback___lsb 17
133#define reg_ser_rw_rec_ctrl___loopback___width 1
134#define reg_ser_rw_rec_ctrl___loopback___bit 17
135#define reg_ser_rw_rec_ctrl_offset 8
136
137/* Register rw_tr_baud_div, scope ser, type rw */
138#define reg_ser_rw_tr_baud_div___div___lsb 0
139#define reg_ser_rw_tr_baud_div___div___width 16
140#define reg_ser_rw_tr_baud_div_offset 12
141
142/* Register rw_rec_baud_div, scope ser, type rw */
143#define reg_ser_rw_rec_baud_div___div___lsb 0
144#define reg_ser_rw_rec_baud_div___div___width 16
145#define reg_ser_rw_rec_baud_div_offset 16
146
147/* Register rw_xoff, scope ser, type rw */
148#define reg_ser_rw_xoff___chr___lsb 0
149#define reg_ser_rw_xoff___chr___width 8
150#define reg_ser_rw_xoff___automatic___lsb 8
151#define reg_ser_rw_xoff___automatic___width 1
152#define reg_ser_rw_xoff___automatic___bit 8
153#define reg_ser_rw_xoff_offset 20
154
155/* Register rw_xoff_clr, scope ser, type rw */
156#define reg_ser_rw_xoff_clr___clr___lsb 0
157#define reg_ser_rw_xoff_clr___clr___width 1
158#define reg_ser_rw_xoff_clr___clr___bit 0
159#define reg_ser_rw_xoff_clr_offset 24
160
161/* Register rw_dout, scope ser, type rw */
162#define reg_ser_rw_dout___data___lsb 0
163#define reg_ser_rw_dout___data___width 8
164#define reg_ser_rw_dout_offset 28
165
166/* Register rs_stat_din, scope ser, type rs */
167#define reg_ser_rs_stat_din___data___lsb 0
168#define reg_ser_rs_stat_din___data___width 8
169#define reg_ser_rs_stat_din___dav___lsb 16
170#define reg_ser_rs_stat_din___dav___width 1
171#define reg_ser_rs_stat_din___dav___bit 16
172#define reg_ser_rs_stat_din___framing_err___lsb 17
173#define reg_ser_rs_stat_din___framing_err___width 1
174#define reg_ser_rs_stat_din___framing_err___bit 17
175#define reg_ser_rs_stat_din___par_err___lsb 18
176#define reg_ser_rs_stat_din___par_err___width 1
177#define reg_ser_rs_stat_din___par_err___bit 18
178#define reg_ser_rs_stat_din___orun___lsb 19
179#define reg_ser_rs_stat_din___orun___width 1
180#define reg_ser_rs_stat_din___orun___bit 19
181#define reg_ser_rs_stat_din___rec_err___lsb 20
182#define reg_ser_rs_stat_din___rec_err___width 1
183#define reg_ser_rs_stat_din___rec_err___bit 20
184#define reg_ser_rs_stat_din___rxd___lsb 21
185#define reg_ser_rs_stat_din___rxd___width 1
186#define reg_ser_rs_stat_din___rxd___bit 21
187#define reg_ser_rs_stat_din___tr_idle___lsb 22
188#define reg_ser_rs_stat_din___tr_idle___width 1
189#define reg_ser_rs_stat_din___tr_idle___bit 22
190#define reg_ser_rs_stat_din___tr_empty___lsb 23
191#define reg_ser_rs_stat_din___tr_empty___width 1
192#define reg_ser_rs_stat_din___tr_empty___bit 23
193#define reg_ser_rs_stat_din___tr_rdy___lsb 24
194#define reg_ser_rs_stat_din___tr_rdy___width 1
195#define reg_ser_rs_stat_din___tr_rdy___bit 24
196#define reg_ser_rs_stat_din___cts_n___lsb 25
197#define reg_ser_rs_stat_din___cts_n___width 1
198#define reg_ser_rs_stat_din___cts_n___bit 25
199#define reg_ser_rs_stat_din___xoff_detect___lsb 26
200#define reg_ser_rs_stat_din___xoff_detect___width 1
201#define reg_ser_rs_stat_din___xoff_detect___bit 26
202#define reg_ser_rs_stat_din___rts_n___lsb 27
203#define reg_ser_rs_stat_din___rts_n___width 1
204#define reg_ser_rs_stat_din___rts_n___bit 27
205#define reg_ser_rs_stat_din___txd___lsb 28
206#define reg_ser_rs_stat_din___txd___width 1
207#define reg_ser_rs_stat_din___txd___bit 28
208#define reg_ser_rs_stat_din_offset 32
209
210/* Register r_stat_din, scope ser, type r */
211#define reg_ser_r_stat_din___data___lsb 0
212#define reg_ser_r_stat_din___data___width 8
213#define reg_ser_r_stat_din___dav___lsb 16
214#define reg_ser_r_stat_din___dav___width 1
215#define reg_ser_r_stat_din___dav___bit 16
216#define reg_ser_r_stat_din___framing_err___lsb 17
217#define reg_ser_r_stat_din___framing_err___width 1
218#define reg_ser_r_stat_din___framing_err___bit 17
219#define reg_ser_r_stat_din___par_err___lsb 18
220#define reg_ser_r_stat_din___par_err___width 1
221#define reg_ser_r_stat_din___par_err___bit 18
222#define reg_ser_r_stat_din___orun___lsb 19
223#define reg_ser_r_stat_din___orun___width 1
224#define reg_ser_r_stat_din___orun___bit 19
225#define reg_ser_r_stat_din___rec_err___lsb 20
226#define reg_ser_r_stat_din___rec_err___width 1
227#define reg_ser_r_stat_din___rec_err___bit 20
228#define reg_ser_r_stat_din___rxd___lsb 21
229#define reg_ser_r_stat_din___rxd___width 1
230#define reg_ser_r_stat_din___rxd___bit 21
231#define reg_ser_r_stat_din___tr_idle___lsb 22
232#define reg_ser_r_stat_din___tr_idle___width 1
233#define reg_ser_r_stat_din___tr_idle___bit 22
234#define reg_ser_r_stat_din___tr_empty___lsb 23
235#define reg_ser_r_stat_din___tr_empty___width 1
236#define reg_ser_r_stat_din___tr_empty___bit 23
237#define reg_ser_r_stat_din___tr_rdy___lsb 24
238#define reg_ser_r_stat_din___tr_rdy___width 1
239#define reg_ser_r_stat_din___tr_rdy___bit 24
240#define reg_ser_r_stat_din___cts_n___lsb 25
241#define reg_ser_r_stat_din___cts_n___width 1
242#define reg_ser_r_stat_din___cts_n___bit 25
243#define reg_ser_r_stat_din___xoff_detect___lsb 26
244#define reg_ser_r_stat_din___xoff_detect___width 1
245#define reg_ser_r_stat_din___xoff_detect___bit 26
246#define reg_ser_r_stat_din___rts_n___lsb 27
247#define reg_ser_r_stat_din___rts_n___width 1
248#define reg_ser_r_stat_din___rts_n___bit 27
249#define reg_ser_r_stat_din___txd___lsb 28
250#define reg_ser_r_stat_din___txd___width 1
251#define reg_ser_r_stat_din___txd___bit 28
252#define reg_ser_r_stat_din_offset 36
253
254/* Register rw_rec_eop, scope ser, type rw */
255#define reg_ser_rw_rec_eop___set___lsb 0
256#define reg_ser_rw_rec_eop___set___width 1
257#define reg_ser_rw_rec_eop___set___bit 0
258#define reg_ser_rw_rec_eop_offset 40
259
260/* Register rw_intr_mask, scope ser, type rw */
261#define reg_ser_rw_intr_mask___tr_rdy___lsb 0
262#define reg_ser_rw_intr_mask___tr_rdy___width 1
263#define reg_ser_rw_intr_mask___tr_rdy___bit 0
264#define reg_ser_rw_intr_mask___tr_empty___lsb 1
265#define reg_ser_rw_intr_mask___tr_empty___width 1
266#define reg_ser_rw_intr_mask___tr_empty___bit 1
267#define reg_ser_rw_intr_mask___tr_idle___lsb 2
268#define reg_ser_rw_intr_mask___tr_idle___width 1
269#define reg_ser_rw_intr_mask___tr_idle___bit 2
270#define reg_ser_rw_intr_mask___dav___lsb 3
271#define reg_ser_rw_intr_mask___dav___width 1
272#define reg_ser_rw_intr_mask___dav___bit 3
273#define reg_ser_rw_intr_mask_offset 44
274
275/* Register rw_ack_intr, scope ser, type rw */
276#define reg_ser_rw_ack_intr___tr_rdy___lsb 0
277#define reg_ser_rw_ack_intr___tr_rdy___width 1
278#define reg_ser_rw_ack_intr___tr_rdy___bit 0
279#define reg_ser_rw_ack_intr___tr_empty___lsb 1
280#define reg_ser_rw_ack_intr___tr_empty___width 1
281#define reg_ser_rw_ack_intr___tr_empty___bit 1
282#define reg_ser_rw_ack_intr___tr_idle___lsb 2
283#define reg_ser_rw_ack_intr___tr_idle___width 1
284#define reg_ser_rw_ack_intr___tr_idle___bit 2
285#define reg_ser_rw_ack_intr___dav___lsb 3
286#define reg_ser_rw_ack_intr___dav___width 1
287#define reg_ser_rw_ack_intr___dav___bit 3
288#define reg_ser_rw_ack_intr_offset 48
289
290/* Register r_intr, scope ser, type r */
291#define reg_ser_r_intr___tr_rdy___lsb 0
292#define reg_ser_r_intr___tr_rdy___width 1
293#define reg_ser_r_intr___tr_rdy___bit 0
294#define reg_ser_r_intr___tr_empty___lsb 1
295#define reg_ser_r_intr___tr_empty___width 1
296#define reg_ser_r_intr___tr_empty___bit 1
297#define reg_ser_r_intr___tr_idle___lsb 2
298#define reg_ser_r_intr___tr_idle___width 1
299#define reg_ser_r_intr___tr_idle___bit 2
300#define reg_ser_r_intr___dav___lsb 3
301#define reg_ser_r_intr___dav___width 1
302#define reg_ser_r_intr___dav___bit 3
303#define reg_ser_r_intr_offset 52
304
305/* Register r_masked_intr, scope ser, type r */
306#define reg_ser_r_masked_intr___tr_rdy___lsb 0
307#define reg_ser_r_masked_intr___tr_rdy___width 1
308#define reg_ser_r_masked_intr___tr_rdy___bit 0
309#define reg_ser_r_masked_intr___tr_empty___lsb 1
310#define reg_ser_r_masked_intr___tr_empty___width 1
311#define reg_ser_r_masked_intr___tr_empty___bit 1
312#define reg_ser_r_masked_intr___tr_idle___lsb 2
313#define reg_ser_r_masked_intr___tr_idle___width 1
314#define reg_ser_r_masked_intr___tr_idle___bit 2
315#define reg_ser_r_masked_intr___dav___lsb 3
316#define reg_ser_r_masked_intr___dav___width 1
317#define reg_ser_r_masked_intr___dav___bit 3
318#define reg_ser_r_masked_intr_offset 56
319
320
321/* Constants */
322#define regk_ser_active 0x00000000
323#define regk_ser_bits1 0x00000000
324#define regk_ser_bits2 0x00000001
325#define regk_ser_bits7 0x00000001
326#define regk_ser_bits8 0x00000000
327#define regk_ser_del0_5 0x00000000
328#define regk_ser_del1 0x00000001
329#define regk_ser_del1_5 0x00000002
330#define regk_ser_del2 0x00000003
331#define regk_ser_del2_5 0x00000004
332#define regk_ser_del3 0x00000005
333#define regk_ser_del3_5 0x00000006
334#define regk_ser_del4 0x00000007
335#define regk_ser_even 0x00000000
336#define regk_ser_ext 0x00000001
337#define regk_ser_f100 0x00000007
338#define regk_ser_f29_493 0x00000004
339#define regk_ser_f32 0x00000005
340#define regk_ser_f32_768 0x00000006
341#define regk_ser_ignore 0x00000001
342#define regk_ser_inactive 0x00000001
343#define regk_ser_majority 0x00000001
344#define regk_ser_mark 0x00000002
345#define regk_ser_middle 0x00000000
346#define regk_ser_no 0x00000000
347#define regk_ser_odd 0x00000001
348#define regk_ser_off 0x00000000
349#define regk_ser_rw_intr_mask_default 0x00000000
350#define regk_ser_rw_rec_baud_div_default 0x00000000
351#define regk_ser_rw_rec_ctrl_default 0x00010000
352#define regk_ser_rw_tr_baud_div_default 0x00000000
353#define regk_ser_rw_tr_ctrl_default 0x00008000
354#define regk_ser_rw_tr_dma_en_default 0x00000000
355#define regk_ser_rw_xoff_default 0x00000000
356#define regk_ser_space 0x00000003
357#define regk_ser_stop 0x00000000
358#define regk_ser_yes 0x00000001
359#endif /* __ser_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/sser_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/sser_defs_asm.h
new file mode 100644
index 000000000000..27d4d91b3abd
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/sser_defs_asm.h
@@ -0,0 +1,462 @@
1#ifndef __sser_defs_asm_h
2#define __sser_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/syncser/rtl/sser_regs.r
7 * id: sser_regs.r,v 1.24 2005/02/11 14:27:36 gunnard Exp
8 * last modfied: Mon Apr 11 16:09:48 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/sser_defs_asm.h ../../inst/syncser/rtl/sser_regs.r
11 * id: $Id: sser_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope sser, type rw */
57#define reg_sser_rw_cfg___clk_div___lsb 0
58#define reg_sser_rw_cfg___clk_div___width 16
59#define reg_sser_rw_cfg___base_freq___lsb 16
60#define reg_sser_rw_cfg___base_freq___width 3
61#define reg_sser_rw_cfg___gate_clk___lsb 19
62#define reg_sser_rw_cfg___gate_clk___width 1
63#define reg_sser_rw_cfg___gate_clk___bit 19
64#define reg_sser_rw_cfg___clkgate_ctrl___lsb 20
65#define reg_sser_rw_cfg___clkgate_ctrl___width 1
66#define reg_sser_rw_cfg___clkgate_ctrl___bit 20
67#define reg_sser_rw_cfg___clkgate_in___lsb 21
68#define reg_sser_rw_cfg___clkgate_in___width 1
69#define reg_sser_rw_cfg___clkgate_in___bit 21
70#define reg_sser_rw_cfg___clk_dir___lsb 22
71#define reg_sser_rw_cfg___clk_dir___width 1
72#define reg_sser_rw_cfg___clk_dir___bit 22
73#define reg_sser_rw_cfg___clk_od_mode___lsb 23
74#define reg_sser_rw_cfg___clk_od_mode___width 1
75#define reg_sser_rw_cfg___clk_od_mode___bit 23
76#define reg_sser_rw_cfg___out_clk_pol___lsb 24
77#define reg_sser_rw_cfg___out_clk_pol___width 1
78#define reg_sser_rw_cfg___out_clk_pol___bit 24
79#define reg_sser_rw_cfg___out_clk_src___lsb 25
80#define reg_sser_rw_cfg___out_clk_src___width 2
81#define reg_sser_rw_cfg___clk_in_sel___lsb 27
82#define reg_sser_rw_cfg___clk_in_sel___width 1
83#define reg_sser_rw_cfg___clk_in_sel___bit 27
84#define reg_sser_rw_cfg___hold_pol___lsb 28
85#define reg_sser_rw_cfg___hold_pol___width 1
86#define reg_sser_rw_cfg___hold_pol___bit 28
87#define reg_sser_rw_cfg___prepare___lsb 29
88#define reg_sser_rw_cfg___prepare___width 1
89#define reg_sser_rw_cfg___prepare___bit 29
90#define reg_sser_rw_cfg___en___lsb 30
91#define reg_sser_rw_cfg___en___width 1
92#define reg_sser_rw_cfg___en___bit 30
93#define reg_sser_rw_cfg_offset 0
94
95/* Register rw_frm_cfg, scope sser, type rw */
96#define reg_sser_rw_frm_cfg___wordrate___lsb 0
97#define reg_sser_rw_frm_cfg___wordrate___width 10
98#define reg_sser_rw_frm_cfg___rec_delay___lsb 10
99#define reg_sser_rw_frm_cfg___rec_delay___width 3
100#define reg_sser_rw_frm_cfg___tr_delay___lsb 13
101#define reg_sser_rw_frm_cfg___tr_delay___width 3
102#define reg_sser_rw_frm_cfg___early_wend___lsb 16
103#define reg_sser_rw_frm_cfg___early_wend___width 1
104#define reg_sser_rw_frm_cfg___early_wend___bit 16
105#define reg_sser_rw_frm_cfg___level___lsb 17
106#define reg_sser_rw_frm_cfg___level___width 2
107#define reg_sser_rw_frm_cfg___type___lsb 19
108#define reg_sser_rw_frm_cfg___type___width 1
109#define reg_sser_rw_frm_cfg___type___bit 19
110#define reg_sser_rw_frm_cfg___clk_pol___lsb 20
111#define reg_sser_rw_frm_cfg___clk_pol___width 1
112#define reg_sser_rw_frm_cfg___clk_pol___bit 20
113#define reg_sser_rw_frm_cfg___fr_in_rxclk___lsb 21
114#define reg_sser_rw_frm_cfg___fr_in_rxclk___width 1
115#define reg_sser_rw_frm_cfg___fr_in_rxclk___bit 21
116#define reg_sser_rw_frm_cfg___clk_src___lsb 22
117#define reg_sser_rw_frm_cfg___clk_src___width 1
118#define reg_sser_rw_frm_cfg___clk_src___bit 22
119#define reg_sser_rw_frm_cfg___out_off___lsb 23
120#define reg_sser_rw_frm_cfg___out_off___width 1
121#define reg_sser_rw_frm_cfg___out_off___bit 23
122#define reg_sser_rw_frm_cfg___out_on___lsb 24
123#define reg_sser_rw_frm_cfg___out_on___width 1
124#define reg_sser_rw_frm_cfg___out_on___bit 24
125#define reg_sser_rw_frm_cfg___frame_pin_dir___lsb 25
126#define reg_sser_rw_frm_cfg___frame_pin_dir___width 1
127#define reg_sser_rw_frm_cfg___frame_pin_dir___bit 25
128#define reg_sser_rw_frm_cfg___frame_pin_use___lsb 26
129#define reg_sser_rw_frm_cfg___frame_pin_use___width 2
130#define reg_sser_rw_frm_cfg___status_pin_dir___lsb 28
131#define reg_sser_rw_frm_cfg___status_pin_dir___width 1
132#define reg_sser_rw_frm_cfg___status_pin_dir___bit 28
133#define reg_sser_rw_frm_cfg___status_pin_use___lsb 29
134#define reg_sser_rw_frm_cfg___status_pin_use___width 2
135#define reg_sser_rw_frm_cfg_offset 4
136
137/* Register rw_tr_cfg, scope sser, type rw */
138#define reg_sser_rw_tr_cfg___tr_en___lsb 0
139#define reg_sser_rw_tr_cfg___tr_en___width 1
140#define reg_sser_rw_tr_cfg___tr_en___bit 0
141#define reg_sser_rw_tr_cfg___stop___lsb 1
142#define reg_sser_rw_tr_cfg___stop___width 1
143#define reg_sser_rw_tr_cfg___stop___bit 1
144#define reg_sser_rw_tr_cfg___urun_stop___lsb 2
145#define reg_sser_rw_tr_cfg___urun_stop___width 1
146#define reg_sser_rw_tr_cfg___urun_stop___bit 2
147#define reg_sser_rw_tr_cfg___eop_stop___lsb 3
148#define reg_sser_rw_tr_cfg___eop_stop___width 1
149#define reg_sser_rw_tr_cfg___eop_stop___bit 3
150#define reg_sser_rw_tr_cfg___sample_size___lsb 4
151#define reg_sser_rw_tr_cfg___sample_size___width 6
152#define reg_sser_rw_tr_cfg___sh_dir___lsb 10
153#define reg_sser_rw_tr_cfg___sh_dir___width 1
154#define reg_sser_rw_tr_cfg___sh_dir___bit 10
155#define reg_sser_rw_tr_cfg___clk_pol___lsb 11
156#define reg_sser_rw_tr_cfg___clk_pol___width 1
157#define reg_sser_rw_tr_cfg___clk_pol___bit 11
158#define reg_sser_rw_tr_cfg___clk_src___lsb 12
159#define reg_sser_rw_tr_cfg___clk_src___width 1
160#define reg_sser_rw_tr_cfg___clk_src___bit 12
161#define reg_sser_rw_tr_cfg___use_dma___lsb 13
162#define reg_sser_rw_tr_cfg___use_dma___width 1
163#define reg_sser_rw_tr_cfg___use_dma___bit 13
164#define reg_sser_rw_tr_cfg___mode___lsb 14
165#define reg_sser_rw_tr_cfg___mode___width 2
166#define reg_sser_rw_tr_cfg___frm_src___lsb 16
167#define reg_sser_rw_tr_cfg___frm_src___width 1
168#define reg_sser_rw_tr_cfg___frm_src___bit 16
169#define reg_sser_rw_tr_cfg___use60958___lsb 17
170#define reg_sser_rw_tr_cfg___use60958___width 1
171#define reg_sser_rw_tr_cfg___use60958___bit 17
172#define reg_sser_rw_tr_cfg___iec60958_ckdiv___lsb 18
173#define reg_sser_rw_tr_cfg___iec60958_ckdiv___width 2
174#define reg_sser_rw_tr_cfg___rate_ctrl___lsb 20
175#define reg_sser_rw_tr_cfg___rate_ctrl___width 1
176#define reg_sser_rw_tr_cfg___rate_ctrl___bit 20
177#define reg_sser_rw_tr_cfg___use_md___lsb 21
178#define reg_sser_rw_tr_cfg___use_md___width 1
179#define reg_sser_rw_tr_cfg___use_md___bit 21
180#define reg_sser_rw_tr_cfg___dual_i2s___lsb 22
181#define reg_sser_rw_tr_cfg___dual_i2s___width 1
182#define reg_sser_rw_tr_cfg___dual_i2s___bit 22
183#define reg_sser_rw_tr_cfg___data_pin_use___lsb 23
184#define reg_sser_rw_tr_cfg___data_pin_use___width 2
185#define reg_sser_rw_tr_cfg___od_mode___lsb 25
186#define reg_sser_rw_tr_cfg___od_mode___width 1
187#define reg_sser_rw_tr_cfg___od_mode___bit 25
188#define reg_sser_rw_tr_cfg___bulk_wspace___lsb 26
189#define reg_sser_rw_tr_cfg___bulk_wspace___width 2
190#define reg_sser_rw_tr_cfg_offset 8
191
192/* Register rw_rec_cfg, scope sser, type rw */
193#define reg_sser_rw_rec_cfg___rec_en___lsb 0
194#define reg_sser_rw_rec_cfg___rec_en___width 1
195#define reg_sser_rw_rec_cfg___rec_en___bit 0
196#define reg_sser_rw_rec_cfg___force_eop___lsb 1
197#define reg_sser_rw_rec_cfg___force_eop___width 1
198#define reg_sser_rw_rec_cfg___force_eop___bit 1
199#define reg_sser_rw_rec_cfg___stop___lsb 2
200#define reg_sser_rw_rec_cfg___stop___width 1
201#define reg_sser_rw_rec_cfg___stop___bit 2
202#define reg_sser_rw_rec_cfg___orun_stop___lsb 3
203#define reg_sser_rw_rec_cfg___orun_stop___width 1
204#define reg_sser_rw_rec_cfg___orun_stop___bit 3
205#define reg_sser_rw_rec_cfg___eop_stop___lsb 4
206#define reg_sser_rw_rec_cfg___eop_stop___width 1
207#define reg_sser_rw_rec_cfg___eop_stop___bit 4
208#define reg_sser_rw_rec_cfg___sample_size___lsb 5
209#define reg_sser_rw_rec_cfg___sample_size___width 6
210#define reg_sser_rw_rec_cfg___sh_dir___lsb 11
211#define reg_sser_rw_rec_cfg___sh_dir___width 1
212#define reg_sser_rw_rec_cfg___sh_dir___bit 11
213#define reg_sser_rw_rec_cfg___clk_pol___lsb 12
214#define reg_sser_rw_rec_cfg___clk_pol___width 1
215#define reg_sser_rw_rec_cfg___clk_pol___bit 12
216#define reg_sser_rw_rec_cfg___clk_src___lsb 13
217#define reg_sser_rw_rec_cfg___clk_src___width 1
218#define reg_sser_rw_rec_cfg___clk_src___bit 13
219#define reg_sser_rw_rec_cfg___use_dma___lsb 14
220#define reg_sser_rw_rec_cfg___use_dma___width 1
221#define reg_sser_rw_rec_cfg___use_dma___bit 14
222#define reg_sser_rw_rec_cfg___mode___lsb 15
223#define reg_sser_rw_rec_cfg___mode___width 2
224#define reg_sser_rw_rec_cfg___frm_src___lsb 17
225#define reg_sser_rw_rec_cfg___frm_src___width 2
226#define reg_sser_rw_rec_cfg___use60958___lsb 19
227#define reg_sser_rw_rec_cfg___use60958___width 1
228#define reg_sser_rw_rec_cfg___use60958___bit 19
229#define reg_sser_rw_rec_cfg___iec60958_ui_len___lsb 20
230#define reg_sser_rw_rec_cfg___iec60958_ui_len___width 5
231#define reg_sser_rw_rec_cfg___slave2_en___lsb 25
232#define reg_sser_rw_rec_cfg___slave2_en___width 1
233#define reg_sser_rw_rec_cfg___slave2_en___bit 25
234#define reg_sser_rw_rec_cfg___slave3_en___lsb 26
235#define reg_sser_rw_rec_cfg___slave3_en___width 1
236#define reg_sser_rw_rec_cfg___slave3_en___bit 26
237#define reg_sser_rw_rec_cfg___fifo_thr___lsb 27
238#define reg_sser_rw_rec_cfg___fifo_thr___width 2
239#define reg_sser_rw_rec_cfg_offset 12
240
241/* Register rw_tr_data, scope sser, type rw */
242#define reg_sser_rw_tr_data___data___lsb 0
243#define reg_sser_rw_tr_data___data___width 16
244#define reg_sser_rw_tr_data___md___lsb 16
245#define reg_sser_rw_tr_data___md___width 1
246#define reg_sser_rw_tr_data___md___bit 16
247#define reg_sser_rw_tr_data_offset 16
248
249/* Register r_rec_data, scope sser, type r */
250#define reg_sser_r_rec_data___data___lsb 0
251#define reg_sser_r_rec_data___data___width 16
252#define reg_sser_r_rec_data___md___lsb 16
253#define reg_sser_r_rec_data___md___width 1
254#define reg_sser_r_rec_data___md___bit 16
255#define reg_sser_r_rec_data___ext_clk___lsb 17
256#define reg_sser_r_rec_data___ext_clk___width 1
257#define reg_sser_r_rec_data___ext_clk___bit 17
258#define reg_sser_r_rec_data___status_in___lsb 18
259#define reg_sser_r_rec_data___status_in___width 1
260#define reg_sser_r_rec_data___status_in___bit 18
261#define reg_sser_r_rec_data___frame_in___lsb 19
262#define reg_sser_r_rec_data___frame_in___width 1
263#define reg_sser_r_rec_data___frame_in___bit 19
264#define reg_sser_r_rec_data___din___lsb 20
265#define reg_sser_r_rec_data___din___width 1
266#define reg_sser_r_rec_data___din___bit 20
267#define reg_sser_r_rec_data___data_in___lsb 21
268#define reg_sser_r_rec_data___data_in___width 1
269#define reg_sser_r_rec_data___data_in___bit 21
270#define reg_sser_r_rec_data___clk_in___lsb 22
271#define reg_sser_r_rec_data___clk_in___width 1
272#define reg_sser_r_rec_data___clk_in___bit 22
273#define reg_sser_r_rec_data_offset 20
274
275/* Register rw_extra, scope sser, type rw */
276#define reg_sser_rw_extra___clkoff_cycles___lsb 0
277#define reg_sser_rw_extra___clkoff_cycles___width 20
278#define reg_sser_rw_extra___clkoff_en___lsb 20
279#define reg_sser_rw_extra___clkoff_en___width 1
280#define reg_sser_rw_extra___clkoff_en___bit 20
281#define reg_sser_rw_extra___clkon_en___lsb 21
282#define reg_sser_rw_extra___clkon_en___width 1
283#define reg_sser_rw_extra___clkon_en___bit 21
284#define reg_sser_rw_extra___dout_delay___lsb 22
285#define reg_sser_rw_extra___dout_delay___width 5
286#define reg_sser_rw_extra_offset 24
287
288/* Register rw_intr_mask, scope sser, type rw */
289#define reg_sser_rw_intr_mask___trdy___lsb 0
290#define reg_sser_rw_intr_mask___trdy___width 1
291#define reg_sser_rw_intr_mask___trdy___bit 0
292#define reg_sser_rw_intr_mask___rdav___lsb 1
293#define reg_sser_rw_intr_mask___rdav___width 1
294#define reg_sser_rw_intr_mask___rdav___bit 1
295#define reg_sser_rw_intr_mask___tidle___lsb 2
296#define reg_sser_rw_intr_mask___tidle___width 1
297#define reg_sser_rw_intr_mask___tidle___bit 2
298#define reg_sser_rw_intr_mask___rstop___lsb 3
299#define reg_sser_rw_intr_mask___rstop___width 1
300#define reg_sser_rw_intr_mask___rstop___bit 3
301#define reg_sser_rw_intr_mask___urun___lsb 4
302#define reg_sser_rw_intr_mask___urun___width 1
303#define reg_sser_rw_intr_mask___urun___bit 4
304#define reg_sser_rw_intr_mask___orun___lsb 5
305#define reg_sser_rw_intr_mask___orun___width 1
306#define reg_sser_rw_intr_mask___orun___bit 5
307#define reg_sser_rw_intr_mask___md_rec___lsb 6
308#define reg_sser_rw_intr_mask___md_rec___width 1
309#define reg_sser_rw_intr_mask___md_rec___bit 6
310#define reg_sser_rw_intr_mask___md_sent___lsb 7
311#define reg_sser_rw_intr_mask___md_sent___width 1
312#define reg_sser_rw_intr_mask___md_sent___bit 7
313#define reg_sser_rw_intr_mask___r958err___lsb 8
314#define reg_sser_rw_intr_mask___r958err___width 1
315#define reg_sser_rw_intr_mask___r958err___bit 8
316#define reg_sser_rw_intr_mask_offset 28
317
318/* Register rw_ack_intr, scope sser, type rw */
319#define reg_sser_rw_ack_intr___trdy___lsb 0
320#define reg_sser_rw_ack_intr___trdy___width 1
321#define reg_sser_rw_ack_intr___trdy___bit 0
322#define reg_sser_rw_ack_intr___rdav___lsb 1
323#define reg_sser_rw_ack_intr___rdav___width 1
324#define reg_sser_rw_ack_intr___rdav___bit 1
325#define reg_sser_rw_ack_intr___tidle___lsb 2
326#define reg_sser_rw_ack_intr___tidle___width 1
327#define reg_sser_rw_ack_intr___tidle___bit 2
328#define reg_sser_rw_ack_intr___rstop___lsb 3
329#define reg_sser_rw_ack_intr___rstop___width 1
330#define reg_sser_rw_ack_intr___rstop___bit 3
331#define reg_sser_rw_ack_intr___urun___lsb 4
332#define reg_sser_rw_ack_intr___urun___width 1
333#define reg_sser_rw_ack_intr___urun___bit 4
334#define reg_sser_rw_ack_intr___orun___lsb 5
335#define reg_sser_rw_ack_intr___orun___width 1
336#define reg_sser_rw_ack_intr___orun___bit 5
337#define reg_sser_rw_ack_intr___md_rec___lsb 6
338#define reg_sser_rw_ack_intr___md_rec___width 1
339#define reg_sser_rw_ack_intr___md_rec___bit 6
340#define reg_sser_rw_ack_intr___md_sent___lsb 7
341#define reg_sser_rw_ack_intr___md_sent___width 1
342#define reg_sser_rw_ack_intr___md_sent___bit 7
343#define reg_sser_rw_ack_intr___r958err___lsb 8
344#define reg_sser_rw_ack_intr___r958err___width 1
345#define reg_sser_rw_ack_intr___r958err___bit 8
346#define reg_sser_rw_ack_intr_offset 32
347
348/* Register r_intr, scope sser, type r */
349#define reg_sser_r_intr___trdy___lsb 0
350#define reg_sser_r_intr___trdy___width 1
351#define reg_sser_r_intr___trdy___bit 0
352#define reg_sser_r_intr___rdav___lsb 1
353#define reg_sser_r_intr___rdav___width 1
354#define reg_sser_r_intr___rdav___bit 1
355#define reg_sser_r_intr___tidle___lsb 2
356#define reg_sser_r_intr___tidle___width 1
357#define reg_sser_r_intr___tidle___bit 2
358#define reg_sser_r_intr___rstop___lsb 3
359#define reg_sser_r_intr___rstop___width 1
360#define reg_sser_r_intr___rstop___bit 3
361#define reg_sser_r_intr___urun___lsb 4
362#define reg_sser_r_intr___urun___width 1
363#define reg_sser_r_intr___urun___bit 4
364#define reg_sser_r_intr___orun___lsb 5
365#define reg_sser_r_intr___orun___width 1
366#define reg_sser_r_intr___orun___bit 5
367#define reg_sser_r_intr___md_rec___lsb 6
368#define reg_sser_r_intr___md_rec___width 1
369#define reg_sser_r_intr___md_rec___bit 6
370#define reg_sser_r_intr___md_sent___lsb 7
371#define reg_sser_r_intr___md_sent___width 1
372#define reg_sser_r_intr___md_sent___bit 7
373#define reg_sser_r_intr___r958err___lsb 8
374#define reg_sser_r_intr___r958err___width 1
375#define reg_sser_r_intr___r958err___bit 8
376#define reg_sser_r_intr_offset 36
377
378/* Register r_masked_intr, scope sser, type r */
379#define reg_sser_r_masked_intr___trdy___lsb 0
380#define reg_sser_r_masked_intr___trdy___width 1
381#define reg_sser_r_masked_intr___trdy___bit 0
382#define reg_sser_r_masked_intr___rdav___lsb 1
383#define reg_sser_r_masked_intr___rdav___width 1
384#define reg_sser_r_masked_intr___rdav___bit 1
385#define reg_sser_r_masked_intr___tidle___lsb 2
386#define reg_sser_r_masked_intr___tidle___width 1
387#define reg_sser_r_masked_intr___tidle___bit 2
388#define reg_sser_r_masked_intr___rstop___lsb 3
389#define reg_sser_r_masked_intr___rstop___width 1
390#define reg_sser_r_masked_intr___rstop___bit 3
391#define reg_sser_r_masked_intr___urun___lsb 4
392#define reg_sser_r_masked_intr___urun___width 1
393#define reg_sser_r_masked_intr___urun___bit 4
394#define reg_sser_r_masked_intr___orun___lsb 5
395#define reg_sser_r_masked_intr___orun___width 1
396#define reg_sser_r_masked_intr___orun___bit 5
397#define reg_sser_r_masked_intr___md_rec___lsb 6
398#define reg_sser_r_masked_intr___md_rec___width 1
399#define reg_sser_r_masked_intr___md_rec___bit 6
400#define reg_sser_r_masked_intr___md_sent___lsb 7
401#define reg_sser_r_masked_intr___md_sent___width 1
402#define reg_sser_r_masked_intr___md_sent___bit 7
403#define reg_sser_r_masked_intr___r958err___lsb 8
404#define reg_sser_r_masked_intr___r958err___width 1
405#define reg_sser_r_masked_intr___r958err___bit 8
406#define reg_sser_r_masked_intr_offset 40
407
408
409/* Constants */
410#define regk_sser_both 0x00000002
411#define regk_sser_bulk 0x00000001
412#define regk_sser_clk100 0x00000000
413#define regk_sser_clk_in 0x00000000
414#define regk_sser_const0 0x00000003
415#define regk_sser_dout 0x00000002
416#define regk_sser_edge 0x00000000
417#define regk_sser_ext 0x00000001
418#define regk_sser_ext_clk 0x00000001
419#define regk_sser_f100 0x00000000
420#define regk_sser_f29_493 0x00000004
421#define regk_sser_f32 0x00000005
422#define regk_sser_f32_768 0x00000006
423#define regk_sser_frm 0x00000003
424#define regk_sser_gio0 0x00000000
425#define regk_sser_gio1 0x00000001
426#define regk_sser_hispeed 0x00000001
427#define regk_sser_hold 0x00000002
428#define regk_sser_in 0x00000000
429#define regk_sser_inf 0x00000003
430#define regk_sser_intern 0x00000000
431#define regk_sser_intern_clk 0x00000001
432#define regk_sser_intern_tb 0x00000000
433#define regk_sser_iso 0x00000000
434#define regk_sser_level 0x00000001
435#define regk_sser_lospeed 0x00000000
436#define regk_sser_lsbfirst 0x00000000
437#define regk_sser_msbfirst 0x00000001
438#define regk_sser_neg 0x00000001
439#define regk_sser_neg_lo 0x00000000
440#define regk_sser_no 0x00000000
441#define regk_sser_no_clk 0x00000007
442#define regk_sser_nojitter 0x00000002
443#define regk_sser_out 0x00000001
444#define regk_sser_pos 0x00000000
445#define regk_sser_pos_hi 0x00000001
446#define regk_sser_rec 0x00000000
447#define regk_sser_rw_cfg_default 0x00000000
448#define regk_sser_rw_extra_default 0x00000000
449#define regk_sser_rw_frm_cfg_default 0x00000000
450#define regk_sser_rw_intr_mask_default 0x00000000
451#define regk_sser_rw_rec_cfg_default 0x00000000
452#define regk_sser_rw_tr_cfg_default 0x01800000
453#define regk_sser_rw_tr_data_default 0x00000000
454#define regk_sser_thr16 0x00000001
455#define regk_sser_thr32 0x00000002
456#define regk_sser_thr8 0x00000000
457#define regk_sser_tr 0x00000001
458#define regk_sser_ts_out 0x00000003
459#define regk_sser_tx_bulk 0x00000002
460#define regk_sser_wiresave 0x00000002
461#define regk_sser_yes 0x00000001
462#endif /* __sser_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/strcop_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/strcop_defs_asm.h
new file mode 100644
index 000000000000..55083e6aec93
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/strcop_defs_asm.h
@@ -0,0 +1,84 @@
1#ifndef __strcop_defs_asm_h
2#define __strcop_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/strcop/rtl/strcop_regs.r
7 * id: strcop_regs.r,v 1.5 2003/10/15 12:09:45 kriskn Exp
8 * last modfied: Mon Apr 11 16:09:38 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/strcop_defs_asm.h ../../inst/strcop/rtl/strcop_regs.r
11 * id: $Id: strcop_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope strcop, type rw */
57#define reg_strcop_rw_cfg___td3___lsb 0
58#define reg_strcop_rw_cfg___td3___width 1
59#define reg_strcop_rw_cfg___td3___bit 0
60#define reg_strcop_rw_cfg___td2___lsb 1
61#define reg_strcop_rw_cfg___td2___width 1
62#define reg_strcop_rw_cfg___td2___bit 1
63#define reg_strcop_rw_cfg___td1___lsb 2
64#define reg_strcop_rw_cfg___td1___width 1
65#define reg_strcop_rw_cfg___td1___bit 2
66#define reg_strcop_rw_cfg___ipend___lsb 3
67#define reg_strcop_rw_cfg___ipend___width 1
68#define reg_strcop_rw_cfg___ipend___bit 3
69#define reg_strcop_rw_cfg___ignore_sync___lsb 4
70#define reg_strcop_rw_cfg___ignore_sync___width 1
71#define reg_strcop_rw_cfg___ignore_sync___bit 4
72#define reg_strcop_rw_cfg___en___lsb 5
73#define reg_strcop_rw_cfg___en___width 1
74#define reg_strcop_rw_cfg___en___bit 5
75#define reg_strcop_rw_cfg_offset 0
76
77
78/* Constants */
79#define regk_strcop_big 0x00000001
80#define regk_strcop_d 0x00000001
81#define regk_strcop_e 0x00000000
82#define regk_strcop_little 0x00000000
83#define regk_strcop_rw_cfg_default 0x00000002
84#endif /* __strcop_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/strmux_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/strmux_defs_asm.h
new file mode 100644
index 000000000000..69b299920f71
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/strmux_defs_asm.h
@@ -0,0 +1,100 @@
1#ifndef __strmux_defs_asm_h
2#define __strmux_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/strmux/rtl/guinness/strmux_regs.r
7 * id: strmux_regs.r,v 1.10 2005/02/10 10:10:46 perz Exp
8 * last modfied: Mon Apr 11 16:09:43 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/strmux_defs_asm.h ../../inst/strmux/rtl/guinness/strmux_regs.r
11 * id: $Id: strmux_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope strmux, type rw */
57#define reg_strmux_rw_cfg___dma0___lsb 0
58#define reg_strmux_rw_cfg___dma0___width 3
59#define reg_strmux_rw_cfg___dma1___lsb 3
60#define reg_strmux_rw_cfg___dma1___width 3
61#define reg_strmux_rw_cfg___dma2___lsb 6
62#define reg_strmux_rw_cfg___dma2___width 3
63#define reg_strmux_rw_cfg___dma3___lsb 9
64#define reg_strmux_rw_cfg___dma3___width 3
65#define reg_strmux_rw_cfg___dma4___lsb 12
66#define reg_strmux_rw_cfg___dma4___width 3
67#define reg_strmux_rw_cfg___dma5___lsb 15
68#define reg_strmux_rw_cfg___dma5___width 3
69#define reg_strmux_rw_cfg___dma6___lsb 18
70#define reg_strmux_rw_cfg___dma6___width 3
71#define reg_strmux_rw_cfg___dma7___lsb 21
72#define reg_strmux_rw_cfg___dma7___width 3
73#define reg_strmux_rw_cfg___dma8___lsb 24
74#define reg_strmux_rw_cfg___dma8___width 3
75#define reg_strmux_rw_cfg___dma9___lsb 27
76#define reg_strmux_rw_cfg___dma9___width 3
77#define reg_strmux_rw_cfg_offset 0
78
79
80/* Constants */
81#define regk_strmux_ata 0x00000003
82#define regk_strmux_eth0 0x00000001
83#define regk_strmux_eth1 0x00000004
84#define regk_strmux_ext0 0x00000001
85#define regk_strmux_ext1 0x00000001
86#define regk_strmux_ext2 0x00000001
87#define regk_strmux_ext3 0x00000001
88#define regk_strmux_iop0 0x00000002
89#define regk_strmux_iop1 0x00000001
90#define regk_strmux_off 0x00000000
91#define regk_strmux_p21 0x00000004
92#define regk_strmux_rw_cfg_default 0x00000000
93#define regk_strmux_ser0 0x00000002
94#define regk_strmux_ser1 0x00000002
95#define regk_strmux_ser2 0x00000004
96#define regk_strmux_ser3 0x00000003
97#define regk_strmux_sser0 0x00000003
98#define regk_strmux_sser1 0x00000003
99#define regk_strmux_strcop 0x00000002
100#endif /* __strmux_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/asm/timer_defs_asm.h b/include/asm-cris/arch-v32/hwregs/asm/timer_defs_asm.h
new file mode 100644
index 000000000000..43146021fc16
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/asm/timer_defs_asm.h
@@ -0,0 +1,229 @@
1#ifndef __timer_defs_asm_h
2#define __timer_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/timer/rtl/timer_regs.r
7 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:53 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/timer_defs_asm.h ../../inst/timer/rtl/timer_regs.r
11 * id: $Id: timer_defs_asm.h,v 1.1 2005/04/24 18:31:04 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_tmr0_div, scope timer, type rw */
57#define reg_timer_rw_tmr0_div_offset 0
58
59/* Register r_tmr0_data, scope timer, type r */
60#define reg_timer_r_tmr0_data_offset 4
61
62/* Register rw_tmr0_ctrl, scope timer, type rw */
63#define reg_timer_rw_tmr0_ctrl___op___lsb 0
64#define reg_timer_rw_tmr0_ctrl___op___width 2
65#define reg_timer_rw_tmr0_ctrl___freq___lsb 2
66#define reg_timer_rw_tmr0_ctrl___freq___width 3
67#define reg_timer_rw_tmr0_ctrl_offset 8
68
69/* Register rw_tmr1_div, scope timer, type rw */
70#define reg_timer_rw_tmr1_div_offset 16
71
72/* Register r_tmr1_data, scope timer, type r */
73#define reg_timer_r_tmr1_data_offset 20
74
75/* Register rw_tmr1_ctrl, scope timer, type rw */
76#define reg_timer_rw_tmr1_ctrl___op___lsb 0
77#define reg_timer_rw_tmr1_ctrl___op___width 2
78#define reg_timer_rw_tmr1_ctrl___freq___lsb 2
79#define reg_timer_rw_tmr1_ctrl___freq___width 3
80#define reg_timer_rw_tmr1_ctrl_offset 24
81
82/* Register rs_cnt_data, scope timer, type rs */
83#define reg_timer_rs_cnt_data___tmr___lsb 0
84#define reg_timer_rs_cnt_data___tmr___width 24
85#define reg_timer_rs_cnt_data___cnt___lsb 24
86#define reg_timer_rs_cnt_data___cnt___width 8
87#define reg_timer_rs_cnt_data_offset 32
88
89/* Register r_cnt_data, scope timer, type r */
90#define reg_timer_r_cnt_data___tmr___lsb 0
91#define reg_timer_r_cnt_data___tmr___width 24
92#define reg_timer_r_cnt_data___cnt___lsb 24
93#define reg_timer_r_cnt_data___cnt___width 8
94#define reg_timer_r_cnt_data_offset 36
95
96/* Register rw_cnt_cfg, scope timer, type rw */
97#define reg_timer_rw_cnt_cfg___clk___lsb 0
98#define reg_timer_rw_cnt_cfg___clk___width 2
99#define reg_timer_rw_cnt_cfg_offset 40
100
101/* Register rw_trig, scope timer, type rw */
102#define reg_timer_rw_trig_offset 48
103
104/* Register rw_trig_cfg, scope timer, type rw */
105#define reg_timer_rw_trig_cfg___tmr___lsb 0
106#define reg_timer_rw_trig_cfg___tmr___width 2
107#define reg_timer_rw_trig_cfg_offset 52
108
109/* Register r_time, scope timer, type r */
110#define reg_timer_r_time_offset 56
111
112/* Register rw_out, scope timer, type rw */
113#define reg_timer_rw_out___tmr___lsb 0
114#define reg_timer_rw_out___tmr___width 2
115#define reg_timer_rw_out_offset 60
116
117/* Register rw_wd_ctrl, scope timer, type rw */
118#define reg_timer_rw_wd_ctrl___cnt___lsb 0
119#define reg_timer_rw_wd_ctrl___cnt___width 8
120#define reg_timer_rw_wd_ctrl___cmd___lsb 8
121#define reg_timer_rw_wd_ctrl___cmd___width 1
122#define reg_timer_rw_wd_ctrl___cmd___bit 8
123#define reg_timer_rw_wd_ctrl___key___lsb 9
124#define reg_timer_rw_wd_ctrl___key___width 7
125#define reg_timer_rw_wd_ctrl_offset 64
126
127/* Register r_wd_stat, scope timer, type r */
128#define reg_timer_r_wd_stat___cnt___lsb 0
129#define reg_timer_r_wd_stat___cnt___width 8
130#define reg_timer_r_wd_stat___cmd___lsb 8
131#define reg_timer_r_wd_stat___cmd___width 1
132#define reg_timer_r_wd_stat___cmd___bit 8
133#define reg_timer_r_wd_stat_offset 68
134
135/* Register rw_intr_mask, scope timer, type rw */
136#define reg_timer_rw_intr_mask___tmr0___lsb 0
137#define reg_timer_rw_intr_mask___tmr0___width 1
138#define reg_timer_rw_intr_mask___tmr0___bit 0
139#define reg_timer_rw_intr_mask___tmr1___lsb 1
140#define reg_timer_rw_intr_mask___tmr1___width 1
141#define reg_timer_rw_intr_mask___tmr1___bit 1
142#define reg_timer_rw_intr_mask___cnt___lsb 2
143#define reg_timer_rw_intr_mask___cnt___width 1
144#define reg_timer_rw_intr_mask___cnt___bit 2
145#define reg_timer_rw_intr_mask___trig___lsb 3
146#define reg_timer_rw_intr_mask___trig___width 1
147#define reg_timer_rw_intr_mask___trig___bit 3
148#define reg_timer_rw_intr_mask_offset 72
149
150/* Register rw_ack_intr, scope timer, type rw */
151#define reg_timer_rw_ack_intr___tmr0___lsb 0
152#define reg_timer_rw_ack_intr___tmr0___width 1
153#define reg_timer_rw_ack_intr___tmr0___bit 0
154#define reg_timer_rw_ack_intr___tmr1___lsb 1
155#define reg_timer_rw_ack_intr___tmr1___width 1
156#define reg_timer_rw_ack_intr___tmr1___bit 1
157#define reg_timer_rw_ack_intr___cnt___lsb 2
158#define reg_timer_rw_ack_intr___cnt___width 1
159#define reg_timer_rw_ack_intr___cnt___bit 2
160#define reg_timer_rw_ack_intr___trig___lsb 3
161#define reg_timer_rw_ack_intr___trig___width 1
162#define reg_timer_rw_ack_intr___trig___bit 3
163#define reg_timer_rw_ack_intr_offset 76
164
165/* Register r_intr, scope timer, type r */
166#define reg_timer_r_intr___tmr0___lsb 0
167#define reg_timer_r_intr___tmr0___width 1
168#define reg_timer_r_intr___tmr0___bit 0
169#define reg_timer_r_intr___tmr1___lsb 1
170#define reg_timer_r_intr___tmr1___width 1
171#define reg_timer_r_intr___tmr1___bit 1
172#define reg_timer_r_intr___cnt___lsb 2
173#define reg_timer_r_intr___cnt___width 1
174#define reg_timer_r_intr___cnt___bit 2
175#define reg_timer_r_intr___trig___lsb 3
176#define reg_timer_r_intr___trig___width 1
177#define reg_timer_r_intr___trig___bit 3
178#define reg_timer_r_intr_offset 80
179
180/* Register r_masked_intr, scope timer, type r */
181#define reg_timer_r_masked_intr___tmr0___lsb 0
182#define reg_timer_r_masked_intr___tmr0___width 1
183#define reg_timer_r_masked_intr___tmr0___bit 0
184#define reg_timer_r_masked_intr___tmr1___lsb 1
185#define reg_timer_r_masked_intr___tmr1___width 1
186#define reg_timer_r_masked_intr___tmr1___bit 1
187#define reg_timer_r_masked_intr___cnt___lsb 2
188#define reg_timer_r_masked_intr___cnt___width 1
189#define reg_timer_r_masked_intr___cnt___bit 2
190#define reg_timer_r_masked_intr___trig___lsb 3
191#define reg_timer_r_masked_intr___trig___width 1
192#define reg_timer_r_masked_intr___trig___bit 3
193#define reg_timer_r_masked_intr_offset 84
194
195/* Register rw_test, scope timer, type rw */
196#define reg_timer_rw_test___dis___lsb 0
197#define reg_timer_rw_test___dis___width 1
198#define reg_timer_rw_test___dis___bit 0
199#define reg_timer_rw_test___en___lsb 1
200#define reg_timer_rw_test___en___width 1
201#define reg_timer_rw_test___en___bit 1
202#define reg_timer_rw_test_offset 88
203
204
205/* Constants */
206#define regk_timer_ext 0x00000001
207#define regk_timer_f100 0x00000007
208#define regk_timer_f29_493 0x00000004
209#define regk_timer_f32 0x00000005
210#define regk_timer_f32_768 0x00000006
211#define regk_timer_hold 0x00000001
212#define regk_timer_ld 0x00000000
213#define regk_timer_no 0x00000000
214#define regk_timer_off 0x00000000
215#define regk_timer_run 0x00000002
216#define regk_timer_rw_cnt_cfg_default 0x00000000
217#define regk_timer_rw_intr_mask_default 0x00000000
218#define regk_timer_rw_out_default 0x00000000
219#define regk_timer_rw_test_default 0x00000000
220#define regk_timer_rw_tmr0_ctrl_default 0x00000000
221#define regk_timer_rw_tmr1_ctrl_default 0x00000000
222#define regk_timer_rw_trig_cfg_default 0x00000000
223#define regk_timer_start 0x00000001
224#define regk_timer_stop 0x00000000
225#define regk_timer_time 0x00000001
226#define regk_timer_tmr0 0x00000002
227#define regk_timer_tmr1 0x00000003
228#define regk_timer_yes 0x00000001
229#endif /* __timer_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/ata_defs.h b/include/asm-cris/arch-v32/hwregs/ata_defs.h
new file mode 100644
index 000000000000..43b6643ff0d3
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/ata_defs.h
@@ -0,0 +1,222 @@
1#ifndef __ata_defs_h
2#define __ata_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/ata/rtl/ata_regs.r
7 * id: ata_regs.r,v 1.11 2005/02/09 08:27:36 kriskn Exp
8 * last modfied: Mon Apr 11 16:06:25 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile ata_defs.h ../../inst/ata/rtl/ata_regs.r
11 * id: $Id: ata_defs.h,v 1.7 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope ata */
86
87/* Register rw_ctrl0, scope ata, type rw */
88typedef struct {
89 unsigned int pio_hold : 6;
90 unsigned int pio_strb : 6;
91 unsigned int pio_setup : 6;
92 unsigned int dma_hold : 6;
93 unsigned int dma_strb : 6;
94 unsigned int rst : 1;
95 unsigned int en : 1;
96} reg_ata_rw_ctrl0;
97#define REG_RD_ADDR_ata_rw_ctrl0 12
98#define REG_WR_ADDR_ata_rw_ctrl0 12
99
100/* Register rw_ctrl1, scope ata, type rw */
101typedef struct {
102 unsigned int udma_tcyc : 4;
103 unsigned int udma_tdvs : 4;
104 unsigned int dummy1 : 24;
105} reg_ata_rw_ctrl1;
106#define REG_RD_ADDR_ata_rw_ctrl1 16
107#define REG_WR_ADDR_ata_rw_ctrl1 16
108
109/* Register rw_ctrl2, scope ata, type rw */
110typedef struct {
111 unsigned int data : 16;
112 unsigned int dummy1 : 3;
113 unsigned int dma_size : 1;
114 unsigned int multi : 1;
115 unsigned int hsh : 2;
116 unsigned int trf_mode : 1;
117 unsigned int rw : 1;
118 unsigned int addr : 3;
119 unsigned int cs0 : 1;
120 unsigned int cs1 : 1;
121 unsigned int sel : 2;
122} reg_ata_rw_ctrl2;
123#define REG_RD_ADDR_ata_rw_ctrl2 0
124#define REG_WR_ADDR_ata_rw_ctrl2 0
125
126/* Register rs_stat_data, scope ata, type rs */
127typedef struct {
128 unsigned int data : 16;
129 unsigned int dav : 1;
130 unsigned int busy : 1;
131 unsigned int dummy1 : 14;
132} reg_ata_rs_stat_data;
133#define REG_RD_ADDR_ata_rs_stat_data 4
134
135/* Register r_stat_data, scope ata, type r */
136typedef struct {
137 unsigned int data : 16;
138 unsigned int dav : 1;
139 unsigned int busy : 1;
140 unsigned int dummy1 : 14;
141} reg_ata_r_stat_data;
142#define REG_RD_ADDR_ata_r_stat_data 8
143
144/* Register rw_trf_cnt, scope ata, type rw */
145typedef struct {
146 unsigned int cnt : 17;
147 unsigned int dummy1 : 15;
148} reg_ata_rw_trf_cnt;
149#define REG_RD_ADDR_ata_rw_trf_cnt 20
150#define REG_WR_ADDR_ata_rw_trf_cnt 20
151
152/* Register r_stat_misc, scope ata, type r */
153typedef struct {
154 unsigned int crc : 16;
155 unsigned int dummy1 : 16;
156} reg_ata_r_stat_misc;
157#define REG_RD_ADDR_ata_r_stat_misc 24
158
159/* Register rw_intr_mask, scope ata, type rw */
160typedef struct {
161 unsigned int bus0 : 1;
162 unsigned int bus1 : 1;
163 unsigned int bus2 : 1;
164 unsigned int bus3 : 1;
165 unsigned int dummy1 : 28;
166} reg_ata_rw_intr_mask;
167#define REG_RD_ADDR_ata_rw_intr_mask 28
168#define REG_WR_ADDR_ata_rw_intr_mask 28
169
170/* Register rw_ack_intr, scope ata, type rw */
171typedef struct {
172 unsigned int bus0 : 1;
173 unsigned int bus1 : 1;
174 unsigned int bus2 : 1;
175 unsigned int bus3 : 1;
176 unsigned int dummy1 : 28;
177} reg_ata_rw_ack_intr;
178#define REG_RD_ADDR_ata_rw_ack_intr 32
179#define REG_WR_ADDR_ata_rw_ack_intr 32
180
181/* Register r_intr, scope ata, type r */
182typedef struct {
183 unsigned int bus0 : 1;
184 unsigned int bus1 : 1;
185 unsigned int bus2 : 1;
186 unsigned int bus3 : 1;
187 unsigned int dummy1 : 28;
188} reg_ata_r_intr;
189#define REG_RD_ADDR_ata_r_intr 36
190
191/* Register r_masked_intr, scope ata, type r */
192typedef struct {
193 unsigned int bus0 : 1;
194 unsigned int bus1 : 1;
195 unsigned int bus2 : 1;
196 unsigned int bus3 : 1;
197 unsigned int dummy1 : 28;
198} reg_ata_r_masked_intr;
199#define REG_RD_ADDR_ata_r_masked_intr 40
200
201
202/* Constants */
203enum {
204 regk_ata_active = 0x00000001,
205 regk_ata_byte = 0x00000001,
206 regk_ata_data = 0x00000001,
207 regk_ata_dma = 0x00000001,
208 regk_ata_inactive = 0x00000000,
209 regk_ata_no = 0x00000000,
210 regk_ata_nodata = 0x00000000,
211 regk_ata_pio = 0x00000000,
212 regk_ata_rd = 0x00000001,
213 regk_ata_reg = 0x00000000,
214 regk_ata_rw_ctrl0_default = 0x00000000,
215 regk_ata_rw_ctrl2_default = 0x00000000,
216 regk_ata_rw_intr_mask_default = 0x00000000,
217 regk_ata_udma = 0x00000002,
218 regk_ata_word = 0x00000000,
219 regk_ata_wr = 0x00000000,
220 regk_ata_yes = 0x00000001
221};
222#endif /* __ata_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/bif_core_defs.h b/include/asm-cris/arch-v32/hwregs/bif_core_defs.h
new file mode 100644
index 000000000000..a56608b50359
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/bif_core_defs.h
@@ -0,0 +1,284 @@
1#ifndef __bif_core_defs_h
2#define __bif_core_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_core_regs.r
7 * id: bif_core_regs.r,v 1.17 2005/02/04 13:28:22 np Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_core_defs.h ../../inst/bif/rtl/bif_core_regs.r
11 * id: $Id: bif_core_defs.h,v 1.3 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_core */
86
87/* Register rw_grp1_cfg, scope bif_core, type rw */
88typedef struct {
89 unsigned int lw : 6;
90 unsigned int ew : 3;
91 unsigned int zw : 3;
92 unsigned int aw : 2;
93 unsigned int dw : 2;
94 unsigned int ewb : 2;
95 unsigned int bw : 1;
96 unsigned int wr_extend : 1;
97 unsigned int erc_en : 1;
98 unsigned int mode : 1;
99 unsigned int dummy1 : 10;
100} reg_bif_core_rw_grp1_cfg;
101#define REG_RD_ADDR_bif_core_rw_grp1_cfg 0
102#define REG_WR_ADDR_bif_core_rw_grp1_cfg 0
103
104/* Register rw_grp2_cfg, scope bif_core, type rw */
105typedef struct {
106 unsigned int lw : 6;
107 unsigned int ew : 3;
108 unsigned int zw : 3;
109 unsigned int aw : 2;
110 unsigned int dw : 2;
111 unsigned int ewb : 2;
112 unsigned int bw : 1;
113 unsigned int wr_extend : 1;
114 unsigned int erc_en : 1;
115 unsigned int mode : 1;
116 unsigned int dummy1 : 10;
117} reg_bif_core_rw_grp2_cfg;
118#define REG_RD_ADDR_bif_core_rw_grp2_cfg 4
119#define REG_WR_ADDR_bif_core_rw_grp2_cfg 4
120
121/* Register rw_grp3_cfg, scope bif_core, type rw */
122typedef struct {
123 unsigned int lw : 6;
124 unsigned int ew : 3;
125 unsigned int zw : 3;
126 unsigned int aw : 2;
127 unsigned int dw : 2;
128 unsigned int ewb : 2;
129 unsigned int bw : 1;
130 unsigned int wr_extend : 1;
131 unsigned int erc_en : 1;
132 unsigned int mode : 1;
133 unsigned int dummy1 : 2;
134 unsigned int gated_csp0 : 2;
135 unsigned int gated_csp1 : 2;
136 unsigned int gated_csp2 : 2;
137 unsigned int gated_csp3 : 2;
138} reg_bif_core_rw_grp3_cfg;
139#define REG_RD_ADDR_bif_core_rw_grp3_cfg 8
140#define REG_WR_ADDR_bif_core_rw_grp3_cfg 8
141
142/* Register rw_grp4_cfg, scope bif_core, type rw */
143typedef struct {
144 unsigned int lw : 6;
145 unsigned int ew : 3;
146 unsigned int zw : 3;
147 unsigned int aw : 2;
148 unsigned int dw : 2;
149 unsigned int ewb : 2;
150 unsigned int bw : 1;
151 unsigned int wr_extend : 1;
152 unsigned int erc_en : 1;
153 unsigned int mode : 1;
154 unsigned int dummy1 : 4;
155 unsigned int gated_csp4 : 2;
156 unsigned int gated_csp5 : 2;
157 unsigned int gated_csp6 : 2;
158} reg_bif_core_rw_grp4_cfg;
159#define REG_RD_ADDR_bif_core_rw_grp4_cfg 12
160#define REG_WR_ADDR_bif_core_rw_grp4_cfg 12
161
162/* Register rw_sdram_cfg_grp0, scope bif_core, type rw */
163typedef struct {
164 unsigned int bank_sel : 5;
165 unsigned int ca : 3;
166 unsigned int type : 1;
167 unsigned int bw : 1;
168 unsigned int sh : 3;
169 unsigned int wmm : 1;
170 unsigned int sh16 : 1;
171 unsigned int grp_sel : 5;
172 unsigned int dummy1 : 12;
173} reg_bif_core_rw_sdram_cfg_grp0;
174#define REG_RD_ADDR_bif_core_rw_sdram_cfg_grp0 16
175#define REG_WR_ADDR_bif_core_rw_sdram_cfg_grp0 16
176
177/* Register rw_sdram_cfg_grp1, scope bif_core, type rw */
178typedef struct {
179 unsigned int bank_sel : 5;
180 unsigned int ca : 3;
181 unsigned int type : 1;
182 unsigned int bw : 1;
183 unsigned int sh : 3;
184 unsigned int wmm : 1;
185 unsigned int sh16 : 1;
186 unsigned int dummy1 : 17;
187} reg_bif_core_rw_sdram_cfg_grp1;
188#define REG_RD_ADDR_bif_core_rw_sdram_cfg_grp1 20
189#define REG_WR_ADDR_bif_core_rw_sdram_cfg_grp1 20
190
191/* Register rw_sdram_timing, scope bif_core, type rw */
192typedef struct {
193 unsigned int cl : 3;
194 unsigned int rcd : 3;
195 unsigned int rp : 3;
196 unsigned int rc : 2;
197 unsigned int dpl : 2;
198 unsigned int pde : 1;
199 unsigned int ref : 2;
200 unsigned int cpd : 1;
201 unsigned int sdcke : 1;
202 unsigned int sdclk : 1;
203 unsigned int dummy1 : 13;
204} reg_bif_core_rw_sdram_timing;
205#define REG_RD_ADDR_bif_core_rw_sdram_timing 24
206#define REG_WR_ADDR_bif_core_rw_sdram_timing 24
207
208/* Register rw_sdram_cmd, scope bif_core, type rw */
209typedef struct {
210 unsigned int cmd : 3;
211 unsigned int mrs_data : 15;
212 unsigned int dummy1 : 14;
213} reg_bif_core_rw_sdram_cmd;
214#define REG_RD_ADDR_bif_core_rw_sdram_cmd 28
215#define REG_WR_ADDR_bif_core_rw_sdram_cmd 28
216
217/* Register rs_sdram_ref_stat, scope bif_core, type rs */
218typedef struct {
219 unsigned int ok : 1;
220 unsigned int dummy1 : 31;
221} reg_bif_core_rs_sdram_ref_stat;
222#define REG_RD_ADDR_bif_core_rs_sdram_ref_stat 32
223
224/* Register r_sdram_ref_stat, scope bif_core, type r */
225typedef struct {
226 unsigned int ok : 1;
227 unsigned int dummy1 : 31;
228} reg_bif_core_r_sdram_ref_stat;
229#define REG_RD_ADDR_bif_core_r_sdram_ref_stat 36
230
231
232/* Constants */
233enum {
234 regk_bif_core_bank2 = 0x00000000,
235 regk_bif_core_bank4 = 0x00000001,
236 regk_bif_core_bit10 = 0x0000000a,
237 regk_bif_core_bit11 = 0x0000000b,
238 regk_bif_core_bit12 = 0x0000000c,
239 regk_bif_core_bit13 = 0x0000000d,
240 regk_bif_core_bit14 = 0x0000000e,
241 regk_bif_core_bit15 = 0x0000000f,
242 regk_bif_core_bit16 = 0x00000010,
243 regk_bif_core_bit17 = 0x00000011,
244 regk_bif_core_bit18 = 0x00000012,
245 regk_bif_core_bit19 = 0x00000013,
246 regk_bif_core_bit20 = 0x00000014,
247 regk_bif_core_bit21 = 0x00000015,
248 regk_bif_core_bit22 = 0x00000016,
249 regk_bif_core_bit23 = 0x00000017,
250 regk_bif_core_bit24 = 0x00000018,
251 regk_bif_core_bit25 = 0x00000019,
252 regk_bif_core_bit26 = 0x0000001a,
253 regk_bif_core_bit27 = 0x0000001b,
254 regk_bif_core_bit28 = 0x0000001c,
255 regk_bif_core_bit29 = 0x0000001d,
256 regk_bif_core_bit9 = 0x00000009,
257 regk_bif_core_bw16 = 0x00000001,
258 regk_bif_core_bw32 = 0x00000000,
259 regk_bif_core_bwe = 0x00000000,
260 regk_bif_core_cwe = 0x00000001,
261 regk_bif_core_e15us = 0x00000001,
262 regk_bif_core_e7800ns = 0x00000002,
263 regk_bif_core_grp0 = 0x00000000,
264 regk_bif_core_grp1 = 0x00000001,
265 regk_bif_core_mrs = 0x00000003,
266 regk_bif_core_no = 0x00000000,
267 regk_bif_core_none = 0x00000000,
268 regk_bif_core_nop = 0x00000000,
269 regk_bif_core_off = 0x00000000,
270 regk_bif_core_pre = 0x00000002,
271 regk_bif_core_r_sdram_ref_stat_default = 0x00000001,
272 regk_bif_core_rd = 0x00000002,
273 regk_bif_core_ref = 0x00000001,
274 regk_bif_core_rs_sdram_ref_stat_default = 0x00000001,
275 regk_bif_core_rw_grp1_cfg_default = 0x000006cf,
276 regk_bif_core_rw_grp2_cfg_default = 0x000006cf,
277 regk_bif_core_rw_grp3_cfg_default = 0x000006cf,
278 regk_bif_core_rw_grp4_cfg_default = 0x000006cf,
279 regk_bif_core_rw_sdram_cfg_grp1_default = 0x00000000,
280 regk_bif_core_slf = 0x00000004,
281 regk_bif_core_wr = 0x00000001,
282 regk_bif_core_yes = 0x00000001
283};
284#endif /* __bif_core_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/bif_dma_defs.h b/include/asm-cris/arch-v32/hwregs/bif_dma_defs.h
new file mode 100644
index 000000000000..b931c1aab679
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/bif_dma_defs.h
@@ -0,0 +1,473 @@
1#ifndef __bif_dma_defs_h
2#define __bif_dma_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_dma_regs.r
7 * id: bif_dma_regs.r,v 1.6 2005/02/04 13:28:31 perz Exp
8 * last modfied: Mon Apr 11 16:06:33 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_dma_defs.h ../../inst/bif/rtl/bif_dma_regs.r
11 * id: $Id: bif_dma_defs.h,v 1.2 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_dma */
86
87/* Register rw_ch0_ctrl, scope bif_dma, type rw */
88typedef struct {
89 unsigned int bw : 2;
90 unsigned int burst_len : 1;
91 unsigned int cont : 1;
92 unsigned int end_pad : 1;
93 unsigned int cnt : 1;
94 unsigned int dreq_pin : 3;
95 unsigned int dreq_mode : 2;
96 unsigned int tc_in_pin : 3;
97 unsigned int tc_in_mode : 2;
98 unsigned int bus_mode : 2;
99 unsigned int rate_en : 1;
100 unsigned int wr_all : 1;
101 unsigned int dummy1 : 12;
102} reg_bif_dma_rw_ch0_ctrl;
103#define REG_RD_ADDR_bif_dma_rw_ch0_ctrl 0
104#define REG_WR_ADDR_bif_dma_rw_ch0_ctrl 0
105
106/* Register rw_ch0_addr, scope bif_dma, type rw */
107typedef struct {
108 unsigned int addr : 32;
109} reg_bif_dma_rw_ch0_addr;
110#define REG_RD_ADDR_bif_dma_rw_ch0_addr 4
111#define REG_WR_ADDR_bif_dma_rw_ch0_addr 4
112
113/* Register rw_ch0_start, scope bif_dma, type rw */
114typedef struct {
115 unsigned int run : 1;
116 unsigned int dummy1 : 31;
117} reg_bif_dma_rw_ch0_start;
118#define REG_RD_ADDR_bif_dma_rw_ch0_start 8
119#define REG_WR_ADDR_bif_dma_rw_ch0_start 8
120
121/* Register rw_ch0_cnt, scope bif_dma, type rw */
122typedef struct {
123 unsigned int start_cnt : 16;
124 unsigned int dummy1 : 16;
125} reg_bif_dma_rw_ch0_cnt;
126#define REG_RD_ADDR_bif_dma_rw_ch0_cnt 12
127#define REG_WR_ADDR_bif_dma_rw_ch0_cnt 12
128
129/* Register r_ch0_stat, scope bif_dma, type r */
130typedef struct {
131 unsigned int cnt : 16;
132 unsigned int dummy1 : 15;
133 unsigned int run : 1;
134} reg_bif_dma_r_ch0_stat;
135#define REG_RD_ADDR_bif_dma_r_ch0_stat 16
136
137/* Register rw_ch1_ctrl, scope bif_dma, type rw */
138typedef struct {
139 unsigned int bw : 2;
140 unsigned int burst_len : 1;
141 unsigned int cont : 1;
142 unsigned int end_discard : 1;
143 unsigned int cnt : 1;
144 unsigned int dreq_pin : 3;
145 unsigned int dreq_mode : 2;
146 unsigned int tc_in_pin : 3;
147 unsigned int tc_in_mode : 2;
148 unsigned int bus_mode : 2;
149 unsigned int rate_en : 1;
150 unsigned int dummy1 : 13;
151} reg_bif_dma_rw_ch1_ctrl;
152#define REG_RD_ADDR_bif_dma_rw_ch1_ctrl 32
153#define REG_WR_ADDR_bif_dma_rw_ch1_ctrl 32
154
155/* Register rw_ch1_addr, scope bif_dma, type rw */
156typedef struct {
157 unsigned int addr : 32;
158} reg_bif_dma_rw_ch1_addr;
159#define REG_RD_ADDR_bif_dma_rw_ch1_addr 36
160#define REG_WR_ADDR_bif_dma_rw_ch1_addr 36
161
162/* Register rw_ch1_start, scope bif_dma, type rw */
163typedef struct {
164 unsigned int run : 1;
165 unsigned int dummy1 : 31;
166} reg_bif_dma_rw_ch1_start;
167#define REG_RD_ADDR_bif_dma_rw_ch1_start 40
168#define REG_WR_ADDR_bif_dma_rw_ch1_start 40
169
170/* Register rw_ch1_cnt, scope bif_dma, type rw */
171typedef struct {
172 unsigned int start_cnt : 16;
173 unsigned int dummy1 : 16;
174} reg_bif_dma_rw_ch1_cnt;
175#define REG_RD_ADDR_bif_dma_rw_ch1_cnt 44
176#define REG_WR_ADDR_bif_dma_rw_ch1_cnt 44
177
178/* Register r_ch1_stat, scope bif_dma, type r */
179typedef struct {
180 unsigned int cnt : 16;
181 unsigned int dummy1 : 15;
182 unsigned int run : 1;
183} reg_bif_dma_r_ch1_stat;
184#define REG_RD_ADDR_bif_dma_r_ch1_stat 48
185
186/* Register rw_ch2_ctrl, scope bif_dma, type rw */
187typedef struct {
188 unsigned int bw : 2;
189 unsigned int burst_len : 1;
190 unsigned int cont : 1;
191 unsigned int end_pad : 1;
192 unsigned int cnt : 1;
193 unsigned int dreq_pin : 3;
194 unsigned int dreq_mode : 2;
195 unsigned int tc_in_pin : 3;
196 unsigned int tc_in_mode : 2;
197 unsigned int bus_mode : 2;
198 unsigned int rate_en : 1;
199 unsigned int wr_all : 1;
200 unsigned int dummy1 : 12;
201} reg_bif_dma_rw_ch2_ctrl;
202#define REG_RD_ADDR_bif_dma_rw_ch2_ctrl 64
203#define REG_WR_ADDR_bif_dma_rw_ch2_ctrl 64
204
205/* Register rw_ch2_addr, scope bif_dma, type rw */
206typedef struct {
207 unsigned int addr : 32;
208} reg_bif_dma_rw_ch2_addr;
209#define REG_RD_ADDR_bif_dma_rw_ch2_addr 68
210#define REG_WR_ADDR_bif_dma_rw_ch2_addr 68
211
212/* Register rw_ch2_start, scope bif_dma, type rw */
213typedef struct {
214 unsigned int run : 1;
215 unsigned int dummy1 : 31;
216} reg_bif_dma_rw_ch2_start;
217#define REG_RD_ADDR_bif_dma_rw_ch2_start 72
218#define REG_WR_ADDR_bif_dma_rw_ch2_start 72
219
220/* Register rw_ch2_cnt, scope bif_dma, type rw */
221typedef struct {
222 unsigned int start_cnt : 16;
223 unsigned int dummy1 : 16;
224} reg_bif_dma_rw_ch2_cnt;
225#define REG_RD_ADDR_bif_dma_rw_ch2_cnt 76
226#define REG_WR_ADDR_bif_dma_rw_ch2_cnt 76
227
228/* Register r_ch2_stat, scope bif_dma, type r */
229typedef struct {
230 unsigned int cnt : 16;
231 unsigned int dummy1 : 15;
232 unsigned int run : 1;
233} reg_bif_dma_r_ch2_stat;
234#define REG_RD_ADDR_bif_dma_r_ch2_stat 80
235
236/* Register rw_ch3_ctrl, scope bif_dma, type rw */
237typedef struct {
238 unsigned int bw : 2;
239 unsigned int burst_len : 1;
240 unsigned int cont : 1;
241 unsigned int end_discard : 1;
242 unsigned int cnt : 1;
243 unsigned int dreq_pin : 3;
244 unsigned int dreq_mode : 2;
245 unsigned int tc_in_pin : 3;
246 unsigned int tc_in_mode : 2;
247 unsigned int bus_mode : 2;
248 unsigned int rate_en : 1;
249 unsigned int dummy1 : 13;
250} reg_bif_dma_rw_ch3_ctrl;
251#define REG_RD_ADDR_bif_dma_rw_ch3_ctrl 96
252#define REG_WR_ADDR_bif_dma_rw_ch3_ctrl 96
253
254/* Register rw_ch3_addr, scope bif_dma, type rw */
255typedef struct {
256 unsigned int addr : 32;
257} reg_bif_dma_rw_ch3_addr;
258#define REG_RD_ADDR_bif_dma_rw_ch3_addr 100
259#define REG_WR_ADDR_bif_dma_rw_ch3_addr 100
260
261/* Register rw_ch3_start, scope bif_dma, type rw */
262typedef struct {
263 unsigned int run : 1;
264 unsigned int dummy1 : 31;
265} reg_bif_dma_rw_ch3_start;
266#define REG_RD_ADDR_bif_dma_rw_ch3_start 104
267#define REG_WR_ADDR_bif_dma_rw_ch3_start 104
268
269/* Register rw_ch3_cnt, scope bif_dma, type rw */
270typedef struct {
271 unsigned int start_cnt : 16;
272 unsigned int dummy1 : 16;
273} reg_bif_dma_rw_ch3_cnt;
274#define REG_RD_ADDR_bif_dma_rw_ch3_cnt 108
275#define REG_WR_ADDR_bif_dma_rw_ch3_cnt 108
276
277/* Register r_ch3_stat, scope bif_dma, type r */
278typedef struct {
279 unsigned int cnt : 16;
280 unsigned int dummy1 : 15;
281 unsigned int run : 1;
282} reg_bif_dma_r_ch3_stat;
283#define REG_RD_ADDR_bif_dma_r_ch3_stat 112
284
285/* Register rw_intr_mask, scope bif_dma, type rw */
286typedef struct {
287 unsigned int ext_dma0 : 1;
288 unsigned int ext_dma1 : 1;
289 unsigned int ext_dma2 : 1;
290 unsigned int ext_dma3 : 1;
291 unsigned int dummy1 : 28;
292} reg_bif_dma_rw_intr_mask;
293#define REG_RD_ADDR_bif_dma_rw_intr_mask 128
294#define REG_WR_ADDR_bif_dma_rw_intr_mask 128
295
296/* Register rw_ack_intr, scope bif_dma, type rw */
297typedef struct {
298 unsigned int ext_dma0 : 1;
299 unsigned int ext_dma1 : 1;
300 unsigned int ext_dma2 : 1;
301 unsigned int ext_dma3 : 1;
302 unsigned int dummy1 : 28;
303} reg_bif_dma_rw_ack_intr;
304#define REG_RD_ADDR_bif_dma_rw_ack_intr 132
305#define REG_WR_ADDR_bif_dma_rw_ack_intr 132
306
307/* Register r_intr, scope bif_dma, type r */
308typedef struct {
309 unsigned int ext_dma0 : 1;
310 unsigned int ext_dma1 : 1;
311 unsigned int ext_dma2 : 1;
312 unsigned int ext_dma3 : 1;
313 unsigned int dummy1 : 28;
314} reg_bif_dma_r_intr;
315#define REG_RD_ADDR_bif_dma_r_intr 136
316
317/* Register r_masked_intr, scope bif_dma, type r */
318typedef struct {
319 unsigned int ext_dma0 : 1;
320 unsigned int ext_dma1 : 1;
321 unsigned int ext_dma2 : 1;
322 unsigned int ext_dma3 : 1;
323 unsigned int dummy1 : 28;
324} reg_bif_dma_r_masked_intr;
325#define REG_RD_ADDR_bif_dma_r_masked_intr 140
326
327/* Register rw_pin0_cfg, scope bif_dma, type rw */
328typedef struct {
329 unsigned int master_ch : 2;
330 unsigned int master_mode : 3;
331 unsigned int slave_ch : 2;
332 unsigned int slave_mode : 3;
333 unsigned int dummy1 : 22;
334} reg_bif_dma_rw_pin0_cfg;
335#define REG_RD_ADDR_bif_dma_rw_pin0_cfg 160
336#define REG_WR_ADDR_bif_dma_rw_pin0_cfg 160
337
338/* Register rw_pin1_cfg, scope bif_dma, type rw */
339typedef struct {
340 unsigned int master_ch : 2;
341 unsigned int master_mode : 3;
342 unsigned int slave_ch : 2;
343 unsigned int slave_mode : 3;
344 unsigned int dummy1 : 22;
345} reg_bif_dma_rw_pin1_cfg;
346#define REG_RD_ADDR_bif_dma_rw_pin1_cfg 164
347#define REG_WR_ADDR_bif_dma_rw_pin1_cfg 164
348
349/* Register rw_pin2_cfg, scope bif_dma, type rw */
350typedef struct {
351 unsigned int master_ch : 2;
352 unsigned int master_mode : 3;
353 unsigned int slave_ch : 2;
354 unsigned int slave_mode : 3;
355 unsigned int dummy1 : 22;
356} reg_bif_dma_rw_pin2_cfg;
357#define REG_RD_ADDR_bif_dma_rw_pin2_cfg 168
358#define REG_WR_ADDR_bif_dma_rw_pin2_cfg 168
359
360/* Register rw_pin3_cfg, scope bif_dma, type rw */
361typedef struct {
362 unsigned int master_ch : 2;
363 unsigned int master_mode : 3;
364 unsigned int slave_ch : 2;
365 unsigned int slave_mode : 3;
366 unsigned int dummy1 : 22;
367} reg_bif_dma_rw_pin3_cfg;
368#define REG_RD_ADDR_bif_dma_rw_pin3_cfg 172
369#define REG_WR_ADDR_bif_dma_rw_pin3_cfg 172
370
371/* Register rw_pin4_cfg, scope bif_dma, type rw */
372typedef struct {
373 unsigned int master_ch : 2;
374 unsigned int master_mode : 3;
375 unsigned int slave_ch : 2;
376 unsigned int slave_mode : 3;
377 unsigned int dummy1 : 22;
378} reg_bif_dma_rw_pin4_cfg;
379#define REG_RD_ADDR_bif_dma_rw_pin4_cfg 176
380#define REG_WR_ADDR_bif_dma_rw_pin4_cfg 176
381
382/* Register rw_pin5_cfg, scope bif_dma, type rw */
383typedef struct {
384 unsigned int master_ch : 2;
385 unsigned int master_mode : 3;
386 unsigned int slave_ch : 2;
387 unsigned int slave_mode : 3;
388 unsigned int dummy1 : 22;
389} reg_bif_dma_rw_pin5_cfg;
390#define REG_RD_ADDR_bif_dma_rw_pin5_cfg 180
391#define REG_WR_ADDR_bif_dma_rw_pin5_cfg 180
392
393/* Register rw_pin6_cfg, scope bif_dma, type rw */
394typedef struct {
395 unsigned int master_ch : 2;
396 unsigned int master_mode : 3;
397 unsigned int slave_ch : 2;
398 unsigned int slave_mode : 3;
399 unsigned int dummy1 : 22;
400} reg_bif_dma_rw_pin6_cfg;
401#define REG_RD_ADDR_bif_dma_rw_pin6_cfg 184
402#define REG_WR_ADDR_bif_dma_rw_pin6_cfg 184
403
404/* Register rw_pin7_cfg, scope bif_dma, type rw */
405typedef struct {
406 unsigned int master_ch : 2;
407 unsigned int master_mode : 3;
408 unsigned int slave_ch : 2;
409 unsigned int slave_mode : 3;
410 unsigned int dummy1 : 22;
411} reg_bif_dma_rw_pin7_cfg;
412#define REG_RD_ADDR_bif_dma_rw_pin7_cfg 188
413#define REG_WR_ADDR_bif_dma_rw_pin7_cfg 188
414
415/* Register r_pin_stat, scope bif_dma, type r */
416typedef struct {
417 unsigned int pin0 : 1;
418 unsigned int pin1 : 1;
419 unsigned int pin2 : 1;
420 unsigned int pin3 : 1;
421 unsigned int pin4 : 1;
422 unsigned int pin5 : 1;
423 unsigned int pin6 : 1;
424 unsigned int pin7 : 1;
425 unsigned int dummy1 : 24;
426} reg_bif_dma_r_pin_stat;
427#define REG_RD_ADDR_bif_dma_r_pin_stat 192
428
429
430/* Constants */
431enum {
432 regk_bif_dma_as_master = 0x00000001,
433 regk_bif_dma_as_slave = 0x00000001,
434 regk_bif_dma_burst1 = 0x00000000,
435 regk_bif_dma_burst8 = 0x00000001,
436 regk_bif_dma_bw16 = 0x00000001,
437 regk_bif_dma_bw32 = 0x00000002,
438 regk_bif_dma_bw8 = 0x00000000,
439 regk_bif_dma_dack = 0x00000006,
440 regk_bif_dma_dack_inv = 0x00000007,
441 regk_bif_dma_force = 0x00000001,
442 regk_bif_dma_hi = 0x00000003,
443 regk_bif_dma_inv = 0x00000003,
444 regk_bif_dma_lo = 0x00000002,
445 regk_bif_dma_master = 0x00000001,
446 regk_bif_dma_no = 0x00000000,
447 regk_bif_dma_norm = 0x00000002,
448 regk_bif_dma_off = 0x00000000,
449 regk_bif_dma_rw_ch0_ctrl_default = 0x00000000,
450 regk_bif_dma_rw_ch0_start_default = 0x00000000,
451 regk_bif_dma_rw_ch1_ctrl_default = 0x00000000,
452 regk_bif_dma_rw_ch1_start_default = 0x00000000,
453 regk_bif_dma_rw_ch2_ctrl_default = 0x00000000,
454 regk_bif_dma_rw_ch2_start_default = 0x00000000,
455 regk_bif_dma_rw_ch3_ctrl_default = 0x00000000,
456 regk_bif_dma_rw_ch3_start_default = 0x00000000,
457 regk_bif_dma_rw_intr_mask_default = 0x00000000,
458 regk_bif_dma_rw_pin0_cfg_default = 0x00000000,
459 regk_bif_dma_rw_pin1_cfg_default = 0x00000000,
460 regk_bif_dma_rw_pin2_cfg_default = 0x00000000,
461 regk_bif_dma_rw_pin3_cfg_default = 0x00000000,
462 regk_bif_dma_rw_pin4_cfg_default = 0x00000000,
463 regk_bif_dma_rw_pin5_cfg_default = 0x00000000,
464 regk_bif_dma_rw_pin6_cfg_default = 0x00000000,
465 regk_bif_dma_rw_pin7_cfg_default = 0x00000000,
466 regk_bif_dma_slave = 0x00000002,
467 regk_bif_dma_sreq = 0x00000006,
468 regk_bif_dma_sreq_inv = 0x00000007,
469 regk_bif_dma_tc = 0x00000004,
470 regk_bif_dma_tc_inv = 0x00000005,
471 regk_bif_dma_yes = 0x00000001
472};
473#endif /* __bif_dma_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/bif_slave_defs.h b/include/asm-cris/arch-v32/hwregs/bif_slave_defs.h
new file mode 100644
index 000000000000..d18fc3c9f569
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/bif_slave_defs.h
@@ -0,0 +1,249 @@
1#ifndef __bif_slave_defs_h
2#define __bif_slave_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/bif/rtl/bif_slave_regs.r
7 * id: bif_slave_regs.r,v 1.5 2005/02/04 13:55:28 perz Exp
8 * last modfied: Mon Apr 11 16:06:34 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile bif_slave_defs.h ../../inst/bif/rtl/bif_slave_regs.r
11 * id: $Id: bif_slave_defs.h,v 1.2 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope bif_slave */
86
87/* Register rw_slave_cfg, scope bif_slave, type rw */
88typedef struct {
89 unsigned int slave_id : 3;
90 unsigned int use_slave_id : 1;
91 unsigned int boot_rdy : 1;
92 unsigned int loopback : 1;
93 unsigned int dis : 1;
94 unsigned int dummy1 : 25;
95} reg_bif_slave_rw_slave_cfg;
96#define REG_RD_ADDR_bif_slave_rw_slave_cfg 0
97#define REG_WR_ADDR_bif_slave_rw_slave_cfg 0
98
99/* Register r_slave_mode, scope bif_slave, type r */
100typedef struct {
101 unsigned int ch0_mode : 1;
102 unsigned int ch1_mode : 1;
103 unsigned int ch2_mode : 1;
104 unsigned int ch3_mode : 1;
105 unsigned int dummy1 : 28;
106} reg_bif_slave_r_slave_mode;
107#define REG_RD_ADDR_bif_slave_r_slave_mode 4
108
109/* Register rw_ch0_cfg, scope bif_slave, type rw */
110typedef struct {
111 unsigned int rd_hold : 2;
112 unsigned int access_mode : 1;
113 unsigned int access_ctrl : 1;
114 unsigned int data_cs : 2;
115 unsigned int dummy1 : 26;
116} reg_bif_slave_rw_ch0_cfg;
117#define REG_RD_ADDR_bif_slave_rw_ch0_cfg 16
118#define REG_WR_ADDR_bif_slave_rw_ch0_cfg 16
119
120/* Register rw_ch1_cfg, scope bif_slave, type rw */
121typedef struct {
122 unsigned int rd_hold : 2;
123 unsigned int access_mode : 1;
124 unsigned int access_ctrl : 1;
125 unsigned int data_cs : 2;
126 unsigned int dummy1 : 26;
127} reg_bif_slave_rw_ch1_cfg;
128#define REG_RD_ADDR_bif_slave_rw_ch1_cfg 20
129#define REG_WR_ADDR_bif_slave_rw_ch1_cfg 20
130
131/* Register rw_ch2_cfg, scope bif_slave, type rw */
132typedef struct {
133 unsigned int rd_hold : 2;
134 unsigned int access_mode : 1;
135 unsigned int access_ctrl : 1;
136 unsigned int data_cs : 2;
137 unsigned int dummy1 : 26;
138} reg_bif_slave_rw_ch2_cfg;
139#define REG_RD_ADDR_bif_slave_rw_ch2_cfg 24
140#define REG_WR_ADDR_bif_slave_rw_ch2_cfg 24
141
142/* Register rw_ch3_cfg, scope bif_slave, type rw */
143typedef struct {
144 unsigned int rd_hold : 2;
145 unsigned int access_mode : 1;
146 unsigned int access_ctrl : 1;
147 unsigned int data_cs : 2;
148 unsigned int dummy1 : 26;
149} reg_bif_slave_rw_ch3_cfg;
150#define REG_RD_ADDR_bif_slave_rw_ch3_cfg 28
151#define REG_WR_ADDR_bif_slave_rw_ch3_cfg 28
152
153/* Register rw_arb_cfg, scope bif_slave, type rw */
154typedef struct {
155 unsigned int brin_mode : 1;
156 unsigned int brout_mode : 3;
157 unsigned int bg_mode : 3;
158 unsigned int release : 2;
159 unsigned int acquire : 1;
160 unsigned int settle_time : 2;
161 unsigned int dram_ctrl : 1;
162 unsigned int dummy1 : 19;
163} reg_bif_slave_rw_arb_cfg;
164#define REG_RD_ADDR_bif_slave_rw_arb_cfg 32
165#define REG_WR_ADDR_bif_slave_rw_arb_cfg 32
166
167/* Register r_arb_stat, scope bif_slave, type r */
168typedef struct {
169 unsigned int init_mode : 1;
170 unsigned int mode : 1;
171 unsigned int brin : 1;
172 unsigned int brout : 1;
173 unsigned int bg : 1;
174 unsigned int dummy1 : 27;
175} reg_bif_slave_r_arb_stat;
176#define REG_RD_ADDR_bif_slave_r_arb_stat 36
177
178/* Register rw_intr_mask, scope bif_slave, type rw */
179typedef struct {
180 unsigned int bus_release : 1;
181 unsigned int bus_acquire : 1;
182 unsigned int dummy1 : 30;
183} reg_bif_slave_rw_intr_mask;
184#define REG_RD_ADDR_bif_slave_rw_intr_mask 64
185#define REG_WR_ADDR_bif_slave_rw_intr_mask 64
186
187/* Register rw_ack_intr, scope bif_slave, type rw */
188typedef struct {
189 unsigned int bus_release : 1;
190 unsigned int bus_acquire : 1;
191 unsigned int dummy1 : 30;
192} reg_bif_slave_rw_ack_intr;
193#define REG_RD_ADDR_bif_slave_rw_ack_intr 68
194#define REG_WR_ADDR_bif_slave_rw_ack_intr 68
195
196/* Register r_intr, scope bif_slave, type r */
197typedef struct {
198 unsigned int bus_release : 1;
199 unsigned int bus_acquire : 1;
200 unsigned int dummy1 : 30;
201} reg_bif_slave_r_intr;
202#define REG_RD_ADDR_bif_slave_r_intr 72
203
204/* Register r_masked_intr, scope bif_slave, type r */
205typedef struct {
206 unsigned int bus_release : 1;
207 unsigned int bus_acquire : 1;
208 unsigned int dummy1 : 30;
209} reg_bif_slave_r_masked_intr;
210#define REG_RD_ADDR_bif_slave_r_masked_intr 76
211
212
213/* Constants */
214enum {
215 regk_bif_slave_active_hi = 0x00000003,
216 regk_bif_slave_active_lo = 0x00000002,
217 regk_bif_slave_addr = 0x00000000,
218 regk_bif_slave_always = 0x00000001,
219 regk_bif_slave_at_idle = 0x00000002,
220 regk_bif_slave_burst_end = 0x00000003,
221 regk_bif_slave_dma = 0x00000001,
222 regk_bif_slave_hi = 0x00000003,
223 regk_bif_slave_inv = 0x00000001,
224 regk_bif_slave_lo = 0x00000002,
225 regk_bif_slave_local = 0x00000001,
226 regk_bif_slave_master = 0x00000000,
227 regk_bif_slave_mode_reg = 0x00000001,
228 regk_bif_slave_no = 0x00000000,
229 regk_bif_slave_norm = 0x00000000,
230 regk_bif_slave_on_access = 0x00000000,
231 regk_bif_slave_rw_arb_cfg_default = 0x00000000,
232 regk_bif_slave_rw_ch0_cfg_default = 0x00000000,
233 regk_bif_slave_rw_ch1_cfg_default = 0x00000000,
234 regk_bif_slave_rw_ch2_cfg_default = 0x00000000,
235 regk_bif_slave_rw_ch3_cfg_default = 0x00000000,
236 regk_bif_slave_rw_intr_mask_default = 0x00000000,
237 regk_bif_slave_rw_slave_cfg_default = 0x00000000,
238 regk_bif_slave_shared = 0x00000000,
239 regk_bif_slave_slave = 0x00000001,
240 regk_bif_slave_t0ns = 0x00000003,
241 regk_bif_slave_t10ns = 0x00000002,
242 regk_bif_slave_t20ns = 0x00000003,
243 regk_bif_slave_t30ns = 0x00000002,
244 regk_bif_slave_t40ns = 0x00000001,
245 regk_bif_slave_t50ns = 0x00000000,
246 regk_bif_slave_yes = 0x00000001,
247 regk_bif_slave_z = 0x00000004
248};
249#endif /* __bif_slave_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/config_defs.h b/include/asm-cris/arch-v32/hwregs/config_defs.h
new file mode 100644
index 000000000000..45457a4e3817
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/config_defs.h
@@ -0,0 +1,142 @@
1#ifndef __config_defs_h
2#define __config_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../rtl/config_regs.r
7 * id: config_regs.r,v 1.23 2004/03/04 11:34:42 mikaeln Exp
8 * last modfied: Thu Mar 4 12:34:39 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile config_defs.h ../../rtl/config_regs.r
11 * id: $Id: config_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope config */
86
87/* Register r_bootsel, scope config, type r */
88typedef struct {
89 unsigned int boot_mode : 3;
90 unsigned int full_duplex : 1;
91 unsigned int user : 1;
92 unsigned int pll : 1;
93 unsigned int flash_bw : 1;
94 unsigned int dummy1 : 25;
95} reg_config_r_bootsel;
96#define REG_RD_ADDR_config_r_bootsel 0
97
98/* Register rw_clk_ctrl, scope config, type rw */
99typedef struct {
100 unsigned int pll : 1;
101 unsigned int cpu : 1;
102 unsigned int iop : 1;
103 unsigned int dma01_eth0 : 1;
104 unsigned int dma23 : 1;
105 unsigned int dma45 : 1;
106 unsigned int dma67 : 1;
107 unsigned int dma89_strcop : 1;
108 unsigned int bif : 1;
109 unsigned int fix_io : 1;
110 unsigned int dummy1 : 22;
111} reg_config_rw_clk_ctrl;
112#define REG_RD_ADDR_config_rw_clk_ctrl 4
113#define REG_WR_ADDR_config_rw_clk_ctrl 4
114
115/* Register rw_pad_ctrl, scope config, type rw */
116typedef struct {
117 unsigned int usb_susp : 1;
118 unsigned int phyrst_n : 1;
119 unsigned int dummy1 : 30;
120} reg_config_rw_pad_ctrl;
121#define REG_RD_ADDR_config_rw_pad_ctrl 8
122#define REG_WR_ADDR_config_rw_pad_ctrl 8
123
124
125/* Constants */
126enum {
127 regk_config_bw16 = 0x00000000,
128 regk_config_bw32 = 0x00000001,
129 regk_config_master = 0x00000005,
130 regk_config_nand = 0x00000003,
131 regk_config_net_rx = 0x00000001,
132 regk_config_net_tx_rx = 0x00000002,
133 regk_config_no = 0x00000000,
134 regk_config_none = 0x00000007,
135 regk_config_nor = 0x00000000,
136 regk_config_rw_clk_ctrl_default = 0x00000002,
137 regk_config_rw_pad_ctrl_default = 0x00000000,
138 regk_config_ser = 0x00000004,
139 regk_config_slave = 0x00000006,
140 regk_config_yes = 0x00000001
141};
142#endif /* __config_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/cpu_vect.h b/include/asm-cris/arch-v32/hwregs/cpu_vect.h
new file mode 100644
index 000000000000..8370aee8a14a
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/cpu_vect.h
@@ -0,0 +1,41 @@
1/* Interrupt vector numbers autogenerated by /n/asic/design/tools/rdesc/src/rdes2intr version
2 from ../../inst/crisp/doc/cpu_vect.r
3version . */
4
5#ifndef _______INST_CRISP_DOC_CPU_VECT_R
6#define _______INST_CRISP_DOC_CPU_VECT_R
7#define NMI_INTR_VECT 0x00
8#define RESERVED_1_INTR_VECT 0x01
9#define RESERVED_2_INTR_VECT 0x02
10#define SINGLE_STEP_INTR_VECT 0x03
11#define INSTR_TLB_REFILL_INTR_VECT 0x04
12#define INSTR_TLB_INV_INTR_VECT 0x05
13#define INSTR_TLB_ACC_INTR_VECT 0x06
14#define TLB_EX_INTR_VECT 0x07
15#define DATA_TLB_REFILL_INTR_VECT 0x08
16#define DATA_TLB_INV_INTR_VECT 0x09
17#define DATA_TLB_ACC_INTR_VECT 0x0a
18#define DATA_TLB_WE_INTR_VECT 0x0b
19#define HW_BP_INTR_VECT 0x0c
20#define RESERVED_D_INTR_VECT 0x0d
21#define RESERVED_E_INTR_VECT 0x0e
22#define RESERVED_F_INTR_VECT 0x0f
23#define BREAK_0_INTR_VECT 0x10
24#define BREAK_1_INTR_VECT 0x11
25#define BREAK_2_INTR_VECT 0x12
26#define BREAK_3_INTR_VECT 0x13
27#define BREAK_4_INTR_VECT 0x14
28#define BREAK_5_INTR_VECT 0x15
29#define BREAK_6_INTR_VECT 0x16
30#define BREAK_7_INTR_VECT 0x17
31#define BREAK_8_INTR_VECT 0x18
32#define BREAK_9_INTR_VECT 0x19
33#define BREAK_10_INTR_VECT 0x1a
34#define BREAK_11_INTR_VECT 0x1b
35#define BREAK_12_INTR_VECT 0x1c
36#define BREAK_13_INTR_VECT 0x1d
37#define BREAK_14_INTR_VECT 0x1e
38#define BREAK_15_INTR_VECT 0x1f
39#define MULTIPLE_INTR_VECT 0x30
40
41#endif
diff --git a/include/asm-cris/arch-v32/hwregs/dma.h b/include/asm-cris/arch-v32/hwregs/dma.h
new file mode 100644
index 000000000000..c31832d3d6be
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/dma.h
@@ -0,0 +1,128 @@
1/* $Id: dma.h,v 1.7 2005/04/24 18:30:58 starvik Exp $
2 *
3 * DMA C definitions and help macros
4 *
5 */
6
7#ifndef dma_h
8#define dma_h
9
10/* registers */ /* Really needed, since both are listed in sw.list? */
11#include "dma_defs.h"
12
13
14/* descriptors */
15
16// ------------------------------------------------------------ dma_descr_group
17typedef struct dma_descr_group {
18 struct dma_descr_group *next;
19 unsigned eol : 1;
20 unsigned tol : 1;
21 unsigned bol : 1;
22 unsigned : 1;
23 unsigned intr : 1;
24 unsigned : 2;
25 unsigned en : 1;
26 unsigned : 7;
27 unsigned dis : 1;
28 unsigned md : 16;
29 struct dma_descr_group *up;
30 union {
31 struct dma_descr_context *context;
32 struct dma_descr_group *group;
33 } down;
34} dma_descr_group;
35
36// ---------------------------------------------------------- dma_descr_context
37typedef struct dma_descr_context {
38 struct dma_descr_context *next;
39 unsigned eol : 1;
40 unsigned : 3;
41 unsigned intr : 1;
42 unsigned : 1;
43 unsigned store_mode : 1;
44 unsigned en : 1;
45 unsigned : 7;
46 unsigned dis : 1;
47 unsigned md0 : 16;
48 unsigned md1;
49 unsigned md2;
50 unsigned md3;
51 unsigned md4;
52 struct dma_descr_data *saved_data;
53 char *saved_data_buf;
54} dma_descr_context;
55
56// ------------------------------------------------------------- dma_descr_data
57typedef struct dma_descr_data {
58 struct dma_descr_data *next;
59 char *buf;
60 unsigned eol : 1;
61 unsigned : 2;
62 unsigned out_eop : 1;
63 unsigned intr : 1;
64 unsigned wait : 1;
65 unsigned : 2;
66 unsigned : 3;
67 unsigned in_eop : 1;
68 unsigned : 4;
69 unsigned md : 16;
70 char *after;
71} dma_descr_data;
72
73// --------------------------------------------------------------------- macros
74
75// enable DMA channel
76#define DMA_ENABLE( inst ) \
77 do { reg_dma_rw_cfg e = REG_RD( dma, inst, rw_cfg );\
78 e.en = regk_dma_yes; \
79 REG_WR( dma, inst, rw_cfg, e); } while( 0 )
80
81// reset DMA channel
82#define DMA_RESET( inst ) \
83 do { reg_dma_rw_cfg r = REG_RD( dma, inst, rw_cfg );\
84 r.en = regk_dma_no; \
85 REG_WR( dma, inst, rw_cfg, r); } while( 0 )
86
87// stop DMA channel
88#define DMA_STOP( inst ) \
89 do { reg_dma_rw_cfg s = REG_RD( dma, inst, rw_cfg );\
90 s.stop = regk_dma_yes; \
91 REG_WR( dma, inst, rw_cfg, s); } while( 0 )
92
93// continue DMA channel operation
94#define DMA_CONTINUE( inst ) \
95 do { reg_dma_rw_cfg c = REG_RD( dma, inst, rw_cfg );\
96 c.stop = regk_dma_no; \
97 REG_WR( dma, inst, rw_cfg, c); } while( 0 )
98
99// give stream command
100#define DMA_WR_CMD( inst, cmd_par ) \
101 do { reg_dma_rw_stream_cmd r = {0}; \
102 do { r = REG_RD( dma, inst, rw_stream_cmd ); } while( r.busy ); \
103 r.cmd = (cmd_par); \
104 REG_WR( dma, inst, rw_stream_cmd, r ); \
105 } while( 0 )
106
107// load: g,c,d:burst
108#define DMA_START_GROUP( inst, group_descr ) \
109 do { REG_WR_INT( dma, inst, rw_group, (int) group_descr ); \
110 DMA_WR_CMD( inst, regk_dma_load_g ); \
111 DMA_WR_CMD( inst, regk_dma_load_c ); \
112 DMA_WR_CMD( inst, regk_dma_load_d | regk_dma_burst ); \
113 } while( 0 )
114
115// load: c,d:burst
116#define DMA_START_CONTEXT( inst, ctx_descr ) \
117 do { REG_WR_INT( dma, inst, rw_group_down, (int) ctx_descr ); \
118 DMA_WR_CMD( inst, regk_dma_load_c ); \
119 DMA_WR_CMD( inst, regk_dma_load_d | regk_dma_burst ); \
120 } while( 0 )
121
122// if the DMA is at the end of the data list, the last data descr is reloaded
123#define DMA_CONTINUE_DATA( inst ) \
124do { reg_dma_rw_cmd c = {0}; \
125 c.cont_data = regk_dma_yes;\
126 REG_WR( dma, inst, rw_cmd, c ); } while( 0 )
127
128#endif
diff --git a/include/asm-cris/arch-v32/hwregs/dma_defs.h b/include/asm-cris/arch-v32/hwregs/dma_defs.h
new file mode 100644
index 000000000000..48ac8cef7ebe
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/dma_defs.h
@@ -0,0 +1,436 @@
1#ifndef __dma_defs_h
2#define __dma_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/dma/inst/dma_common/rtl/dma_regdes.r
7 * id: dma_regdes.r,v 1.39 2005/02/10 14:07:23 janb Exp
8 * last modfied: Mon Apr 11 16:06:51 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile dma_defs.h ../../inst/dma/inst/dma_common/rtl/dma_regdes.r
11 * id: $Id: dma_defs.h,v 1.7 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope dma */
86
87/* Register rw_data, scope dma, type rw */
88typedef unsigned int reg_dma_rw_data;
89#define REG_RD_ADDR_dma_rw_data 0
90#define REG_WR_ADDR_dma_rw_data 0
91
92/* Register rw_data_next, scope dma, type rw */
93typedef unsigned int reg_dma_rw_data_next;
94#define REG_RD_ADDR_dma_rw_data_next 4
95#define REG_WR_ADDR_dma_rw_data_next 4
96
97/* Register rw_data_buf, scope dma, type rw */
98typedef unsigned int reg_dma_rw_data_buf;
99#define REG_RD_ADDR_dma_rw_data_buf 8
100#define REG_WR_ADDR_dma_rw_data_buf 8
101
102/* Register rw_data_ctrl, scope dma, type rw */
103typedef struct {
104 unsigned int eol : 1;
105 unsigned int dummy1 : 2;
106 unsigned int out_eop : 1;
107 unsigned int intr : 1;
108 unsigned int wait : 1;
109 unsigned int dummy2 : 26;
110} reg_dma_rw_data_ctrl;
111#define REG_RD_ADDR_dma_rw_data_ctrl 12
112#define REG_WR_ADDR_dma_rw_data_ctrl 12
113
114/* Register rw_data_stat, scope dma, type rw */
115typedef struct {
116 unsigned int dummy1 : 3;
117 unsigned int in_eop : 1;
118 unsigned int dummy2 : 28;
119} reg_dma_rw_data_stat;
120#define REG_RD_ADDR_dma_rw_data_stat 16
121#define REG_WR_ADDR_dma_rw_data_stat 16
122
123/* Register rw_data_md, scope dma, type rw */
124typedef struct {
125 unsigned int md : 16;
126 unsigned int dummy1 : 16;
127} reg_dma_rw_data_md;
128#define REG_RD_ADDR_dma_rw_data_md 20
129#define REG_WR_ADDR_dma_rw_data_md 20
130
131/* Register rw_data_md_s, scope dma, type rw */
132typedef struct {
133 unsigned int md_s : 16;
134 unsigned int dummy1 : 16;
135} reg_dma_rw_data_md_s;
136#define REG_RD_ADDR_dma_rw_data_md_s 24
137#define REG_WR_ADDR_dma_rw_data_md_s 24
138
139/* Register rw_data_after, scope dma, type rw */
140typedef unsigned int reg_dma_rw_data_after;
141#define REG_RD_ADDR_dma_rw_data_after 28
142#define REG_WR_ADDR_dma_rw_data_after 28
143
144/* Register rw_ctxt, scope dma, type rw */
145typedef unsigned int reg_dma_rw_ctxt;
146#define REG_RD_ADDR_dma_rw_ctxt 32
147#define REG_WR_ADDR_dma_rw_ctxt 32
148
149/* Register rw_ctxt_next, scope dma, type rw */
150typedef unsigned int reg_dma_rw_ctxt_next;
151#define REG_RD_ADDR_dma_rw_ctxt_next 36
152#define REG_WR_ADDR_dma_rw_ctxt_next 36
153
154/* Register rw_ctxt_ctrl, scope dma, type rw */
155typedef struct {
156 unsigned int eol : 1;
157 unsigned int dummy1 : 3;
158 unsigned int intr : 1;
159 unsigned int dummy2 : 1;
160 unsigned int store_mode : 1;
161 unsigned int en : 1;
162 unsigned int dummy3 : 24;
163} reg_dma_rw_ctxt_ctrl;
164#define REG_RD_ADDR_dma_rw_ctxt_ctrl 40
165#define REG_WR_ADDR_dma_rw_ctxt_ctrl 40
166
167/* Register rw_ctxt_stat, scope dma, type rw */
168typedef struct {
169 unsigned int dummy1 : 7;
170 unsigned int dis : 1;
171 unsigned int dummy2 : 24;
172} reg_dma_rw_ctxt_stat;
173#define REG_RD_ADDR_dma_rw_ctxt_stat 44
174#define REG_WR_ADDR_dma_rw_ctxt_stat 44
175
176/* Register rw_ctxt_md0, scope dma, type rw */
177typedef struct {
178 unsigned int md0 : 16;
179 unsigned int dummy1 : 16;
180} reg_dma_rw_ctxt_md0;
181#define REG_RD_ADDR_dma_rw_ctxt_md0 48
182#define REG_WR_ADDR_dma_rw_ctxt_md0 48
183
184/* Register rw_ctxt_md0_s, scope dma, type rw */
185typedef struct {
186 unsigned int md0_s : 16;
187 unsigned int dummy1 : 16;
188} reg_dma_rw_ctxt_md0_s;
189#define REG_RD_ADDR_dma_rw_ctxt_md0_s 52
190#define REG_WR_ADDR_dma_rw_ctxt_md0_s 52
191
192/* Register rw_ctxt_md1, scope dma, type rw */
193typedef unsigned int reg_dma_rw_ctxt_md1;
194#define REG_RD_ADDR_dma_rw_ctxt_md1 56
195#define REG_WR_ADDR_dma_rw_ctxt_md1 56
196
197/* Register rw_ctxt_md1_s, scope dma, type rw */
198typedef unsigned int reg_dma_rw_ctxt_md1_s;
199#define REG_RD_ADDR_dma_rw_ctxt_md1_s 60
200#define REG_WR_ADDR_dma_rw_ctxt_md1_s 60
201
202/* Register rw_ctxt_md2, scope dma, type rw */
203typedef unsigned int reg_dma_rw_ctxt_md2;
204#define REG_RD_ADDR_dma_rw_ctxt_md2 64
205#define REG_WR_ADDR_dma_rw_ctxt_md2 64
206
207/* Register rw_ctxt_md2_s, scope dma, type rw */
208typedef unsigned int reg_dma_rw_ctxt_md2_s;
209#define REG_RD_ADDR_dma_rw_ctxt_md2_s 68
210#define REG_WR_ADDR_dma_rw_ctxt_md2_s 68
211
212/* Register rw_ctxt_md3, scope dma, type rw */
213typedef unsigned int reg_dma_rw_ctxt_md3;
214#define REG_RD_ADDR_dma_rw_ctxt_md3 72
215#define REG_WR_ADDR_dma_rw_ctxt_md3 72
216
217/* Register rw_ctxt_md3_s, scope dma, type rw */
218typedef unsigned int reg_dma_rw_ctxt_md3_s;
219#define REG_RD_ADDR_dma_rw_ctxt_md3_s 76
220#define REG_WR_ADDR_dma_rw_ctxt_md3_s 76
221
222/* Register rw_ctxt_md4, scope dma, type rw */
223typedef unsigned int reg_dma_rw_ctxt_md4;
224#define REG_RD_ADDR_dma_rw_ctxt_md4 80
225#define REG_WR_ADDR_dma_rw_ctxt_md4 80
226
227/* Register rw_ctxt_md4_s, scope dma, type rw */
228typedef unsigned int reg_dma_rw_ctxt_md4_s;
229#define REG_RD_ADDR_dma_rw_ctxt_md4_s 84
230#define REG_WR_ADDR_dma_rw_ctxt_md4_s 84
231
232/* Register rw_saved_data, scope dma, type rw */
233typedef unsigned int reg_dma_rw_saved_data;
234#define REG_RD_ADDR_dma_rw_saved_data 88
235#define REG_WR_ADDR_dma_rw_saved_data 88
236
237/* Register rw_saved_data_buf, scope dma, type rw */
238typedef unsigned int reg_dma_rw_saved_data_buf;
239#define REG_RD_ADDR_dma_rw_saved_data_buf 92
240#define REG_WR_ADDR_dma_rw_saved_data_buf 92
241
242/* Register rw_group, scope dma, type rw */
243typedef unsigned int reg_dma_rw_group;
244#define REG_RD_ADDR_dma_rw_group 96
245#define REG_WR_ADDR_dma_rw_group 96
246
247/* Register rw_group_next, scope dma, type rw */
248typedef unsigned int reg_dma_rw_group_next;
249#define REG_RD_ADDR_dma_rw_group_next 100
250#define REG_WR_ADDR_dma_rw_group_next 100
251
252/* Register rw_group_ctrl, scope dma, type rw */
253typedef struct {
254 unsigned int eol : 1;
255 unsigned int tol : 1;
256 unsigned int bol : 1;
257 unsigned int dummy1 : 1;
258 unsigned int intr : 1;
259 unsigned int dummy2 : 2;
260 unsigned int en : 1;
261 unsigned int dummy3 : 24;
262} reg_dma_rw_group_ctrl;
263#define REG_RD_ADDR_dma_rw_group_ctrl 104
264#define REG_WR_ADDR_dma_rw_group_ctrl 104
265
266/* Register rw_group_stat, scope dma, type rw */
267typedef struct {
268 unsigned int dummy1 : 7;
269 unsigned int dis : 1;
270 unsigned int dummy2 : 24;
271} reg_dma_rw_group_stat;
272#define REG_RD_ADDR_dma_rw_group_stat 108
273#define REG_WR_ADDR_dma_rw_group_stat 108
274
275/* Register rw_group_md, scope dma, type rw */
276typedef struct {
277 unsigned int md : 16;
278 unsigned int dummy1 : 16;
279} reg_dma_rw_group_md;
280#define REG_RD_ADDR_dma_rw_group_md 112
281#define REG_WR_ADDR_dma_rw_group_md 112
282
283/* Register rw_group_md_s, scope dma, type rw */
284typedef struct {
285 unsigned int md_s : 16;
286 unsigned int dummy1 : 16;
287} reg_dma_rw_group_md_s;
288#define REG_RD_ADDR_dma_rw_group_md_s 116
289#define REG_WR_ADDR_dma_rw_group_md_s 116
290
291/* Register rw_group_up, scope dma, type rw */
292typedef unsigned int reg_dma_rw_group_up;
293#define REG_RD_ADDR_dma_rw_group_up 120
294#define REG_WR_ADDR_dma_rw_group_up 120
295
296/* Register rw_group_down, scope dma, type rw */
297typedef unsigned int reg_dma_rw_group_down;
298#define REG_RD_ADDR_dma_rw_group_down 124
299#define REG_WR_ADDR_dma_rw_group_down 124
300
301/* Register rw_cmd, scope dma, type rw */
302typedef struct {
303 unsigned int cont_data : 1;
304 unsigned int dummy1 : 31;
305} reg_dma_rw_cmd;
306#define REG_RD_ADDR_dma_rw_cmd 128
307#define REG_WR_ADDR_dma_rw_cmd 128
308
309/* Register rw_cfg, scope dma, type rw */
310typedef struct {
311 unsigned int en : 1;
312 unsigned int stop : 1;
313 unsigned int dummy1 : 30;
314} reg_dma_rw_cfg;
315#define REG_RD_ADDR_dma_rw_cfg 132
316#define REG_WR_ADDR_dma_rw_cfg 132
317
318/* Register rw_stat, scope dma, type rw */
319typedef struct {
320 unsigned int mode : 5;
321 unsigned int list_state : 3;
322 unsigned int stream_cmd_src : 8;
323 unsigned int dummy1 : 8;
324 unsigned int buf : 8;
325} reg_dma_rw_stat;
326#define REG_RD_ADDR_dma_rw_stat 136
327#define REG_WR_ADDR_dma_rw_stat 136
328
329/* Register rw_intr_mask, scope dma, type rw */
330typedef struct {
331 unsigned int group : 1;
332 unsigned int ctxt : 1;
333 unsigned int data : 1;
334 unsigned int in_eop : 1;
335 unsigned int stream_cmd : 1;
336 unsigned int dummy1 : 27;
337} reg_dma_rw_intr_mask;
338#define REG_RD_ADDR_dma_rw_intr_mask 140
339#define REG_WR_ADDR_dma_rw_intr_mask 140
340
341/* Register rw_ack_intr, scope dma, type rw */
342typedef struct {
343 unsigned int group : 1;
344 unsigned int ctxt : 1;
345 unsigned int data : 1;
346 unsigned int in_eop : 1;
347 unsigned int stream_cmd : 1;
348 unsigned int dummy1 : 27;
349} reg_dma_rw_ack_intr;
350#define REG_RD_ADDR_dma_rw_ack_intr 144
351#define REG_WR_ADDR_dma_rw_ack_intr 144
352
353/* Register r_intr, scope dma, type r */
354typedef struct {
355 unsigned int group : 1;
356 unsigned int ctxt : 1;
357 unsigned int data : 1;
358 unsigned int in_eop : 1;
359 unsigned int stream_cmd : 1;
360 unsigned int dummy1 : 27;
361} reg_dma_r_intr;
362#define REG_RD_ADDR_dma_r_intr 148
363
364/* Register r_masked_intr, scope dma, type r */
365typedef struct {
366 unsigned int group : 1;
367 unsigned int ctxt : 1;
368 unsigned int data : 1;
369 unsigned int in_eop : 1;
370 unsigned int stream_cmd : 1;
371 unsigned int dummy1 : 27;
372} reg_dma_r_masked_intr;
373#define REG_RD_ADDR_dma_r_masked_intr 152
374
375/* Register rw_stream_cmd, scope dma, type rw */
376typedef struct {
377 unsigned int cmd : 10;
378 unsigned int dummy1 : 6;
379 unsigned int n : 8;
380 unsigned int dummy2 : 7;
381 unsigned int busy : 1;
382} reg_dma_rw_stream_cmd;
383#define REG_RD_ADDR_dma_rw_stream_cmd 156
384#define REG_WR_ADDR_dma_rw_stream_cmd 156
385
386
387/* Constants */
388enum {
389 regk_dma_ack_pkt = 0x00000100,
390 regk_dma_anytime = 0x00000001,
391 regk_dma_array = 0x00000008,
392 regk_dma_burst = 0x00000020,
393 regk_dma_client = 0x00000002,
394 regk_dma_copy_next = 0x00000010,
395 regk_dma_copy_up = 0x00000020,
396 regk_dma_data_at_eol = 0x00000001,
397 regk_dma_dis_c = 0x00000010,
398 regk_dma_dis_g = 0x00000020,
399 regk_dma_idle = 0x00000001,
400 regk_dma_intern = 0x00000004,
401 regk_dma_load_c = 0x00000200,
402 regk_dma_load_c_n = 0x00000280,
403 regk_dma_load_c_next = 0x00000240,
404 regk_dma_load_d = 0x00000140,
405 regk_dma_load_g = 0x00000300,
406 regk_dma_load_g_down = 0x000003c0,
407 regk_dma_load_g_next = 0x00000340,
408 regk_dma_load_g_up = 0x00000380,
409 regk_dma_next_en = 0x00000010,
410 regk_dma_next_pkt = 0x00000010,
411 regk_dma_no = 0x00000000,
412 regk_dma_only_at_wait = 0x00000000,
413 regk_dma_restore = 0x00000020,
414 regk_dma_rst = 0x00000001,
415 regk_dma_running = 0x00000004,
416 regk_dma_rw_cfg_default = 0x00000000,
417 regk_dma_rw_cmd_default = 0x00000000,
418 regk_dma_rw_intr_mask_default = 0x00000000,
419 regk_dma_rw_stat_default = 0x00000101,
420 regk_dma_rw_stream_cmd_default = 0x00000000,
421 regk_dma_save_down = 0x00000020,
422 regk_dma_save_up = 0x00000020,
423 regk_dma_set_reg = 0x00000050,
424 regk_dma_set_w_size1 = 0x00000190,
425 regk_dma_set_w_size2 = 0x000001a0,
426 regk_dma_set_w_size4 = 0x000001c0,
427 regk_dma_stopped = 0x00000002,
428 regk_dma_store_c = 0x00000002,
429 regk_dma_store_descr = 0x00000000,
430 regk_dma_store_g = 0x00000004,
431 regk_dma_store_md = 0x00000001,
432 regk_dma_sw = 0x00000008,
433 regk_dma_update_down = 0x00000020,
434 regk_dma_yes = 0x00000001
435};
436#endif /* __dma_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/eth_defs.h b/include/asm-cris/arch-v32/hwregs/eth_defs.h
new file mode 100644
index 000000000000..1196d7cc783f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/eth_defs.h
@@ -0,0 +1,384 @@
1#ifndef __eth_defs_h
2#define __eth_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/eth/rtl/eth_regs.r
7 * id: eth_regs.r,v 1.11 2005/02/09 10:48:38 kriskn Exp
8 * last modfied: Mon Apr 11 16:07:03 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile eth_defs.h ../../inst/eth/rtl/eth_regs.r
11 * id: $Id: eth_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope eth */
86
87/* Register rw_ma0_lo, scope eth, type rw */
88typedef struct {
89 unsigned int addr : 32;
90} reg_eth_rw_ma0_lo;
91#define REG_RD_ADDR_eth_rw_ma0_lo 0
92#define REG_WR_ADDR_eth_rw_ma0_lo 0
93
94/* Register rw_ma0_hi, scope eth, type rw */
95typedef struct {
96 unsigned int addr : 16;
97 unsigned int dummy1 : 16;
98} reg_eth_rw_ma0_hi;
99#define REG_RD_ADDR_eth_rw_ma0_hi 4
100#define REG_WR_ADDR_eth_rw_ma0_hi 4
101
102/* Register rw_ma1_lo, scope eth, type rw */
103typedef struct {
104 unsigned int addr : 32;
105} reg_eth_rw_ma1_lo;
106#define REG_RD_ADDR_eth_rw_ma1_lo 8
107#define REG_WR_ADDR_eth_rw_ma1_lo 8
108
109/* Register rw_ma1_hi, scope eth, type rw */
110typedef struct {
111 unsigned int addr : 16;
112 unsigned int dummy1 : 16;
113} reg_eth_rw_ma1_hi;
114#define REG_RD_ADDR_eth_rw_ma1_hi 12
115#define REG_WR_ADDR_eth_rw_ma1_hi 12
116
117/* Register rw_ga_lo, scope eth, type rw */
118typedef struct {
119 unsigned int table : 32;
120} reg_eth_rw_ga_lo;
121#define REG_RD_ADDR_eth_rw_ga_lo 16
122#define REG_WR_ADDR_eth_rw_ga_lo 16
123
124/* Register rw_ga_hi, scope eth, type rw */
125typedef struct {
126 unsigned int table : 32;
127} reg_eth_rw_ga_hi;
128#define REG_RD_ADDR_eth_rw_ga_hi 20
129#define REG_WR_ADDR_eth_rw_ga_hi 20
130
131/* Register rw_gen_ctrl, scope eth, type rw */
132typedef struct {
133 unsigned int en : 1;
134 unsigned int phy : 2;
135 unsigned int protocol : 1;
136 unsigned int loopback : 1;
137 unsigned int flow_ctrl_dis : 1;
138 unsigned int dummy1 : 26;
139} reg_eth_rw_gen_ctrl;
140#define REG_RD_ADDR_eth_rw_gen_ctrl 24
141#define REG_WR_ADDR_eth_rw_gen_ctrl 24
142
143/* Register rw_rec_ctrl, scope eth, type rw */
144typedef struct {
145 unsigned int ma0 : 1;
146 unsigned int ma1 : 1;
147 unsigned int individual : 1;
148 unsigned int broadcast : 1;
149 unsigned int undersize : 1;
150 unsigned int oversize : 1;
151 unsigned int bad_crc : 1;
152 unsigned int duplex : 1;
153 unsigned int max_size : 1;
154 unsigned int dummy1 : 23;
155} reg_eth_rw_rec_ctrl;
156#define REG_RD_ADDR_eth_rw_rec_ctrl 28
157#define REG_WR_ADDR_eth_rw_rec_ctrl 28
158
159/* Register rw_tr_ctrl, scope eth, type rw */
160typedef struct {
161 unsigned int crc : 1;
162 unsigned int pad : 1;
163 unsigned int retry : 1;
164 unsigned int ignore_col : 1;
165 unsigned int cancel : 1;
166 unsigned int hsh_delay : 1;
167 unsigned int ignore_crs : 1;
168 unsigned int dummy1 : 25;
169} reg_eth_rw_tr_ctrl;
170#define REG_RD_ADDR_eth_rw_tr_ctrl 32
171#define REG_WR_ADDR_eth_rw_tr_ctrl 32
172
173/* Register rw_clr_err, scope eth, type rw */
174typedef struct {
175 unsigned int clr : 1;
176 unsigned int dummy1 : 31;
177} reg_eth_rw_clr_err;
178#define REG_RD_ADDR_eth_rw_clr_err 36
179#define REG_WR_ADDR_eth_rw_clr_err 36
180
181/* Register rw_mgm_ctrl, scope eth, type rw */
182typedef struct {
183 unsigned int mdio : 1;
184 unsigned int mdoe : 1;
185 unsigned int mdc : 1;
186 unsigned int phyclk : 1;
187 unsigned int txdata : 4;
188 unsigned int txen : 1;
189 unsigned int dummy1 : 23;
190} reg_eth_rw_mgm_ctrl;
191#define REG_RD_ADDR_eth_rw_mgm_ctrl 40
192#define REG_WR_ADDR_eth_rw_mgm_ctrl 40
193
194/* Register r_stat, scope eth, type r */
195typedef struct {
196 unsigned int mdio : 1;
197 unsigned int exc_col : 1;
198 unsigned int urun : 1;
199 unsigned int phyclk : 1;
200 unsigned int txdata : 4;
201 unsigned int txen : 1;
202 unsigned int col : 1;
203 unsigned int crs : 1;
204 unsigned int txclk : 1;
205 unsigned int rxdata : 4;
206 unsigned int rxer : 1;
207 unsigned int rxdv : 1;
208 unsigned int rxclk : 1;
209 unsigned int dummy1 : 13;
210} reg_eth_r_stat;
211#define REG_RD_ADDR_eth_r_stat 44
212
213/* Register rs_rec_cnt, scope eth, type rs */
214typedef struct {
215 unsigned int crc_err : 8;
216 unsigned int align_err : 8;
217 unsigned int oversize : 8;
218 unsigned int congestion : 8;
219} reg_eth_rs_rec_cnt;
220#define REG_RD_ADDR_eth_rs_rec_cnt 48
221
222/* Register r_rec_cnt, scope eth, type r */
223typedef struct {
224 unsigned int crc_err : 8;
225 unsigned int align_err : 8;
226 unsigned int oversize : 8;
227 unsigned int congestion : 8;
228} reg_eth_r_rec_cnt;
229#define REG_RD_ADDR_eth_r_rec_cnt 52
230
231/* Register rs_tr_cnt, scope eth, type rs */
232typedef struct {
233 unsigned int single_col : 8;
234 unsigned int mult_col : 8;
235 unsigned int late_col : 8;
236 unsigned int deferred : 8;
237} reg_eth_rs_tr_cnt;
238#define REG_RD_ADDR_eth_rs_tr_cnt 56
239
240/* Register r_tr_cnt, scope eth, type r */
241typedef struct {
242 unsigned int single_col : 8;
243 unsigned int mult_col : 8;
244 unsigned int late_col : 8;
245 unsigned int deferred : 8;
246} reg_eth_r_tr_cnt;
247#define REG_RD_ADDR_eth_r_tr_cnt 60
248
249/* Register rs_phy_cnt, scope eth, type rs */
250typedef struct {
251 unsigned int carrier_loss : 8;
252 unsigned int sqe_err : 8;
253 unsigned int dummy1 : 16;
254} reg_eth_rs_phy_cnt;
255#define REG_RD_ADDR_eth_rs_phy_cnt 64
256
257/* Register r_phy_cnt, scope eth, type r */
258typedef struct {
259 unsigned int carrier_loss : 8;
260 unsigned int sqe_err : 8;
261 unsigned int dummy1 : 16;
262} reg_eth_r_phy_cnt;
263#define REG_RD_ADDR_eth_r_phy_cnt 68
264
265/* Register rw_test_ctrl, scope eth, type rw */
266typedef struct {
267 unsigned int snmp_inc : 1;
268 unsigned int snmp : 1;
269 unsigned int backoff : 1;
270 unsigned int dummy1 : 29;
271} reg_eth_rw_test_ctrl;
272#define REG_RD_ADDR_eth_rw_test_ctrl 72
273#define REG_WR_ADDR_eth_rw_test_ctrl 72
274
275/* Register rw_intr_mask, scope eth, type rw */
276typedef struct {
277 unsigned int crc : 1;
278 unsigned int align : 1;
279 unsigned int oversize : 1;
280 unsigned int congestion : 1;
281 unsigned int single_col : 1;
282 unsigned int mult_col : 1;
283 unsigned int late_col : 1;
284 unsigned int deferred : 1;
285 unsigned int carrier_loss : 1;
286 unsigned int sqe_test_err : 1;
287 unsigned int orun : 1;
288 unsigned int urun : 1;
289 unsigned int excessive_col : 1;
290 unsigned int mdio : 1;
291 unsigned int dummy1 : 18;
292} reg_eth_rw_intr_mask;
293#define REG_RD_ADDR_eth_rw_intr_mask 76
294#define REG_WR_ADDR_eth_rw_intr_mask 76
295
296/* Register rw_ack_intr, scope eth, type rw */
297typedef struct {
298 unsigned int crc : 1;
299 unsigned int align : 1;
300 unsigned int oversize : 1;
301 unsigned int congestion : 1;
302 unsigned int single_col : 1;
303 unsigned int mult_col : 1;
304 unsigned int late_col : 1;
305 unsigned int deferred : 1;
306 unsigned int carrier_loss : 1;
307 unsigned int sqe_test_err : 1;
308 unsigned int orun : 1;
309 unsigned int urun : 1;
310 unsigned int excessive_col : 1;
311 unsigned int mdio : 1;
312 unsigned int dummy1 : 18;
313} reg_eth_rw_ack_intr;
314#define REG_RD_ADDR_eth_rw_ack_intr 80
315#define REG_WR_ADDR_eth_rw_ack_intr 80
316
317/* Register r_intr, scope eth, type r */
318typedef struct {
319 unsigned int crc : 1;
320 unsigned int align : 1;
321 unsigned int oversize : 1;
322 unsigned int congestion : 1;
323 unsigned int single_col : 1;
324 unsigned int mult_col : 1;
325 unsigned int late_col : 1;
326 unsigned int deferred : 1;
327 unsigned int carrier_loss : 1;
328 unsigned int sqe_test_err : 1;
329 unsigned int orun : 1;
330 unsigned int urun : 1;
331 unsigned int excessive_col : 1;
332 unsigned int mdio : 1;
333 unsigned int dummy1 : 18;
334} reg_eth_r_intr;
335#define REG_RD_ADDR_eth_r_intr 84
336
337/* Register r_masked_intr, scope eth, type r */
338typedef struct {
339 unsigned int crc : 1;
340 unsigned int align : 1;
341 unsigned int oversize : 1;
342 unsigned int congestion : 1;
343 unsigned int single_col : 1;
344 unsigned int mult_col : 1;
345 unsigned int late_col : 1;
346 unsigned int deferred : 1;
347 unsigned int carrier_loss : 1;
348 unsigned int sqe_test_err : 1;
349 unsigned int orun : 1;
350 unsigned int urun : 1;
351 unsigned int excessive_col : 1;
352 unsigned int mdio : 1;
353 unsigned int dummy1 : 18;
354} reg_eth_r_masked_intr;
355#define REG_RD_ADDR_eth_r_masked_intr 88
356
357
358/* Constants */
359enum {
360 regk_eth_discard = 0x00000000,
361 regk_eth_ether = 0x00000000,
362 regk_eth_full = 0x00000001,
363 regk_eth_half = 0x00000000,
364 regk_eth_hsh = 0x00000001,
365 regk_eth_mii = 0x00000001,
366 regk_eth_mii_clk = 0x00000000,
367 regk_eth_mii_rec = 0x00000002,
368 regk_eth_no = 0x00000000,
369 regk_eth_rec = 0x00000001,
370 regk_eth_rw_ga_hi_default = 0x00000000,
371 regk_eth_rw_ga_lo_default = 0x00000000,
372 regk_eth_rw_gen_ctrl_default = 0x00000000,
373 regk_eth_rw_intr_mask_default = 0x00000000,
374 regk_eth_rw_ma0_hi_default = 0x00000000,
375 regk_eth_rw_ma0_lo_default = 0x00000000,
376 regk_eth_rw_ma1_hi_default = 0x00000000,
377 regk_eth_rw_ma1_lo_default = 0x00000000,
378 regk_eth_rw_mgm_ctrl_default = 0x00000000,
379 regk_eth_rw_test_ctrl_default = 0x00000000,
380 regk_eth_size1518 = 0x00000000,
381 regk_eth_size1522 = 0x00000001,
382 regk_eth_yes = 0x00000001
383};
384#endif /* __eth_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/extmem_defs.h b/include/asm-cris/arch-v32/hwregs/extmem_defs.h
new file mode 100644
index 000000000000..c47b5ca48ece
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/extmem_defs.h
@@ -0,0 +1,369 @@
1#ifndef __extmem_defs_h
2#define __extmem_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/ext_mem/mod/extmem_regs.r
7 * id: extmem_regs.r,v 1.1 2004/02/16 13:29:30 np Exp
8 * last modfied: Tue Mar 30 22:26:21 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile extmem_defs.h ../../inst/ext_mem/mod/extmem_regs.r
11 * id: $Id: extmem_defs.h,v 1.5 2004/06/04 07:15:33 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope extmem */
86
87/* Register rw_cse0_cfg, scope extmem, type rw */
88typedef struct {
89 unsigned int lw : 6;
90 unsigned int ew : 3;
91 unsigned int zw : 3;
92 unsigned int aw : 2;
93 unsigned int dw : 2;
94 unsigned int ewb : 2;
95 unsigned int bw : 1;
96 unsigned int mode : 1;
97 unsigned int erc_en : 1;
98 unsigned int dummy1 : 6;
99 unsigned int size : 3;
100 unsigned int log : 1;
101 unsigned int en : 1;
102} reg_extmem_rw_cse0_cfg;
103#define REG_RD_ADDR_extmem_rw_cse0_cfg 0
104#define REG_WR_ADDR_extmem_rw_cse0_cfg 0
105
106/* Register rw_cse1_cfg, scope extmem, type rw */
107typedef struct {
108 unsigned int lw : 6;
109 unsigned int ew : 3;
110 unsigned int zw : 3;
111 unsigned int aw : 2;
112 unsigned int dw : 2;
113 unsigned int ewb : 2;
114 unsigned int bw : 1;
115 unsigned int mode : 1;
116 unsigned int erc_en : 1;
117 unsigned int dummy1 : 6;
118 unsigned int size : 3;
119 unsigned int log : 1;
120 unsigned int en : 1;
121} reg_extmem_rw_cse1_cfg;
122#define REG_RD_ADDR_extmem_rw_cse1_cfg 4
123#define REG_WR_ADDR_extmem_rw_cse1_cfg 4
124
125/* Register rw_csr0_cfg, scope extmem, type rw */
126typedef struct {
127 unsigned int lw : 6;
128 unsigned int ew : 3;
129 unsigned int zw : 3;
130 unsigned int aw : 2;
131 unsigned int dw : 2;
132 unsigned int ewb : 2;
133 unsigned int bw : 1;
134 unsigned int mode : 1;
135 unsigned int erc_en : 1;
136 unsigned int dummy1 : 6;
137 unsigned int size : 3;
138 unsigned int log : 1;
139 unsigned int en : 1;
140} reg_extmem_rw_csr0_cfg;
141#define REG_RD_ADDR_extmem_rw_csr0_cfg 8
142#define REG_WR_ADDR_extmem_rw_csr0_cfg 8
143
144/* Register rw_csr1_cfg, scope extmem, type rw */
145typedef struct {
146 unsigned int lw : 6;
147 unsigned int ew : 3;
148 unsigned int zw : 3;
149 unsigned int aw : 2;
150 unsigned int dw : 2;
151 unsigned int ewb : 2;
152 unsigned int bw : 1;
153 unsigned int mode : 1;
154 unsigned int erc_en : 1;
155 unsigned int dummy1 : 6;
156 unsigned int size : 3;
157 unsigned int log : 1;
158 unsigned int en : 1;
159} reg_extmem_rw_csr1_cfg;
160#define REG_RD_ADDR_extmem_rw_csr1_cfg 12
161#define REG_WR_ADDR_extmem_rw_csr1_cfg 12
162
163/* Register rw_csp0_cfg, scope extmem, type rw */
164typedef struct {
165 unsigned int lw : 6;
166 unsigned int ew : 3;
167 unsigned int zw : 3;
168 unsigned int aw : 2;
169 unsigned int dw : 2;
170 unsigned int ewb : 2;
171 unsigned int bw : 1;
172 unsigned int mode : 1;
173 unsigned int erc_en : 1;
174 unsigned int dummy1 : 6;
175 unsigned int size : 3;
176 unsigned int log : 1;
177 unsigned int en : 1;
178} reg_extmem_rw_csp0_cfg;
179#define REG_RD_ADDR_extmem_rw_csp0_cfg 16
180#define REG_WR_ADDR_extmem_rw_csp0_cfg 16
181
182/* Register rw_csp1_cfg, scope extmem, type rw */
183typedef struct {
184 unsigned int lw : 6;
185 unsigned int ew : 3;
186 unsigned int zw : 3;
187 unsigned int aw : 2;
188 unsigned int dw : 2;
189 unsigned int ewb : 2;
190 unsigned int bw : 1;
191 unsigned int mode : 1;
192 unsigned int erc_en : 1;
193 unsigned int dummy1 : 6;
194 unsigned int size : 3;
195 unsigned int log : 1;
196 unsigned int en : 1;
197} reg_extmem_rw_csp1_cfg;
198#define REG_RD_ADDR_extmem_rw_csp1_cfg 20
199#define REG_WR_ADDR_extmem_rw_csp1_cfg 20
200
201/* Register rw_csp2_cfg, scope extmem, type rw */
202typedef struct {
203 unsigned int lw : 6;
204 unsigned int ew : 3;
205 unsigned int zw : 3;
206 unsigned int aw : 2;
207 unsigned int dw : 2;
208 unsigned int ewb : 2;
209 unsigned int bw : 1;
210 unsigned int mode : 1;
211 unsigned int erc_en : 1;
212 unsigned int dummy1 : 6;
213 unsigned int size : 3;
214 unsigned int log : 1;
215 unsigned int en : 1;
216} reg_extmem_rw_csp2_cfg;
217#define REG_RD_ADDR_extmem_rw_csp2_cfg 24
218#define REG_WR_ADDR_extmem_rw_csp2_cfg 24
219
220/* Register rw_csp3_cfg, scope extmem, type rw */
221typedef struct {
222 unsigned int lw : 6;
223 unsigned int ew : 3;
224 unsigned int zw : 3;
225 unsigned int aw : 2;
226 unsigned int dw : 2;
227 unsigned int ewb : 2;
228 unsigned int bw : 1;
229 unsigned int mode : 1;
230 unsigned int erc_en : 1;
231 unsigned int dummy1 : 6;
232 unsigned int size : 3;
233 unsigned int log : 1;
234 unsigned int en : 1;
235} reg_extmem_rw_csp3_cfg;
236#define REG_RD_ADDR_extmem_rw_csp3_cfg 28
237#define REG_WR_ADDR_extmem_rw_csp3_cfg 28
238
239/* Register rw_csp4_cfg, scope extmem, type rw */
240typedef struct {
241 unsigned int lw : 6;
242 unsigned int ew : 3;
243 unsigned int zw : 3;
244 unsigned int aw : 2;
245 unsigned int dw : 2;
246 unsigned int ewb : 2;
247 unsigned int bw : 1;
248 unsigned int mode : 1;
249 unsigned int erc_en : 1;
250 unsigned int dummy1 : 6;
251 unsigned int size : 3;
252 unsigned int log : 1;
253 unsigned int en : 1;
254} reg_extmem_rw_csp4_cfg;
255#define REG_RD_ADDR_extmem_rw_csp4_cfg 32
256#define REG_WR_ADDR_extmem_rw_csp4_cfg 32
257
258/* Register rw_csp5_cfg, scope extmem, type rw */
259typedef struct {
260 unsigned int lw : 6;
261 unsigned int ew : 3;
262 unsigned int zw : 3;
263 unsigned int aw : 2;
264 unsigned int dw : 2;
265 unsigned int ewb : 2;
266 unsigned int bw : 1;
267 unsigned int mode : 1;
268 unsigned int erc_en : 1;
269 unsigned int dummy1 : 6;
270 unsigned int size : 3;
271 unsigned int log : 1;
272 unsigned int en : 1;
273} reg_extmem_rw_csp5_cfg;
274#define REG_RD_ADDR_extmem_rw_csp5_cfg 36
275#define REG_WR_ADDR_extmem_rw_csp5_cfg 36
276
277/* Register rw_csp6_cfg, scope extmem, type rw */
278typedef struct {
279 unsigned int lw : 6;
280 unsigned int ew : 3;
281 unsigned int zw : 3;
282 unsigned int aw : 2;
283 unsigned int dw : 2;
284 unsigned int ewb : 2;
285 unsigned int bw : 1;
286 unsigned int mode : 1;
287 unsigned int erc_en : 1;
288 unsigned int dummy1 : 6;
289 unsigned int size : 3;
290 unsigned int log : 1;
291 unsigned int en : 1;
292} reg_extmem_rw_csp6_cfg;
293#define REG_RD_ADDR_extmem_rw_csp6_cfg 40
294#define REG_WR_ADDR_extmem_rw_csp6_cfg 40
295
296/* Register rw_css_cfg, scope extmem, type rw */
297typedef struct {
298 unsigned int lw : 6;
299 unsigned int ew : 3;
300 unsigned int zw : 3;
301 unsigned int aw : 2;
302 unsigned int dw : 2;
303 unsigned int ewb : 2;
304 unsigned int bw : 1;
305 unsigned int mode : 1;
306 unsigned int erc_en : 1;
307 unsigned int dummy1 : 6;
308 unsigned int size : 3;
309 unsigned int log : 1;
310 unsigned int en : 1;
311} reg_extmem_rw_css_cfg;
312#define REG_RD_ADDR_extmem_rw_css_cfg 44
313#define REG_WR_ADDR_extmem_rw_css_cfg 44
314
315/* Register rw_status_handle, scope extmem, type rw */
316typedef struct {
317 unsigned int h : 32;
318} reg_extmem_rw_status_handle;
319#define REG_RD_ADDR_extmem_rw_status_handle 48
320#define REG_WR_ADDR_extmem_rw_status_handle 48
321
322/* Register rw_wait_pin, scope extmem, type rw */
323typedef struct {
324 unsigned int val : 16;
325 unsigned int dummy1 : 15;
326 unsigned int start : 1;
327} reg_extmem_rw_wait_pin;
328#define REG_RD_ADDR_extmem_rw_wait_pin 52
329#define REG_WR_ADDR_extmem_rw_wait_pin 52
330
331/* Register rw_gated_csp, scope extmem, type rw */
332typedef struct {
333 unsigned int dummy1 : 31;
334 unsigned int en : 1;
335} reg_extmem_rw_gated_csp;
336#define REG_RD_ADDR_extmem_rw_gated_csp 56
337#define REG_WR_ADDR_extmem_rw_gated_csp 56
338
339
340/* Constants */
341enum {
342 regk_extmem_b16 = 0x00000001,
343 regk_extmem_b32 = 0x00000000,
344 regk_extmem_bwe = 0x00000000,
345 regk_extmem_cwe = 0x00000001,
346 regk_extmem_no = 0x00000000,
347 regk_extmem_rw_cse0_cfg_default = 0x000006cf,
348 regk_extmem_rw_cse1_cfg_default = 0x000006cf,
349 regk_extmem_rw_csp0_cfg_default = 0x000006cf,
350 regk_extmem_rw_csp1_cfg_default = 0x000006cf,
351 regk_extmem_rw_csp2_cfg_default = 0x000006cf,
352 regk_extmem_rw_csp3_cfg_default = 0x000006cf,
353 regk_extmem_rw_csp4_cfg_default = 0x000006cf,
354 regk_extmem_rw_csp5_cfg_default = 0x000006cf,
355 regk_extmem_rw_csp6_cfg_default = 0x000006cf,
356 regk_extmem_rw_csr0_cfg_default = 0x000006cf,
357 regk_extmem_rw_csr1_cfg_default = 0x000006cf,
358 regk_extmem_rw_css_cfg_default = 0x000006cf,
359 regk_extmem_s128KB = 0x00000000,
360 regk_extmem_s16MB = 0x00000005,
361 regk_extmem_s1MB = 0x00000001,
362 regk_extmem_s2MB = 0x00000002,
363 regk_extmem_s32MB = 0x00000006,
364 regk_extmem_s4MB = 0x00000003,
365 regk_extmem_s64MB = 0x00000007,
366 regk_extmem_s8MB = 0x00000004,
367 regk_extmem_yes = 0x00000001
368};
369#endif /* __extmem_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/gio_defs.h b/include/asm-cris/arch-v32/hwregs/gio_defs.h
new file mode 100644
index 000000000000..3e9a0b25366f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/gio_defs.h
@@ -0,0 +1,295 @@
1#ifndef __gio_defs_h
2#define __gio_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/gio/rtl/gio_regs.r
7 * id: gio_regs.r,v 1.5 2005/02/04 09:43:21 perz Exp
8 * last modfied: Mon Apr 11 16:07:47 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile gio_defs.h ../../inst/gio/rtl/gio_regs.r
11 * id: $Id: gio_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope gio */
86
87/* Register rw_pa_dout, scope gio, type rw */
88typedef struct {
89 unsigned int data : 8;
90 unsigned int dummy1 : 24;
91} reg_gio_rw_pa_dout;
92#define REG_RD_ADDR_gio_rw_pa_dout 0
93#define REG_WR_ADDR_gio_rw_pa_dout 0
94
95/* Register r_pa_din, scope gio, type r */
96typedef struct {
97 unsigned int data : 8;
98 unsigned int dummy1 : 24;
99} reg_gio_r_pa_din;
100#define REG_RD_ADDR_gio_r_pa_din 4
101
102/* Register rw_pa_oe, scope gio, type rw */
103typedef struct {
104 unsigned int oe : 8;
105 unsigned int dummy1 : 24;
106} reg_gio_rw_pa_oe;
107#define REG_RD_ADDR_gio_rw_pa_oe 8
108#define REG_WR_ADDR_gio_rw_pa_oe 8
109
110/* Register rw_intr_cfg, scope gio, type rw */
111typedef struct {
112 unsigned int pa0 : 3;
113 unsigned int pa1 : 3;
114 unsigned int pa2 : 3;
115 unsigned int pa3 : 3;
116 unsigned int pa4 : 3;
117 unsigned int pa5 : 3;
118 unsigned int pa6 : 3;
119 unsigned int pa7 : 3;
120 unsigned int dummy1 : 8;
121} reg_gio_rw_intr_cfg;
122#define REG_RD_ADDR_gio_rw_intr_cfg 12
123#define REG_WR_ADDR_gio_rw_intr_cfg 12
124
125/* Register rw_intr_mask, scope gio, type rw */
126typedef struct {
127 unsigned int pa0 : 1;
128 unsigned int pa1 : 1;
129 unsigned int pa2 : 1;
130 unsigned int pa3 : 1;
131 unsigned int pa4 : 1;
132 unsigned int pa5 : 1;
133 unsigned int pa6 : 1;
134 unsigned int pa7 : 1;
135 unsigned int dummy1 : 24;
136} reg_gio_rw_intr_mask;
137#define REG_RD_ADDR_gio_rw_intr_mask 16
138#define REG_WR_ADDR_gio_rw_intr_mask 16
139
140/* Register rw_ack_intr, scope gio, type rw */
141typedef struct {
142 unsigned int pa0 : 1;
143 unsigned int pa1 : 1;
144 unsigned int pa2 : 1;
145 unsigned int pa3 : 1;
146 unsigned int pa4 : 1;
147 unsigned int pa5 : 1;
148 unsigned int pa6 : 1;
149 unsigned int pa7 : 1;
150 unsigned int dummy1 : 24;
151} reg_gio_rw_ack_intr;
152#define REG_RD_ADDR_gio_rw_ack_intr 20
153#define REG_WR_ADDR_gio_rw_ack_intr 20
154
155/* Register r_intr, scope gio, type r */
156typedef struct {
157 unsigned int pa0 : 1;
158 unsigned int pa1 : 1;
159 unsigned int pa2 : 1;
160 unsigned int pa3 : 1;
161 unsigned int pa4 : 1;
162 unsigned int pa5 : 1;
163 unsigned int pa6 : 1;
164 unsigned int pa7 : 1;
165 unsigned int dummy1 : 24;
166} reg_gio_r_intr;
167#define REG_RD_ADDR_gio_r_intr 24
168
169/* Register r_masked_intr, scope gio, type r */
170typedef struct {
171 unsigned int pa0 : 1;
172 unsigned int pa1 : 1;
173 unsigned int pa2 : 1;
174 unsigned int pa3 : 1;
175 unsigned int pa4 : 1;
176 unsigned int pa5 : 1;
177 unsigned int pa6 : 1;
178 unsigned int pa7 : 1;
179 unsigned int dummy1 : 24;
180} reg_gio_r_masked_intr;
181#define REG_RD_ADDR_gio_r_masked_intr 28
182
183/* Register rw_pb_dout, scope gio, type rw */
184typedef struct {
185 unsigned int data : 18;
186 unsigned int dummy1 : 14;
187} reg_gio_rw_pb_dout;
188#define REG_RD_ADDR_gio_rw_pb_dout 32
189#define REG_WR_ADDR_gio_rw_pb_dout 32
190
191/* Register r_pb_din, scope gio, type r */
192typedef struct {
193 unsigned int data : 18;
194 unsigned int dummy1 : 14;
195} reg_gio_r_pb_din;
196#define REG_RD_ADDR_gio_r_pb_din 36
197
198/* Register rw_pb_oe, scope gio, type rw */
199typedef struct {
200 unsigned int oe : 18;
201 unsigned int dummy1 : 14;
202} reg_gio_rw_pb_oe;
203#define REG_RD_ADDR_gio_rw_pb_oe 40
204#define REG_WR_ADDR_gio_rw_pb_oe 40
205
206/* Register rw_pc_dout, scope gio, type rw */
207typedef struct {
208 unsigned int data : 18;
209 unsigned int dummy1 : 14;
210} reg_gio_rw_pc_dout;
211#define REG_RD_ADDR_gio_rw_pc_dout 48
212#define REG_WR_ADDR_gio_rw_pc_dout 48
213
214/* Register r_pc_din, scope gio, type r */
215typedef struct {
216 unsigned int data : 18;
217 unsigned int dummy1 : 14;
218} reg_gio_r_pc_din;
219#define REG_RD_ADDR_gio_r_pc_din 52
220
221/* Register rw_pc_oe, scope gio, type rw */
222typedef struct {
223 unsigned int oe : 18;
224 unsigned int dummy1 : 14;
225} reg_gio_rw_pc_oe;
226#define REG_RD_ADDR_gio_rw_pc_oe 56
227#define REG_WR_ADDR_gio_rw_pc_oe 56
228
229/* Register rw_pd_dout, scope gio, type rw */
230typedef struct {
231 unsigned int data : 18;
232 unsigned int dummy1 : 14;
233} reg_gio_rw_pd_dout;
234#define REG_RD_ADDR_gio_rw_pd_dout 64
235#define REG_WR_ADDR_gio_rw_pd_dout 64
236
237/* Register r_pd_din, scope gio, type r */
238typedef struct {
239 unsigned int data : 18;
240 unsigned int dummy1 : 14;
241} reg_gio_r_pd_din;
242#define REG_RD_ADDR_gio_r_pd_din 68
243
244/* Register rw_pd_oe, scope gio, type rw */
245typedef struct {
246 unsigned int oe : 18;
247 unsigned int dummy1 : 14;
248} reg_gio_rw_pd_oe;
249#define REG_RD_ADDR_gio_rw_pd_oe 72
250#define REG_WR_ADDR_gio_rw_pd_oe 72
251
252/* Register rw_pe_dout, scope gio, type rw */
253typedef struct {
254 unsigned int data : 18;
255 unsigned int dummy1 : 14;
256} reg_gio_rw_pe_dout;
257#define REG_RD_ADDR_gio_rw_pe_dout 80
258#define REG_WR_ADDR_gio_rw_pe_dout 80
259
260/* Register r_pe_din, scope gio, type r */
261typedef struct {
262 unsigned int data : 18;
263 unsigned int dummy1 : 14;
264} reg_gio_r_pe_din;
265#define REG_RD_ADDR_gio_r_pe_din 84
266
267/* Register rw_pe_oe, scope gio, type rw */
268typedef struct {
269 unsigned int oe : 18;
270 unsigned int dummy1 : 14;
271} reg_gio_rw_pe_oe;
272#define REG_RD_ADDR_gio_rw_pe_oe 88
273#define REG_WR_ADDR_gio_rw_pe_oe 88
274
275
276/* Constants */
277enum {
278 regk_gio_anyedge = 0x00000007,
279 regk_gio_hi = 0x00000001,
280 regk_gio_lo = 0x00000002,
281 regk_gio_negedge = 0x00000006,
282 regk_gio_no = 0x00000000,
283 regk_gio_off = 0x00000000,
284 regk_gio_posedge = 0x00000005,
285 regk_gio_rw_intr_cfg_default = 0x00000000,
286 regk_gio_rw_intr_mask_default = 0x00000000,
287 regk_gio_rw_pa_oe_default = 0x00000000,
288 regk_gio_rw_pb_oe_default = 0x00000000,
289 regk_gio_rw_pc_oe_default = 0x00000000,
290 regk_gio_rw_pd_oe_default = 0x00000000,
291 regk_gio_rw_pe_oe_default = 0x00000000,
292 regk_gio_set = 0x00000003,
293 regk_gio_yes = 0x00000001
294};
295#endif /* __gio_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/intr_vect.h b/include/asm-cris/arch-v32/hwregs/intr_vect.h
new file mode 100644
index 000000000000..5c1b28fb205d
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/intr_vect.h
@@ -0,0 +1,39 @@
1/* Interrupt vector numbers autogenerated by /n/asic/design/tools/rdesc/src/rdes2intr version
2 from ../../inst/intr_vect/rtl/guinness/ivmask.config.r
3version . */
4
5#ifndef _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
6#define _______INST_INTR_VECT_RTL_GUINNESS_IVMASK_CONFIG_R
7#define MEMARB_INTR_VECT 0x31
8#define GEN_IO_INTR_VECT 0x32
9#define IOP0_INTR_VECT 0x33
10#define IOP1_INTR_VECT 0x34
11#define IOP2_INTR_VECT 0x35
12#define IOP3_INTR_VECT 0x36
13#define DMA0_INTR_VECT 0x37
14#define DMA1_INTR_VECT 0x38
15#define DMA2_INTR_VECT 0x39
16#define DMA3_INTR_VECT 0x3a
17#define DMA4_INTR_VECT 0x3b
18#define DMA5_INTR_VECT 0x3c
19#define DMA6_INTR_VECT 0x3d
20#define DMA7_INTR_VECT 0x3e
21#define DMA8_INTR_VECT 0x3f
22#define DMA9_INTR_VECT 0x40
23#define ATA_INTR_VECT 0x41
24#define SSER0_INTR_VECT 0x42
25#define SSER1_INTR_VECT 0x43
26#define SER0_INTR_VECT 0x44
27#define SER1_INTR_VECT 0x45
28#define SER2_INTR_VECT 0x46
29#define SER3_INTR_VECT 0x47
30#define P21_INTR_VECT 0x48
31#define ETH0_INTR_VECT 0x49
32#define ETH1_INTR_VECT 0x4a
33#define TIMER_INTR_VECT 0x4b
34#define BIF_ARB_INTR_VECT 0x4c
35#define BIF_DMA_INTR_VECT 0x4d
36#define EXT_INTR_VECT 0x4e
37#define IPI_INTR_VECT 0x4f
38
39#endif
diff --git a/include/asm-cris/arch-v32/hwregs/intr_vect_defs.h b/include/asm-cris/arch-v32/hwregs/intr_vect_defs.h
new file mode 100644
index 000000000000..535aaf1b4b52
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/intr_vect_defs.h
@@ -0,0 +1,225 @@
1#ifndef __intr_vect_defs_h
2#define __intr_vect_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/intr_vect/rtl/guinness/ivmask.config.r
7 * id: ivmask.config.r,v 1.4 2005/02/15 16:05:38 stefans Exp
8 * last modfied: Mon Apr 11 16:08:03 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile intr_vect_defs.h ../../inst/intr_vect/rtl/guinness/ivmask.config.r
11 * id: $Id: intr_vect_defs.h,v 1.8 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope intr_vect */
86
87/* Register rw_mask, scope intr_vect, type rw */
88typedef struct {
89 unsigned int memarb : 1;
90 unsigned int gen_io : 1;
91 unsigned int iop0 : 1;
92 unsigned int iop1 : 1;
93 unsigned int iop2 : 1;
94 unsigned int iop3 : 1;
95 unsigned int dma0 : 1;
96 unsigned int dma1 : 1;
97 unsigned int dma2 : 1;
98 unsigned int dma3 : 1;
99 unsigned int dma4 : 1;
100 unsigned int dma5 : 1;
101 unsigned int dma6 : 1;
102 unsigned int dma7 : 1;
103 unsigned int dma8 : 1;
104 unsigned int dma9 : 1;
105 unsigned int ata : 1;
106 unsigned int sser0 : 1;
107 unsigned int sser1 : 1;
108 unsigned int ser0 : 1;
109 unsigned int ser1 : 1;
110 unsigned int ser2 : 1;
111 unsigned int ser3 : 1;
112 unsigned int p21 : 1;
113 unsigned int eth0 : 1;
114 unsigned int eth1 : 1;
115 unsigned int timer : 1;
116 unsigned int bif_arb : 1;
117 unsigned int bif_dma : 1;
118 unsigned int ext : 1;
119 unsigned int dummy1 : 2;
120} reg_intr_vect_rw_mask;
121#define REG_RD_ADDR_intr_vect_rw_mask 0
122#define REG_WR_ADDR_intr_vect_rw_mask 0
123
124/* Register r_vect, scope intr_vect, type r */
125typedef struct {
126 unsigned int memarb : 1;
127 unsigned int gen_io : 1;
128 unsigned int iop0 : 1;
129 unsigned int iop1 : 1;
130 unsigned int iop2 : 1;
131 unsigned int iop3 : 1;
132 unsigned int dma0 : 1;
133 unsigned int dma1 : 1;
134 unsigned int dma2 : 1;
135 unsigned int dma3 : 1;
136 unsigned int dma4 : 1;
137 unsigned int dma5 : 1;
138 unsigned int dma6 : 1;
139 unsigned int dma7 : 1;
140 unsigned int dma8 : 1;
141 unsigned int dma9 : 1;
142 unsigned int ata : 1;
143 unsigned int sser0 : 1;
144 unsigned int sser1 : 1;
145 unsigned int ser0 : 1;
146 unsigned int ser1 : 1;
147 unsigned int ser2 : 1;
148 unsigned int ser3 : 1;
149 unsigned int p21 : 1;
150 unsigned int eth0 : 1;
151 unsigned int eth1 : 1;
152 unsigned int timer : 1;
153 unsigned int bif_arb : 1;
154 unsigned int bif_dma : 1;
155 unsigned int ext : 1;
156 unsigned int dummy1 : 2;
157} reg_intr_vect_r_vect;
158#define REG_RD_ADDR_intr_vect_r_vect 4
159
160/* Register r_masked_vect, scope intr_vect, type r */
161typedef struct {
162 unsigned int memarb : 1;
163 unsigned int gen_io : 1;
164 unsigned int iop0 : 1;
165 unsigned int iop1 : 1;
166 unsigned int iop2 : 1;
167 unsigned int iop3 : 1;
168 unsigned int dma0 : 1;
169 unsigned int dma1 : 1;
170 unsigned int dma2 : 1;
171 unsigned int dma3 : 1;
172 unsigned int dma4 : 1;
173 unsigned int dma5 : 1;
174 unsigned int dma6 : 1;
175 unsigned int dma7 : 1;
176 unsigned int dma8 : 1;
177 unsigned int dma9 : 1;
178 unsigned int ata : 1;
179 unsigned int sser0 : 1;
180 unsigned int sser1 : 1;
181 unsigned int ser0 : 1;
182 unsigned int ser1 : 1;
183 unsigned int ser2 : 1;
184 unsigned int ser3 : 1;
185 unsigned int p21 : 1;
186 unsigned int eth0 : 1;
187 unsigned int eth1 : 1;
188 unsigned int timer : 1;
189 unsigned int bif_arb : 1;
190 unsigned int bif_dma : 1;
191 unsigned int ext : 1;
192 unsigned int dummy1 : 2;
193} reg_intr_vect_r_masked_vect;
194#define REG_RD_ADDR_intr_vect_r_masked_vect 8
195
196/* Register r_nmi, scope intr_vect, type r */
197typedef struct {
198 unsigned int ext : 1;
199 unsigned int watchdog : 1;
200 unsigned int dummy1 : 30;
201} reg_intr_vect_r_nmi;
202#define REG_RD_ADDR_intr_vect_r_nmi 12
203
204/* Register r_guru, scope intr_vect, type r */
205typedef struct {
206 unsigned int jtag : 1;
207 unsigned int dummy1 : 31;
208} reg_intr_vect_r_guru;
209#define REG_RD_ADDR_intr_vect_r_guru 16
210
211/* Register rw_ipi, scope intr_vect, type rw */
212typedef struct
213{
214 unsigned int vector;
215} reg_intr_vect_rw_ipi;
216#define REG_RD_ADDR_intr_vect_rw_ipi 20
217#define REG_WR_ADDR_intr_vect_rw_ipi 20
218
219/* Constants */
220enum {
221 regk_intr_vect_off = 0x00000000,
222 regk_intr_vect_on = 0x00000001,
223 regk_intr_vect_rw_mask_default = 0x00000000
224};
225#endif /* __intr_vect_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/Makefile b/include/asm-cris/arch-v32/hwregs/iop/Makefile
new file mode 100644
index 000000000000..a90056a095e3
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/Makefile
@@ -0,0 +1,146 @@
1# $Id: Makefile,v 1.3 2004/01/07 20:34:55 johana Exp $
2# Makefile to generate or copy the latest register definitions
3# and related datastructures and helpermacros.
4# The offical place for these files is probably at:
5RELEASE ?= r1_alfa5
6IOPOFFICIAL_INCDIR = /n/asic/projects/guinness/releases/$(RELEASE)/design/top/sw/include/
7
8IOPROCDIR = /n/asic/design/io/io_proc/rtl
9
10IOPROCINCL_FILES =
11IOPROCINCL_FILES2=
12IOPROCINCL_FILES += iop_crc_par_defs.h
13IOPROCINCL_FILES += iop_dmc_in_defs.h
14IOPROCINCL_FILES += iop_dmc_out_defs.h
15IOPROCINCL_FILES += iop_fifo_in_defs.h
16IOPROCINCL_FILES += iop_fifo_in_xtra_defs.h
17IOPROCINCL_FILES += iop_fifo_out_defs.h
18IOPROCINCL_FILES += iop_fifo_out_xtra_defs.h
19IOPROCINCL_FILES += iop_mpu_defs.h
20IOPROCINCL_FILES2+= iop_mpu_macros.h
21IOPROCINCL_FILES2+= iop_reg_space.h
22IOPROCINCL_FILES += iop_sap_in_defs.h
23IOPROCINCL_FILES += iop_sap_out_defs.h
24IOPROCINCL_FILES += iop_scrc_in_defs.h
25IOPROCINCL_FILES += iop_scrc_out_defs.h
26IOPROCINCL_FILES += iop_spu_defs.h
27# in guiness/
28IOPROCINCL_FILES += iop_sw_cfg_defs.h
29IOPROCINCL_FILES += iop_sw_cpu_defs.h
30IOPROCINCL_FILES += iop_sw_mpu_defs.h
31IOPROCINCL_FILES += iop_sw_spu_defs.h
32#
33IOPROCINCL_FILES += iop_timer_grp_defs.h
34IOPROCINCL_FILES += iop_trigger_grp_defs.h
35# in guiness/
36IOPROCINCL_FILES += iop_version_defs.h
37
38IOPROCASMINCL_FILES = $(patsubst %_defs.h,%_defs_asm.h,$(IOPROCINCL_FILES))
39IOPROCASMINCL_FILES+= iop_reg_space_asm.h
40
41
42IOPROCREGDESC =
43IOPROCREGDESC += $(IOPROCDIR)/iop_crc_par.r
44#IOPROCREGDESC += $(IOPROCDIR)/iop_crc_ser.r
45IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_in.r
46IOPROCREGDESC += $(IOPROCDIR)/iop_dmc_out.r
47IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in.r
48IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_in_xtra.r
49IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out.r
50IOPROCREGDESC += $(IOPROCDIR)/iop_fifo_out_xtra.r
51IOPROCREGDESC += $(IOPROCDIR)/iop_mpu.r
52IOPROCREGDESC += $(IOPROCDIR)/iop_sap_in.r
53IOPROCREGDESC += $(IOPROCDIR)/iop_sap_out.r
54IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_in.r
55IOPROCREGDESC += $(IOPROCDIR)/iop_scrc_out.r
56IOPROCREGDESC += $(IOPROCDIR)/iop_spu.r
57IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cfg.r
58IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_cpu.r
59IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_mpu.r
60IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_sw_spu.r
61IOPROCREGDESC += $(IOPROCDIR)/iop_timer_grp.r
62IOPROCREGDESC += $(IOPROCDIR)/iop_trigger_grp.r
63IOPROCREGDESC += $(IOPROCDIR)/guinness/iop_version.r
64
65
66RDES2C = /n/asic/bin/rdes2c
67RDES2C = /n/asic/design/tools/rdesc/rdes2c
68RDES2INTR = /n/asic/design/tools/rdesc/rdes2intr
69RDES2TXT = /n/asic/design/tools/rdesc/rdes2txt
70
71## all - Just print help - you probably want to do 'make gen'
72all: help
73
74## help - This help
75help:
76 @grep '^## ' Makefile
77
78## gen - Generate include files
79gen: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
80 echo "INCL: $(IOPROCINCL_FILES)"
81 echo "INCL2: $(IOPROCINCL_FILES2)"
82 echo "ASMINCL: $(IOPROCASMINCL_FILES)"
83
84# From the official location...
85iop_reg_space.h: $(IOPOFFICIAL_INCDIR)/iop_reg_space.h
86 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
87iop_mpu_macros.h: $(IOPOFFICIAL_INCDIR)/iop_mpu_macros.h
88 cat $< | sed -e 's/\$$Id\:/id\:/g' >$@
89
90## copy - Copy files from official location
91copy:
92 @echo "## Copying and fixing iop files ##"
93 @for HFILE in $(IOPROCINCL_FILES); do \
94 echo " $$HFILE"; \
95 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
96 done
97 @for HFILE in $(IOPROCINCL_FILES2); do \
98 echo " $$HFILE"; \
99 cat $(IOPOFFICIAL_INCDIR)$$HFILE | sed -e 's/\$$Id\:/id\:/g' > $$HFILE; \
100 done
101 @echo "## Copying and fixing iop asm files ##"
102 @for HFILE in $(IOPROCASMINCL_FILES); do \
103 echo " $$HFILE"; \
104 cat $(IOPOFFICIAL_INCDIR)asm/$$HFILE | sed -e 's/\$$Id\:/id\:/g' > asm/$$HFILE; \
105 done
106
107# I/O processor files:
108## iop - Generate I/O processor include files
109iop: $(IOPROCINCL_FILES) $(IOPROCINCL_FILES2) $(IOPROCASMINCL_FILES)
110iop_sw_%_defs.h: $(IOPROCDIR)/guinness/iop_sw_%.r
111 $(RDES2C) $<
112iop_version_defs.h: $(IOPROCDIR)/guinness/iop_version.r
113 $(RDES2C) $<
114%_defs.h: $(IOPROCDIR)/%.r
115 $(RDES2C) $<
116%_defs_asm.h: $(IOPROCDIR)/%.r
117 $(RDES2C) -asm $<
118iop_version_defs_asm.h: $(IOPROCDIR)/guinness/iop_version.r
119 $(RDES2C) -asm $<
120
121## doc - Generate .axw files from register description.
122doc: $(IOPROCREGDESC)
123 for RDES in $^; do \
124 $(RDES2TXT) $$RDES; \
125 done
126
127.PHONY: axw
128## %.axw - Generate the specified .axw file (doesn't work for all files
129## due to inconsistent naming of .r files.
130%.axw: axw
131 @for RDES in $(IOPROCREGDESC); do \
132 if echo "$$RDES" | grep $* ; then \
133 $(RDES2TXT) $$RDES; \
134 fi \
135 done
136
137.PHONY: clean
138## clean - Remove .h files and .axw files.
139clean:
140 rm -rf $(IOPROCINCL_FILES) *.axw
141
142.PHONY: cleandoc
143## cleandoc - Remove .axw files.
144cleandoc:
145 rm -rf *.axw
146
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_crc_par_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_crc_par_defs_asm.h
new file mode 100644
index 000000000000..a4b58000c164
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_crc_par_defs_asm.h
@@ -0,0 +1,171 @@
1#ifndef __iop_crc_par_defs_asm_h
2#define __iop_crc_par_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_crc_par.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_crc_par_defs_asm.h ../../inst/io_proc/rtl/iop_crc_par.r
11 * id: $Id: iop_crc_par_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_crc_par, type rw */
57#define reg_iop_crc_par_rw_cfg___mode___lsb 0
58#define reg_iop_crc_par_rw_cfg___mode___width 1
59#define reg_iop_crc_par_rw_cfg___mode___bit 0
60#define reg_iop_crc_par_rw_cfg___crc_out___lsb 1
61#define reg_iop_crc_par_rw_cfg___crc_out___width 1
62#define reg_iop_crc_par_rw_cfg___crc_out___bit 1
63#define reg_iop_crc_par_rw_cfg___rev_out___lsb 2
64#define reg_iop_crc_par_rw_cfg___rev_out___width 1
65#define reg_iop_crc_par_rw_cfg___rev_out___bit 2
66#define reg_iop_crc_par_rw_cfg___inv_out___lsb 3
67#define reg_iop_crc_par_rw_cfg___inv_out___width 1
68#define reg_iop_crc_par_rw_cfg___inv_out___bit 3
69#define reg_iop_crc_par_rw_cfg___trig___lsb 4
70#define reg_iop_crc_par_rw_cfg___trig___width 2
71#define reg_iop_crc_par_rw_cfg___poly___lsb 6
72#define reg_iop_crc_par_rw_cfg___poly___width 3
73#define reg_iop_crc_par_rw_cfg_offset 0
74
75/* Register rw_init_crc, scope iop_crc_par, type rw */
76#define reg_iop_crc_par_rw_init_crc_offset 4
77
78/* Register rw_correct_crc, scope iop_crc_par, type rw */
79#define reg_iop_crc_par_rw_correct_crc_offset 8
80
81/* Register rw_ctrl, scope iop_crc_par, type rw */
82#define reg_iop_crc_par_rw_ctrl___en___lsb 0
83#define reg_iop_crc_par_rw_ctrl___en___width 1
84#define reg_iop_crc_par_rw_ctrl___en___bit 0
85#define reg_iop_crc_par_rw_ctrl_offset 12
86
87/* Register rw_set_last, scope iop_crc_par, type rw */
88#define reg_iop_crc_par_rw_set_last___tr_dif___lsb 0
89#define reg_iop_crc_par_rw_set_last___tr_dif___width 1
90#define reg_iop_crc_par_rw_set_last___tr_dif___bit 0
91#define reg_iop_crc_par_rw_set_last_offset 16
92
93/* Register rw_wr1byte, scope iop_crc_par, type rw */
94#define reg_iop_crc_par_rw_wr1byte___data___lsb 0
95#define reg_iop_crc_par_rw_wr1byte___data___width 8
96#define reg_iop_crc_par_rw_wr1byte_offset 20
97
98/* Register rw_wr2byte, scope iop_crc_par, type rw */
99#define reg_iop_crc_par_rw_wr2byte___data___lsb 0
100#define reg_iop_crc_par_rw_wr2byte___data___width 16
101#define reg_iop_crc_par_rw_wr2byte_offset 24
102
103/* Register rw_wr3byte, scope iop_crc_par, type rw */
104#define reg_iop_crc_par_rw_wr3byte___data___lsb 0
105#define reg_iop_crc_par_rw_wr3byte___data___width 24
106#define reg_iop_crc_par_rw_wr3byte_offset 28
107
108/* Register rw_wr4byte, scope iop_crc_par, type rw */
109#define reg_iop_crc_par_rw_wr4byte___data___lsb 0
110#define reg_iop_crc_par_rw_wr4byte___data___width 32
111#define reg_iop_crc_par_rw_wr4byte_offset 32
112
113/* Register rw_wr1byte_last, scope iop_crc_par, type rw */
114#define reg_iop_crc_par_rw_wr1byte_last___data___lsb 0
115#define reg_iop_crc_par_rw_wr1byte_last___data___width 8
116#define reg_iop_crc_par_rw_wr1byte_last_offset 36
117
118/* Register rw_wr2byte_last, scope iop_crc_par, type rw */
119#define reg_iop_crc_par_rw_wr2byte_last___data___lsb 0
120#define reg_iop_crc_par_rw_wr2byte_last___data___width 16
121#define reg_iop_crc_par_rw_wr2byte_last_offset 40
122
123/* Register rw_wr3byte_last, scope iop_crc_par, type rw */
124#define reg_iop_crc_par_rw_wr3byte_last___data___lsb 0
125#define reg_iop_crc_par_rw_wr3byte_last___data___width 24
126#define reg_iop_crc_par_rw_wr3byte_last_offset 44
127
128/* Register rw_wr4byte_last, scope iop_crc_par, type rw */
129#define reg_iop_crc_par_rw_wr4byte_last___data___lsb 0
130#define reg_iop_crc_par_rw_wr4byte_last___data___width 32
131#define reg_iop_crc_par_rw_wr4byte_last_offset 48
132
133/* Register r_stat, scope iop_crc_par, type r */
134#define reg_iop_crc_par_r_stat___err___lsb 0
135#define reg_iop_crc_par_r_stat___err___width 1
136#define reg_iop_crc_par_r_stat___err___bit 0
137#define reg_iop_crc_par_r_stat___busy___lsb 1
138#define reg_iop_crc_par_r_stat___busy___width 1
139#define reg_iop_crc_par_r_stat___busy___bit 1
140#define reg_iop_crc_par_r_stat_offset 52
141
142/* Register r_sh_reg, scope iop_crc_par, type r */
143#define reg_iop_crc_par_r_sh_reg_offset 56
144
145/* Register r_crc, scope iop_crc_par, type r */
146#define reg_iop_crc_par_r_crc_offset 60
147
148/* Register rw_strb_rec_dif_in, scope iop_crc_par, type rw */
149#define reg_iop_crc_par_rw_strb_rec_dif_in___last___lsb 0
150#define reg_iop_crc_par_rw_strb_rec_dif_in___last___width 2
151#define reg_iop_crc_par_rw_strb_rec_dif_in_offset 64
152
153
154/* Constants */
155#define regk_iop_crc_par_calc 0x00000001
156#define regk_iop_crc_par_ccitt 0x00000002
157#define regk_iop_crc_par_check 0x00000000
158#define regk_iop_crc_par_crc16 0x00000001
159#define regk_iop_crc_par_crc32 0x00000000
160#define regk_iop_crc_par_crc5 0x00000003
161#define regk_iop_crc_par_crc5_11 0x00000004
162#define regk_iop_crc_par_dif_in 0x00000002
163#define regk_iop_crc_par_hi 0x00000000
164#define regk_iop_crc_par_neg 0x00000002
165#define regk_iop_crc_par_no 0x00000000
166#define regk_iop_crc_par_pos 0x00000001
167#define regk_iop_crc_par_pos_neg 0x00000003
168#define regk_iop_crc_par_rw_cfg_default 0x00000000
169#define regk_iop_crc_par_rw_ctrl_default 0x00000000
170#define regk_iop_crc_par_yes 0x00000001
171#endif /* __iop_crc_par_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_in_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_in_defs_asm.h
new file mode 100644
index 000000000000..e7d539feccb1
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_in_defs_asm.h
@@ -0,0 +1,321 @@
1#ifndef __iop_dmc_in_defs_asm_h
2#define __iop_dmc_in_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_dmc_in.r
7 * id: iop_dmc_in.r,v 1.26 2005/02/16 09:14:17 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_dmc_in_defs_asm.h ../../inst/io_proc/rtl/iop_dmc_in.r
11 * id: $Id: iop_dmc_in_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_dmc_in, type rw */
57#define reg_iop_dmc_in_rw_cfg___sth_intr___lsb 0
58#define reg_iop_dmc_in_rw_cfg___sth_intr___width 3
59#define reg_iop_dmc_in_rw_cfg___last_dis_dif___lsb 3
60#define reg_iop_dmc_in_rw_cfg___last_dis_dif___width 1
61#define reg_iop_dmc_in_rw_cfg___last_dis_dif___bit 3
62#define reg_iop_dmc_in_rw_cfg_offset 0
63
64/* Register rw_ctrl, scope iop_dmc_in, type rw */
65#define reg_iop_dmc_in_rw_ctrl___dif_en___lsb 0
66#define reg_iop_dmc_in_rw_ctrl___dif_en___width 1
67#define reg_iop_dmc_in_rw_ctrl___dif_en___bit 0
68#define reg_iop_dmc_in_rw_ctrl___dif_dis___lsb 1
69#define reg_iop_dmc_in_rw_ctrl___dif_dis___width 1
70#define reg_iop_dmc_in_rw_ctrl___dif_dis___bit 1
71#define reg_iop_dmc_in_rw_ctrl___stream_clr___lsb 2
72#define reg_iop_dmc_in_rw_ctrl___stream_clr___width 1
73#define reg_iop_dmc_in_rw_ctrl___stream_clr___bit 2
74#define reg_iop_dmc_in_rw_ctrl_offset 4
75
76/* Register r_stat, scope iop_dmc_in, type r */
77#define reg_iop_dmc_in_r_stat___dif_en___lsb 0
78#define reg_iop_dmc_in_r_stat___dif_en___width 1
79#define reg_iop_dmc_in_r_stat___dif_en___bit 0
80#define reg_iop_dmc_in_r_stat_offset 8
81
82/* Register rw_stream_cmd, scope iop_dmc_in, type rw */
83#define reg_iop_dmc_in_rw_stream_cmd___cmd___lsb 0
84#define reg_iop_dmc_in_rw_stream_cmd___cmd___width 10
85#define reg_iop_dmc_in_rw_stream_cmd___n___lsb 16
86#define reg_iop_dmc_in_rw_stream_cmd___n___width 8
87#define reg_iop_dmc_in_rw_stream_cmd_offset 12
88
89/* Register rw_stream_wr_data, scope iop_dmc_in, type rw */
90#define reg_iop_dmc_in_rw_stream_wr_data_offset 16
91
92/* Register rw_stream_wr_data_last, scope iop_dmc_in, type rw */
93#define reg_iop_dmc_in_rw_stream_wr_data_last_offset 20
94
95/* Register rw_stream_ctrl, scope iop_dmc_in, type rw */
96#define reg_iop_dmc_in_rw_stream_ctrl___eop___lsb 0
97#define reg_iop_dmc_in_rw_stream_ctrl___eop___width 1
98#define reg_iop_dmc_in_rw_stream_ctrl___eop___bit 0
99#define reg_iop_dmc_in_rw_stream_ctrl___wait___lsb 1
100#define reg_iop_dmc_in_rw_stream_ctrl___wait___width 1
101#define reg_iop_dmc_in_rw_stream_ctrl___wait___bit 1
102#define reg_iop_dmc_in_rw_stream_ctrl___keep_md___lsb 2
103#define reg_iop_dmc_in_rw_stream_ctrl___keep_md___width 1
104#define reg_iop_dmc_in_rw_stream_ctrl___keep_md___bit 2
105#define reg_iop_dmc_in_rw_stream_ctrl___size___lsb 3
106#define reg_iop_dmc_in_rw_stream_ctrl___size___width 3
107#define reg_iop_dmc_in_rw_stream_ctrl_offset 24
108
109/* Register r_stream_stat, scope iop_dmc_in, type r */
110#define reg_iop_dmc_in_r_stream_stat___sth___lsb 0
111#define reg_iop_dmc_in_r_stream_stat___sth___width 7
112#define reg_iop_dmc_in_r_stream_stat___full___lsb 16
113#define reg_iop_dmc_in_r_stream_stat___full___width 1
114#define reg_iop_dmc_in_r_stream_stat___full___bit 16
115#define reg_iop_dmc_in_r_stream_stat___last_pkt___lsb 17
116#define reg_iop_dmc_in_r_stream_stat___last_pkt___width 1
117#define reg_iop_dmc_in_r_stream_stat___last_pkt___bit 17
118#define reg_iop_dmc_in_r_stream_stat___data_md_valid___lsb 18
119#define reg_iop_dmc_in_r_stream_stat___data_md_valid___width 1
120#define reg_iop_dmc_in_r_stream_stat___data_md_valid___bit 18
121#define reg_iop_dmc_in_r_stream_stat___ctxt_md_valid___lsb 19
122#define reg_iop_dmc_in_r_stream_stat___ctxt_md_valid___width 1
123#define reg_iop_dmc_in_r_stream_stat___ctxt_md_valid___bit 19
124#define reg_iop_dmc_in_r_stream_stat___group_md_valid___lsb 20
125#define reg_iop_dmc_in_r_stream_stat___group_md_valid___width 1
126#define reg_iop_dmc_in_r_stream_stat___group_md_valid___bit 20
127#define reg_iop_dmc_in_r_stream_stat___stream_busy___lsb 21
128#define reg_iop_dmc_in_r_stream_stat___stream_busy___width 1
129#define reg_iop_dmc_in_r_stream_stat___stream_busy___bit 21
130#define reg_iop_dmc_in_r_stream_stat___cmd_rdy___lsb 22
131#define reg_iop_dmc_in_r_stream_stat___cmd_rdy___width 1
132#define reg_iop_dmc_in_r_stream_stat___cmd_rdy___bit 22
133#define reg_iop_dmc_in_r_stream_stat_offset 28
134
135/* Register r_data_descr, scope iop_dmc_in, type r */
136#define reg_iop_dmc_in_r_data_descr___ctrl___lsb 0
137#define reg_iop_dmc_in_r_data_descr___ctrl___width 8
138#define reg_iop_dmc_in_r_data_descr___stat___lsb 8
139#define reg_iop_dmc_in_r_data_descr___stat___width 8
140#define reg_iop_dmc_in_r_data_descr___md___lsb 16
141#define reg_iop_dmc_in_r_data_descr___md___width 16
142#define reg_iop_dmc_in_r_data_descr_offset 32
143
144/* Register r_ctxt_descr, scope iop_dmc_in, type r */
145#define reg_iop_dmc_in_r_ctxt_descr___ctrl___lsb 0
146#define reg_iop_dmc_in_r_ctxt_descr___ctrl___width 8
147#define reg_iop_dmc_in_r_ctxt_descr___stat___lsb 8
148#define reg_iop_dmc_in_r_ctxt_descr___stat___width 8
149#define reg_iop_dmc_in_r_ctxt_descr___md0___lsb 16
150#define reg_iop_dmc_in_r_ctxt_descr___md0___width 16
151#define reg_iop_dmc_in_r_ctxt_descr_offset 36
152
153/* Register r_ctxt_descr_md1, scope iop_dmc_in, type r */
154#define reg_iop_dmc_in_r_ctxt_descr_md1_offset 40
155
156/* Register r_ctxt_descr_md2, scope iop_dmc_in, type r */
157#define reg_iop_dmc_in_r_ctxt_descr_md2_offset 44
158
159/* Register r_group_descr, scope iop_dmc_in, type r */
160#define reg_iop_dmc_in_r_group_descr___ctrl___lsb 0
161#define reg_iop_dmc_in_r_group_descr___ctrl___width 8
162#define reg_iop_dmc_in_r_group_descr___stat___lsb 8
163#define reg_iop_dmc_in_r_group_descr___stat___width 8
164#define reg_iop_dmc_in_r_group_descr___md___lsb 16
165#define reg_iop_dmc_in_r_group_descr___md___width 16
166#define reg_iop_dmc_in_r_group_descr_offset 56
167
168/* Register rw_data_descr, scope iop_dmc_in, type rw */
169#define reg_iop_dmc_in_rw_data_descr___md___lsb 16
170#define reg_iop_dmc_in_rw_data_descr___md___width 16
171#define reg_iop_dmc_in_rw_data_descr_offset 60
172
173/* Register rw_ctxt_descr, scope iop_dmc_in, type rw */
174#define reg_iop_dmc_in_rw_ctxt_descr___md0___lsb 16
175#define reg_iop_dmc_in_rw_ctxt_descr___md0___width 16
176#define reg_iop_dmc_in_rw_ctxt_descr_offset 64
177
178/* Register rw_ctxt_descr_md1, scope iop_dmc_in, type rw */
179#define reg_iop_dmc_in_rw_ctxt_descr_md1_offset 68
180
181/* Register rw_ctxt_descr_md2, scope iop_dmc_in, type rw */
182#define reg_iop_dmc_in_rw_ctxt_descr_md2_offset 72
183
184/* Register rw_group_descr, scope iop_dmc_in, type rw */
185#define reg_iop_dmc_in_rw_group_descr___md___lsb 16
186#define reg_iop_dmc_in_rw_group_descr___md___width 16
187#define reg_iop_dmc_in_rw_group_descr_offset 84
188
189/* Register rw_intr_mask, scope iop_dmc_in, type rw */
190#define reg_iop_dmc_in_rw_intr_mask___data_md___lsb 0
191#define reg_iop_dmc_in_rw_intr_mask___data_md___width 1
192#define reg_iop_dmc_in_rw_intr_mask___data_md___bit 0
193#define reg_iop_dmc_in_rw_intr_mask___ctxt_md___lsb 1
194#define reg_iop_dmc_in_rw_intr_mask___ctxt_md___width 1
195#define reg_iop_dmc_in_rw_intr_mask___ctxt_md___bit 1
196#define reg_iop_dmc_in_rw_intr_mask___group_md___lsb 2
197#define reg_iop_dmc_in_rw_intr_mask___group_md___width 1
198#define reg_iop_dmc_in_rw_intr_mask___group_md___bit 2
199#define reg_iop_dmc_in_rw_intr_mask___cmd_rdy___lsb 3
200#define reg_iop_dmc_in_rw_intr_mask___cmd_rdy___width 1
201#define reg_iop_dmc_in_rw_intr_mask___cmd_rdy___bit 3
202#define reg_iop_dmc_in_rw_intr_mask___sth___lsb 4
203#define reg_iop_dmc_in_rw_intr_mask___sth___width 1
204#define reg_iop_dmc_in_rw_intr_mask___sth___bit 4
205#define reg_iop_dmc_in_rw_intr_mask___full___lsb 5
206#define reg_iop_dmc_in_rw_intr_mask___full___width 1
207#define reg_iop_dmc_in_rw_intr_mask___full___bit 5
208#define reg_iop_dmc_in_rw_intr_mask_offset 88
209
210/* Register rw_ack_intr, scope iop_dmc_in, type rw */
211#define reg_iop_dmc_in_rw_ack_intr___data_md___lsb 0
212#define reg_iop_dmc_in_rw_ack_intr___data_md___width 1
213#define reg_iop_dmc_in_rw_ack_intr___data_md___bit 0
214#define reg_iop_dmc_in_rw_ack_intr___ctxt_md___lsb 1
215#define reg_iop_dmc_in_rw_ack_intr___ctxt_md___width 1
216#define reg_iop_dmc_in_rw_ack_intr___ctxt_md___bit 1
217#define reg_iop_dmc_in_rw_ack_intr___group_md___lsb 2
218#define reg_iop_dmc_in_rw_ack_intr___group_md___width 1
219#define reg_iop_dmc_in_rw_ack_intr___group_md___bit 2
220#define reg_iop_dmc_in_rw_ack_intr___cmd_rdy___lsb 3
221#define reg_iop_dmc_in_rw_ack_intr___cmd_rdy___width 1
222#define reg_iop_dmc_in_rw_ack_intr___cmd_rdy___bit 3
223#define reg_iop_dmc_in_rw_ack_intr___sth___lsb 4
224#define reg_iop_dmc_in_rw_ack_intr___sth___width 1
225#define reg_iop_dmc_in_rw_ack_intr___sth___bit 4
226#define reg_iop_dmc_in_rw_ack_intr___full___lsb 5
227#define reg_iop_dmc_in_rw_ack_intr___full___width 1
228#define reg_iop_dmc_in_rw_ack_intr___full___bit 5
229#define reg_iop_dmc_in_rw_ack_intr_offset 92
230
231/* Register r_intr, scope iop_dmc_in, type r */
232#define reg_iop_dmc_in_r_intr___data_md___lsb 0
233#define reg_iop_dmc_in_r_intr___data_md___width 1
234#define reg_iop_dmc_in_r_intr___data_md___bit 0
235#define reg_iop_dmc_in_r_intr___ctxt_md___lsb 1
236#define reg_iop_dmc_in_r_intr___ctxt_md___width 1
237#define reg_iop_dmc_in_r_intr___ctxt_md___bit 1
238#define reg_iop_dmc_in_r_intr___group_md___lsb 2
239#define reg_iop_dmc_in_r_intr___group_md___width 1
240#define reg_iop_dmc_in_r_intr___group_md___bit 2
241#define reg_iop_dmc_in_r_intr___cmd_rdy___lsb 3
242#define reg_iop_dmc_in_r_intr___cmd_rdy___width 1
243#define reg_iop_dmc_in_r_intr___cmd_rdy___bit 3
244#define reg_iop_dmc_in_r_intr___sth___lsb 4
245#define reg_iop_dmc_in_r_intr___sth___width 1
246#define reg_iop_dmc_in_r_intr___sth___bit 4
247#define reg_iop_dmc_in_r_intr___full___lsb 5
248#define reg_iop_dmc_in_r_intr___full___width 1
249#define reg_iop_dmc_in_r_intr___full___bit 5
250#define reg_iop_dmc_in_r_intr_offset 96
251
252/* Register r_masked_intr, scope iop_dmc_in, type r */
253#define reg_iop_dmc_in_r_masked_intr___data_md___lsb 0
254#define reg_iop_dmc_in_r_masked_intr___data_md___width 1
255#define reg_iop_dmc_in_r_masked_intr___data_md___bit 0
256#define reg_iop_dmc_in_r_masked_intr___ctxt_md___lsb 1
257#define reg_iop_dmc_in_r_masked_intr___ctxt_md___width 1
258#define reg_iop_dmc_in_r_masked_intr___ctxt_md___bit 1
259#define reg_iop_dmc_in_r_masked_intr___group_md___lsb 2
260#define reg_iop_dmc_in_r_masked_intr___group_md___width 1
261#define reg_iop_dmc_in_r_masked_intr___group_md___bit 2
262#define reg_iop_dmc_in_r_masked_intr___cmd_rdy___lsb 3
263#define reg_iop_dmc_in_r_masked_intr___cmd_rdy___width 1
264#define reg_iop_dmc_in_r_masked_intr___cmd_rdy___bit 3
265#define reg_iop_dmc_in_r_masked_intr___sth___lsb 4
266#define reg_iop_dmc_in_r_masked_intr___sth___width 1
267#define reg_iop_dmc_in_r_masked_intr___sth___bit 4
268#define reg_iop_dmc_in_r_masked_intr___full___lsb 5
269#define reg_iop_dmc_in_r_masked_intr___full___width 1
270#define reg_iop_dmc_in_r_masked_intr___full___bit 5
271#define reg_iop_dmc_in_r_masked_intr_offset 100
272
273
274/* Constants */
275#define regk_iop_dmc_in_ack_pkt 0x00000100
276#define regk_iop_dmc_in_array 0x00000008
277#define regk_iop_dmc_in_burst 0x00000020
278#define regk_iop_dmc_in_copy_next 0x00000010
279#define regk_iop_dmc_in_copy_up 0x00000020
280#define regk_iop_dmc_in_dis_c 0x00000010
281#define regk_iop_dmc_in_dis_g 0x00000020
282#define regk_iop_dmc_in_lim1 0x00000000
283#define regk_iop_dmc_in_lim16 0x00000004
284#define regk_iop_dmc_in_lim2 0x00000001
285#define regk_iop_dmc_in_lim32 0x00000005
286#define regk_iop_dmc_in_lim4 0x00000002
287#define regk_iop_dmc_in_lim64 0x00000006
288#define regk_iop_dmc_in_lim8 0x00000003
289#define regk_iop_dmc_in_load_c 0x00000200
290#define regk_iop_dmc_in_load_c_n 0x00000280
291#define regk_iop_dmc_in_load_c_next 0x00000240
292#define regk_iop_dmc_in_load_d 0x00000140
293#define regk_iop_dmc_in_load_g 0x00000300
294#define regk_iop_dmc_in_load_g_down 0x000003c0
295#define regk_iop_dmc_in_load_g_next 0x00000340
296#define regk_iop_dmc_in_load_g_up 0x00000380
297#define regk_iop_dmc_in_next_en 0x00000010
298#define regk_iop_dmc_in_next_pkt 0x00000010
299#define regk_iop_dmc_in_no 0x00000000
300#define regk_iop_dmc_in_restore 0x00000020
301#define regk_iop_dmc_in_rw_cfg_default 0x00000000
302#define regk_iop_dmc_in_rw_ctxt_descr_default 0x00000000
303#define regk_iop_dmc_in_rw_ctxt_descr_md1_default 0x00000000
304#define regk_iop_dmc_in_rw_ctxt_descr_md2_default 0x00000000
305#define regk_iop_dmc_in_rw_data_descr_default 0x00000000
306#define regk_iop_dmc_in_rw_group_descr_default 0x00000000
307#define regk_iop_dmc_in_rw_intr_mask_default 0x00000000
308#define regk_iop_dmc_in_rw_stream_ctrl_default 0x00000000
309#define regk_iop_dmc_in_save_down 0x00000020
310#define regk_iop_dmc_in_save_up 0x00000020
311#define regk_iop_dmc_in_set_reg 0x00000050
312#define regk_iop_dmc_in_set_w_size1 0x00000190
313#define regk_iop_dmc_in_set_w_size2 0x000001a0
314#define regk_iop_dmc_in_set_w_size4 0x000001c0
315#define regk_iop_dmc_in_store_c 0x00000002
316#define regk_iop_dmc_in_store_descr 0x00000000
317#define regk_iop_dmc_in_store_g 0x00000004
318#define regk_iop_dmc_in_store_md 0x00000001
319#define regk_iop_dmc_in_update_down 0x00000020
320#define regk_iop_dmc_in_yes 0x00000001
321#endif /* __iop_dmc_in_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_out_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_out_defs_asm.h
new file mode 100644
index 000000000000..9fe1a8054371
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_dmc_out_defs_asm.h
@@ -0,0 +1,349 @@
1#ifndef __iop_dmc_out_defs_asm_h
2#define __iop_dmc_out_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_dmc_out.r
7 * id: iop_dmc_out.r,v 1.30 2005/02/16 09:14:11 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_dmc_out_defs_asm.h ../../inst/io_proc/rtl/iop_dmc_out.r
11 * id: $Id: iop_dmc_out_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_dmc_out, type rw */
57#define reg_iop_dmc_out_rw_cfg___trf_lim___lsb 0
58#define reg_iop_dmc_out_rw_cfg___trf_lim___width 16
59#define reg_iop_dmc_out_rw_cfg___last_at_trf_lim___lsb 16
60#define reg_iop_dmc_out_rw_cfg___last_at_trf_lim___width 1
61#define reg_iop_dmc_out_rw_cfg___last_at_trf_lim___bit 16
62#define reg_iop_dmc_out_rw_cfg___dth_intr___lsb 17
63#define reg_iop_dmc_out_rw_cfg___dth_intr___width 3
64#define reg_iop_dmc_out_rw_cfg_offset 0
65
66/* Register rw_ctrl, scope iop_dmc_out, type rw */
67#define reg_iop_dmc_out_rw_ctrl___dif_en___lsb 0
68#define reg_iop_dmc_out_rw_ctrl___dif_en___width 1
69#define reg_iop_dmc_out_rw_ctrl___dif_en___bit 0
70#define reg_iop_dmc_out_rw_ctrl___dif_dis___lsb 1
71#define reg_iop_dmc_out_rw_ctrl___dif_dis___width 1
72#define reg_iop_dmc_out_rw_ctrl___dif_dis___bit 1
73#define reg_iop_dmc_out_rw_ctrl_offset 4
74
75/* Register r_stat, scope iop_dmc_out, type r */
76#define reg_iop_dmc_out_r_stat___dif_en___lsb 0
77#define reg_iop_dmc_out_r_stat___dif_en___width 1
78#define reg_iop_dmc_out_r_stat___dif_en___bit 0
79#define reg_iop_dmc_out_r_stat_offset 8
80
81/* Register rw_stream_cmd, scope iop_dmc_out, type rw */
82#define reg_iop_dmc_out_rw_stream_cmd___cmd___lsb 0
83#define reg_iop_dmc_out_rw_stream_cmd___cmd___width 10
84#define reg_iop_dmc_out_rw_stream_cmd___n___lsb 16
85#define reg_iop_dmc_out_rw_stream_cmd___n___width 8
86#define reg_iop_dmc_out_rw_stream_cmd_offset 12
87
88/* Register rs_stream_data, scope iop_dmc_out, type rs */
89#define reg_iop_dmc_out_rs_stream_data_offset 16
90
91/* Register r_stream_data, scope iop_dmc_out, type r */
92#define reg_iop_dmc_out_r_stream_data_offset 20
93
94/* Register r_stream_stat, scope iop_dmc_out, type r */
95#define reg_iop_dmc_out_r_stream_stat___dth___lsb 0
96#define reg_iop_dmc_out_r_stream_stat___dth___width 7
97#define reg_iop_dmc_out_r_stream_stat___dv___lsb 16
98#define reg_iop_dmc_out_r_stream_stat___dv___width 1
99#define reg_iop_dmc_out_r_stream_stat___dv___bit 16
100#define reg_iop_dmc_out_r_stream_stat___all_avail___lsb 17
101#define reg_iop_dmc_out_r_stream_stat___all_avail___width 1
102#define reg_iop_dmc_out_r_stream_stat___all_avail___bit 17
103#define reg_iop_dmc_out_r_stream_stat___last___lsb 18
104#define reg_iop_dmc_out_r_stream_stat___last___width 1
105#define reg_iop_dmc_out_r_stream_stat___last___bit 18
106#define reg_iop_dmc_out_r_stream_stat___size___lsb 19
107#define reg_iop_dmc_out_r_stream_stat___size___width 3
108#define reg_iop_dmc_out_r_stream_stat___data_md_valid___lsb 22
109#define reg_iop_dmc_out_r_stream_stat___data_md_valid___width 1
110#define reg_iop_dmc_out_r_stream_stat___data_md_valid___bit 22
111#define reg_iop_dmc_out_r_stream_stat___ctxt_md_valid___lsb 23
112#define reg_iop_dmc_out_r_stream_stat___ctxt_md_valid___width 1
113#define reg_iop_dmc_out_r_stream_stat___ctxt_md_valid___bit 23
114#define reg_iop_dmc_out_r_stream_stat___group_md_valid___lsb 24
115#define reg_iop_dmc_out_r_stream_stat___group_md_valid___width 1
116#define reg_iop_dmc_out_r_stream_stat___group_md_valid___bit 24
117#define reg_iop_dmc_out_r_stream_stat___stream_busy___lsb 25
118#define reg_iop_dmc_out_r_stream_stat___stream_busy___width 1
119#define reg_iop_dmc_out_r_stream_stat___stream_busy___bit 25
120#define reg_iop_dmc_out_r_stream_stat___cmd_rdy___lsb 26
121#define reg_iop_dmc_out_r_stream_stat___cmd_rdy___width 1
122#define reg_iop_dmc_out_r_stream_stat___cmd_rdy___bit 26
123#define reg_iop_dmc_out_r_stream_stat___cmd_rq___lsb 27
124#define reg_iop_dmc_out_r_stream_stat___cmd_rq___width 1
125#define reg_iop_dmc_out_r_stream_stat___cmd_rq___bit 27
126#define reg_iop_dmc_out_r_stream_stat_offset 24
127
128/* Register r_data_descr, scope iop_dmc_out, type r */
129#define reg_iop_dmc_out_r_data_descr___ctrl___lsb 0
130#define reg_iop_dmc_out_r_data_descr___ctrl___width 8
131#define reg_iop_dmc_out_r_data_descr___stat___lsb 8
132#define reg_iop_dmc_out_r_data_descr___stat___width 8
133#define reg_iop_dmc_out_r_data_descr___md___lsb 16
134#define reg_iop_dmc_out_r_data_descr___md___width 16
135#define reg_iop_dmc_out_r_data_descr_offset 28
136
137/* Register r_ctxt_descr, scope iop_dmc_out, type r */
138#define reg_iop_dmc_out_r_ctxt_descr___ctrl___lsb 0
139#define reg_iop_dmc_out_r_ctxt_descr___ctrl___width 8
140#define reg_iop_dmc_out_r_ctxt_descr___stat___lsb 8
141#define reg_iop_dmc_out_r_ctxt_descr___stat___width 8
142#define reg_iop_dmc_out_r_ctxt_descr___md0___lsb 16
143#define reg_iop_dmc_out_r_ctxt_descr___md0___width 16
144#define reg_iop_dmc_out_r_ctxt_descr_offset 32
145
146/* Register r_ctxt_descr_md1, scope iop_dmc_out, type r */
147#define reg_iop_dmc_out_r_ctxt_descr_md1_offset 36
148
149/* Register r_ctxt_descr_md2, scope iop_dmc_out, type r */
150#define reg_iop_dmc_out_r_ctxt_descr_md2_offset 40
151
152/* Register r_group_descr, scope iop_dmc_out, type r */
153#define reg_iop_dmc_out_r_group_descr___ctrl___lsb 0
154#define reg_iop_dmc_out_r_group_descr___ctrl___width 8
155#define reg_iop_dmc_out_r_group_descr___stat___lsb 8
156#define reg_iop_dmc_out_r_group_descr___stat___width 8
157#define reg_iop_dmc_out_r_group_descr___md___lsb 16
158#define reg_iop_dmc_out_r_group_descr___md___width 16
159#define reg_iop_dmc_out_r_group_descr_offset 52
160
161/* Register rw_data_descr, scope iop_dmc_out, type rw */
162#define reg_iop_dmc_out_rw_data_descr___md___lsb 16
163#define reg_iop_dmc_out_rw_data_descr___md___width 16
164#define reg_iop_dmc_out_rw_data_descr_offset 56
165
166/* Register rw_ctxt_descr, scope iop_dmc_out, type rw */
167#define reg_iop_dmc_out_rw_ctxt_descr___md0___lsb 16
168#define reg_iop_dmc_out_rw_ctxt_descr___md0___width 16
169#define reg_iop_dmc_out_rw_ctxt_descr_offset 60
170
171/* Register rw_ctxt_descr_md1, scope iop_dmc_out, type rw */
172#define reg_iop_dmc_out_rw_ctxt_descr_md1_offset 64
173
174/* Register rw_ctxt_descr_md2, scope iop_dmc_out, type rw */
175#define reg_iop_dmc_out_rw_ctxt_descr_md2_offset 68
176
177/* Register rw_group_descr, scope iop_dmc_out, type rw */
178#define reg_iop_dmc_out_rw_group_descr___md___lsb 16
179#define reg_iop_dmc_out_rw_group_descr___md___width 16
180#define reg_iop_dmc_out_rw_group_descr_offset 80
181
182/* Register rw_intr_mask, scope iop_dmc_out, type rw */
183#define reg_iop_dmc_out_rw_intr_mask___data_md___lsb 0
184#define reg_iop_dmc_out_rw_intr_mask___data_md___width 1
185#define reg_iop_dmc_out_rw_intr_mask___data_md___bit 0
186#define reg_iop_dmc_out_rw_intr_mask___ctxt_md___lsb 1
187#define reg_iop_dmc_out_rw_intr_mask___ctxt_md___width 1
188#define reg_iop_dmc_out_rw_intr_mask___ctxt_md___bit 1
189#define reg_iop_dmc_out_rw_intr_mask___group_md___lsb 2
190#define reg_iop_dmc_out_rw_intr_mask___group_md___width 1
191#define reg_iop_dmc_out_rw_intr_mask___group_md___bit 2
192#define reg_iop_dmc_out_rw_intr_mask___cmd_rdy___lsb 3
193#define reg_iop_dmc_out_rw_intr_mask___cmd_rdy___width 1
194#define reg_iop_dmc_out_rw_intr_mask___cmd_rdy___bit 3
195#define reg_iop_dmc_out_rw_intr_mask___dth___lsb 4
196#define reg_iop_dmc_out_rw_intr_mask___dth___width 1
197#define reg_iop_dmc_out_rw_intr_mask___dth___bit 4
198#define reg_iop_dmc_out_rw_intr_mask___dv___lsb 5
199#define reg_iop_dmc_out_rw_intr_mask___dv___width 1
200#define reg_iop_dmc_out_rw_intr_mask___dv___bit 5
201#define reg_iop_dmc_out_rw_intr_mask___last_data___lsb 6
202#define reg_iop_dmc_out_rw_intr_mask___last_data___width 1
203#define reg_iop_dmc_out_rw_intr_mask___last_data___bit 6
204#define reg_iop_dmc_out_rw_intr_mask___trf_lim___lsb 7
205#define reg_iop_dmc_out_rw_intr_mask___trf_lim___width 1
206#define reg_iop_dmc_out_rw_intr_mask___trf_lim___bit 7
207#define reg_iop_dmc_out_rw_intr_mask___cmd_rq___lsb 8
208#define reg_iop_dmc_out_rw_intr_mask___cmd_rq___width 1
209#define reg_iop_dmc_out_rw_intr_mask___cmd_rq___bit 8
210#define reg_iop_dmc_out_rw_intr_mask_offset 84
211
212/* Register rw_ack_intr, scope iop_dmc_out, type rw */
213#define reg_iop_dmc_out_rw_ack_intr___data_md___lsb 0
214#define reg_iop_dmc_out_rw_ack_intr___data_md___width 1
215#define reg_iop_dmc_out_rw_ack_intr___data_md___bit 0
216#define reg_iop_dmc_out_rw_ack_intr___ctxt_md___lsb 1
217#define reg_iop_dmc_out_rw_ack_intr___ctxt_md___width 1
218#define reg_iop_dmc_out_rw_ack_intr___ctxt_md___bit 1
219#define reg_iop_dmc_out_rw_ack_intr___group_md___lsb 2
220#define reg_iop_dmc_out_rw_ack_intr___group_md___width 1
221#define reg_iop_dmc_out_rw_ack_intr___group_md___bit 2
222#define reg_iop_dmc_out_rw_ack_intr___cmd_rdy___lsb 3
223#define reg_iop_dmc_out_rw_ack_intr___cmd_rdy___width 1
224#define reg_iop_dmc_out_rw_ack_intr___cmd_rdy___bit 3
225#define reg_iop_dmc_out_rw_ack_intr___dth___lsb 4
226#define reg_iop_dmc_out_rw_ack_intr___dth___width 1
227#define reg_iop_dmc_out_rw_ack_intr___dth___bit 4
228#define reg_iop_dmc_out_rw_ack_intr___dv___lsb 5
229#define reg_iop_dmc_out_rw_ack_intr___dv___width 1
230#define reg_iop_dmc_out_rw_ack_intr___dv___bit 5
231#define reg_iop_dmc_out_rw_ack_intr___last_data___lsb 6
232#define reg_iop_dmc_out_rw_ack_intr___last_data___width 1
233#define reg_iop_dmc_out_rw_ack_intr___last_data___bit 6
234#define reg_iop_dmc_out_rw_ack_intr___trf_lim___lsb 7
235#define reg_iop_dmc_out_rw_ack_intr___trf_lim___width 1
236#define reg_iop_dmc_out_rw_ack_intr___trf_lim___bit 7
237#define reg_iop_dmc_out_rw_ack_intr___cmd_rq___lsb 8
238#define reg_iop_dmc_out_rw_ack_intr___cmd_rq___width 1
239#define reg_iop_dmc_out_rw_ack_intr___cmd_rq___bit 8
240#define reg_iop_dmc_out_rw_ack_intr_offset 88
241
242/* Register r_intr, scope iop_dmc_out, type r */
243#define reg_iop_dmc_out_r_intr___data_md___lsb 0
244#define reg_iop_dmc_out_r_intr___data_md___width 1
245#define reg_iop_dmc_out_r_intr___data_md___bit 0
246#define reg_iop_dmc_out_r_intr___ctxt_md___lsb 1
247#define reg_iop_dmc_out_r_intr___ctxt_md___width 1
248#define reg_iop_dmc_out_r_intr___ctxt_md___bit 1
249#define reg_iop_dmc_out_r_intr___group_md___lsb 2
250#define reg_iop_dmc_out_r_intr___group_md___width 1
251#define reg_iop_dmc_out_r_intr___group_md___bit 2
252#define reg_iop_dmc_out_r_intr___cmd_rdy___lsb 3
253#define reg_iop_dmc_out_r_intr___cmd_rdy___width 1
254#define reg_iop_dmc_out_r_intr___cmd_rdy___bit 3
255#define reg_iop_dmc_out_r_intr___dth___lsb 4
256#define reg_iop_dmc_out_r_intr___dth___width 1
257#define reg_iop_dmc_out_r_intr___dth___bit 4
258#define reg_iop_dmc_out_r_intr___dv___lsb 5
259#define reg_iop_dmc_out_r_intr___dv___width 1
260#define reg_iop_dmc_out_r_intr___dv___bit 5
261#define reg_iop_dmc_out_r_intr___last_data___lsb 6
262#define reg_iop_dmc_out_r_intr___last_data___width 1
263#define reg_iop_dmc_out_r_intr___last_data___bit 6
264#define reg_iop_dmc_out_r_intr___trf_lim___lsb 7
265#define reg_iop_dmc_out_r_intr___trf_lim___width 1
266#define reg_iop_dmc_out_r_intr___trf_lim___bit 7
267#define reg_iop_dmc_out_r_intr___cmd_rq___lsb 8
268#define reg_iop_dmc_out_r_intr___cmd_rq___width 1
269#define reg_iop_dmc_out_r_intr___cmd_rq___bit 8
270#define reg_iop_dmc_out_r_intr_offset 92
271
272/* Register r_masked_intr, scope iop_dmc_out, type r */
273#define reg_iop_dmc_out_r_masked_intr___data_md___lsb 0
274#define reg_iop_dmc_out_r_masked_intr___data_md___width 1
275#define reg_iop_dmc_out_r_masked_intr___data_md___bit 0
276#define reg_iop_dmc_out_r_masked_intr___ctxt_md___lsb 1
277#define reg_iop_dmc_out_r_masked_intr___ctxt_md___width 1
278#define reg_iop_dmc_out_r_masked_intr___ctxt_md___bit 1
279#define reg_iop_dmc_out_r_masked_intr___group_md___lsb 2
280#define reg_iop_dmc_out_r_masked_intr___group_md___width 1
281#define reg_iop_dmc_out_r_masked_intr___group_md___bit 2
282#define reg_iop_dmc_out_r_masked_intr___cmd_rdy___lsb 3
283#define reg_iop_dmc_out_r_masked_intr___cmd_rdy___width 1
284#define reg_iop_dmc_out_r_masked_intr___cmd_rdy___bit 3
285#define reg_iop_dmc_out_r_masked_intr___dth___lsb 4
286#define reg_iop_dmc_out_r_masked_intr___dth___width 1
287#define reg_iop_dmc_out_r_masked_intr___dth___bit 4
288#define reg_iop_dmc_out_r_masked_intr___dv___lsb 5
289#define reg_iop_dmc_out_r_masked_intr___dv___width 1
290#define reg_iop_dmc_out_r_masked_intr___dv___bit 5
291#define reg_iop_dmc_out_r_masked_intr___last_data___lsb 6
292#define reg_iop_dmc_out_r_masked_intr___last_data___width 1
293#define reg_iop_dmc_out_r_masked_intr___last_data___bit 6
294#define reg_iop_dmc_out_r_masked_intr___trf_lim___lsb 7
295#define reg_iop_dmc_out_r_masked_intr___trf_lim___width 1
296#define reg_iop_dmc_out_r_masked_intr___trf_lim___bit 7
297#define reg_iop_dmc_out_r_masked_intr___cmd_rq___lsb 8
298#define reg_iop_dmc_out_r_masked_intr___cmd_rq___width 1
299#define reg_iop_dmc_out_r_masked_intr___cmd_rq___bit 8
300#define reg_iop_dmc_out_r_masked_intr_offset 96
301
302
303/* Constants */
304#define regk_iop_dmc_out_ack_pkt 0x00000100
305#define regk_iop_dmc_out_array 0x00000008
306#define regk_iop_dmc_out_burst 0x00000020
307#define regk_iop_dmc_out_copy_next 0x00000010
308#define regk_iop_dmc_out_copy_up 0x00000020
309#define regk_iop_dmc_out_dis_c 0x00000010
310#define regk_iop_dmc_out_dis_g 0x00000020
311#define regk_iop_dmc_out_lim1 0x00000000
312#define regk_iop_dmc_out_lim16 0x00000004
313#define regk_iop_dmc_out_lim2 0x00000001
314#define regk_iop_dmc_out_lim32 0x00000005
315#define regk_iop_dmc_out_lim4 0x00000002
316#define regk_iop_dmc_out_lim64 0x00000006
317#define regk_iop_dmc_out_lim8 0x00000003
318#define regk_iop_dmc_out_load_c 0x00000200
319#define regk_iop_dmc_out_load_c_n 0x00000280
320#define regk_iop_dmc_out_load_c_next 0x00000240
321#define regk_iop_dmc_out_load_d 0x00000140
322#define regk_iop_dmc_out_load_g 0x00000300
323#define regk_iop_dmc_out_load_g_down 0x000003c0
324#define regk_iop_dmc_out_load_g_next 0x00000340
325#define regk_iop_dmc_out_load_g_up 0x00000380
326#define regk_iop_dmc_out_next_en 0x00000010
327#define regk_iop_dmc_out_next_pkt 0x00000010
328#define regk_iop_dmc_out_no 0x00000000
329#define regk_iop_dmc_out_restore 0x00000020
330#define regk_iop_dmc_out_rw_cfg_default 0x00000000
331#define regk_iop_dmc_out_rw_ctxt_descr_default 0x00000000
332#define regk_iop_dmc_out_rw_ctxt_descr_md1_default 0x00000000
333#define regk_iop_dmc_out_rw_ctxt_descr_md2_default 0x00000000
334#define regk_iop_dmc_out_rw_data_descr_default 0x00000000
335#define regk_iop_dmc_out_rw_group_descr_default 0x00000000
336#define regk_iop_dmc_out_rw_intr_mask_default 0x00000000
337#define regk_iop_dmc_out_save_down 0x00000020
338#define regk_iop_dmc_out_save_up 0x00000020
339#define regk_iop_dmc_out_set_reg 0x00000050
340#define regk_iop_dmc_out_set_w_size1 0x00000190
341#define regk_iop_dmc_out_set_w_size2 0x000001a0
342#define regk_iop_dmc_out_set_w_size4 0x000001c0
343#define regk_iop_dmc_out_store_c 0x00000002
344#define regk_iop_dmc_out_store_descr 0x00000000
345#define regk_iop_dmc_out_store_g 0x00000004
346#define regk_iop_dmc_out_store_md 0x00000001
347#define regk_iop_dmc_out_update_down 0x00000020
348#define regk_iop_dmc_out_yes 0x00000001
349#endif /* __iop_dmc_out_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_defs_asm.h
new file mode 100644
index 000000000000..974dee082f9f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_defs_asm.h
@@ -0,0 +1,234 @@
1#ifndef __iop_fifo_in_defs_asm_h
2#define __iop_fifo_in_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_in.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:07 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_fifo_in_defs_asm.h ../../inst/io_proc/rtl/iop_fifo_in.r
11 * id: $Id: iop_fifo_in_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_fifo_in, type rw */
57#define reg_iop_fifo_in_rw_cfg___avail_lim___lsb 0
58#define reg_iop_fifo_in_rw_cfg___avail_lim___width 3
59#define reg_iop_fifo_in_rw_cfg___byte_order___lsb 3
60#define reg_iop_fifo_in_rw_cfg___byte_order___width 2
61#define reg_iop_fifo_in_rw_cfg___trig___lsb 5
62#define reg_iop_fifo_in_rw_cfg___trig___width 2
63#define reg_iop_fifo_in_rw_cfg___last_dis_dif_in___lsb 7
64#define reg_iop_fifo_in_rw_cfg___last_dis_dif_in___width 1
65#define reg_iop_fifo_in_rw_cfg___last_dis_dif_in___bit 7
66#define reg_iop_fifo_in_rw_cfg___mode___lsb 8
67#define reg_iop_fifo_in_rw_cfg___mode___width 2
68#define reg_iop_fifo_in_rw_cfg_offset 0
69
70/* Register rw_ctrl, scope iop_fifo_in, type rw */
71#define reg_iop_fifo_in_rw_ctrl___dif_in_en___lsb 0
72#define reg_iop_fifo_in_rw_ctrl___dif_in_en___width 1
73#define reg_iop_fifo_in_rw_ctrl___dif_in_en___bit 0
74#define reg_iop_fifo_in_rw_ctrl___dif_out_en___lsb 1
75#define reg_iop_fifo_in_rw_ctrl___dif_out_en___width 1
76#define reg_iop_fifo_in_rw_ctrl___dif_out_en___bit 1
77#define reg_iop_fifo_in_rw_ctrl_offset 4
78
79/* Register r_stat, scope iop_fifo_in, type r */
80#define reg_iop_fifo_in_r_stat___avail_bytes___lsb 0
81#define reg_iop_fifo_in_r_stat___avail_bytes___width 4
82#define reg_iop_fifo_in_r_stat___last___lsb 4
83#define reg_iop_fifo_in_r_stat___last___width 8
84#define reg_iop_fifo_in_r_stat___dif_in_en___lsb 12
85#define reg_iop_fifo_in_r_stat___dif_in_en___width 1
86#define reg_iop_fifo_in_r_stat___dif_in_en___bit 12
87#define reg_iop_fifo_in_r_stat___dif_out_en___lsb 13
88#define reg_iop_fifo_in_r_stat___dif_out_en___width 1
89#define reg_iop_fifo_in_r_stat___dif_out_en___bit 13
90#define reg_iop_fifo_in_r_stat_offset 8
91
92/* Register rs_rd1byte, scope iop_fifo_in, type rs */
93#define reg_iop_fifo_in_rs_rd1byte___data___lsb 0
94#define reg_iop_fifo_in_rs_rd1byte___data___width 8
95#define reg_iop_fifo_in_rs_rd1byte_offset 12
96
97/* Register r_rd1byte, scope iop_fifo_in, type r */
98#define reg_iop_fifo_in_r_rd1byte___data___lsb 0
99#define reg_iop_fifo_in_r_rd1byte___data___width 8
100#define reg_iop_fifo_in_r_rd1byte_offset 16
101
102/* Register rs_rd2byte, scope iop_fifo_in, type rs */
103#define reg_iop_fifo_in_rs_rd2byte___data___lsb 0
104#define reg_iop_fifo_in_rs_rd2byte___data___width 16
105#define reg_iop_fifo_in_rs_rd2byte_offset 20
106
107/* Register r_rd2byte, scope iop_fifo_in, type r */
108#define reg_iop_fifo_in_r_rd2byte___data___lsb 0
109#define reg_iop_fifo_in_r_rd2byte___data___width 16
110#define reg_iop_fifo_in_r_rd2byte_offset 24
111
112/* Register rs_rd3byte, scope iop_fifo_in, type rs */
113#define reg_iop_fifo_in_rs_rd3byte___data___lsb 0
114#define reg_iop_fifo_in_rs_rd3byte___data___width 24
115#define reg_iop_fifo_in_rs_rd3byte_offset 28
116
117/* Register r_rd3byte, scope iop_fifo_in, type r */
118#define reg_iop_fifo_in_r_rd3byte___data___lsb 0
119#define reg_iop_fifo_in_r_rd3byte___data___width 24
120#define reg_iop_fifo_in_r_rd3byte_offset 32
121
122/* Register rs_rd4byte, scope iop_fifo_in, type rs */
123#define reg_iop_fifo_in_rs_rd4byte___data___lsb 0
124#define reg_iop_fifo_in_rs_rd4byte___data___width 32
125#define reg_iop_fifo_in_rs_rd4byte_offset 36
126
127/* Register r_rd4byte, scope iop_fifo_in, type r */
128#define reg_iop_fifo_in_r_rd4byte___data___lsb 0
129#define reg_iop_fifo_in_r_rd4byte___data___width 32
130#define reg_iop_fifo_in_r_rd4byte_offset 40
131
132/* Register rw_set_last, scope iop_fifo_in, type rw */
133#define reg_iop_fifo_in_rw_set_last_offset 44
134
135/* Register rw_strb_dif_in, scope iop_fifo_in, type rw */
136#define reg_iop_fifo_in_rw_strb_dif_in___last___lsb 0
137#define reg_iop_fifo_in_rw_strb_dif_in___last___width 2
138#define reg_iop_fifo_in_rw_strb_dif_in_offset 48
139
140/* Register rw_intr_mask, scope iop_fifo_in, type rw */
141#define reg_iop_fifo_in_rw_intr_mask___urun___lsb 0
142#define reg_iop_fifo_in_rw_intr_mask___urun___width 1
143#define reg_iop_fifo_in_rw_intr_mask___urun___bit 0
144#define reg_iop_fifo_in_rw_intr_mask___last_data___lsb 1
145#define reg_iop_fifo_in_rw_intr_mask___last_data___width 1
146#define reg_iop_fifo_in_rw_intr_mask___last_data___bit 1
147#define reg_iop_fifo_in_rw_intr_mask___dav___lsb 2
148#define reg_iop_fifo_in_rw_intr_mask___dav___width 1
149#define reg_iop_fifo_in_rw_intr_mask___dav___bit 2
150#define reg_iop_fifo_in_rw_intr_mask___avail___lsb 3
151#define reg_iop_fifo_in_rw_intr_mask___avail___width 1
152#define reg_iop_fifo_in_rw_intr_mask___avail___bit 3
153#define reg_iop_fifo_in_rw_intr_mask___orun___lsb 4
154#define reg_iop_fifo_in_rw_intr_mask___orun___width 1
155#define reg_iop_fifo_in_rw_intr_mask___orun___bit 4
156#define reg_iop_fifo_in_rw_intr_mask_offset 52
157
158/* Register rw_ack_intr, scope iop_fifo_in, type rw */
159#define reg_iop_fifo_in_rw_ack_intr___urun___lsb 0
160#define reg_iop_fifo_in_rw_ack_intr___urun___width 1
161#define reg_iop_fifo_in_rw_ack_intr___urun___bit 0
162#define reg_iop_fifo_in_rw_ack_intr___last_data___lsb 1
163#define reg_iop_fifo_in_rw_ack_intr___last_data___width 1
164#define reg_iop_fifo_in_rw_ack_intr___last_data___bit 1
165#define reg_iop_fifo_in_rw_ack_intr___dav___lsb 2
166#define reg_iop_fifo_in_rw_ack_intr___dav___width 1
167#define reg_iop_fifo_in_rw_ack_intr___dav___bit 2
168#define reg_iop_fifo_in_rw_ack_intr___avail___lsb 3
169#define reg_iop_fifo_in_rw_ack_intr___avail___width 1
170#define reg_iop_fifo_in_rw_ack_intr___avail___bit 3
171#define reg_iop_fifo_in_rw_ack_intr___orun___lsb 4
172#define reg_iop_fifo_in_rw_ack_intr___orun___width 1
173#define reg_iop_fifo_in_rw_ack_intr___orun___bit 4
174#define reg_iop_fifo_in_rw_ack_intr_offset 56
175
176/* Register r_intr, scope iop_fifo_in, type r */
177#define reg_iop_fifo_in_r_intr___urun___lsb 0
178#define reg_iop_fifo_in_r_intr___urun___width 1
179#define reg_iop_fifo_in_r_intr___urun___bit 0
180#define reg_iop_fifo_in_r_intr___last_data___lsb 1
181#define reg_iop_fifo_in_r_intr___last_data___width 1
182#define reg_iop_fifo_in_r_intr___last_data___bit 1
183#define reg_iop_fifo_in_r_intr___dav___lsb 2
184#define reg_iop_fifo_in_r_intr___dav___width 1
185#define reg_iop_fifo_in_r_intr___dav___bit 2
186#define reg_iop_fifo_in_r_intr___avail___lsb 3
187#define reg_iop_fifo_in_r_intr___avail___width 1
188#define reg_iop_fifo_in_r_intr___avail___bit 3
189#define reg_iop_fifo_in_r_intr___orun___lsb 4
190#define reg_iop_fifo_in_r_intr___orun___width 1
191#define reg_iop_fifo_in_r_intr___orun___bit 4
192#define reg_iop_fifo_in_r_intr_offset 60
193
194/* Register r_masked_intr, scope iop_fifo_in, type r */
195#define reg_iop_fifo_in_r_masked_intr___urun___lsb 0
196#define reg_iop_fifo_in_r_masked_intr___urun___width 1
197#define reg_iop_fifo_in_r_masked_intr___urun___bit 0
198#define reg_iop_fifo_in_r_masked_intr___last_data___lsb 1
199#define reg_iop_fifo_in_r_masked_intr___last_data___width 1
200#define reg_iop_fifo_in_r_masked_intr___last_data___bit 1
201#define reg_iop_fifo_in_r_masked_intr___dav___lsb 2
202#define reg_iop_fifo_in_r_masked_intr___dav___width 1
203#define reg_iop_fifo_in_r_masked_intr___dav___bit 2
204#define reg_iop_fifo_in_r_masked_intr___avail___lsb 3
205#define reg_iop_fifo_in_r_masked_intr___avail___width 1
206#define reg_iop_fifo_in_r_masked_intr___avail___bit 3
207#define reg_iop_fifo_in_r_masked_intr___orun___lsb 4
208#define reg_iop_fifo_in_r_masked_intr___orun___width 1
209#define reg_iop_fifo_in_r_masked_intr___orun___bit 4
210#define reg_iop_fifo_in_r_masked_intr_offset 64
211
212
213/* Constants */
214#define regk_iop_fifo_in_dif_in 0x00000002
215#define regk_iop_fifo_in_hi 0x00000000
216#define regk_iop_fifo_in_neg 0x00000002
217#define regk_iop_fifo_in_no 0x00000000
218#define regk_iop_fifo_in_order16 0x00000001
219#define regk_iop_fifo_in_order24 0x00000002
220#define regk_iop_fifo_in_order32 0x00000003
221#define regk_iop_fifo_in_order8 0x00000000
222#define regk_iop_fifo_in_pos 0x00000001
223#define regk_iop_fifo_in_pos_neg 0x00000003
224#define regk_iop_fifo_in_rw_cfg_default 0x00000024
225#define regk_iop_fifo_in_rw_ctrl_default 0x00000000
226#define regk_iop_fifo_in_rw_intr_mask_default 0x00000000
227#define regk_iop_fifo_in_rw_set_last_default 0x00000000
228#define regk_iop_fifo_in_rw_strb_dif_in_default 0x00000000
229#define regk_iop_fifo_in_size16 0x00000002
230#define regk_iop_fifo_in_size24 0x00000001
231#define regk_iop_fifo_in_size32 0x00000000
232#define regk_iop_fifo_in_size8 0x00000003
233#define regk_iop_fifo_in_yes 0x00000001
234#endif /* __iop_fifo_in_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_extra_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_extra_defs_asm.h
new file mode 100644
index 000000000000..e00fab0c9335
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_in_extra_defs_asm.h
@@ -0,0 +1,155 @@
1#ifndef __iop_fifo_in_extra_defs_asm_h
2#define __iop_fifo_in_extra_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_in_extra.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:08 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_fifo_in_extra_defs_asm.h ../../inst/io_proc/rtl/iop_fifo_in_extra.r
11 * id: $Id: iop_fifo_in_extra_defs_asm.h,v 1.1 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_wr_data, scope iop_fifo_in_extra, type rw */
57#define reg_iop_fifo_in_extra_rw_wr_data_offset 0
58
59/* Register r_stat, scope iop_fifo_in_extra, type r */
60#define reg_iop_fifo_in_extra_r_stat___avail_bytes___lsb 0
61#define reg_iop_fifo_in_extra_r_stat___avail_bytes___width 4
62#define reg_iop_fifo_in_extra_r_stat___last___lsb 4
63#define reg_iop_fifo_in_extra_r_stat___last___width 8
64#define reg_iop_fifo_in_extra_r_stat___dif_in_en___lsb 12
65#define reg_iop_fifo_in_extra_r_stat___dif_in_en___width 1
66#define reg_iop_fifo_in_extra_r_stat___dif_in_en___bit 12
67#define reg_iop_fifo_in_extra_r_stat___dif_out_en___lsb 13
68#define reg_iop_fifo_in_extra_r_stat___dif_out_en___width 1
69#define reg_iop_fifo_in_extra_r_stat___dif_out_en___bit 13
70#define reg_iop_fifo_in_extra_r_stat_offset 4
71
72/* Register rw_strb_dif_in, scope iop_fifo_in_extra, type rw */
73#define reg_iop_fifo_in_extra_rw_strb_dif_in___last___lsb 0
74#define reg_iop_fifo_in_extra_rw_strb_dif_in___last___width 2
75#define reg_iop_fifo_in_extra_rw_strb_dif_in_offset 8
76
77/* Register rw_intr_mask, scope iop_fifo_in_extra, type rw */
78#define reg_iop_fifo_in_extra_rw_intr_mask___urun___lsb 0
79#define reg_iop_fifo_in_extra_rw_intr_mask___urun___width 1
80#define reg_iop_fifo_in_extra_rw_intr_mask___urun___bit 0
81#define reg_iop_fifo_in_extra_rw_intr_mask___last_data___lsb 1
82#define reg_iop_fifo_in_extra_rw_intr_mask___last_data___width 1
83#define reg_iop_fifo_in_extra_rw_intr_mask___last_data___bit 1
84#define reg_iop_fifo_in_extra_rw_intr_mask___dav___lsb 2
85#define reg_iop_fifo_in_extra_rw_intr_mask___dav___width 1
86#define reg_iop_fifo_in_extra_rw_intr_mask___dav___bit 2
87#define reg_iop_fifo_in_extra_rw_intr_mask___avail___lsb 3
88#define reg_iop_fifo_in_extra_rw_intr_mask___avail___width 1
89#define reg_iop_fifo_in_extra_rw_intr_mask___avail___bit 3
90#define reg_iop_fifo_in_extra_rw_intr_mask___orun___lsb 4
91#define reg_iop_fifo_in_extra_rw_intr_mask___orun___width 1
92#define reg_iop_fifo_in_extra_rw_intr_mask___orun___bit 4
93#define reg_iop_fifo_in_extra_rw_intr_mask_offset 12
94
95/* Register rw_ack_intr, scope iop_fifo_in_extra, type rw */
96#define reg_iop_fifo_in_extra_rw_ack_intr___urun___lsb 0
97#define reg_iop_fifo_in_extra_rw_ack_intr___urun___width 1
98#define reg_iop_fifo_in_extra_rw_ack_intr___urun___bit 0
99#define reg_iop_fifo_in_extra_rw_ack_intr___last_data___lsb 1
100#define reg_iop_fifo_in_extra_rw_ack_intr___last_data___width 1
101#define reg_iop_fifo_in_extra_rw_ack_intr___last_data___bit 1
102#define reg_iop_fifo_in_extra_rw_ack_intr___dav___lsb 2
103#define reg_iop_fifo_in_extra_rw_ack_intr___dav___width 1
104#define reg_iop_fifo_in_extra_rw_ack_intr___dav___bit 2
105#define reg_iop_fifo_in_extra_rw_ack_intr___avail___lsb 3
106#define reg_iop_fifo_in_extra_rw_ack_intr___avail___width 1
107#define reg_iop_fifo_in_extra_rw_ack_intr___avail___bit 3
108#define reg_iop_fifo_in_extra_rw_ack_intr___orun___lsb 4
109#define reg_iop_fifo_in_extra_rw_ack_intr___orun___width 1
110#define reg_iop_fifo_in_extra_rw_ack_intr___orun___bit 4
111#define reg_iop_fifo_in_extra_rw_ack_intr_offset 16
112
113/* Register r_intr, scope iop_fifo_in_extra, type r */
114#define reg_iop_fifo_in_extra_r_intr___urun___lsb 0
115#define reg_iop_fifo_in_extra_r_intr___urun___width 1
116#define reg_iop_fifo_in_extra_r_intr___urun___bit 0
117#define reg_iop_fifo_in_extra_r_intr___last_data___lsb 1
118#define reg_iop_fifo_in_extra_r_intr___last_data___width 1
119#define reg_iop_fifo_in_extra_r_intr___last_data___bit 1
120#define reg_iop_fifo_in_extra_r_intr___dav___lsb 2
121#define reg_iop_fifo_in_extra_r_intr___dav___width 1
122#define reg_iop_fifo_in_extra_r_intr___dav___bit 2
123#define reg_iop_fifo_in_extra_r_intr___avail___lsb 3
124#define reg_iop_fifo_in_extra_r_intr___avail___width 1
125#define reg_iop_fifo_in_extra_r_intr___avail___bit 3
126#define reg_iop_fifo_in_extra_r_intr___orun___lsb 4
127#define reg_iop_fifo_in_extra_r_intr___orun___width 1
128#define reg_iop_fifo_in_extra_r_intr___orun___bit 4
129#define reg_iop_fifo_in_extra_r_intr_offset 20
130
131/* Register r_masked_intr, scope iop_fifo_in_extra, type r */
132#define reg_iop_fifo_in_extra_r_masked_intr___urun___lsb 0
133#define reg_iop_fifo_in_extra_r_masked_intr___urun___width 1
134#define reg_iop_fifo_in_extra_r_masked_intr___urun___bit 0
135#define reg_iop_fifo_in_extra_r_masked_intr___last_data___lsb 1
136#define reg_iop_fifo_in_extra_r_masked_intr___last_data___width 1
137#define reg_iop_fifo_in_extra_r_masked_intr___last_data___bit 1
138#define reg_iop_fifo_in_extra_r_masked_intr___dav___lsb 2
139#define reg_iop_fifo_in_extra_r_masked_intr___dav___width 1
140#define reg_iop_fifo_in_extra_r_masked_intr___dav___bit 2
141#define reg_iop_fifo_in_extra_r_masked_intr___avail___lsb 3
142#define reg_iop_fifo_in_extra_r_masked_intr___avail___width 1
143#define reg_iop_fifo_in_extra_r_masked_intr___avail___bit 3
144#define reg_iop_fifo_in_extra_r_masked_intr___orun___lsb 4
145#define reg_iop_fifo_in_extra_r_masked_intr___orun___width 1
146#define reg_iop_fifo_in_extra_r_masked_intr___orun___bit 4
147#define reg_iop_fifo_in_extra_r_masked_intr_offset 24
148
149
150/* Constants */
151#define regk_iop_fifo_in_extra_fifo_in 0x00000002
152#define regk_iop_fifo_in_extra_no 0x00000000
153#define regk_iop_fifo_in_extra_rw_intr_mask_default 0x00000000
154#define regk_iop_fifo_in_extra_yes 0x00000001
155#endif /* __iop_fifo_in_extra_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_defs_asm.h
new file mode 100644
index 000000000000..9ec5f4a826df
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_defs_asm.h
@@ -0,0 +1,254 @@
1#ifndef __iop_fifo_out_defs_asm_h
2#define __iop_fifo_out_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_out.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:09 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_fifo_out_defs_asm.h ../../inst/io_proc/rtl/iop_fifo_out.r
11 * id: $Id: iop_fifo_out_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_fifo_out, type rw */
57#define reg_iop_fifo_out_rw_cfg___free_lim___lsb 0
58#define reg_iop_fifo_out_rw_cfg___free_lim___width 3
59#define reg_iop_fifo_out_rw_cfg___byte_order___lsb 3
60#define reg_iop_fifo_out_rw_cfg___byte_order___width 2
61#define reg_iop_fifo_out_rw_cfg___trig___lsb 5
62#define reg_iop_fifo_out_rw_cfg___trig___width 2
63#define reg_iop_fifo_out_rw_cfg___last_dis_dif_in___lsb 7
64#define reg_iop_fifo_out_rw_cfg___last_dis_dif_in___width 1
65#define reg_iop_fifo_out_rw_cfg___last_dis_dif_in___bit 7
66#define reg_iop_fifo_out_rw_cfg___mode___lsb 8
67#define reg_iop_fifo_out_rw_cfg___mode___width 2
68#define reg_iop_fifo_out_rw_cfg___delay_out_last___lsb 10
69#define reg_iop_fifo_out_rw_cfg___delay_out_last___width 1
70#define reg_iop_fifo_out_rw_cfg___delay_out_last___bit 10
71#define reg_iop_fifo_out_rw_cfg___last_dis_dif_out___lsb 11
72#define reg_iop_fifo_out_rw_cfg___last_dis_dif_out___width 1
73#define reg_iop_fifo_out_rw_cfg___last_dis_dif_out___bit 11
74#define reg_iop_fifo_out_rw_cfg_offset 0
75
76/* Register rw_ctrl, scope iop_fifo_out, type rw */
77#define reg_iop_fifo_out_rw_ctrl___dif_in_en___lsb 0
78#define reg_iop_fifo_out_rw_ctrl___dif_in_en___width 1
79#define reg_iop_fifo_out_rw_ctrl___dif_in_en___bit 0
80#define reg_iop_fifo_out_rw_ctrl___dif_out_en___lsb 1
81#define reg_iop_fifo_out_rw_ctrl___dif_out_en___width 1
82#define reg_iop_fifo_out_rw_ctrl___dif_out_en___bit 1
83#define reg_iop_fifo_out_rw_ctrl_offset 4
84
85/* Register r_stat, scope iop_fifo_out, type r */
86#define reg_iop_fifo_out_r_stat___avail_bytes___lsb 0
87#define reg_iop_fifo_out_r_stat___avail_bytes___width 4
88#define reg_iop_fifo_out_r_stat___last___lsb 4
89#define reg_iop_fifo_out_r_stat___last___width 8
90#define reg_iop_fifo_out_r_stat___dif_in_en___lsb 12
91#define reg_iop_fifo_out_r_stat___dif_in_en___width 1
92#define reg_iop_fifo_out_r_stat___dif_in_en___bit 12
93#define reg_iop_fifo_out_r_stat___dif_out_en___lsb 13
94#define reg_iop_fifo_out_r_stat___dif_out_en___width 1
95#define reg_iop_fifo_out_r_stat___dif_out_en___bit 13
96#define reg_iop_fifo_out_r_stat___zero_data_last___lsb 14
97#define reg_iop_fifo_out_r_stat___zero_data_last___width 1
98#define reg_iop_fifo_out_r_stat___zero_data_last___bit 14
99#define reg_iop_fifo_out_r_stat_offset 8
100
101/* Register rw_wr1byte, scope iop_fifo_out, type rw */
102#define reg_iop_fifo_out_rw_wr1byte___data___lsb 0
103#define reg_iop_fifo_out_rw_wr1byte___data___width 8
104#define reg_iop_fifo_out_rw_wr1byte_offset 12
105
106/* Register rw_wr2byte, scope iop_fifo_out, type rw */
107#define reg_iop_fifo_out_rw_wr2byte___data___lsb 0
108#define reg_iop_fifo_out_rw_wr2byte___data___width 16
109#define reg_iop_fifo_out_rw_wr2byte_offset 16
110
111/* Register rw_wr3byte, scope iop_fifo_out, type rw */
112#define reg_iop_fifo_out_rw_wr3byte___data___lsb 0
113#define reg_iop_fifo_out_rw_wr3byte___data___width 24
114#define reg_iop_fifo_out_rw_wr3byte_offset 20
115
116/* Register rw_wr4byte, scope iop_fifo_out, type rw */
117#define reg_iop_fifo_out_rw_wr4byte___data___lsb 0
118#define reg_iop_fifo_out_rw_wr4byte___data___width 32
119#define reg_iop_fifo_out_rw_wr4byte_offset 24
120
121/* Register rw_wr1byte_last, scope iop_fifo_out, type rw */
122#define reg_iop_fifo_out_rw_wr1byte_last___data___lsb 0
123#define reg_iop_fifo_out_rw_wr1byte_last___data___width 8
124#define reg_iop_fifo_out_rw_wr1byte_last_offset 28
125
126/* Register rw_wr2byte_last, scope iop_fifo_out, type rw */
127#define reg_iop_fifo_out_rw_wr2byte_last___data___lsb 0
128#define reg_iop_fifo_out_rw_wr2byte_last___data___width 16
129#define reg_iop_fifo_out_rw_wr2byte_last_offset 32
130
131/* Register rw_wr3byte_last, scope iop_fifo_out, type rw */
132#define reg_iop_fifo_out_rw_wr3byte_last___data___lsb 0
133#define reg_iop_fifo_out_rw_wr3byte_last___data___width 24
134#define reg_iop_fifo_out_rw_wr3byte_last_offset 36
135
136/* Register rw_wr4byte_last, scope iop_fifo_out, type rw */
137#define reg_iop_fifo_out_rw_wr4byte_last___data___lsb 0
138#define reg_iop_fifo_out_rw_wr4byte_last___data___width 32
139#define reg_iop_fifo_out_rw_wr4byte_last_offset 40
140
141/* Register rw_set_last, scope iop_fifo_out, type rw */
142#define reg_iop_fifo_out_rw_set_last_offset 44
143
144/* Register rs_rd_data, scope iop_fifo_out, type rs */
145#define reg_iop_fifo_out_rs_rd_data_offset 48
146
147/* Register r_rd_data, scope iop_fifo_out, type r */
148#define reg_iop_fifo_out_r_rd_data_offset 52
149
150/* Register rw_strb_dif_out, scope iop_fifo_out, type rw */
151#define reg_iop_fifo_out_rw_strb_dif_out_offset 56
152
153/* Register rw_intr_mask, scope iop_fifo_out, type rw */
154#define reg_iop_fifo_out_rw_intr_mask___urun___lsb 0
155#define reg_iop_fifo_out_rw_intr_mask___urun___width 1
156#define reg_iop_fifo_out_rw_intr_mask___urun___bit 0
157#define reg_iop_fifo_out_rw_intr_mask___last_data___lsb 1
158#define reg_iop_fifo_out_rw_intr_mask___last_data___width 1
159#define reg_iop_fifo_out_rw_intr_mask___last_data___bit 1
160#define reg_iop_fifo_out_rw_intr_mask___dav___lsb 2
161#define reg_iop_fifo_out_rw_intr_mask___dav___width 1
162#define reg_iop_fifo_out_rw_intr_mask___dav___bit 2
163#define reg_iop_fifo_out_rw_intr_mask___free___lsb 3
164#define reg_iop_fifo_out_rw_intr_mask___free___width 1
165#define reg_iop_fifo_out_rw_intr_mask___free___bit 3
166#define reg_iop_fifo_out_rw_intr_mask___orun___lsb 4
167#define reg_iop_fifo_out_rw_intr_mask___orun___width 1
168#define reg_iop_fifo_out_rw_intr_mask___orun___bit 4
169#define reg_iop_fifo_out_rw_intr_mask_offset 60
170
171/* Register rw_ack_intr, scope iop_fifo_out, type rw */
172#define reg_iop_fifo_out_rw_ack_intr___urun___lsb 0
173#define reg_iop_fifo_out_rw_ack_intr___urun___width 1
174#define reg_iop_fifo_out_rw_ack_intr___urun___bit 0
175#define reg_iop_fifo_out_rw_ack_intr___last_data___lsb 1
176#define reg_iop_fifo_out_rw_ack_intr___last_data___width 1
177#define reg_iop_fifo_out_rw_ack_intr___last_data___bit 1
178#define reg_iop_fifo_out_rw_ack_intr___dav___lsb 2
179#define reg_iop_fifo_out_rw_ack_intr___dav___width 1
180#define reg_iop_fifo_out_rw_ack_intr___dav___bit 2
181#define reg_iop_fifo_out_rw_ack_intr___free___lsb 3
182#define reg_iop_fifo_out_rw_ack_intr___free___width 1
183#define reg_iop_fifo_out_rw_ack_intr___free___bit 3
184#define reg_iop_fifo_out_rw_ack_intr___orun___lsb 4
185#define reg_iop_fifo_out_rw_ack_intr___orun___width 1
186#define reg_iop_fifo_out_rw_ack_intr___orun___bit 4
187#define reg_iop_fifo_out_rw_ack_intr_offset 64
188
189/* Register r_intr, scope iop_fifo_out, type r */
190#define reg_iop_fifo_out_r_intr___urun___lsb 0
191#define reg_iop_fifo_out_r_intr___urun___width 1
192#define reg_iop_fifo_out_r_intr___urun___bit 0
193#define reg_iop_fifo_out_r_intr___last_data___lsb 1
194#define reg_iop_fifo_out_r_intr___last_data___width 1
195#define reg_iop_fifo_out_r_intr___last_data___bit 1
196#define reg_iop_fifo_out_r_intr___dav___lsb 2
197#define reg_iop_fifo_out_r_intr___dav___width 1
198#define reg_iop_fifo_out_r_intr___dav___bit 2
199#define reg_iop_fifo_out_r_intr___free___lsb 3
200#define reg_iop_fifo_out_r_intr___free___width 1
201#define reg_iop_fifo_out_r_intr___free___bit 3
202#define reg_iop_fifo_out_r_intr___orun___lsb 4
203#define reg_iop_fifo_out_r_intr___orun___width 1
204#define reg_iop_fifo_out_r_intr___orun___bit 4
205#define reg_iop_fifo_out_r_intr_offset 68
206
207/* Register r_masked_intr, scope iop_fifo_out, type r */
208#define reg_iop_fifo_out_r_masked_intr___urun___lsb 0
209#define reg_iop_fifo_out_r_masked_intr___urun___width 1
210#define reg_iop_fifo_out_r_masked_intr___urun___bit 0
211#define reg_iop_fifo_out_r_masked_intr___last_data___lsb 1
212#define reg_iop_fifo_out_r_masked_intr___last_data___width 1
213#define reg_iop_fifo_out_r_masked_intr___last_data___bit 1
214#define reg_iop_fifo_out_r_masked_intr___dav___lsb 2
215#define reg_iop_fifo_out_r_masked_intr___dav___width 1
216#define reg_iop_fifo_out_r_masked_intr___dav___bit 2
217#define reg_iop_fifo_out_r_masked_intr___free___lsb 3
218#define reg_iop_fifo_out_r_masked_intr___free___width 1
219#define reg_iop_fifo_out_r_masked_intr___free___bit 3
220#define reg_iop_fifo_out_r_masked_intr___orun___lsb 4
221#define reg_iop_fifo_out_r_masked_intr___orun___width 1
222#define reg_iop_fifo_out_r_masked_intr___orun___bit 4
223#define reg_iop_fifo_out_r_masked_intr_offset 72
224
225
226/* Constants */
227#define regk_iop_fifo_out_hi 0x00000000
228#define regk_iop_fifo_out_neg 0x00000002
229#define regk_iop_fifo_out_no 0x00000000
230#define regk_iop_fifo_out_order16 0x00000001
231#define regk_iop_fifo_out_order24 0x00000002
232#define regk_iop_fifo_out_order32 0x00000003
233#define regk_iop_fifo_out_order8 0x00000000
234#define regk_iop_fifo_out_pos 0x00000001
235#define regk_iop_fifo_out_pos_neg 0x00000003
236#define regk_iop_fifo_out_rw_cfg_default 0x00000024
237#define regk_iop_fifo_out_rw_ctrl_default 0x00000000
238#define regk_iop_fifo_out_rw_intr_mask_default 0x00000000
239#define regk_iop_fifo_out_rw_set_last_default 0x00000000
240#define regk_iop_fifo_out_rw_strb_dif_out_default 0x00000000
241#define regk_iop_fifo_out_rw_wr1byte_default 0x00000000
242#define regk_iop_fifo_out_rw_wr1byte_last_default 0x00000000
243#define regk_iop_fifo_out_rw_wr2byte_default 0x00000000
244#define regk_iop_fifo_out_rw_wr2byte_last_default 0x00000000
245#define regk_iop_fifo_out_rw_wr3byte_default 0x00000000
246#define regk_iop_fifo_out_rw_wr3byte_last_default 0x00000000
247#define regk_iop_fifo_out_rw_wr4byte_default 0x00000000
248#define regk_iop_fifo_out_rw_wr4byte_last_default 0x00000000
249#define regk_iop_fifo_out_size16 0x00000002
250#define regk_iop_fifo_out_size24 0x00000001
251#define regk_iop_fifo_out_size32 0x00000000
252#define regk_iop_fifo_out_size8 0x00000003
253#define regk_iop_fifo_out_yes 0x00000001
254#endif /* __iop_fifo_out_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_extra_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_extra_defs_asm.h
new file mode 100644
index 000000000000..0f84a50cf77c
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_fifo_out_extra_defs_asm.h
@@ -0,0 +1,158 @@
1#ifndef __iop_fifo_out_extra_defs_asm_h
2#define __iop_fifo_out_extra_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_out_extra.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:10 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_fifo_out_extra_defs_asm.h ../../inst/io_proc/rtl/iop_fifo_out_extra.r
11 * id: $Id: iop_fifo_out_extra_defs_asm.h,v 1.1 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rs_rd_data, scope iop_fifo_out_extra, type rs */
57#define reg_iop_fifo_out_extra_rs_rd_data_offset 0
58
59/* Register r_rd_data, scope iop_fifo_out_extra, type r */
60#define reg_iop_fifo_out_extra_r_rd_data_offset 4
61
62/* Register r_stat, scope iop_fifo_out_extra, type r */
63#define reg_iop_fifo_out_extra_r_stat___avail_bytes___lsb 0
64#define reg_iop_fifo_out_extra_r_stat___avail_bytes___width 4
65#define reg_iop_fifo_out_extra_r_stat___last___lsb 4
66#define reg_iop_fifo_out_extra_r_stat___last___width 8
67#define reg_iop_fifo_out_extra_r_stat___dif_in_en___lsb 12
68#define reg_iop_fifo_out_extra_r_stat___dif_in_en___width 1
69#define reg_iop_fifo_out_extra_r_stat___dif_in_en___bit 12
70#define reg_iop_fifo_out_extra_r_stat___dif_out_en___lsb 13
71#define reg_iop_fifo_out_extra_r_stat___dif_out_en___width 1
72#define reg_iop_fifo_out_extra_r_stat___dif_out_en___bit 13
73#define reg_iop_fifo_out_extra_r_stat___zero_data_last___lsb 14
74#define reg_iop_fifo_out_extra_r_stat___zero_data_last___width 1
75#define reg_iop_fifo_out_extra_r_stat___zero_data_last___bit 14
76#define reg_iop_fifo_out_extra_r_stat_offset 8
77
78/* Register rw_strb_dif_out, scope iop_fifo_out_extra, type rw */
79#define reg_iop_fifo_out_extra_rw_strb_dif_out_offset 12
80
81/* Register rw_intr_mask, scope iop_fifo_out_extra, type rw */
82#define reg_iop_fifo_out_extra_rw_intr_mask___urun___lsb 0
83#define reg_iop_fifo_out_extra_rw_intr_mask___urun___width 1
84#define reg_iop_fifo_out_extra_rw_intr_mask___urun___bit 0
85#define reg_iop_fifo_out_extra_rw_intr_mask___last_data___lsb 1
86#define reg_iop_fifo_out_extra_rw_intr_mask___last_data___width 1
87#define reg_iop_fifo_out_extra_rw_intr_mask___last_data___bit 1
88#define reg_iop_fifo_out_extra_rw_intr_mask___dav___lsb 2
89#define reg_iop_fifo_out_extra_rw_intr_mask___dav___width 1
90#define reg_iop_fifo_out_extra_rw_intr_mask___dav___bit 2
91#define reg_iop_fifo_out_extra_rw_intr_mask___free___lsb 3
92#define reg_iop_fifo_out_extra_rw_intr_mask___free___width 1
93#define reg_iop_fifo_out_extra_rw_intr_mask___free___bit 3
94#define reg_iop_fifo_out_extra_rw_intr_mask___orun___lsb 4
95#define reg_iop_fifo_out_extra_rw_intr_mask___orun___width 1
96#define reg_iop_fifo_out_extra_rw_intr_mask___orun___bit 4
97#define reg_iop_fifo_out_extra_rw_intr_mask_offset 16
98
99/* Register rw_ack_intr, scope iop_fifo_out_extra, type rw */
100#define reg_iop_fifo_out_extra_rw_ack_intr___urun___lsb 0
101#define reg_iop_fifo_out_extra_rw_ack_intr___urun___width 1
102#define reg_iop_fifo_out_extra_rw_ack_intr___urun___bit 0
103#define reg_iop_fifo_out_extra_rw_ack_intr___last_data___lsb 1
104#define reg_iop_fifo_out_extra_rw_ack_intr___last_data___width 1
105#define reg_iop_fifo_out_extra_rw_ack_intr___last_data___bit 1
106#define reg_iop_fifo_out_extra_rw_ack_intr___dav___lsb 2
107#define reg_iop_fifo_out_extra_rw_ack_intr___dav___width 1
108#define reg_iop_fifo_out_extra_rw_ack_intr___dav___bit 2
109#define reg_iop_fifo_out_extra_rw_ack_intr___free___lsb 3
110#define reg_iop_fifo_out_extra_rw_ack_intr___free___width 1
111#define reg_iop_fifo_out_extra_rw_ack_intr___free___bit 3
112#define reg_iop_fifo_out_extra_rw_ack_intr___orun___lsb 4
113#define reg_iop_fifo_out_extra_rw_ack_intr___orun___width 1
114#define reg_iop_fifo_out_extra_rw_ack_intr___orun___bit 4
115#define reg_iop_fifo_out_extra_rw_ack_intr_offset 20
116
117/* Register r_intr, scope iop_fifo_out_extra, type r */
118#define reg_iop_fifo_out_extra_r_intr___urun___lsb 0
119#define reg_iop_fifo_out_extra_r_intr___urun___width 1
120#define reg_iop_fifo_out_extra_r_intr___urun___bit 0
121#define reg_iop_fifo_out_extra_r_intr___last_data___lsb 1
122#define reg_iop_fifo_out_extra_r_intr___last_data___width 1
123#define reg_iop_fifo_out_extra_r_intr___last_data___bit 1
124#define reg_iop_fifo_out_extra_r_intr___dav___lsb 2
125#define reg_iop_fifo_out_extra_r_intr___dav___width 1
126#define reg_iop_fifo_out_extra_r_intr___dav___bit 2
127#define reg_iop_fifo_out_extra_r_intr___free___lsb 3
128#define reg_iop_fifo_out_extra_r_intr___free___width 1
129#define reg_iop_fifo_out_extra_r_intr___free___bit 3
130#define reg_iop_fifo_out_extra_r_intr___orun___lsb 4
131#define reg_iop_fifo_out_extra_r_intr___orun___width 1
132#define reg_iop_fifo_out_extra_r_intr___orun___bit 4
133#define reg_iop_fifo_out_extra_r_intr_offset 24
134
135/* Register r_masked_intr, scope iop_fifo_out_extra, type r */
136#define reg_iop_fifo_out_extra_r_masked_intr___urun___lsb 0
137#define reg_iop_fifo_out_extra_r_masked_intr___urun___width 1
138#define reg_iop_fifo_out_extra_r_masked_intr___urun___bit 0
139#define reg_iop_fifo_out_extra_r_masked_intr___last_data___lsb 1
140#define reg_iop_fifo_out_extra_r_masked_intr___last_data___width 1
141#define reg_iop_fifo_out_extra_r_masked_intr___last_data___bit 1
142#define reg_iop_fifo_out_extra_r_masked_intr___dav___lsb 2
143#define reg_iop_fifo_out_extra_r_masked_intr___dav___width 1
144#define reg_iop_fifo_out_extra_r_masked_intr___dav___bit 2
145#define reg_iop_fifo_out_extra_r_masked_intr___free___lsb 3
146#define reg_iop_fifo_out_extra_r_masked_intr___free___width 1
147#define reg_iop_fifo_out_extra_r_masked_intr___free___bit 3
148#define reg_iop_fifo_out_extra_r_masked_intr___orun___lsb 4
149#define reg_iop_fifo_out_extra_r_masked_intr___orun___width 1
150#define reg_iop_fifo_out_extra_r_masked_intr___orun___bit 4
151#define reg_iop_fifo_out_extra_r_masked_intr_offset 28
152
153
154/* Constants */
155#define regk_iop_fifo_out_extra_no 0x00000000
156#define regk_iop_fifo_out_extra_rw_intr_mask_default 0x00000000
157#define regk_iop_fifo_out_extra_yes 0x00000001
158#endif /* __iop_fifo_out_extra_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_mpu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_mpu_defs_asm.h
new file mode 100644
index 000000000000..80490c82cc29
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_mpu_defs_asm.h
@@ -0,0 +1,177 @@
1#ifndef __iop_mpu_defs_asm_h
2#define __iop_mpu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_mpu.r
7 * id: iop_mpu.r,v 1.30 2005/02/17 08:12:33 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_mpu_defs_asm.h ../../inst/io_proc/rtl/iop_mpu.r
11 * id: $Id: iop_mpu_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56#define STRIDE_iop_mpu_rw_r 4
57/* Register rw_r, scope iop_mpu, type rw */
58#define reg_iop_mpu_rw_r_offset 0
59
60/* Register rw_ctrl, scope iop_mpu, type rw */
61#define reg_iop_mpu_rw_ctrl___en___lsb 0
62#define reg_iop_mpu_rw_ctrl___en___width 1
63#define reg_iop_mpu_rw_ctrl___en___bit 0
64#define reg_iop_mpu_rw_ctrl_offset 128
65
66/* Register r_pc, scope iop_mpu, type r */
67#define reg_iop_mpu_r_pc___addr___lsb 0
68#define reg_iop_mpu_r_pc___addr___width 12
69#define reg_iop_mpu_r_pc_offset 132
70
71/* Register r_stat, scope iop_mpu, type r */
72#define reg_iop_mpu_r_stat___instr_reg_busy___lsb 0
73#define reg_iop_mpu_r_stat___instr_reg_busy___width 1
74#define reg_iop_mpu_r_stat___instr_reg_busy___bit 0
75#define reg_iop_mpu_r_stat___intr_busy___lsb 1
76#define reg_iop_mpu_r_stat___intr_busy___width 1
77#define reg_iop_mpu_r_stat___intr_busy___bit 1
78#define reg_iop_mpu_r_stat___intr_vect___lsb 2
79#define reg_iop_mpu_r_stat___intr_vect___width 16
80#define reg_iop_mpu_r_stat_offset 136
81
82/* Register rw_instr, scope iop_mpu, type rw */
83#define reg_iop_mpu_rw_instr_offset 140
84
85/* Register rw_immediate, scope iop_mpu, type rw */
86#define reg_iop_mpu_rw_immediate_offset 144
87
88/* Register r_trace, scope iop_mpu, type r */
89#define reg_iop_mpu_r_trace___intr_vect___lsb 0
90#define reg_iop_mpu_r_trace___intr_vect___width 16
91#define reg_iop_mpu_r_trace___pc___lsb 16
92#define reg_iop_mpu_r_trace___pc___width 12
93#define reg_iop_mpu_r_trace___en___lsb 28
94#define reg_iop_mpu_r_trace___en___width 1
95#define reg_iop_mpu_r_trace___en___bit 28
96#define reg_iop_mpu_r_trace___instr_reg_busy___lsb 29
97#define reg_iop_mpu_r_trace___instr_reg_busy___width 1
98#define reg_iop_mpu_r_trace___instr_reg_busy___bit 29
99#define reg_iop_mpu_r_trace___intr_busy___lsb 30
100#define reg_iop_mpu_r_trace___intr_busy___width 1
101#define reg_iop_mpu_r_trace___intr_busy___bit 30
102#define reg_iop_mpu_r_trace_offset 148
103
104/* Register r_wr_stat, scope iop_mpu, type r */
105#define reg_iop_mpu_r_wr_stat___r0___lsb 0
106#define reg_iop_mpu_r_wr_stat___r0___width 1
107#define reg_iop_mpu_r_wr_stat___r0___bit 0
108#define reg_iop_mpu_r_wr_stat___r1___lsb 1
109#define reg_iop_mpu_r_wr_stat___r1___width 1
110#define reg_iop_mpu_r_wr_stat___r1___bit 1
111#define reg_iop_mpu_r_wr_stat___r2___lsb 2
112#define reg_iop_mpu_r_wr_stat___r2___width 1
113#define reg_iop_mpu_r_wr_stat___r2___bit 2
114#define reg_iop_mpu_r_wr_stat___r3___lsb 3
115#define reg_iop_mpu_r_wr_stat___r3___width 1
116#define reg_iop_mpu_r_wr_stat___r3___bit 3
117#define reg_iop_mpu_r_wr_stat___r4___lsb 4
118#define reg_iop_mpu_r_wr_stat___r4___width 1
119#define reg_iop_mpu_r_wr_stat___r4___bit 4
120#define reg_iop_mpu_r_wr_stat___r5___lsb 5
121#define reg_iop_mpu_r_wr_stat___r5___width 1
122#define reg_iop_mpu_r_wr_stat___r5___bit 5
123#define reg_iop_mpu_r_wr_stat___r6___lsb 6
124#define reg_iop_mpu_r_wr_stat___r6___width 1
125#define reg_iop_mpu_r_wr_stat___r6___bit 6
126#define reg_iop_mpu_r_wr_stat___r7___lsb 7
127#define reg_iop_mpu_r_wr_stat___r7___width 1
128#define reg_iop_mpu_r_wr_stat___r7___bit 7
129#define reg_iop_mpu_r_wr_stat___r8___lsb 8
130#define reg_iop_mpu_r_wr_stat___r8___width 1
131#define reg_iop_mpu_r_wr_stat___r8___bit 8
132#define reg_iop_mpu_r_wr_stat___r9___lsb 9
133#define reg_iop_mpu_r_wr_stat___r9___width 1
134#define reg_iop_mpu_r_wr_stat___r9___bit 9
135#define reg_iop_mpu_r_wr_stat___r10___lsb 10
136#define reg_iop_mpu_r_wr_stat___r10___width 1
137#define reg_iop_mpu_r_wr_stat___r10___bit 10
138#define reg_iop_mpu_r_wr_stat___r11___lsb 11
139#define reg_iop_mpu_r_wr_stat___r11___width 1
140#define reg_iop_mpu_r_wr_stat___r11___bit 11
141#define reg_iop_mpu_r_wr_stat___r12___lsb 12
142#define reg_iop_mpu_r_wr_stat___r12___width 1
143#define reg_iop_mpu_r_wr_stat___r12___bit 12
144#define reg_iop_mpu_r_wr_stat___r13___lsb 13
145#define reg_iop_mpu_r_wr_stat___r13___width 1
146#define reg_iop_mpu_r_wr_stat___r13___bit 13
147#define reg_iop_mpu_r_wr_stat___r14___lsb 14
148#define reg_iop_mpu_r_wr_stat___r14___width 1
149#define reg_iop_mpu_r_wr_stat___r14___bit 14
150#define reg_iop_mpu_r_wr_stat___r15___lsb 15
151#define reg_iop_mpu_r_wr_stat___r15___width 1
152#define reg_iop_mpu_r_wr_stat___r15___bit 15
153#define reg_iop_mpu_r_wr_stat_offset 152
154
155#define STRIDE_iop_mpu_rw_thread 4
156/* Register rw_thread, scope iop_mpu, type rw */
157#define reg_iop_mpu_rw_thread___addr___lsb 0
158#define reg_iop_mpu_rw_thread___addr___width 12
159#define reg_iop_mpu_rw_thread_offset 156
160
161#define STRIDE_iop_mpu_rw_intr 4
162/* Register rw_intr, scope iop_mpu, type rw */
163#define reg_iop_mpu_rw_intr___addr___lsb 0
164#define reg_iop_mpu_rw_intr___addr___width 12
165#define reg_iop_mpu_rw_intr_offset 196
166
167
168/* Constants */
169#define regk_iop_mpu_no 0x00000000
170#define regk_iop_mpu_r_pc_default 0x00000000
171#define regk_iop_mpu_rw_ctrl_default 0x00000000
172#define regk_iop_mpu_rw_intr_size 0x00000010
173#define regk_iop_mpu_rw_r_size 0x00000010
174#define regk_iop_mpu_rw_thread_default 0x00000000
175#define regk_iop_mpu_rw_thread_size 0x00000004
176#define regk_iop_mpu_yes 0x00000001
177#endif /* __iop_mpu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_reg_space_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_reg_space_asm.h
new file mode 100644
index 000000000000..a20b8857b4d0
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_reg_space_asm.h
@@ -0,0 +1,44 @@
1/* Autogenerated Changes here will be lost!
2 * generated by ../gen_sw.pl Mon Apr 11 16:10:18 2005 iop_sw.cfg
3 */
4#define iop_version 0
5#define iop_fifo_in0_extra 64
6#define iop_fifo_in1_extra 128
7#define iop_fifo_out0_extra 192
8#define iop_fifo_out1_extra 256
9#define iop_trigger_grp0 320
10#define iop_trigger_grp1 384
11#define iop_trigger_grp2 448
12#define iop_trigger_grp3 512
13#define iop_trigger_grp4 576
14#define iop_trigger_grp5 640
15#define iop_trigger_grp6 704
16#define iop_trigger_grp7 768
17#define iop_crc_par0 896
18#define iop_crc_par1 1024
19#define iop_dmc_in0 1152
20#define iop_dmc_in1 1280
21#define iop_dmc_out0 1408
22#define iop_dmc_out1 1536
23#define iop_fifo_in0 1664
24#define iop_fifo_in1 1792
25#define iop_fifo_out0 1920
26#define iop_fifo_out1 2048
27#define iop_scrc_in0 2176
28#define iop_scrc_in1 2304
29#define iop_scrc_out0 2432
30#define iop_scrc_out1 2560
31#define iop_timer_grp0 2688
32#define iop_timer_grp1 2816
33#define iop_timer_grp2 2944
34#define iop_timer_grp3 3072
35#define iop_sap_in 3328
36#define iop_sap_out 3584
37#define iop_spu0 3840
38#define iop_spu1 4096
39#define iop_sw_cfg 4352
40#define iop_sw_cpu 4608
41#define iop_sw_mpu 4864
42#define iop_sw_spu0 5120
43#define iop_sw_spu1 5376
44#define iop_mpu 5632
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_in_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_in_defs_asm.h
new file mode 100644
index 000000000000..a4a10ff300b3
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_in_defs_asm.h
@@ -0,0 +1,182 @@
1#ifndef __iop_sap_in_defs_asm_h
2#define __iop_sap_in_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_sap_in.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sap_in_defs_asm.h ../../inst/io_proc/rtl/iop_sap_in.r
11 * id: $Id: iop_sap_in_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_bus0_sync, scope iop_sap_in, type rw */
57#define reg_iop_sap_in_rw_bus0_sync___byte0_sel___lsb 0
58#define reg_iop_sap_in_rw_bus0_sync___byte0_sel___width 2
59#define reg_iop_sap_in_rw_bus0_sync___byte0_ext_src___lsb 2
60#define reg_iop_sap_in_rw_bus0_sync___byte0_ext_src___width 3
61#define reg_iop_sap_in_rw_bus0_sync___byte0_edge___lsb 5
62#define reg_iop_sap_in_rw_bus0_sync___byte0_edge___width 2
63#define reg_iop_sap_in_rw_bus0_sync___byte0_delay___lsb 7
64#define reg_iop_sap_in_rw_bus0_sync___byte0_delay___width 1
65#define reg_iop_sap_in_rw_bus0_sync___byte0_delay___bit 7
66#define reg_iop_sap_in_rw_bus0_sync___byte1_sel___lsb 8
67#define reg_iop_sap_in_rw_bus0_sync___byte1_sel___width 2
68#define reg_iop_sap_in_rw_bus0_sync___byte1_ext_src___lsb 10
69#define reg_iop_sap_in_rw_bus0_sync___byte1_ext_src___width 3
70#define reg_iop_sap_in_rw_bus0_sync___byte1_edge___lsb 13
71#define reg_iop_sap_in_rw_bus0_sync___byte1_edge___width 2
72#define reg_iop_sap_in_rw_bus0_sync___byte1_delay___lsb 15
73#define reg_iop_sap_in_rw_bus0_sync___byte1_delay___width 1
74#define reg_iop_sap_in_rw_bus0_sync___byte1_delay___bit 15
75#define reg_iop_sap_in_rw_bus0_sync___byte2_sel___lsb 16
76#define reg_iop_sap_in_rw_bus0_sync___byte2_sel___width 2
77#define reg_iop_sap_in_rw_bus0_sync___byte2_ext_src___lsb 18
78#define reg_iop_sap_in_rw_bus0_sync___byte2_ext_src___width 3
79#define reg_iop_sap_in_rw_bus0_sync___byte2_edge___lsb 21
80#define reg_iop_sap_in_rw_bus0_sync___byte2_edge___width 2
81#define reg_iop_sap_in_rw_bus0_sync___byte2_delay___lsb 23
82#define reg_iop_sap_in_rw_bus0_sync___byte2_delay___width 1
83#define reg_iop_sap_in_rw_bus0_sync___byte2_delay___bit 23
84#define reg_iop_sap_in_rw_bus0_sync___byte3_sel___lsb 24
85#define reg_iop_sap_in_rw_bus0_sync___byte3_sel___width 2
86#define reg_iop_sap_in_rw_bus0_sync___byte3_ext_src___lsb 26
87#define reg_iop_sap_in_rw_bus0_sync___byte3_ext_src___width 3
88#define reg_iop_sap_in_rw_bus0_sync___byte3_edge___lsb 29
89#define reg_iop_sap_in_rw_bus0_sync___byte3_edge___width 2
90#define reg_iop_sap_in_rw_bus0_sync___byte3_delay___lsb 31
91#define reg_iop_sap_in_rw_bus0_sync___byte3_delay___width 1
92#define reg_iop_sap_in_rw_bus0_sync___byte3_delay___bit 31
93#define reg_iop_sap_in_rw_bus0_sync_offset 0
94
95/* Register rw_bus1_sync, scope iop_sap_in, type rw */
96#define reg_iop_sap_in_rw_bus1_sync___byte0_sel___lsb 0
97#define reg_iop_sap_in_rw_bus1_sync___byte0_sel___width 2
98#define reg_iop_sap_in_rw_bus1_sync___byte0_ext_src___lsb 2
99#define reg_iop_sap_in_rw_bus1_sync___byte0_ext_src___width 3
100#define reg_iop_sap_in_rw_bus1_sync___byte0_edge___lsb 5
101#define reg_iop_sap_in_rw_bus1_sync___byte0_edge___width 2
102#define reg_iop_sap_in_rw_bus1_sync___byte0_delay___lsb 7
103#define reg_iop_sap_in_rw_bus1_sync___byte0_delay___width 1
104#define reg_iop_sap_in_rw_bus1_sync___byte0_delay___bit 7
105#define reg_iop_sap_in_rw_bus1_sync___byte1_sel___lsb 8
106#define reg_iop_sap_in_rw_bus1_sync___byte1_sel___width 2
107#define reg_iop_sap_in_rw_bus1_sync___byte1_ext_src___lsb 10
108#define reg_iop_sap_in_rw_bus1_sync___byte1_ext_src___width 3
109#define reg_iop_sap_in_rw_bus1_sync___byte1_edge___lsb 13
110#define reg_iop_sap_in_rw_bus1_sync___byte1_edge___width 2
111#define reg_iop_sap_in_rw_bus1_sync___byte1_delay___lsb 15
112#define reg_iop_sap_in_rw_bus1_sync___byte1_delay___width 1
113#define reg_iop_sap_in_rw_bus1_sync___byte1_delay___bit 15
114#define reg_iop_sap_in_rw_bus1_sync___byte2_sel___lsb 16
115#define reg_iop_sap_in_rw_bus1_sync___byte2_sel___width 2
116#define reg_iop_sap_in_rw_bus1_sync___byte2_ext_src___lsb 18
117#define reg_iop_sap_in_rw_bus1_sync___byte2_ext_src___width 3
118#define reg_iop_sap_in_rw_bus1_sync___byte2_edge___lsb 21
119#define reg_iop_sap_in_rw_bus1_sync___byte2_edge___width 2
120#define reg_iop_sap_in_rw_bus1_sync___byte2_delay___lsb 23
121#define reg_iop_sap_in_rw_bus1_sync___byte2_delay___width 1
122#define reg_iop_sap_in_rw_bus1_sync___byte2_delay___bit 23
123#define reg_iop_sap_in_rw_bus1_sync___byte3_sel___lsb 24
124#define reg_iop_sap_in_rw_bus1_sync___byte3_sel___width 2
125#define reg_iop_sap_in_rw_bus1_sync___byte3_ext_src___lsb 26
126#define reg_iop_sap_in_rw_bus1_sync___byte3_ext_src___width 3
127#define reg_iop_sap_in_rw_bus1_sync___byte3_edge___lsb 29
128#define reg_iop_sap_in_rw_bus1_sync___byte3_edge___width 2
129#define reg_iop_sap_in_rw_bus1_sync___byte3_delay___lsb 31
130#define reg_iop_sap_in_rw_bus1_sync___byte3_delay___width 1
131#define reg_iop_sap_in_rw_bus1_sync___byte3_delay___bit 31
132#define reg_iop_sap_in_rw_bus1_sync_offset 4
133
134#define STRIDE_iop_sap_in_rw_gio 4
135/* Register rw_gio, scope iop_sap_in, type rw */
136#define reg_iop_sap_in_rw_gio___sync_sel___lsb 0
137#define reg_iop_sap_in_rw_gio___sync_sel___width 2
138#define reg_iop_sap_in_rw_gio___sync_ext_src___lsb 2
139#define reg_iop_sap_in_rw_gio___sync_ext_src___width 3
140#define reg_iop_sap_in_rw_gio___sync_edge___lsb 5
141#define reg_iop_sap_in_rw_gio___sync_edge___width 2
142#define reg_iop_sap_in_rw_gio___delay___lsb 7
143#define reg_iop_sap_in_rw_gio___delay___width 1
144#define reg_iop_sap_in_rw_gio___delay___bit 7
145#define reg_iop_sap_in_rw_gio___logic___lsb 8
146#define reg_iop_sap_in_rw_gio___logic___width 2
147#define reg_iop_sap_in_rw_gio_offset 8
148
149
150/* Constants */
151#define regk_iop_sap_in_and 0x00000002
152#define regk_iop_sap_in_ext_clk200 0x00000003
153#define regk_iop_sap_in_gio1 0x00000000
154#define regk_iop_sap_in_gio13 0x00000005
155#define regk_iop_sap_in_gio18 0x00000003
156#define regk_iop_sap_in_gio19 0x00000004
157#define regk_iop_sap_in_gio21 0x00000006
158#define regk_iop_sap_in_gio23 0x00000005
159#define regk_iop_sap_in_gio29 0x00000007
160#define regk_iop_sap_in_gio5 0x00000004
161#define regk_iop_sap_in_gio6 0x00000001
162#define regk_iop_sap_in_gio7 0x00000002
163#define regk_iop_sap_in_inv 0x00000001
164#define regk_iop_sap_in_neg 0x00000002
165#define regk_iop_sap_in_no 0x00000000
166#define regk_iop_sap_in_no_del_ext_clk200 0x00000001
167#define regk_iop_sap_in_none 0x00000000
168#define regk_iop_sap_in_or 0x00000003
169#define regk_iop_sap_in_pos 0x00000001
170#define regk_iop_sap_in_pos_neg 0x00000003
171#define regk_iop_sap_in_rw_bus0_sync_default 0x02020202
172#define regk_iop_sap_in_rw_bus1_sync_default 0x02020202
173#define regk_iop_sap_in_rw_gio_default 0x00000002
174#define regk_iop_sap_in_rw_gio_size 0x00000020
175#define regk_iop_sap_in_timer_grp0_tmr3 0x00000006
176#define regk_iop_sap_in_timer_grp1_tmr3 0x00000004
177#define regk_iop_sap_in_timer_grp2_tmr3 0x00000005
178#define regk_iop_sap_in_timer_grp3_tmr3 0x00000007
179#define regk_iop_sap_in_tmr_clk200 0x00000000
180#define regk_iop_sap_in_two_clk200 0x00000002
181#define regk_iop_sap_in_yes 0x00000001
182#endif /* __iop_sap_in_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_out_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_out_defs_asm.h
new file mode 100644
index 000000000000..0ec727f92a25
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sap_out_defs_asm.h
@@ -0,0 +1,346 @@
1#ifndef __iop_sap_out_defs_asm_h
2#define __iop_sap_out_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_sap_out.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sap_out_defs_asm.h ../../inst/io_proc/rtl/iop_sap_out.r
11 * id: $Id: iop_sap_out_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_gen_gated, scope iop_sap_out, type rw */
57#define reg_iop_sap_out_rw_gen_gated___clk0_src___lsb 0
58#define reg_iop_sap_out_rw_gen_gated___clk0_src___width 2
59#define reg_iop_sap_out_rw_gen_gated___clk0_gate_src___lsb 2
60#define reg_iop_sap_out_rw_gen_gated___clk0_gate_src___width 2
61#define reg_iop_sap_out_rw_gen_gated___clk0_force_src___lsb 4
62#define reg_iop_sap_out_rw_gen_gated___clk0_force_src___width 3
63#define reg_iop_sap_out_rw_gen_gated___clk1_src___lsb 7
64#define reg_iop_sap_out_rw_gen_gated___clk1_src___width 2
65#define reg_iop_sap_out_rw_gen_gated___clk1_gate_src___lsb 9
66#define reg_iop_sap_out_rw_gen_gated___clk1_gate_src___width 2
67#define reg_iop_sap_out_rw_gen_gated___clk1_force_src___lsb 11
68#define reg_iop_sap_out_rw_gen_gated___clk1_force_src___width 3
69#define reg_iop_sap_out_rw_gen_gated___clk2_src___lsb 14
70#define reg_iop_sap_out_rw_gen_gated___clk2_src___width 2
71#define reg_iop_sap_out_rw_gen_gated___clk2_gate_src___lsb 16
72#define reg_iop_sap_out_rw_gen_gated___clk2_gate_src___width 2
73#define reg_iop_sap_out_rw_gen_gated___clk2_force_src___lsb 18
74#define reg_iop_sap_out_rw_gen_gated___clk2_force_src___width 3
75#define reg_iop_sap_out_rw_gen_gated___clk3_src___lsb 21
76#define reg_iop_sap_out_rw_gen_gated___clk3_src___width 2
77#define reg_iop_sap_out_rw_gen_gated___clk3_gate_src___lsb 23
78#define reg_iop_sap_out_rw_gen_gated___clk3_gate_src___width 2
79#define reg_iop_sap_out_rw_gen_gated___clk3_force_src___lsb 25
80#define reg_iop_sap_out_rw_gen_gated___clk3_force_src___width 3
81#define reg_iop_sap_out_rw_gen_gated_offset 0
82
83/* Register rw_bus0, scope iop_sap_out, type rw */
84#define reg_iop_sap_out_rw_bus0___byte0_clk_sel___lsb 0
85#define reg_iop_sap_out_rw_bus0___byte0_clk_sel___width 3
86#define reg_iop_sap_out_rw_bus0___byte0_gated_clk___lsb 3
87#define reg_iop_sap_out_rw_bus0___byte0_gated_clk___width 2
88#define reg_iop_sap_out_rw_bus0___byte0_clk_inv___lsb 5
89#define reg_iop_sap_out_rw_bus0___byte0_clk_inv___width 1
90#define reg_iop_sap_out_rw_bus0___byte0_clk_inv___bit 5
91#define reg_iop_sap_out_rw_bus0___byte1_clk_sel___lsb 6
92#define reg_iop_sap_out_rw_bus0___byte1_clk_sel___width 3
93#define reg_iop_sap_out_rw_bus0___byte1_gated_clk___lsb 9
94#define reg_iop_sap_out_rw_bus0___byte1_gated_clk___width 2
95#define reg_iop_sap_out_rw_bus0___byte1_clk_inv___lsb 11
96#define reg_iop_sap_out_rw_bus0___byte1_clk_inv___width 1
97#define reg_iop_sap_out_rw_bus0___byte1_clk_inv___bit 11
98#define reg_iop_sap_out_rw_bus0___byte2_clk_sel___lsb 12
99#define reg_iop_sap_out_rw_bus0___byte2_clk_sel___width 3
100#define reg_iop_sap_out_rw_bus0___byte2_gated_clk___lsb 15
101#define reg_iop_sap_out_rw_bus0___byte2_gated_clk___width 2
102#define reg_iop_sap_out_rw_bus0___byte2_clk_inv___lsb 17
103#define reg_iop_sap_out_rw_bus0___byte2_clk_inv___width 1
104#define reg_iop_sap_out_rw_bus0___byte2_clk_inv___bit 17
105#define reg_iop_sap_out_rw_bus0___byte3_clk_sel___lsb 18
106#define reg_iop_sap_out_rw_bus0___byte3_clk_sel___width 3
107#define reg_iop_sap_out_rw_bus0___byte3_gated_clk___lsb 21
108#define reg_iop_sap_out_rw_bus0___byte3_gated_clk___width 2
109#define reg_iop_sap_out_rw_bus0___byte3_clk_inv___lsb 23
110#define reg_iop_sap_out_rw_bus0___byte3_clk_inv___width 1
111#define reg_iop_sap_out_rw_bus0___byte3_clk_inv___bit 23
112#define reg_iop_sap_out_rw_bus0_offset 4
113
114/* Register rw_bus1, scope iop_sap_out, type rw */
115#define reg_iop_sap_out_rw_bus1___byte0_clk_sel___lsb 0
116#define reg_iop_sap_out_rw_bus1___byte0_clk_sel___width 3
117#define reg_iop_sap_out_rw_bus1___byte0_gated_clk___lsb 3
118#define reg_iop_sap_out_rw_bus1___byte0_gated_clk___width 2
119#define reg_iop_sap_out_rw_bus1___byte0_clk_inv___lsb 5
120#define reg_iop_sap_out_rw_bus1___byte0_clk_inv___width 1
121#define reg_iop_sap_out_rw_bus1___byte0_clk_inv___bit 5
122#define reg_iop_sap_out_rw_bus1___byte1_clk_sel___lsb 6
123#define reg_iop_sap_out_rw_bus1___byte1_clk_sel___width 3
124#define reg_iop_sap_out_rw_bus1___byte1_gated_clk___lsb 9
125#define reg_iop_sap_out_rw_bus1___byte1_gated_clk___width 2
126#define reg_iop_sap_out_rw_bus1___byte1_clk_inv___lsb 11
127#define reg_iop_sap_out_rw_bus1___byte1_clk_inv___width 1
128#define reg_iop_sap_out_rw_bus1___byte1_clk_inv___bit 11
129#define reg_iop_sap_out_rw_bus1___byte2_clk_sel___lsb 12
130#define reg_iop_sap_out_rw_bus1___byte2_clk_sel___width 3
131#define reg_iop_sap_out_rw_bus1___byte2_gated_clk___lsb 15
132#define reg_iop_sap_out_rw_bus1___byte2_gated_clk___width 2
133#define reg_iop_sap_out_rw_bus1___byte2_clk_inv___lsb 17
134#define reg_iop_sap_out_rw_bus1___byte2_clk_inv___width 1
135#define reg_iop_sap_out_rw_bus1___byte2_clk_inv___bit 17
136#define reg_iop_sap_out_rw_bus1___byte3_clk_sel___lsb 18
137#define reg_iop_sap_out_rw_bus1___byte3_clk_sel___width 3
138#define reg_iop_sap_out_rw_bus1___byte3_gated_clk___lsb 21
139#define reg_iop_sap_out_rw_bus1___byte3_gated_clk___width 2
140#define reg_iop_sap_out_rw_bus1___byte3_clk_inv___lsb 23
141#define reg_iop_sap_out_rw_bus1___byte3_clk_inv___width 1
142#define reg_iop_sap_out_rw_bus1___byte3_clk_inv___bit 23
143#define reg_iop_sap_out_rw_bus1_offset 8
144
145/* Register rw_bus0_lo_oe, scope iop_sap_out, type rw */
146#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_sel___lsb 0
147#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_sel___width 3
148#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_ext___lsb 3
149#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_ext___width 3
150#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_gated_clk___lsb 6
151#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_gated_clk___width 2
152#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_inv___lsb 8
153#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_inv___width 1
154#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_clk_inv___bit 8
155#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_logic___lsb 9
156#define reg_iop_sap_out_rw_bus0_lo_oe___byte0_logic___width 2
157#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_sel___lsb 11
158#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_sel___width 3
159#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_ext___lsb 14
160#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_ext___width 3
161#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_gated_clk___lsb 17
162#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_gated_clk___width 2
163#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_inv___lsb 19
164#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_inv___width 1
165#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_clk_inv___bit 19
166#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_logic___lsb 20
167#define reg_iop_sap_out_rw_bus0_lo_oe___byte1_logic___width 2
168#define reg_iop_sap_out_rw_bus0_lo_oe_offset 12
169
170/* Register rw_bus0_hi_oe, scope iop_sap_out, type rw */
171#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_sel___lsb 0
172#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_sel___width 3
173#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_ext___lsb 3
174#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_ext___width 3
175#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_gated_clk___lsb 6
176#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_gated_clk___width 2
177#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_inv___lsb 8
178#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_inv___width 1
179#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_clk_inv___bit 8
180#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_logic___lsb 9
181#define reg_iop_sap_out_rw_bus0_hi_oe___byte2_logic___width 2
182#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_sel___lsb 11
183#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_sel___width 3
184#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_ext___lsb 14
185#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_ext___width 3
186#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_gated_clk___lsb 17
187#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_gated_clk___width 2
188#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_inv___lsb 19
189#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_inv___width 1
190#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_clk_inv___bit 19
191#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_logic___lsb 20
192#define reg_iop_sap_out_rw_bus0_hi_oe___byte3_logic___width 2
193#define reg_iop_sap_out_rw_bus0_hi_oe_offset 16
194
195/* Register rw_bus1_lo_oe, scope iop_sap_out, type rw */
196#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_sel___lsb 0
197#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_sel___width 3
198#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_ext___lsb 3
199#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_ext___width 3
200#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_gated_clk___lsb 6
201#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_gated_clk___width 2
202#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_inv___lsb 8
203#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_inv___width 1
204#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_clk_inv___bit 8
205#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_logic___lsb 9
206#define reg_iop_sap_out_rw_bus1_lo_oe___byte0_logic___width 2
207#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_sel___lsb 11
208#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_sel___width 3
209#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_ext___lsb 14
210#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_ext___width 3
211#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_gated_clk___lsb 17
212#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_gated_clk___width 2
213#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_inv___lsb 19
214#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_inv___width 1
215#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_clk_inv___bit 19
216#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_logic___lsb 20
217#define reg_iop_sap_out_rw_bus1_lo_oe___byte1_logic___width 2
218#define reg_iop_sap_out_rw_bus1_lo_oe_offset 20
219
220/* Register rw_bus1_hi_oe, scope iop_sap_out, type rw */
221#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_sel___lsb 0
222#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_sel___width 3
223#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_ext___lsb 3
224#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_ext___width 3
225#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_gated_clk___lsb 6
226#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_gated_clk___width 2
227#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_inv___lsb 8
228#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_inv___width 1
229#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_clk_inv___bit 8
230#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_logic___lsb 9
231#define reg_iop_sap_out_rw_bus1_hi_oe___byte2_logic___width 2
232#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_sel___lsb 11
233#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_sel___width 3
234#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_ext___lsb 14
235#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_ext___width 3
236#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_gated_clk___lsb 17
237#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_gated_clk___width 2
238#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_inv___lsb 19
239#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_inv___width 1
240#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_clk_inv___bit 19
241#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_logic___lsb 20
242#define reg_iop_sap_out_rw_bus1_hi_oe___byte3_logic___width 2
243#define reg_iop_sap_out_rw_bus1_hi_oe_offset 24
244
245#define STRIDE_iop_sap_out_rw_gio 4
246/* Register rw_gio, scope iop_sap_out, type rw */
247#define reg_iop_sap_out_rw_gio___out_clk_sel___lsb 0
248#define reg_iop_sap_out_rw_gio___out_clk_sel___width 3
249#define reg_iop_sap_out_rw_gio___out_clk_ext___lsb 3
250#define reg_iop_sap_out_rw_gio___out_clk_ext___width 4
251#define reg_iop_sap_out_rw_gio___out_gated_clk___lsb 7
252#define reg_iop_sap_out_rw_gio___out_gated_clk___width 2
253#define reg_iop_sap_out_rw_gio___out_clk_inv___lsb 9
254#define reg_iop_sap_out_rw_gio___out_clk_inv___width 1
255#define reg_iop_sap_out_rw_gio___out_clk_inv___bit 9
256#define reg_iop_sap_out_rw_gio___out_logic___lsb 10
257#define reg_iop_sap_out_rw_gio___out_logic___width 1
258#define reg_iop_sap_out_rw_gio___out_logic___bit 10
259#define reg_iop_sap_out_rw_gio___oe_clk_sel___lsb 11
260#define reg_iop_sap_out_rw_gio___oe_clk_sel___width 3
261#define reg_iop_sap_out_rw_gio___oe_clk_ext___lsb 14
262#define reg_iop_sap_out_rw_gio___oe_clk_ext___width 3
263#define reg_iop_sap_out_rw_gio___oe_gated_clk___lsb 17
264#define reg_iop_sap_out_rw_gio___oe_gated_clk___width 2
265#define reg_iop_sap_out_rw_gio___oe_clk_inv___lsb 19
266#define reg_iop_sap_out_rw_gio___oe_clk_inv___width 1
267#define reg_iop_sap_out_rw_gio___oe_clk_inv___bit 19
268#define reg_iop_sap_out_rw_gio___oe_logic___lsb 20
269#define reg_iop_sap_out_rw_gio___oe_logic___width 2
270#define reg_iop_sap_out_rw_gio_offset 28
271
272
273/* Constants */
274#define regk_iop_sap_out_and 0x00000002
275#define regk_iop_sap_out_clk0 0x00000000
276#define regk_iop_sap_out_clk1 0x00000001
277#define regk_iop_sap_out_clk12 0x00000002
278#define regk_iop_sap_out_clk2 0x00000002
279#define regk_iop_sap_out_clk200 0x00000001
280#define regk_iop_sap_out_clk3 0x00000003
281#define regk_iop_sap_out_ext 0x00000003
282#define regk_iop_sap_out_gated 0x00000004
283#define regk_iop_sap_out_gio1 0x00000000
284#define regk_iop_sap_out_gio13 0x00000002
285#define regk_iop_sap_out_gio13_clk 0x0000000c
286#define regk_iop_sap_out_gio15 0x00000001
287#define regk_iop_sap_out_gio18 0x00000003
288#define regk_iop_sap_out_gio18_clk 0x0000000d
289#define regk_iop_sap_out_gio1_clk 0x00000008
290#define regk_iop_sap_out_gio21_clk 0x0000000e
291#define regk_iop_sap_out_gio23 0x00000002
292#define regk_iop_sap_out_gio29_clk 0x0000000f
293#define regk_iop_sap_out_gio31 0x00000003
294#define regk_iop_sap_out_gio5 0x00000001
295#define regk_iop_sap_out_gio5_clk 0x00000009
296#define regk_iop_sap_out_gio6_clk 0x0000000a
297#define regk_iop_sap_out_gio7 0x00000000
298#define regk_iop_sap_out_gio7_clk 0x0000000b
299#define regk_iop_sap_out_gio_in13 0x00000001
300#define regk_iop_sap_out_gio_in21 0x00000002
301#define regk_iop_sap_out_gio_in29 0x00000003
302#define regk_iop_sap_out_gio_in5 0x00000000
303#define regk_iop_sap_out_inv 0x00000001
304#define regk_iop_sap_out_nand 0x00000003
305#define regk_iop_sap_out_no 0x00000000
306#define regk_iop_sap_out_none 0x00000000
307#define regk_iop_sap_out_rw_bus0_default 0x00000000
308#define regk_iop_sap_out_rw_bus0_hi_oe_default 0x00000000
309#define regk_iop_sap_out_rw_bus0_lo_oe_default 0x00000000
310#define regk_iop_sap_out_rw_bus1_default 0x00000000
311#define regk_iop_sap_out_rw_bus1_hi_oe_default 0x00000000
312#define regk_iop_sap_out_rw_bus1_lo_oe_default 0x00000000
313#define regk_iop_sap_out_rw_gen_gated_default 0x00000000
314#define regk_iop_sap_out_rw_gio_default 0x00000000
315#define regk_iop_sap_out_rw_gio_size 0x00000020
316#define regk_iop_sap_out_spu0_gio0 0x00000002
317#define regk_iop_sap_out_spu0_gio1 0x00000003
318#define regk_iop_sap_out_spu0_gio12 0x00000004
319#define regk_iop_sap_out_spu0_gio13 0x00000004
320#define regk_iop_sap_out_spu0_gio14 0x00000004
321#define regk_iop_sap_out_spu0_gio15 0x00000004
322#define regk_iop_sap_out_spu0_gio2 0x00000002
323#define regk_iop_sap_out_spu0_gio3 0x00000003
324#define regk_iop_sap_out_spu0_gio4 0x00000002
325#define regk_iop_sap_out_spu0_gio5 0x00000003
326#define regk_iop_sap_out_spu0_gio6 0x00000002
327#define regk_iop_sap_out_spu0_gio7 0x00000003
328#define regk_iop_sap_out_spu1_gio0 0x00000005
329#define regk_iop_sap_out_spu1_gio1 0x00000006
330#define regk_iop_sap_out_spu1_gio12 0x00000007
331#define regk_iop_sap_out_spu1_gio13 0x00000007
332#define regk_iop_sap_out_spu1_gio14 0x00000007
333#define regk_iop_sap_out_spu1_gio15 0x00000007
334#define regk_iop_sap_out_spu1_gio2 0x00000005
335#define regk_iop_sap_out_spu1_gio3 0x00000006
336#define regk_iop_sap_out_spu1_gio4 0x00000005
337#define regk_iop_sap_out_spu1_gio5 0x00000006
338#define regk_iop_sap_out_spu1_gio6 0x00000005
339#define regk_iop_sap_out_spu1_gio7 0x00000006
340#define regk_iop_sap_out_timer_grp0_tmr2 0x00000004
341#define regk_iop_sap_out_timer_grp1_tmr2 0x00000005
342#define regk_iop_sap_out_timer_grp2_tmr2 0x00000006
343#define regk_iop_sap_out_timer_grp3_tmr2 0x00000007
344#define regk_iop_sap_out_tmr 0x00000005
345#define regk_iop_sap_out_yes 0x00000001
346#endif /* __iop_sap_out_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_in_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_in_defs_asm.h
new file mode 100644
index 000000000000..2cf5721597fc
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_in_defs_asm.h
@@ -0,0 +1,111 @@
1#ifndef __iop_scrc_in_defs_asm_h
2#define __iop_scrc_in_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_scrc_in.r
7 * id: iop_scrc_in.r,v 1.10 2005/02/16 09:13:58 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_scrc_in_defs_asm.h ../../inst/io_proc/rtl/iop_scrc_in.r
11 * id: $Id: iop_scrc_in_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_scrc_in, type rw */
57#define reg_iop_scrc_in_rw_cfg___trig___lsb 0
58#define reg_iop_scrc_in_rw_cfg___trig___width 2
59#define reg_iop_scrc_in_rw_cfg_offset 0
60
61/* Register rw_ctrl, scope iop_scrc_in, type rw */
62#define reg_iop_scrc_in_rw_ctrl___dif_in_en___lsb 0
63#define reg_iop_scrc_in_rw_ctrl___dif_in_en___width 1
64#define reg_iop_scrc_in_rw_ctrl___dif_in_en___bit 0
65#define reg_iop_scrc_in_rw_ctrl_offset 4
66
67/* Register r_stat, scope iop_scrc_in, type r */
68#define reg_iop_scrc_in_r_stat___err___lsb 0
69#define reg_iop_scrc_in_r_stat___err___width 1
70#define reg_iop_scrc_in_r_stat___err___bit 0
71#define reg_iop_scrc_in_r_stat_offset 8
72
73/* Register rw_init_crc, scope iop_scrc_in, type rw */
74#define reg_iop_scrc_in_rw_init_crc_offset 12
75
76/* Register rs_computed_crc, scope iop_scrc_in, type rs */
77#define reg_iop_scrc_in_rs_computed_crc_offset 16
78
79/* Register r_computed_crc, scope iop_scrc_in, type r */
80#define reg_iop_scrc_in_r_computed_crc_offset 20
81
82/* Register rw_crc, scope iop_scrc_in, type rw */
83#define reg_iop_scrc_in_rw_crc_offset 24
84
85/* Register rw_correct_crc, scope iop_scrc_in, type rw */
86#define reg_iop_scrc_in_rw_correct_crc_offset 28
87
88/* Register rw_wr1bit, scope iop_scrc_in, type rw */
89#define reg_iop_scrc_in_rw_wr1bit___data___lsb 0
90#define reg_iop_scrc_in_rw_wr1bit___data___width 2
91#define reg_iop_scrc_in_rw_wr1bit___last___lsb 2
92#define reg_iop_scrc_in_rw_wr1bit___last___width 2
93#define reg_iop_scrc_in_rw_wr1bit_offset 32
94
95
96/* Constants */
97#define regk_iop_scrc_in_dif_in 0x00000002
98#define regk_iop_scrc_in_hi 0x00000000
99#define regk_iop_scrc_in_neg 0x00000002
100#define regk_iop_scrc_in_no 0x00000000
101#define regk_iop_scrc_in_pos 0x00000001
102#define regk_iop_scrc_in_pos_neg 0x00000003
103#define regk_iop_scrc_in_r_computed_crc_default 0x00000000
104#define regk_iop_scrc_in_rs_computed_crc_default 0x00000000
105#define regk_iop_scrc_in_rw_cfg_default 0x00000000
106#define regk_iop_scrc_in_rw_ctrl_default 0x00000000
107#define regk_iop_scrc_in_rw_init_crc_default 0x00000000
108#define regk_iop_scrc_in_set0 0x00000000
109#define regk_iop_scrc_in_set1 0x00000001
110#define regk_iop_scrc_in_yes 0x00000001
111#endif /* __iop_scrc_in_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_out_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_out_defs_asm.h
new file mode 100644
index 000000000000..640a25725f20
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_scrc_out_defs_asm.h
@@ -0,0 +1,105 @@
1#ifndef __iop_scrc_out_defs_asm_h
2#define __iop_scrc_out_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_scrc_out.r
7 * id: iop_scrc_out.r,v 1.11 2005/02/16 09:13:38 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_scrc_out_defs_asm.h ../../inst/io_proc/rtl/iop_scrc_out.r
11 * id: $Id: iop_scrc_out_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_scrc_out, type rw */
57#define reg_iop_scrc_out_rw_cfg___trig___lsb 0
58#define reg_iop_scrc_out_rw_cfg___trig___width 2
59#define reg_iop_scrc_out_rw_cfg___inv_crc___lsb 2
60#define reg_iop_scrc_out_rw_cfg___inv_crc___width 1
61#define reg_iop_scrc_out_rw_cfg___inv_crc___bit 2
62#define reg_iop_scrc_out_rw_cfg_offset 0
63
64/* Register rw_ctrl, scope iop_scrc_out, type rw */
65#define reg_iop_scrc_out_rw_ctrl___strb_src___lsb 0
66#define reg_iop_scrc_out_rw_ctrl___strb_src___width 1
67#define reg_iop_scrc_out_rw_ctrl___strb_src___bit 0
68#define reg_iop_scrc_out_rw_ctrl___out_src___lsb 1
69#define reg_iop_scrc_out_rw_ctrl___out_src___width 1
70#define reg_iop_scrc_out_rw_ctrl___out_src___bit 1
71#define reg_iop_scrc_out_rw_ctrl_offset 4
72
73/* Register rw_init_crc, scope iop_scrc_out, type rw */
74#define reg_iop_scrc_out_rw_init_crc_offset 8
75
76/* Register rw_crc, scope iop_scrc_out, type rw */
77#define reg_iop_scrc_out_rw_crc_offset 12
78
79/* Register rw_data, scope iop_scrc_out, type rw */
80#define reg_iop_scrc_out_rw_data___val___lsb 0
81#define reg_iop_scrc_out_rw_data___val___width 1
82#define reg_iop_scrc_out_rw_data___val___bit 0
83#define reg_iop_scrc_out_rw_data_offset 16
84
85/* Register r_computed_crc, scope iop_scrc_out, type r */
86#define reg_iop_scrc_out_r_computed_crc_offset 20
87
88
89/* Constants */
90#define regk_iop_scrc_out_crc 0x00000001
91#define regk_iop_scrc_out_data 0x00000000
92#define regk_iop_scrc_out_dif 0x00000001
93#define regk_iop_scrc_out_hi 0x00000000
94#define regk_iop_scrc_out_neg 0x00000002
95#define regk_iop_scrc_out_no 0x00000000
96#define regk_iop_scrc_out_pos 0x00000001
97#define regk_iop_scrc_out_pos_neg 0x00000003
98#define regk_iop_scrc_out_reg 0x00000000
99#define regk_iop_scrc_out_rw_cfg_default 0x00000000
100#define regk_iop_scrc_out_rw_crc_default 0x00000000
101#define regk_iop_scrc_out_rw_ctrl_default 0x00000000
102#define regk_iop_scrc_out_rw_data_default 0x00000000
103#define regk_iop_scrc_out_rw_init_crc_default 0x00000000
104#define regk_iop_scrc_out_yes 0x00000001
105#endif /* __iop_scrc_out_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_spu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_spu_defs_asm.h
new file mode 100644
index 000000000000..bb402c1aa761
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_spu_defs_asm.h
@@ -0,0 +1,573 @@
1#ifndef __iop_spu_defs_asm_h
2#define __iop_spu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_spu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_spu_defs_asm.h ../../inst/io_proc/rtl/iop_spu.r
11 * id: $Id: iop_spu_defs_asm.h,v 1.5 2005/04/24 18:31:06 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56#define STRIDE_iop_spu_rw_r 4
57/* Register rw_r, scope iop_spu, type rw */
58#define reg_iop_spu_rw_r_offset 0
59
60/* Register rw_seq_pc, scope iop_spu, type rw */
61#define reg_iop_spu_rw_seq_pc___addr___lsb 0
62#define reg_iop_spu_rw_seq_pc___addr___width 12
63#define reg_iop_spu_rw_seq_pc_offset 64
64
65/* Register rw_fsm_pc, scope iop_spu, type rw */
66#define reg_iop_spu_rw_fsm_pc___addr___lsb 0
67#define reg_iop_spu_rw_fsm_pc___addr___width 12
68#define reg_iop_spu_rw_fsm_pc_offset 68
69
70/* Register rw_ctrl, scope iop_spu, type rw */
71#define reg_iop_spu_rw_ctrl___fsm___lsb 0
72#define reg_iop_spu_rw_ctrl___fsm___width 1
73#define reg_iop_spu_rw_ctrl___fsm___bit 0
74#define reg_iop_spu_rw_ctrl___en___lsb 1
75#define reg_iop_spu_rw_ctrl___en___width 1
76#define reg_iop_spu_rw_ctrl___en___bit 1
77#define reg_iop_spu_rw_ctrl_offset 72
78
79/* Register rw_fsm_inputs3_0, scope iop_spu, type rw */
80#define reg_iop_spu_rw_fsm_inputs3_0___val0___lsb 0
81#define reg_iop_spu_rw_fsm_inputs3_0___val0___width 5
82#define reg_iop_spu_rw_fsm_inputs3_0___src0___lsb 5
83#define reg_iop_spu_rw_fsm_inputs3_0___src0___width 3
84#define reg_iop_spu_rw_fsm_inputs3_0___val1___lsb 8
85#define reg_iop_spu_rw_fsm_inputs3_0___val1___width 5
86#define reg_iop_spu_rw_fsm_inputs3_0___src1___lsb 13
87#define reg_iop_spu_rw_fsm_inputs3_0___src1___width 3
88#define reg_iop_spu_rw_fsm_inputs3_0___val2___lsb 16
89#define reg_iop_spu_rw_fsm_inputs3_0___val2___width 5
90#define reg_iop_spu_rw_fsm_inputs3_0___src2___lsb 21
91#define reg_iop_spu_rw_fsm_inputs3_0___src2___width 3
92#define reg_iop_spu_rw_fsm_inputs3_0___val3___lsb 24
93#define reg_iop_spu_rw_fsm_inputs3_0___val3___width 5
94#define reg_iop_spu_rw_fsm_inputs3_0___src3___lsb 29
95#define reg_iop_spu_rw_fsm_inputs3_0___src3___width 3
96#define reg_iop_spu_rw_fsm_inputs3_0_offset 76
97
98/* Register rw_fsm_inputs7_4, scope iop_spu, type rw */
99#define reg_iop_spu_rw_fsm_inputs7_4___val4___lsb 0
100#define reg_iop_spu_rw_fsm_inputs7_4___val4___width 5
101#define reg_iop_spu_rw_fsm_inputs7_4___src4___lsb 5
102#define reg_iop_spu_rw_fsm_inputs7_4___src4___width 3
103#define reg_iop_spu_rw_fsm_inputs7_4___val5___lsb 8
104#define reg_iop_spu_rw_fsm_inputs7_4___val5___width 5
105#define reg_iop_spu_rw_fsm_inputs7_4___src5___lsb 13
106#define reg_iop_spu_rw_fsm_inputs7_4___src5___width 3
107#define reg_iop_spu_rw_fsm_inputs7_4___val6___lsb 16
108#define reg_iop_spu_rw_fsm_inputs7_4___val6___width 5
109#define reg_iop_spu_rw_fsm_inputs7_4___src6___lsb 21
110#define reg_iop_spu_rw_fsm_inputs7_4___src6___width 3
111#define reg_iop_spu_rw_fsm_inputs7_4___val7___lsb 24
112#define reg_iop_spu_rw_fsm_inputs7_4___val7___width 5
113#define reg_iop_spu_rw_fsm_inputs7_4___src7___lsb 29
114#define reg_iop_spu_rw_fsm_inputs7_4___src7___width 3
115#define reg_iop_spu_rw_fsm_inputs7_4_offset 80
116
117/* Register rw_gio_out, scope iop_spu, type rw */
118#define reg_iop_spu_rw_gio_out_offset 84
119
120/* Register rw_bus0_out, scope iop_spu, type rw */
121#define reg_iop_spu_rw_bus0_out_offset 88
122
123/* Register rw_bus1_out, scope iop_spu, type rw */
124#define reg_iop_spu_rw_bus1_out_offset 92
125
126/* Register r_gio_in, scope iop_spu, type r */
127#define reg_iop_spu_r_gio_in_offset 96
128
129/* Register r_bus0_in, scope iop_spu, type r */
130#define reg_iop_spu_r_bus0_in_offset 100
131
132/* Register r_bus1_in, scope iop_spu, type r */
133#define reg_iop_spu_r_bus1_in_offset 104
134
135/* Register rw_gio_out_set, scope iop_spu, type rw */
136#define reg_iop_spu_rw_gio_out_set_offset 108
137
138/* Register rw_gio_out_clr, scope iop_spu, type rw */
139#define reg_iop_spu_rw_gio_out_clr_offset 112
140
141/* Register rs_wr_stat, scope iop_spu, type rs */
142#define reg_iop_spu_rs_wr_stat___r0___lsb 0
143#define reg_iop_spu_rs_wr_stat___r0___width 1
144#define reg_iop_spu_rs_wr_stat___r0___bit 0
145#define reg_iop_spu_rs_wr_stat___r1___lsb 1
146#define reg_iop_spu_rs_wr_stat___r1___width 1
147#define reg_iop_spu_rs_wr_stat___r1___bit 1
148#define reg_iop_spu_rs_wr_stat___r2___lsb 2
149#define reg_iop_spu_rs_wr_stat___r2___width 1
150#define reg_iop_spu_rs_wr_stat___r2___bit 2
151#define reg_iop_spu_rs_wr_stat___r3___lsb 3
152#define reg_iop_spu_rs_wr_stat___r3___width 1
153#define reg_iop_spu_rs_wr_stat___r3___bit 3
154#define reg_iop_spu_rs_wr_stat___r4___lsb 4
155#define reg_iop_spu_rs_wr_stat___r4___width 1
156#define reg_iop_spu_rs_wr_stat___r4___bit 4
157#define reg_iop_spu_rs_wr_stat___r5___lsb 5
158#define reg_iop_spu_rs_wr_stat___r5___width 1
159#define reg_iop_spu_rs_wr_stat___r5___bit 5
160#define reg_iop_spu_rs_wr_stat___r6___lsb 6
161#define reg_iop_spu_rs_wr_stat___r6___width 1
162#define reg_iop_spu_rs_wr_stat___r6___bit 6
163#define reg_iop_spu_rs_wr_stat___r7___lsb 7
164#define reg_iop_spu_rs_wr_stat___r7___width 1
165#define reg_iop_spu_rs_wr_stat___r7___bit 7
166#define reg_iop_spu_rs_wr_stat___r8___lsb 8
167#define reg_iop_spu_rs_wr_stat___r8___width 1
168#define reg_iop_spu_rs_wr_stat___r8___bit 8
169#define reg_iop_spu_rs_wr_stat___r9___lsb 9
170#define reg_iop_spu_rs_wr_stat___r9___width 1
171#define reg_iop_spu_rs_wr_stat___r9___bit 9
172#define reg_iop_spu_rs_wr_stat___r10___lsb 10
173#define reg_iop_spu_rs_wr_stat___r10___width 1
174#define reg_iop_spu_rs_wr_stat___r10___bit 10
175#define reg_iop_spu_rs_wr_stat___r11___lsb 11
176#define reg_iop_spu_rs_wr_stat___r11___width 1
177#define reg_iop_spu_rs_wr_stat___r11___bit 11
178#define reg_iop_spu_rs_wr_stat___r12___lsb 12
179#define reg_iop_spu_rs_wr_stat___r12___width 1
180#define reg_iop_spu_rs_wr_stat___r12___bit 12
181#define reg_iop_spu_rs_wr_stat___r13___lsb 13
182#define reg_iop_spu_rs_wr_stat___r13___width 1
183#define reg_iop_spu_rs_wr_stat___r13___bit 13
184#define reg_iop_spu_rs_wr_stat___r14___lsb 14
185#define reg_iop_spu_rs_wr_stat___r14___width 1
186#define reg_iop_spu_rs_wr_stat___r14___bit 14
187#define reg_iop_spu_rs_wr_stat___r15___lsb 15
188#define reg_iop_spu_rs_wr_stat___r15___width 1
189#define reg_iop_spu_rs_wr_stat___r15___bit 15
190#define reg_iop_spu_rs_wr_stat_offset 116
191
192/* Register r_wr_stat, scope iop_spu, type r */
193#define reg_iop_spu_r_wr_stat___r0___lsb 0
194#define reg_iop_spu_r_wr_stat___r0___width 1
195#define reg_iop_spu_r_wr_stat___r0___bit 0
196#define reg_iop_spu_r_wr_stat___r1___lsb 1
197#define reg_iop_spu_r_wr_stat___r1___width 1
198#define reg_iop_spu_r_wr_stat___r1___bit 1
199#define reg_iop_spu_r_wr_stat___r2___lsb 2
200#define reg_iop_spu_r_wr_stat___r2___width 1
201#define reg_iop_spu_r_wr_stat___r2___bit 2
202#define reg_iop_spu_r_wr_stat___r3___lsb 3
203#define reg_iop_spu_r_wr_stat___r3___width 1
204#define reg_iop_spu_r_wr_stat___r3___bit 3
205#define reg_iop_spu_r_wr_stat___r4___lsb 4
206#define reg_iop_spu_r_wr_stat___r4___width 1
207#define reg_iop_spu_r_wr_stat___r4___bit 4
208#define reg_iop_spu_r_wr_stat___r5___lsb 5
209#define reg_iop_spu_r_wr_stat___r5___width 1
210#define reg_iop_spu_r_wr_stat___r5___bit 5
211#define reg_iop_spu_r_wr_stat___r6___lsb 6
212#define reg_iop_spu_r_wr_stat___r6___width 1
213#define reg_iop_spu_r_wr_stat___r6___bit 6
214#define reg_iop_spu_r_wr_stat___r7___lsb 7
215#define reg_iop_spu_r_wr_stat___r7___width 1
216#define reg_iop_spu_r_wr_stat___r7___bit 7
217#define reg_iop_spu_r_wr_stat___r8___lsb 8
218#define reg_iop_spu_r_wr_stat___r8___width 1
219#define reg_iop_spu_r_wr_stat___r8___bit 8
220#define reg_iop_spu_r_wr_stat___r9___lsb 9
221#define reg_iop_spu_r_wr_stat___r9___width 1
222#define reg_iop_spu_r_wr_stat___r9___bit 9
223#define reg_iop_spu_r_wr_stat___r10___lsb 10
224#define reg_iop_spu_r_wr_stat___r10___width 1
225#define reg_iop_spu_r_wr_stat___r10___bit 10
226#define reg_iop_spu_r_wr_stat___r11___lsb 11
227#define reg_iop_spu_r_wr_stat___r11___width 1
228#define reg_iop_spu_r_wr_stat___r11___bit 11
229#define reg_iop_spu_r_wr_stat___r12___lsb 12
230#define reg_iop_spu_r_wr_stat___r12___width 1
231#define reg_iop_spu_r_wr_stat___r12___bit 12
232#define reg_iop_spu_r_wr_stat___r13___lsb 13
233#define reg_iop_spu_r_wr_stat___r13___width 1
234#define reg_iop_spu_r_wr_stat___r13___bit 13
235#define reg_iop_spu_r_wr_stat___r14___lsb 14
236#define reg_iop_spu_r_wr_stat___r14___width 1
237#define reg_iop_spu_r_wr_stat___r14___bit 14
238#define reg_iop_spu_r_wr_stat___r15___lsb 15
239#define reg_iop_spu_r_wr_stat___r15___width 1
240#define reg_iop_spu_r_wr_stat___r15___bit 15
241#define reg_iop_spu_r_wr_stat_offset 120
242
243/* Register r_reg_indexed_by_bus0_in, scope iop_spu, type r */
244#define reg_iop_spu_r_reg_indexed_by_bus0_in_offset 124
245
246/* Register r_stat_in, scope iop_spu, type r */
247#define reg_iop_spu_r_stat_in___timer_grp_lo___lsb 0
248#define reg_iop_spu_r_stat_in___timer_grp_lo___width 4
249#define reg_iop_spu_r_stat_in___fifo_out_last___lsb 4
250#define reg_iop_spu_r_stat_in___fifo_out_last___width 1
251#define reg_iop_spu_r_stat_in___fifo_out_last___bit 4
252#define reg_iop_spu_r_stat_in___fifo_out_rdy___lsb 5
253#define reg_iop_spu_r_stat_in___fifo_out_rdy___width 1
254#define reg_iop_spu_r_stat_in___fifo_out_rdy___bit 5
255#define reg_iop_spu_r_stat_in___fifo_out_all___lsb 6
256#define reg_iop_spu_r_stat_in___fifo_out_all___width 1
257#define reg_iop_spu_r_stat_in___fifo_out_all___bit 6
258#define reg_iop_spu_r_stat_in___fifo_in_rdy___lsb 7
259#define reg_iop_spu_r_stat_in___fifo_in_rdy___width 1
260#define reg_iop_spu_r_stat_in___fifo_in_rdy___bit 7
261#define reg_iop_spu_r_stat_in___dmc_out_all___lsb 8
262#define reg_iop_spu_r_stat_in___dmc_out_all___width 1
263#define reg_iop_spu_r_stat_in___dmc_out_all___bit 8
264#define reg_iop_spu_r_stat_in___dmc_out_dth___lsb 9
265#define reg_iop_spu_r_stat_in___dmc_out_dth___width 1
266#define reg_iop_spu_r_stat_in___dmc_out_dth___bit 9
267#define reg_iop_spu_r_stat_in___dmc_out_eop___lsb 10
268#define reg_iop_spu_r_stat_in___dmc_out_eop___width 1
269#define reg_iop_spu_r_stat_in___dmc_out_eop___bit 10
270#define reg_iop_spu_r_stat_in___dmc_out_dv___lsb 11
271#define reg_iop_spu_r_stat_in___dmc_out_dv___width 1
272#define reg_iop_spu_r_stat_in___dmc_out_dv___bit 11
273#define reg_iop_spu_r_stat_in___dmc_out_last___lsb 12
274#define reg_iop_spu_r_stat_in___dmc_out_last___width 1
275#define reg_iop_spu_r_stat_in___dmc_out_last___bit 12
276#define reg_iop_spu_r_stat_in___dmc_out_cmd_rq___lsb 13
277#define reg_iop_spu_r_stat_in___dmc_out_cmd_rq___width 1
278#define reg_iop_spu_r_stat_in___dmc_out_cmd_rq___bit 13
279#define reg_iop_spu_r_stat_in___dmc_out_cmd_rdy___lsb 14
280#define reg_iop_spu_r_stat_in___dmc_out_cmd_rdy___width 1
281#define reg_iop_spu_r_stat_in___dmc_out_cmd_rdy___bit 14
282#define reg_iop_spu_r_stat_in___pcrc_correct___lsb 15
283#define reg_iop_spu_r_stat_in___pcrc_correct___width 1
284#define reg_iop_spu_r_stat_in___pcrc_correct___bit 15
285#define reg_iop_spu_r_stat_in___timer_grp_hi___lsb 16
286#define reg_iop_spu_r_stat_in___timer_grp_hi___width 4
287#define reg_iop_spu_r_stat_in___dmc_in_sth___lsb 20
288#define reg_iop_spu_r_stat_in___dmc_in_sth___width 1
289#define reg_iop_spu_r_stat_in___dmc_in_sth___bit 20
290#define reg_iop_spu_r_stat_in___dmc_in_full___lsb 21
291#define reg_iop_spu_r_stat_in___dmc_in_full___width 1
292#define reg_iop_spu_r_stat_in___dmc_in_full___bit 21
293#define reg_iop_spu_r_stat_in___dmc_in_cmd_rdy___lsb 22
294#define reg_iop_spu_r_stat_in___dmc_in_cmd_rdy___width 1
295#define reg_iop_spu_r_stat_in___dmc_in_cmd_rdy___bit 22
296#define reg_iop_spu_r_stat_in___spu_gio_out___lsb 23
297#define reg_iop_spu_r_stat_in___spu_gio_out___width 4
298#define reg_iop_spu_r_stat_in___sync_clk12___lsb 27
299#define reg_iop_spu_r_stat_in___sync_clk12___width 1
300#define reg_iop_spu_r_stat_in___sync_clk12___bit 27
301#define reg_iop_spu_r_stat_in___scrc_out_data___lsb 28
302#define reg_iop_spu_r_stat_in___scrc_out_data___width 1
303#define reg_iop_spu_r_stat_in___scrc_out_data___bit 28
304#define reg_iop_spu_r_stat_in___scrc_in_err___lsb 29
305#define reg_iop_spu_r_stat_in___scrc_in_err___width 1
306#define reg_iop_spu_r_stat_in___scrc_in_err___bit 29
307#define reg_iop_spu_r_stat_in___mc_busy___lsb 30
308#define reg_iop_spu_r_stat_in___mc_busy___width 1
309#define reg_iop_spu_r_stat_in___mc_busy___bit 30
310#define reg_iop_spu_r_stat_in___mc_owned___lsb 31
311#define reg_iop_spu_r_stat_in___mc_owned___width 1
312#define reg_iop_spu_r_stat_in___mc_owned___bit 31
313#define reg_iop_spu_r_stat_in_offset 128
314
315/* Register r_trigger_in, scope iop_spu, type r */
316#define reg_iop_spu_r_trigger_in_offset 132
317
318/* Register r_special_stat, scope iop_spu, type r */
319#define reg_iop_spu_r_special_stat___c_flag___lsb 0
320#define reg_iop_spu_r_special_stat___c_flag___width 1
321#define reg_iop_spu_r_special_stat___c_flag___bit 0
322#define reg_iop_spu_r_special_stat___v_flag___lsb 1
323#define reg_iop_spu_r_special_stat___v_flag___width 1
324#define reg_iop_spu_r_special_stat___v_flag___bit 1
325#define reg_iop_spu_r_special_stat___z_flag___lsb 2
326#define reg_iop_spu_r_special_stat___z_flag___width 1
327#define reg_iop_spu_r_special_stat___z_flag___bit 2
328#define reg_iop_spu_r_special_stat___n_flag___lsb 3
329#define reg_iop_spu_r_special_stat___n_flag___width 1
330#define reg_iop_spu_r_special_stat___n_flag___bit 3
331#define reg_iop_spu_r_special_stat___xor_bus0_r2_0___lsb 4
332#define reg_iop_spu_r_special_stat___xor_bus0_r2_0___width 1
333#define reg_iop_spu_r_special_stat___xor_bus0_r2_0___bit 4
334#define reg_iop_spu_r_special_stat___xor_bus1_r3_0___lsb 5
335#define reg_iop_spu_r_special_stat___xor_bus1_r3_0___width 1
336#define reg_iop_spu_r_special_stat___xor_bus1_r3_0___bit 5
337#define reg_iop_spu_r_special_stat___xor_bus0m_r2_0___lsb 6
338#define reg_iop_spu_r_special_stat___xor_bus0m_r2_0___width 1
339#define reg_iop_spu_r_special_stat___xor_bus0m_r2_0___bit 6
340#define reg_iop_spu_r_special_stat___xor_bus1m_r3_0___lsb 7
341#define reg_iop_spu_r_special_stat___xor_bus1m_r3_0___width 1
342#define reg_iop_spu_r_special_stat___xor_bus1m_r3_0___bit 7
343#define reg_iop_spu_r_special_stat___fsm_in0___lsb 8
344#define reg_iop_spu_r_special_stat___fsm_in0___width 1
345#define reg_iop_spu_r_special_stat___fsm_in0___bit 8
346#define reg_iop_spu_r_special_stat___fsm_in1___lsb 9
347#define reg_iop_spu_r_special_stat___fsm_in1___width 1
348#define reg_iop_spu_r_special_stat___fsm_in1___bit 9
349#define reg_iop_spu_r_special_stat___fsm_in2___lsb 10
350#define reg_iop_spu_r_special_stat___fsm_in2___width 1
351#define reg_iop_spu_r_special_stat___fsm_in2___bit 10
352#define reg_iop_spu_r_special_stat___fsm_in3___lsb 11
353#define reg_iop_spu_r_special_stat___fsm_in3___width 1
354#define reg_iop_spu_r_special_stat___fsm_in3___bit 11
355#define reg_iop_spu_r_special_stat___fsm_in4___lsb 12
356#define reg_iop_spu_r_special_stat___fsm_in4___width 1
357#define reg_iop_spu_r_special_stat___fsm_in4___bit 12
358#define reg_iop_spu_r_special_stat___fsm_in5___lsb 13
359#define reg_iop_spu_r_special_stat___fsm_in5___width 1
360#define reg_iop_spu_r_special_stat___fsm_in5___bit 13
361#define reg_iop_spu_r_special_stat___fsm_in6___lsb 14
362#define reg_iop_spu_r_special_stat___fsm_in6___width 1
363#define reg_iop_spu_r_special_stat___fsm_in6___bit 14
364#define reg_iop_spu_r_special_stat___fsm_in7___lsb 15
365#define reg_iop_spu_r_special_stat___fsm_in7___width 1
366#define reg_iop_spu_r_special_stat___fsm_in7___bit 15
367#define reg_iop_spu_r_special_stat___event0___lsb 16
368#define reg_iop_spu_r_special_stat___event0___width 1
369#define reg_iop_spu_r_special_stat___event0___bit 16
370#define reg_iop_spu_r_special_stat___event1___lsb 17
371#define reg_iop_spu_r_special_stat___event1___width 1
372#define reg_iop_spu_r_special_stat___event1___bit 17
373#define reg_iop_spu_r_special_stat___event2___lsb 18
374#define reg_iop_spu_r_special_stat___event2___width 1
375#define reg_iop_spu_r_special_stat___event2___bit 18
376#define reg_iop_spu_r_special_stat___event3___lsb 19
377#define reg_iop_spu_r_special_stat___event3___width 1
378#define reg_iop_spu_r_special_stat___event3___bit 19
379#define reg_iop_spu_r_special_stat_offset 136
380
381/* Register rw_reg_access, scope iop_spu, type rw */
382#define reg_iop_spu_rw_reg_access___addr___lsb 0
383#define reg_iop_spu_rw_reg_access___addr___width 13
384#define reg_iop_spu_rw_reg_access___imm_hi___lsb 16
385#define reg_iop_spu_rw_reg_access___imm_hi___width 16
386#define reg_iop_spu_rw_reg_access_offset 140
387
388#define STRIDE_iop_spu_rw_event_cfg 4
389/* Register rw_event_cfg, scope iop_spu, type rw */
390#define reg_iop_spu_rw_event_cfg___addr___lsb 0
391#define reg_iop_spu_rw_event_cfg___addr___width 12
392#define reg_iop_spu_rw_event_cfg___src___lsb 12
393#define reg_iop_spu_rw_event_cfg___src___width 2
394#define reg_iop_spu_rw_event_cfg___eq_en___lsb 14
395#define reg_iop_spu_rw_event_cfg___eq_en___width 1
396#define reg_iop_spu_rw_event_cfg___eq_en___bit 14
397#define reg_iop_spu_rw_event_cfg___eq_inv___lsb 15
398#define reg_iop_spu_rw_event_cfg___eq_inv___width 1
399#define reg_iop_spu_rw_event_cfg___eq_inv___bit 15
400#define reg_iop_spu_rw_event_cfg___gt_en___lsb 16
401#define reg_iop_spu_rw_event_cfg___gt_en___width 1
402#define reg_iop_spu_rw_event_cfg___gt_en___bit 16
403#define reg_iop_spu_rw_event_cfg___gt_inv___lsb 17
404#define reg_iop_spu_rw_event_cfg___gt_inv___width 1
405#define reg_iop_spu_rw_event_cfg___gt_inv___bit 17
406#define reg_iop_spu_rw_event_cfg_offset 144
407
408#define STRIDE_iop_spu_rw_event_mask 4
409/* Register rw_event_mask, scope iop_spu, type rw */
410#define reg_iop_spu_rw_event_mask_offset 160
411
412#define STRIDE_iop_spu_rw_event_val 4
413/* Register rw_event_val, scope iop_spu, type rw */
414#define reg_iop_spu_rw_event_val_offset 176
415
416/* Register rw_event_ret, scope iop_spu, type rw */
417#define reg_iop_spu_rw_event_ret___addr___lsb 0
418#define reg_iop_spu_rw_event_ret___addr___width 12
419#define reg_iop_spu_rw_event_ret_offset 192
420
421/* Register r_trace, scope iop_spu, type r */
422#define reg_iop_spu_r_trace___fsm___lsb 0
423#define reg_iop_spu_r_trace___fsm___width 1
424#define reg_iop_spu_r_trace___fsm___bit 0
425#define reg_iop_spu_r_trace___en___lsb 1
426#define reg_iop_spu_r_trace___en___width 1
427#define reg_iop_spu_r_trace___en___bit 1
428#define reg_iop_spu_r_trace___c_flag___lsb 2
429#define reg_iop_spu_r_trace___c_flag___width 1
430#define reg_iop_spu_r_trace___c_flag___bit 2
431#define reg_iop_spu_r_trace___v_flag___lsb 3
432#define reg_iop_spu_r_trace___v_flag___width 1
433#define reg_iop_spu_r_trace___v_flag___bit 3
434#define reg_iop_spu_r_trace___z_flag___lsb 4
435#define reg_iop_spu_r_trace___z_flag___width 1
436#define reg_iop_spu_r_trace___z_flag___bit 4
437#define reg_iop_spu_r_trace___n_flag___lsb 5
438#define reg_iop_spu_r_trace___n_flag___width 1
439#define reg_iop_spu_r_trace___n_flag___bit 5
440#define reg_iop_spu_r_trace___seq_addr___lsb 6
441#define reg_iop_spu_r_trace___seq_addr___width 12
442#define reg_iop_spu_r_trace___fsm_addr___lsb 20
443#define reg_iop_spu_r_trace___fsm_addr___width 12
444#define reg_iop_spu_r_trace_offset 196
445
446/* Register r_fsm_trace, scope iop_spu, type r */
447#define reg_iop_spu_r_fsm_trace___fsm___lsb 0
448#define reg_iop_spu_r_fsm_trace___fsm___width 1
449#define reg_iop_spu_r_fsm_trace___fsm___bit 0
450#define reg_iop_spu_r_fsm_trace___en___lsb 1
451#define reg_iop_spu_r_fsm_trace___en___width 1
452#define reg_iop_spu_r_fsm_trace___en___bit 1
453#define reg_iop_spu_r_fsm_trace___tmr_done___lsb 2
454#define reg_iop_spu_r_fsm_trace___tmr_done___width 1
455#define reg_iop_spu_r_fsm_trace___tmr_done___bit 2
456#define reg_iop_spu_r_fsm_trace___inp0___lsb 3
457#define reg_iop_spu_r_fsm_trace___inp0___width 1
458#define reg_iop_spu_r_fsm_trace___inp0___bit 3
459#define reg_iop_spu_r_fsm_trace___inp1___lsb 4
460#define reg_iop_spu_r_fsm_trace___inp1___width 1
461#define reg_iop_spu_r_fsm_trace___inp1___bit 4
462#define reg_iop_spu_r_fsm_trace___inp2___lsb 5
463#define reg_iop_spu_r_fsm_trace___inp2___width 1
464#define reg_iop_spu_r_fsm_trace___inp2___bit 5
465#define reg_iop_spu_r_fsm_trace___inp3___lsb 6
466#define reg_iop_spu_r_fsm_trace___inp3___width 1
467#define reg_iop_spu_r_fsm_trace___inp3___bit 6
468#define reg_iop_spu_r_fsm_trace___event0___lsb 7
469#define reg_iop_spu_r_fsm_trace___event0___width 1
470#define reg_iop_spu_r_fsm_trace___event0___bit 7
471#define reg_iop_spu_r_fsm_trace___event1___lsb 8
472#define reg_iop_spu_r_fsm_trace___event1___width 1
473#define reg_iop_spu_r_fsm_trace___event1___bit 8
474#define reg_iop_spu_r_fsm_trace___event2___lsb 9
475#define reg_iop_spu_r_fsm_trace___event2___width 1
476#define reg_iop_spu_r_fsm_trace___event2___bit 9
477#define reg_iop_spu_r_fsm_trace___event3___lsb 10
478#define reg_iop_spu_r_fsm_trace___event3___width 1
479#define reg_iop_spu_r_fsm_trace___event3___bit 10
480#define reg_iop_spu_r_fsm_trace___gio_out___lsb 11
481#define reg_iop_spu_r_fsm_trace___gio_out___width 8
482#define reg_iop_spu_r_fsm_trace___fsm_addr___lsb 20
483#define reg_iop_spu_r_fsm_trace___fsm_addr___width 12
484#define reg_iop_spu_r_fsm_trace_offset 200
485
486#define STRIDE_iop_spu_rw_brp 4
487/* Register rw_brp, scope iop_spu, type rw */
488#define reg_iop_spu_rw_brp___addr___lsb 0
489#define reg_iop_spu_rw_brp___addr___width 12
490#define reg_iop_spu_rw_brp___fsm___lsb 12
491#define reg_iop_spu_rw_brp___fsm___width 1
492#define reg_iop_spu_rw_brp___fsm___bit 12
493#define reg_iop_spu_rw_brp___en___lsb 13
494#define reg_iop_spu_rw_brp___en___width 1
495#define reg_iop_spu_rw_brp___en___bit 13
496#define reg_iop_spu_rw_brp_offset 204
497
498
499/* Constants */
500#define regk_iop_spu_attn_hi 0x00000005
501#define regk_iop_spu_attn_lo 0x00000005
502#define regk_iop_spu_attn_r0 0x00000000
503#define regk_iop_spu_attn_r1 0x00000001
504#define regk_iop_spu_attn_r10 0x00000002
505#define regk_iop_spu_attn_r11 0x00000003
506#define regk_iop_spu_attn_r12 0x00000004
507#define regk_iop_spu_attn_r13 0x00000005
508#define regk_iop_spu_attn_r14 0x00000006
509#define regk_iop_spu_attn_r15 0x00000007
510#define regk_iop_spu_attn_r2 0x00000002
511#define regk_iop_spu_attn_r3 0x00000003
512#define regk_iop_spu_attn_r4 0x00000004
513#define regk_iop_spu_attn_r5 0x00000005
514#define regk_iop_spu_attn_r6 0x00000006
515#define regk_iop_spu_attn_r7 0x00000007
516#define regk_iop_spu_attn_r8 0x00000000
517#define regk_iop_spu_attn_r9 0x00000001
518#define regk_iop_spu_c 0x00000000
519#define regk_iop_spu_flag 0x00000002
520#define regk_iop_spu_gio_in 0x00000000
521#define regk_iop_spu_gio_out 0x00000005
522#define regk_iop_spu_gio_out0 0x00000008
523#define regk_iop_spu_gio_out1 0x00000009
524#define regk_iop_spu_gio_out2 0x0000000a
525#define regk_iop_spu_gio_out3 0x0000000b
526#define regk_iop_spu_gio_out4 0x0000000c
527#define regk_iop_spu_gio_out5 0x0000000d
528#define regk_iop_spu_gio_out6 0x0000000e
529#define regk_iop_spu_gio_out7 0x0000000f
530#define regk_iop_spu_n 0x00000003
531#define regk_iop_spu_no 0x00000000
532#define regk_iop_spu_r0 0x00000008
533#define regk_iop_spu_r1 0x00000009
534#define regk_iop_spu_r10 0x0000000a
535#define regk_iop_spu_r11 0x0000000b
536#define regk_iop_spu_r12 0x0000000c
537#define regk_iop_spu_r13 0x0000000d
538#define regk_iop_spu_r14 0x0000000e
539#define regk_iop_spu_r15 0x0000000f
540#define regk_iop_spu_r2 0x0000000a
541#define regk_iop_spu_r3 0x0000000b
542#define regk_iop_spu_r4 0x0000000c
543#define regk_iop_spu_r5 0x0000000d
544#define regk_iop_spu_r6 0x0000000e
545#define regk_iop_spu_r7 0x0000000f
546#define regk_iop_spu_r8 0x00000008
547#define regk_iop_spu_r9 0x00000009
548#define regk_iop_spu_reg_hi 0x00000002
549#define regk_iop_spu_reg_lo 0x00000002
550#define regk_iop_spu_rw_brp_default 0x00000000
551#define regk_iop_spu_rw_brp_size 0x00000004
552#define regk_iop_spu_rw_ctrl_default 0x00000000
553#define regk_iop_spu_rw_event_cfg_size 0x00000004
554#define regk_iop_spu_rw_event_mask_size 0x00000004
555#define regk_iop_spu_rw_event_val_size 0x00000004
556#define regk_iop_spu_rw_gio_out_default 0x00000000
557#define regk_iop_spu_rw_r_size 0x00000010
558#define regk_iop_spu_rw_reg_access_default 0x00000000
559#define regk_iop_spu_stat_in 0x00000002
560#define regk_iop_spu_statin_hi 0x00000004
561#define regk_iop_spu_statin_lo 0x00000004
562#define regk_iop_spu_trig 0x00000003
563#define regk_iop_spu_trigger 0x00000006
564#define regk_iop_spu_v 0x00000001
565#define regk_iop_spu_wsts_gioout_spec 0x00000001
566#define regk_iop_spu_xor 0x00000003
567#define regk_iop_spu_xor_bus0_r2_0 0x00000000
568#define regk_iop_spu_xor_bus0m_r2_0 0x00000002
569#define regk_iop_spu_xor_bus1_r3_0 0x00000001
570#define regk_iop_spu_xor_bus1m_r3_0 0x00000003
571#define regk_iop_spu_yes 0x00000001
572#define regk_iop_spu_z 0x00000002
573#endif /* __iop_spu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cfg_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cfg_defs_asm.h
new file mode 100644
index 000000000000..3be60f9b024c
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cfg_defs_asm.h
@@ -0,0 +1,1052 @@
1#ifndef __iop_sw_cfg_defs_asm_h
2#define __iop_sw_cfg_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_cfg.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sw_cfg_defs_asm.h ../../inst/io_proc/rtl/guinness/iop_sw_cfg.r
11 * id: $Id: iop_sw_cfg_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_crc_par0_owner, scope iop_sw_cfg, type rw */
57#define reg_iop_sw_cfg_rw_crc_par0_owner___cfg___lsb 0
58#define reg_iop_sw_cfg_rw_crc_par0_owner___cfg___width 2
59#define reg_iop_sw_cfg_rw_crc_par0_owner_offset 0
60
61/* Register rw_crc_par1_owner, scope iop_sw_cfg, type rw */
62#define reg_iop_sw_cfg_rw_crc_par1_owner___cfg___lsb 0
63#define reg_iop_sw_cfg_rw_crc_par1_owner___cfg___width 2
64#define reg_iop_sw_cfg_rw_crc_par1_owner_offset 4
65
66/* Register rw_dmc_in0_owner, scope iop_sw_cfg, type rw */
67#define reg_iop_sw_cfg_rw_dmc_in0_owner___cfg___lsb 0
68#define reg_iop_sw_cfg_rw_dmc_in0_owner___cfg___width 2
69#define reg_iop_sw_cfg_rw_dmc_in0_owner_offset 8
70
71/* Register rw_dmc_in1_owner, scope iop_sw_cfg, type rw */
72#define reg_iop_sw_cfg_rw_dmc_in1_owner___cfg___lsb 0
73#define reg_iop_sw_cfg_rw_dmc_in1_owner___cfg___width 2
74#define reg_iop_sw_cfg_rw_dmc_in1_owner_offset 12
75
76/* Register rw_dmc_out0_owner, scope iop_sw_cfg, type rw */
77#define reg_iop_sw_cfg_rw_dmc_out0_owner___cfg___lsb 0
78#define reg_iop_sw_cfg_rw_dmc_out0_owner___cfg___width 2
79#define reg_iop_sw_cfg_rw_dmc_out0_owner_offset 16
80
81/* Register rw_dmc_out1_owner, scope iop_sw_cfg, type rw */
82#define reg_iop_sw_cfg_rw_dmc_out1_owner___cfg___lsb 0
83#define reg_iop_sw_cfg_rw_dmc_out1_owner___cfg___width 2
84#define reg_iop_sw_cfg_rw_dmc_out1_owner_offset 20
85
86/* Register rw_fifo_in0_owner, scope iop_sw_cfg, type rw */
87#define reg_iop_sw_cfg_rw_fifo_in0_owner___cfg___lsb 0
88#define reg_iop_sw_cfg_rw_fifo_in0_owner___cfg___width 2
89#define reg_iop_sw_cfg_rw_fifo_in0_owner_offset 24
90
91/* Register rw_fifo_in0_extra_owner, scope iop_sw_cfg, type rw */
92#define reg_iop_sw_cfg_rw_fifo_in0_extra_owner___cfg___lsb 0
93#define reg_iop_sw_cfg_rw_fifo_in0_extra_owner___cfg___width 2
94#define reg_iop_sw_cfg_rw_fifo_in0_extra_owner_offset 28
95
96/* Register rw_fifo_in1_owner, scope iop_sw_cfg, type rw */
97#define reg_iop_sw_cfg_rw_fifo_in1_owner___cfg___lsb 0
98#define reg_iop_sw_cfg_rw_fifo_in1_owner___cfg___width 2
99#define reg_iop_sw_cfg_rw_fifo_in1_owner_offset 32
100
101/* Register rw_fifo_in1_extra_owner, scope iop_sw_cfg, type rw */
102#define reg_iop_sw_cfg_rw_fifo_in1_extra_owner___cfg___lsb 0
103#define reg_iop_sw_cfg_rw_fifo_in1_extra_owner___cfg___width 2
104#define reg_iop_sw_cfg_rw_fifo_in1_extra_owner_offset 36
105
106/* Register rw_fifo_out0_owner, scope iop_sw_cfg, type rw */
107#define reg_iop_sw_cfg_rw_fifo_out0_owner___cfg___lsb 0
108#define reg_iop_sw_cfg_rw_fifo_out0_owner___cfg___width 2
109#define reg_iop_sw_cfg_rw_fifo_out0_owner_offset 40
110
111/* Register rw_fifo_out0_extra_owner, scope iop_sw_cfg, type rw */
112#define reg_iop_sw_cfg_rw_fifo_out0_extra_owner___cfg___lsb 0
113#define reg_iop_sw_cfg_rw_fifo_out0_extra_owner___cfg___width 2
114#define reg_iop_sw_cfg_rw_fifo_out0_extra_owner_offset 44
115
116/* Register rw_fifo_out1_owner, scope iop_sw_cfg, type rw */
117#define reg_iop_sw_cfg_rw_fifo_out1_owner___cfg___lsb 0
118#define reg_iop_sw_cfg_rw_fifo_out1_owner___cfg___width 2
119#define reg_iop_sw_cfg_rw_fifo_out1_owner_offset 48
120
121/* Register rw_fifo_out1_extra_owner, scope iop_sw_cfg, type rw */
122#define reg_iop_sw_cfg_rw_fifo_out1_extra_owner___cfg___lsb 0
123#define reg_iop_sw_cfg_rw_fifo_out1_extra_owner___cfg___width 2
124#define reg_iop_sw_cfg_rw_fifo_out1_extra_owner_offset 52
125
126/* Register rw_sap_in_owner, scope iop_sw_cfg, type rw */
127#define reg_iop_sw_cfg_rw_sap_in_owner___cfg___lsb 0
128#define reg_iop_sw_cfg_rw_sap_in_owner___cfg___width 2
129#define reg_iop_sw_cfg_rw_sap_in_owner_offset 56
130
131/* Register rw_sap_out_owner, scope iop_sw_cfg, type rw */
132#define reg_iop_sw_cfg_rw_sap_out_owner___cfg___lsb 0
133#define reg_iop_sw_cfg_rw_sap_out_owner___cfg___width 2
134#define reg_iop_sw_cfg_rw_sap_out_owner_offset 60
135
136/* Register rw_scrc_in0_owner, scope iop_sw_cfg, type rw */
137#define reg_iop_sw_cfg_rw_scrc_in0_owner___cfg___lsb 0
138#define reg_iop_sw_cfg_rw_scrc_in0_owner___cfg___width 2
139#define reg_iop_sw_cfg_rw_scrc_in0_owner_offset 64
140
141/* Register rw_scrc_in1_owner, scope iop_sw_cfg, type rw */
142#define reg_iop_sw_cfg_rw_scrc_in1_owner___cfg___lsb 0
143#define reg_iop_sw_cfg_rw_scrc_in1_owner___cfg___width 2
144#define reg_iop_sw_cfg_rw_scrc_in1_owner_offset 68
145
146/* Register rw_scrc_out0_owner, scope iop_sw_cfg, type rw */
147#define reg_iop_sw_cfg_rw_scrc_out0_owner___cfg___lsb 0
148#define reg_iop_sw_cfg_rw_scrc_out0_owner___cfg___width 2
149#define reg_iop_sw_cfg_rw_scrc_out0_owner_offset 72
150
151/* Register rw_scrc_out1_owner, scope iop_sw_cfg, type rw */
152#define reg_iop_sw_cfg_rw_scrc_out1_owner___cfg___lsb 0
153#define reg_iop_sw_cfg_rw_scrc_out1_owner___cfg___width 2
154#define reg_iop_sw_cfg_rw_scrc_out1_owner_offset 76
155
156/* Register rw_spu0_owner, scope iop_sw_cfg, type rw */
157#define reg_iop_sw_cfg_rw_spu0_owner___cfg___lsb 0
158#define reg_iop_sw_cfg_rw_spu0_owner___cfg___width 2
159#define reg_iop_sw_cfg_rw_spu0_owner_offset 80
160
161/* Register rw_spu1_owner, scope iop_sw_cfg, type rw */
162#define reg_iop_sw_cfg_rw_spu1_owner___cfg___lsb 0
163#define reg_iop_sw_cfg_rw_spu1_owner___cfg___width 2
164#define reg_iop_sw_cfg_rw_spu1_owner_offset 84
165
166/* Register rw_timer_grp0_owner, scope iop_sw_cfg, type rw */
167#define reg_iop_sw_cfg_rw_timer_grp0_owner___cfg___lsb 0
168#define reg_iop_sw_cfg_rw_timer_grp0_owner___cfg___width 2
169#define reg_iop_sw_cfg_rw_timer_grp0_owner_offset 88
170
171/* Register rw_timer_grp1_owner, scope iop_sw_cfg, type rw */
172#define reg_iop_sw_cfg_rw_timer_grp1_owner___cfg___lsb 0
173#define reg_iop_sw_cfg_rw_timer_grp1_owner___cfg___width 2
174#define reg_iop_sw_cfg_rw_timer_grp1_owner_offset 92
175
176/* Register rw_timer_grp2_owner, scope iop_sw_cfg, type rw */
177#define reg_iop_sw_cfg_rw_timer_grp2_owner___cfg___lsb 0
178#define reg_iop_sw_cfg_rw_timer_grp2_owner___cfg___width 2
179#define reg_iop_sw_cfg_rw_timer_grp2_owner_offset 96
180
181/* Register rw_timer_grp3_owner, scope iop_sw_cfg, type rw */
182#define reg_iop_sw_cfg_rw_timer_grp3_owner___cfg___lsb 0
183#define reg_iop_sw_cfg_rw_timer_grp3_owner___cfg___width 2
184#define reg_iop_sw_cfg_rw_timer_grp3_owner_offset 100
185
186/* Register rw_trigger_grp0_owner, scope iop_sw_cfg, type rw */
187#define reg_iop_sw_cfg_rw_trigger_grp0_owner___cfg___lsb 0
188#define reg_iop_sw_cfg_rw_trigger_grp0_owner___cfg___width 2
189#define reg_iop_sw_cfg_rw_trigger_grp0_owner_offset 104
190
191/* Register rw_trigger_grp1_owner, scope iop_sw_cfg, type rw */
192#define reg_iop_sw_cfg_rw_trigger_grp1_owner___cfg___lsb 0
193#define reg_iop_sw_cfg_rw_trigger_grp1_owner___cfg___width 2
194#define reg_iop_sw_cfg_rw_trigger_grp1_owner_offset 108
195
196/* Register rw_trigger_grp2_owner, scope iop_sw_cfg, type rw */
197#define reg_iop_sw_cfg_rw_trigger_grp2_owner___cfg___lsb 0
198#define reg_iop_sw_cfg_rw_trigger_grp2_owner___cfg___width 2
199#define reg_iop_sw_cfg_rw_trigger_grp2_owner_offset 112
200
201/* Register rw_trigger_grp3_owner, scope iop_sw_cfg, type rw */
202#define reg_iop_sw_cfg_rw_trigger_grp3_owner___cfg___lsb 0
203#define reg_iop_sw_cfg_rw_trigger_grp3_owner___cfg___width 2
204#define reg_iop_sw_cfg_rw_trigger_grp3_owner_offset 116
205
206/* Register rw_trigger_grp4_owner, scope iop_sw_cfg, type rw */
207#define reg_iop_sw_cfg_rw_trigger_grp4_owner___cfg___lsb 0
208#define reg_iop_sw_cfg_rw_trigger_grp4_owner___cfg___width 2
209#define reg_iop_sw_cfg_rw_trigger_grp4_owner_offset 120
210
211/* Register rw_trigger_grp5_owner, scope iop_sw_cfg, type rw */
212#define reg_iop_sw_cfg_rw_trigger_grp5_owner___cfg___lsb 0
213#define reg_iop_sw_cfg_rw_trigger_grp5_owner___cfg___width 2
214#define reg_iop_sw_cfg_rw_trigger_grp5_owner_offset 124
215
216/* Register rw_trigger_grp6_owner, scope iop_sw_cfg, type rw */
217#define reg_iop_sw_cfg_rw_trigger_grp6_owner___cfg___lsb 0
218#define reg_iop_sw_cfg_rw_trigger_grp6_owner___cfg___width 2
219#define reg_iop_sw_cfg_rw_trigger_grp6_owner_offset 128
220
221/* Register rw_trigger_grp7_owner, scope iop_sw_cfg, type rw */
222#define reg_iop_sw_cfg_rw_trigger_grp7_owner___cfg___lsb 0
223#define reg_iop_sw_cfg_rw_trigger_grp7_owner___cfg___width 2
224#define reg_iop_sw_cfg_rw_trigger_grp7_owner_offset 132
225
226/* Register rw_bus0_mask, scope iop_sw_cfg, type rw */
227#define reg_iop_sw_cfg_rw_bus0_mask___byte0___lsb 0
228#define reg_iop_sw_cfg_rw_bus0_mask___byte0___width 8
229#define reg_iop_sw_cfg_rw_bus0_mask___byte1___lsb 8
230#define reg_iop_sw_cfg_rw_bus0_mask___byte1___width 8
231#define reg_iop_sw_cfg_rw_bus0_mask___byte2___lsb 16
232#define reg_iop_sw_cfg_rw_bus0_mask___byte2___width 8
233#define reg_iop_sw_cfg_rw_bus0_mask___byte3___lsb 24
234#define reg_iop_sw_cfg_rw_bus0_mask___byte3___width 8
235#define reg_iop_sw_cfg_rw_bus0_mask_offset 136
236
237/* Register rw_bus0_oe_mask, scope iop_sw_cfg, type rw */
238#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte0___lsb 0
239#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte0___width 1
240#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte0___bit 0
241#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte1___lsb 1
242#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte1___width 1
243#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte1___bit 1
244#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte2___lsb 2
245#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte2___width 1
246#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte2___bit 2
247#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte3___lsb 3
248#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte3___width 1
249#define reg_iop_sw_cfg_rw_bus0_oe_mask___byte3___bit 3
250#define reg_iop_sw_cfg_rw_bus0_oe_mask_offset 140
251
252/* Register rw_bus1_mask, scope iop_sw_cfg, type rw */
253#define reg_iop_sw_cfg_rw_bus1_mask___byte0___lsb 0
254#define reg_iop_sw_cfg_rw_bus1_mask___byte0___width 8
255#define reg_iop_sw_cfg_rw_bus1_mask___byte1___lsb 8
256#define reg_iop_sw_cfg_rw_bus1_mask___byte1___width 8
257#define reg_iop_sw_cfg_rw_bus1_mask___byte2___lsb 16
258#define reg_iop_sw_cfg_rw_bus1_mask___byte2___width 8
259#define reg_iop_sw_cfg_rw_bus1_mask___byte3___lsb 24
260#define reg_iop_sw_cfg_rw_bus1_mask___byte3___width 8
261#define reg_iop_sw_cfg_rw_bus1_mask_offset 144
262
263/* Register rw_bus1_oe_mask, scope iop_sw_cfg, type rw */
264#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte0___lsb 0
265#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte0___width 1
266#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte0___bit 0
267#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte1___lsb 1
268#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte1___width 1
269#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte1___bit 1
270#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte2___lsb 2
271#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte2___width 1
272#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte2___bit 2
273#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte3___lsb 3
274#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte3___width 1
275#define reg_iop_sw_cfg_rw_bus1_oe_mask___byte3___bit 3
276#define reg_iop_sw_cfg_rw_bus1_oe_mask_offset 148
277
278/* Register rw_gio_mask, scope iop_sw_cfg, type rw */
279#define reg_iop_sw_cfg_rw_gio_mask___val___lsb 0
280#define reg_iop_sw_cfg_rw_gio_mask___val___width 32
281#define reg_iop_sw_cfg_rw_gio_mask_offset 152
282
283/* Register rw_gio_oe_mask, scope iop_sw_cfg, type rw */
284#define reg_iop_sw_cfg_rw_gio_oe_mask___val___lsb 0
285#define reg_iop_sw_cfg_rw_gio_oe_mask___val___width 32
286#define reg_iop_sw_cfg_rw_gio_oe_mask_offset 156
287
288/* Register rw_pinmapping, scope iop_sw_cfg, type rw */
289#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte0___lsb 0
290#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte0___width 2
291#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte1___lsb 2
292#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte1___width 2
293#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte2___lsb 4
294#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte2___width 2
295#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte3___lsb 6
296#define reg_iop_sw_cfg_rw_pinmapping___bus0_byte3___width 2
297#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte0___lsb 8
298#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte0___width 2
299#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte1___lsb 10
300#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte1___width 2
301#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte2___lsb 12
302#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte2___width 2
303#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte3___lsb 14
304#define reg_iop_sw_cfg_rw_pinmapping___bus1_byte3___width 2
305#define reg_iop_sw_cfg_rw_pinmapping___gio3_0___lsb 16
306#define reg_iop_sw_cfg_rw_pinmapping___gio3_0___width 2
307#define reg_iop_sw_cfg_rw_pinmapping___gio7_4___lsb 18
308#define reg_iop_sw_cfg_rw_pinmapping___gio7_4___width 2
309#define reg_iop_sw_cfg_rw_pinmapping___gio11_8___lsb 20
310#define reg_iop_sw_cfg_rw_pinmapping___gio11_8___width 2
311#define reg_iop_sw_cfg_rw_pinmapping___gio15_12___lsb 22
312#define reg_iop_sw_cfg_rw_pinmapping___gio15_12___width 2
313#define reg_iop_sw_cfg_rw_pinmapping___gio19_16___lsb 24
314#define reg_iop_sw_cfg_rw_pinmapping___gio19_16___width 2
315#define reg_iop_sw_cfg_rw_pinmapping___gio23_20___lsb 26
316#define reg_iop_sw_cfg_rw_pinmapping___gio23_20___width 2
317#define reg_iop_sw_cfg_rw_pinmapping___gio27_24___lsb 28
318#define reg_iop_sw_cfg_rw_pinmapping___gio27_24___width 2
319#define reg_iop_sw_cfg_rw_pinmapping___gio31_28___lsb 30
320#define reg_iop_sw_cfg_rw_pinmapping___gio31_28___width 2
321#define reg_iop_sw_cfg_rw_pinmapping_offset 160
322
323/* Register rw_bus_out_cfg, scope iop_sw_cfg, type rw */
324#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_lo___lsb 0
325#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_lo___width 3
326#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_hi___lsb 3
327#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_hi___width 3
328#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_lo_oe___lsb 6
329#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_lo_oe___width 3
330#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_hi_oe___lsb 9
331#define reg_iop_sw_cfg_rw_bus_out_cfg___bus0_hi_oe___width 3
332#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_lo___lsb 12
333#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_lo___width 3
334#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_hi___lsb 15
335#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_hi___width 3
336#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_lo_oe___lsb 18
337#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_lo_oe___width 3
338#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_hi_oe___lsb 21
339#define reg_iop_sw_cfg_rw_bus_out_cfg___bus1_hi_oe___width 3
340#define reg_iop_sw_cfg_rw_bus_out_cfg_offset 164
341
342/* Register rw_gio_out_grp0_cfg, scope iop_sw_cfg, type rw */
343#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0___lsb 0
344#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0___width 4
345#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0_oe___lsb 4
346#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio0_oe___width 2
347#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1___lsb 6
348#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1___width 4
349#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1_oe___lsb 10
350#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio1_oe___width 2
351#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2___lsb 12
352#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2___width 4
353#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2_oe___lsb 16
354#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio2_oe___width 2
355#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3___lsb 18
356#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3___width 4
357#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3_oe___lsb 22
358#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg___gio3_oe___width 2
359#define reg_iop_sw_cfg_rw_gio_out_grp0_cfg_offset 168
360
361/* Register rw_gio_out_grp1_cfg, scope iop_sw_cfg, type rw */
362#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4___lsb 0
363#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4___width 4
364#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4_oe___lsb 4
365#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio4_oe___width 2
366#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5___lsb 6
367#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5___width 4
368#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5_oe___lsb 10
369#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio5_oe___width 2
370#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6___lsb 12
371#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6___width 4
372#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6_oe___lsb 16
373#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio6_oe___width 2
374#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7___lsb 18
375#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7___width 4
376#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7_oe___lsb 22
377#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg___gio7_oe___width 2
378#define reg_iop_sw_cfg_rw_gio_out_grp1_cfg_offset 172
379
380/* Register rw_gio_out_grp2_cfg, scope iop_sw_cfg, type rw */
381#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8___lsb 0
382#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8___width 4
383#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8_oe___lsb 4
384#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio8_oe___width 2
385#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9___lsb 6
386#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9___width 4
387#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9_oe___lsb 10
388#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio9_oe___width 2
389#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10___lsb 12
390#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10___width 4
391#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10_oe___lsb 16
392#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio10_oe___width 2
393#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11___lsb 18
394#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11___width 4
395#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11_oe___lsb 22
396#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg___gio11_oe___width 2
397#define reg_iop_sw_cfg_rw_gio_out_grp2_cfg_offset 176
398
399/* Register rw_gio_out_grp3_cfg, scope iop_sw_cfg, type rw */
400#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12___lsb 0
401#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12___width 4
402#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12_oe___lsb 4
403#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio12_oe___width 2
404#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13___lsb 6
405#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13___width 4
406#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13_oe___lsb 10
407#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio13_oe___width 2
408#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14___lsb 12
409#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14___width 4
410#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14_oe___lsb 16
411#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio14_oe___width 2
412#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15___lsb 18
413#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15___width 4
414#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15_oe___lsb 22
415#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg___gio15_oe___width 2
416#define reg_iop_sw_cfg_rw_gio_out_grp3_cfg_offset 180
417
418/* Register rw_gio_out_grp4_cfg, scope iop_sw_cfg, type rw */
419#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16___lsb 0
420#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16___width 4
421#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16_oe___lsb 4
422#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio16_oe___width 2
423#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17___lsb 6
424#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17___width 4
425#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17_oe___lsb 10
426#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio17_oe___width 2
427#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18___lsb 12
428#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18___width 4
429#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18_oe___lsb 16
430#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio18_oe___width 2
431#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19___lsb 18
432#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19___width 4
433#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19_oe___lsb 22
434#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg___gio19_oe___width 2
435#define reg_iop_sw_cfg_rw_gio_out_grp4_cfg_offset 184
436
437/* Register rw_gio_out_grp5_cfg, scope iop_sw_cfg, type rw */
438#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20___lsb 0
439#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20___width 4
440#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20_oe___lsb 4
441#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio20_oe___width 2
442#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21___lsb 6
443#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21___width 4
444#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21_oe___lsb 10
445#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio21_oe___width 2
446#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22___lsb 12
447#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22___width 4
448#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22_oe___lsb 16
449#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio22_oe___width 2
450#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23___lsb 18
451#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23___width 4
452#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23_oe___lsb 22
453#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg___gio23_oe___width 2
454#define reg_iop_sw_cfg_rw_gio_out_grp5_cfg_offset 188
455
456/* Register rw_gio_out_grp6_cfg, scope iop_sw_cfg, type rw */
457#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24___lsb 0
458#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24___width 4
459#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24_oe___lsb 4
460#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio24_oe___width 2
461#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25___lsb 6
462#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25___width 4
463#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25_oe___lsb 10
464#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio25_oe___width 2
465#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26___lsb 12
466#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26___width 4
467#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26_oe___lsb 16
468#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio26_oe___width 2
469#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27___lsb 18
470#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27___width 4
471#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27_oe___lsb 22
472#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg___gio27_oe___width 2
473#define reg_iop_sw_cfg_rw_gio_out_grp6_cfg_offset 192
474
475/* Register rw_gio_out_grp7_cfg, scope iop_sw_cfg, type rw */
476#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28___lsb 0
477#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28___width 4
478#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28_oe___lsb 4
479#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio28_oe___width 2
480#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29___lsb 6
481#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29___width 4
482#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29_oe___lsb 10
483#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio29_oe___width 2
484#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30___lsb 12
485#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30___width 4
486#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30_oe___lsb 16
487#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio30_oe___width 2
488#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31___lsb 18
489#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31___width 4
490#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31_oe___lsb 22
491#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg___gio31_oe___width 2
492#define reg_iop_sw_cfg_rw_gio_out_grp7_cfg_offset 196
493
494/* Register rw_spu0_cfg, scope iop_sw_cfg, type rw */
495#define reg_iop_sw_cfg_rw_spu0_cfg___bus0_in___lsb 0
496#define reg_iop_sw_cfg_rw_spu0_cfg___bus0_in___width 2
497#define reg_iop_sw_cfg_rw_spu0_cfg___bus1_in___lsb 2
498#define reg_iop_sw_cfg_rw_spu0_cfg___bus1_in___width 2
499#define reg_iop_sw_cfg_rw_spu0_cfg_offset 200
500
501/* Register rw_spu1_cfg, scope iop_sw_cfg, type rw */
502#define reg_iop_sw_cfg_rw_spu1_cfg___bus0_in___lsb 0
503#define reg_iop_sw_cfg_rw_spu1_cfg___bus0_in___width 2
504#define reg_iop_sw_cfg_rw_spu1_cfg___bus1_in___lsb 2
505#define reg_iop_sw_cfg_rw_spu1_cfg___bus1_in___width 2
506#define reg_iop_sw_cfg_rw_spu1_cfg_offset 204
507
508/* Register rw_timer_grp0_cfg, scope iop_sw_cfg, type rw */
509#define reg_iop_sw_cfg_rw_timer_grp0_cfg___ext_clk___lsb 0
510#define reg_iop_sw_cfg_rw_timer_grp0_cfg___ext_clk___width 3
511#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_en___lsb 3
512#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_en___width 1
513#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_en___bit 3
514#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_en___lsb 4
515#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_en___width 1
516#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_en___bit 4
517#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_en___lsb 5
518#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_en___width 1
519#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_en___bit 5
520#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_en___lsb 6
521#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_en___width 1
522#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_en___bit 6
523#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_dis___lsb 7
524#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_dis___width 1
525#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr0_dis___bit 7
526#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_dis___lsb 8
527#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_dis___width 1
528#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr1_dis___bit 8
529#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_dis___lsb 9
530#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_dis___width 1
531#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr2_dis___bit 9
532#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_dis___lsb 10
533#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_dis___width 1
534#define reg_iop_sw_cfg_rw_timer_grp0_cfg___tmr3_dis___bit 10
535#define reg_iop_sw_cfg_rw_timer_grp0_cfg_offset 208
536
537/* Register rw_timer_grp1_cfg, scope iop_sw_cfg, type rw */
538#define reg_iop_sw_cfg_rw_timer_grp1_cfg___ext_clk___lsb 0
539#define reg_iop_sw_cfg_rw_timer_grp1_cfg___ext_clk___width 3
540#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_en___lsb 3
541#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_en___width 1
542#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_en___bit 3
543#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_en___lsb 4
544#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_en___width 1
545#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_en___bit 4
546#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_en___lsb 5
547#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_en___width 1
548#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_en___bit 5
549#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_en___lsb 6
550#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_en___width 1
551#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_en___bit 6
552#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_dis___lsb 7
553#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_dis___width 1
554#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr0_dis___bit 7
555#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_dis___lsb 8
556#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_dis___width 1
557#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr1_dis___bit 8
558#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_dis___lsb 9
559#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_dis___width 1
560#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr2_dis___bit 9
561#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_dis___lsb 10
562#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_dis___width 1
563#define reg_iop_sw_cfg_rw_timer_grp1_cfg___tmr3_dis___bit 10
564#define reg_iop_sw_cfg_rw_timer_grp1_cfg_offset 212
565
566/* Register rw_timer_grp2_cfg, scope iop_sw_cfg, type rw */
567#define reg_iop_sw_cfg_rw_timer_grp2_cfg___ext_clk___lsb 0
568#define reg_iop_sw_cfg_rw_timer_grp2_cfg___ext_clk___width 3
569#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_en___lsb 3
570#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_en___width 1
571#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_en___bit 3
572#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_en___lsb 4
573#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_en___width 1
574#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_en___bit 4
575#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_en___lsb 5
576#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_en___width 1
577#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_en___bit 5
578#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_en___lsb 6
579#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_en___width 1
580#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_en___bit 6
581#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_dis___lsb 7
582#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_dis___width 1
583#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr0_dis___bit 7
584#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_dis___lsb 8
585#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_dis___width 1
586#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr1_dis___bit 8
587#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_dis___lsb 9
588#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_dis___width 1
589#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr2_dis___bit 9
590#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_dis___lsb 10
591#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_dis___width 1
592#define reg_iop_sw_cfg_rw_timer_grp2_cfg___tmr3_dis___bit 10
593#define reg_iop_sw_cfg_rw_timer_grp2_cfg_offset 216
594
595/* Register rw_timer_grp3_cfg, scope iop_sw_cfg, type rw */
596#define reg_iop_sw_cfg_rw_timer_grp3_cfg___ext_clk___lsb 0
597#define reg_iop_sw_cfg_rw_timer_grp3_cfg___ext_clk___width 3
598#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_en___lsb 3
599#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_en___width 1
600#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_en___bit 3
601#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_en___lsb 4
602#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_en___width 1
603#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_en___bit 4
604#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_en___lsb 5
605#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_en___width 1
606#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_en___bit 5
607#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_en___lsb 6
608#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_en___width 1
609#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_en___bit 6
610#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_dis___lsb 7
611#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_dis___width 1
612#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr0_dis___bit 7
613#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_dis___lsb 8
614#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_dis___width 1
615#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr1_dis___bit 8
616#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_dis___lsb 9
617#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_dis___width 1
618#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr2_dis___bit 9
619#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_dis___lsb 10
620#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_dis___width 1
621#define reg_iop_sw_cfg_rw_timer_grp3_cfg___tmr3_dis___bit 10
622#define reg_iop_sw_cfg_rw_timer_grp3_cfg_offset 220
623
624/* Register rw_trigger_grps_cfg, scope iop_sw_cfg, type rw */
625#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___lsb 0
626#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___width 1
627#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_dis___bit 0
628#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___lsb 1
629#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___width 1
630#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp0_en___bit 1
631#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___lsb 2
632#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___width 1
633#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_dis___bit 2
634#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___lsb 3
635#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___width 1
636#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp1_en___bit 3
637#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___lsb 4
638#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___width 1
639#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_dis___bit 4
640#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___lsb 5
641#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___width 1
642#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp2_en___bit 5
643#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___lsb 6
644#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___width 1
645#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_dis___bit 6
646#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___lsb 7
647#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___width 1
648#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp3_en___bit 7
649#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___lsb 8
650#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___width 1
651#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_dis___bit 8
652#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___lsb 9
653#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___width 1
654#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp4_en___bit 9
655#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___lsb 10
656#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___width 1
657#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_dis___bit 10
658#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___lsb 11
659#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___width 1
660#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp5_en___bit 11
661#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___lsb 12
662#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___width 1
663#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_dis___bit 12
664#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___lsb 13
665#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___width 1
666#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp6_en___bit 13
667#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___lsb 14
668#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___width 1
669#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_dis___bit 14
670#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___lsb 15
671#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___width 1
672#define reg_iop_sw_cfg_rw_trigger_grps_cfg___grp7_en___bit 15
673#define reg_iop_sw_cfg_rw_trigger_grps_cfg_offset 224
674
675/* Register rw_pdp0_cfg, scope iop_sw_cfg, type rw */
676#define reg_iop_sw_cfg_rw_pdp0_cfg___dmc0_usr___lsb 0
677#define reg_iop_sw_cfg_rw_pdp0_cfg___dmc0_usr___width 1
678#define reg_iop_sw_cfg_rw_pdp0_cfg___dmc0_usr___bit 0
679#define reg_iop_sw_cfg_rw_pdp0_cfg___out_strb___lsb 1
680#define reg_iop_sw_cfg_rw_pdp0_cfg___out_strb___width 5
681#define reg_iop_sw_cfg_rw_pdp0_cfg___in_src___lsb 6
682#define reg_iop_sw_cfg_rw_pdp0_cfg___in_src___width 3
683#define reg_iop_sw_cfg_rw_pdp0_cfg___in_size___lsb 9
684#define reg_iop_sw_cfg_rw_pdp0_cfg___in_size___width 3
685#define reg_iop_sw_cfg_rw_pdp0_cfg___in_last___lsb 12
686#define reg_iop_sw_cfg_rw_pdp0_cfg___in_last___width 2
687#define reg_iop_sw_cfg_rw_pdp0_cfg___in_strb___lsb 14
688#define reg_iop_sw_cfg_rw_pdp0_cfg___in_strb___width 4
689#define reg_iop_sw_cfg_rw_pdp0_cfg___out_src___lsb 18
690#define reg_iop_sw_cfg_rw_pdp0_cfg___out_src___width 1
691#define reg_iop_sw_cfg_rw_pdp0_cfg___out_src___bit 18
692#define reg_iop_sw_cfg_rw_pdp0_cfg_offset 228
693
694/* Register rw_pdp1_cfg, scope iop_sw_cfg, type rw */
695#define reg_iop_sw_cfg_rw_pdp1_cfg___dmc1_usr___lsb 0
696#define reg_iop_sw_cfg_rw_pdp1_cfg___dmc1_usr___width 1
697#define reg_iop_sw_cfg_rw_pdp1_cfg___dmc1_usr___bit 0
698#define reg_iop_sw_cfg_rw_pdp1_cfg___out_strb___lsb 1
699#define reg_iop_sw_cfg_rw_pdp1_cfg___out_strb___width 5
700#define reg_iop_sw_cfg_rw_pdp1_cfg___in_src___lsb 6
701#define reg_iop_sw_cfg_rw_pdp1_cfg___in_src___width 3
702#define reg_iop_sw_cfg_rw_pdp1_cfg___in_size___lsb 9
703#define reg_iop_sw_cfg_rw_pdp1_cfg___in_size___width 3
704#define reg_iop_sw_cfg_rw_pdp1_cfg___in_last___lsb 12
705#define reg_iop_sw_cfg_rw_pdp1_cfg___in_last___width 2
706#define reg_iop_sw_cfg_rw_pdp1_cfg___in_strb___lsb 14
707#define reg_iop_sw_cfg_rw_pdp1_cfg___in_strb___width 4
708#define reg_iop_sw_cfg_rw_pdp1_cfg___out_src___lsb 18
709#define reg_iop_sw_cfg_rw_pdp1_cfg___out_src___width 1
710#define reg_iop_sw_cfg_rw_pdp1_cfg___out_src___bit 18
711#define reg_iop_sw_cfg_rw_pdp1_cfg_offset 232
712
713/* Register rw_sdp_cfg, scope iop_sw_cfg, type rw */
714#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out0_strb___lsb 0
715#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out0_strb___width 3
716#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out1_strb___lsb 3
717#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_out1_strb___width 3
718#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_data___lsb 6
719#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_data___width 3
720#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_last___lsb 9
721#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_last___width 2
722#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_strb___lsb 11
723#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in0_strb___width 3
724#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_data___lsb 14
725#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_data___width 3
726#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_last___lsb 17
727#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_last___width 2
728#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_strb___lsb 19
729#define reg_iop_sw_cfg_rw_sdp_cfg___sdp_in1_strb___width 3
730#define reg_iop_sw_cfg_rw_sdp_cfg_offset 236
731
732
733/* Constants */
734#define regk_iop_sw_cfg_a 0x00000001
735#define regk_iop_sw_cfg_b 0x00000002
736#define regk_iop_sw_cfg_bus0 0x00000000
737#define regk_iop_sw_cfg_bus0_rot16 0x00000004
738#define regk_iop_sw_cfg_bus0_rot24 0x00000006
739#define regk_iop_sw_cfg_bus0_rot8 0x00000002
740#define regk_iop_sw_cfg_bus1 0x00000001
741#define regk_iop_sw_cfg_bus1_rot16 0x00000005
742#define regk_iop_sw_cfg_bus1_rot24 0x00000007
743#define regk_iop_sw_cfg_bus1_rot8 0x00000003
744#define regk_iop_sw_cfg_clk12 0x00000000
745#define regk_iop_sw_cfg_cpu 0x00000000
746#define regk_iop_sw_cfg_dmc0 0x00000000
747#define regk_iop_sw_cfg_dmc1 0x00000001
748#define regk_iop_sw_cfg_gated_clk0 0x00000010
749#define regk_iop_sw_cfg_gated_clk1 0x00000011
750#define regk_iop_sw_cfg_gated_clk2 0x00000012
751#define regk_iop_sw_cfg_gated_clk3 0x00000013
752#define regk_iop_sw_cfg_gio0 0x00000004
753#define regk_iop_sw_cfg_gio1 0x00000001
754#define regk_iop_sw_cfg_gio2 0x00000005
755#define regk_iop_sw_cfg_gio3 0x00000002
756#define regk_iop_sw_cfg_gio4 0x00000006
757#define regk_iop_sw_cfg_gio5 0x00000003
758#define regk_iop_sw_cfg_gio6 0x00000007
759#define regk_iop_sw_cfg_gio7 0x00000004
760#define regk_iop_sw_cfg_gio_in0 0x00000000
761#define regk_iop_sw_cfg_gio_in1 0x00000001
762#define regk_iop_sw_cfg_gio_in10 0x00000002
763#define regk_iop_sw_cfg_gio_in11 0x00000003
764#define regk_iop_sw_cfg_gio_in14 0x00000004
765#define regk_iop_sw_cfg_gio_in15 0x00000005
766#define regk_iop_sw_cfg_gio_in18 0x00000002
767#define regk_iop_sw_cfg_gio_in19 0x00000003
768#define regk_iop_sw_cfg_gio_in20 0x00000004
769#define regk_iop_sw_cfg_gio_in21 0x00000005
770#define regk_iop_sw_cfg_gio_in26 0x00000006
771#define regk_iop_sw_cfg_gio_in27 0x00000007
772#define regk_iop_sw_cfg_gio_in28 0x00000006
773#define regk_iop_sw_cfg_gio_in29 0x00000007
774#define regk_iop_sw_cfg_gio_in4 0x00000000
775#define regk_iop_sw_cfg_gio_in5 0x00000001
776#define regk_iop_sw_cfg_last_timer_grp0_tmr2 0x00000001
777#define regk_iop_sw_cfg_last_timer_grp1_tmr2 0x00000001
778#define regk_iop_sw_cfg_last_timer_grp2_tmr2 0x00000002
779#define regk_iop_sw_cfg_last_timer_grp2_tmr3 0x00000003
780#define regk_iop_sw_cfg_last_timer_grp3_tmr2 0x00000002
781#define regk_iop_sw_cfg_last_timer_grp3_tmr3 0x00000003
782#define regk_iop_sw_cfg_mpu 0x00000001
783#define regk_iop_sw_cfg_none 0x00000000
784#define regk_iop_sw_cfg_par0 0x00000000
785#define regk_iop_sw_cfg_par1 0x00000001
786#define regk_iop_sw_cfg_pdp_out0 0x00000002
787#define regk_iop_sw_cfg_pdp_out0_hi 0x00000001
788#define regk_iop_sw_cfg_pdp_out0_hi_rot8 0x00000005
789#define regk_iop_sw_cfg_pdp_out0_lo 0x00000000
790#define regk_iop_sw_cfg_pdp_out0_lo_rot8 0x00000004
791#define regk_iop_sw_cfg_pdp_out1 0x00000003
792#define regk_iop_sw_cfg_pdp_out1_hi 0x00000003
793#define regk_iop_sw_cfg_pdp_out1_hi_rot8 0x00000005
794#define regk_iop_sw_cfg_pdp_out1_lo 0x00000002
795#define regk_iop_sw_cfg_pdp_out1_lo_rot8 0x00000004
796#define regk_iop_sw_cfg_rw_bus0_mask_default 0x00000000
797#define regk_iop_sw_cfg_rw_bus0_oe_mask_default 0x00000000
798#define regk_iop_sw_cfg_rw_bus1_mask_default 0x00000000
799#define regk_iop_sw_cfg_rw_bus1_oe_mask_default 0x00000000
800#define regk_iop_sw_cfg_rw_bus_out_cfg_default 0x00000000
801#define regk_iop_sw_cfg_rw_crc_par0_owner_default 0x00000000
802#define regk_iop_sw_cfg_rw_crc_par1_owner_default 0x00000000
803#define regk_iop_sw_cfg_rw_dmc_in0_owner_default 0x00000000
804#define regk_iop_sw_cfg_rw_dmc_in1_owner_default 0x00000000
805#define regk_iop_sw_cfg_rw_dmc_out0_owner_default 0x00000000
806#define regk_iop_sw_cfg_rw_dmc_out1_owner_default 0x00000000
807#define regk_iop_sw_cfg_rw_fifo_in0_extra_owner_default 0x00000000
808#define regk_iop_sw_cfg_rw_fifo_in0_owner_default 0x00000000
809#define regk_iop_sw_cfg_rw_fifo_in1_extra_owner_default 0x00000000
810#define regk_iop_sw_cfg_rw_fifo_in1_owner_default 0x00000000
811#define regk_iop_sw_cfg_rw_fifo_out0_extra_owner_default 0x00000000
812#define regk_iop_sw_cfg_rw_fifo_out0_owner_default 0x00000000
813#define regk_iop_sw_cfg_rw_fifo_out1_extra_owner_default 0x00000000
814#define regk_iop_sw_cfg_rw_fifo_out1_owner_default 0x00000000
815#define regk_iop_sw_cfg_rw_gio_mask_default 0x00000000
816#define regk_iop_sw_cfg_rw_gio_oe_mask_default 0x00000000
817#define regk_iop_sw_cfg_rw_gio_out_grp0_cfg_default 0x00000000
818#define regk_iop_sw_cfg_rw_gio_out_grp1_cfg_default 0x00000000
819#define regk_iop_sw_cfg_rw_gio_out_grp2_cfg_default 0x00000000
820#define regk_iop_sw_cfg_rw_gio_out_grp3_cfg_default 0x00000000
821#define regk_iop_sw_cfg_rw_gio_out_grp4_cfg_default 0x00000000
822#define regk_iop_sw_cfg_rw_gio_out_grp5_cfg_default 0x00000000
823#define regk_iop_sw_cfg_rw_gio_out_grp6_cfg_default 0x00000000
824#define regk_iop_sw_cfg_rw_gio_out_grp7_cfg_default 0x00000000
825#define regk_iop_sw_cfg_rw_pdp0_cfg_default 0x00000000
826#define regk_iop_sw_cfg_rw_pdp1_cfg_default 0x00000000
827#define regk_iop_sw_cfg_rw_pinmapping_default 0x55555555
828#define regk_iop_sw_cfg_rw_sap_in_owner_default 0x00000000
829#define regk_iop_sw_cfg_rw_sap_out_owner_default 0x00000000
830#define regk_iop_sw_cfg_rw_scrc_in0_owner_default 0x00000000
831#define regk_iop_sw_cfg_rw_scrc_in1_owner_default 0x00000000
832#define regk_iop_sw_cfg_rw_scrc_out0_owner_default 0x00000000
833#define regk_iop_sw_cfg_rw_scrc_out1_owner_default 0x00000000
834#define regk_iop_sw_cfg_rw_sdp_cfg_default 0x00000000
835#define regk_iop_sw_cfg_rw_spu0_cfg_default 0x00000000
836#define regk_iop_sw_cfg_rw_spu0_owner_default 0x00000000
837#define regk_iop_sw_cfg_rw_spu1_cfg_default 0x00000000
838#define regk_iop_sw_cfg_rw_spu1_owner_default 0x00000000
839#define regk_iop_sw_cfg_rw_timer_grp0_cfg_default 0x00000000
840#define regk_iop_sw_cfg_rw_timer_grp0_owner_default 0x00000000
841#define regk_iop_sw_cfg_rw_timer_grp1_cfg_default 0x00000000
842#define regk_iop_sw_cfg_rw_timer_grp1_owner_default 0x00000000
843#define regk_iop_sw_cfg_rw_timer_grp2_cfg_default 0x00000000
844#define regk_iop_sw_cfg_rw_timer_grp2_owner_default 0x00000000
845#define regk_iop_sw_cfg_rw_timer_grp3_cfg_default 0x00000000
846#define regk_iop_sw_cfg_rw_timer_grp3_owner_default 0x00000000
847#define regk_iop_sw_cfg_rw_trigger_grp0_owner_default 0x00000000
848#define regk_iop_sw_cfg_rw_trigger_grp1_owner_default 0x00000000
849#define regk_iop_sw_cfg_rw_trigger_grp2_owner_default 0x00000000
850#define regk_iop_sw_cfg_rw_trigger_grp3_owner_default 0x00000000
851#define regk_iop_sw_cfg_rw_trigger_grp4_owner_default 0x00000000
852#define regk_iop_sw_cfg_rw_trigger_grp5_owner_default 0x00000000
853#define regk_iop_sw_cfg_rw_trigger_grp6_owner_default 0x00000000
854#define regk_iop_sw_cfg_rw_trigger_grp7_owner_default 0x00000000
855#define regk_iop_sw_cfg_rw_trigger_grps_cfg_default 0x00000000
856#define regk_iop_sw_cfg_sdp_out0 0x00000008
857#define regk_iop_sw_cfg_sdp_out1 0x00000009
858#define regk_iop_sw_cfg_size16 0x00000002
859#define regk_iop_sw_cfg_size24 0x00000003
860#define regk_iop_sw_cfg_size32 0x00000004
861#define regk_iop_sw_cfg_size8 0x00000001
862#define regk_iop_sw_cfg_spu0 0x00000002
863#define regk_iop_sw_cfg_spu0_bus_out0_hi 0x00000006
864#define regk_iop_sw_cfg_spu0_bus_out0_lo 0x00000006
865#define regk_iop_sw_cfg_spu0_bus_out1_hi 0x00000007
866#define regk_iop_sw_cfg_spu0_bus_out1_lo 0x00000007
867#define regk_iop_sw_cfg_spu0_g0 0x0000000e
868#define regk_iop_sw_cfg_spu0_g1 0x0000000e
869#define regk_iop_sw_cfg_spu0_g2 0x0000000e
870#define regk_iop_sw_cfg_spu0_g3 0x0000000e
871#define regk_iop_sw_cfg_spu0_g4 0x0000000e
872#define regk_iop_sw_cfg_spu0_g5 0x0000000e
873#define regk_iop_sw_cfg_spu0_g6 0x0000000e
874#define regk_iop_sw_cfg_spu0_g7 0x0000000e
875#define regk_iop_sw_cfg_spu0_gio0 0x00000000
876#define regk_iop_sw_cfg_spu0_gio1 0x00000001
877#define regk_iop_sw_cfg_spu0_gio2 0x00000000
878#define regk_iop_sw_cfg_spu0_gio5 0x00000005
879#define regk_iop_sw_cfg_spu0_gio6 0x00000006
880#define regk_iop_sw_cfg_spu0_gio7 0x00000007
881#define regk_iop_sw_cfg_spu0_gio_out0 0x00000008
882#define regk_iop_sw_cfg_spu0_gio_out1 0x00000009
883#define regk_iop_sw_cfg_spu0_gio_out2 0x0000000a
884#define regk_iop_sw_cfg_spu0_gio_out3 0x0000000b
885#define regk_iop_sw_cfg_spu0_gio_out4 0x0000000c
886#define regk_iop_sw_cfg_spu0_gio_out5 0x0000000d
887#define regk_iop_sw_cfg_spu0_gio_out6 0x0000000e
888#define regk_iop_sw_cfg_spu0_gio_out7 0x0000000f
889#define regk_iop_sw_cfg_spu0_gioout0 0x00000000
890#define regk_iop_sw_cfg_spu0_gioout1 0x00000000
891#define regk_iop_sw_cfg_spu0_gioout10 0x0000000e
892#define regk_iop_sw_cfg_spu0_gioout11 0x0000000e
893#define regk_iop_sw_cfg_spu0_gioout12 0x0000000e
894#define regk_iop_sw_cfg_spu0_gioout13 0x0000000e
895#define regk_iop_sw_cfg_spu0_gioout14 0x0000000e
896#define regk_iop_sw_cfg_spu0_gioout15 0x0000000e
897#define regk_iop_sw_cfg_spu0_gioout16 0x0000000e
898#define regk_iop_sw_cfg_spu0_gioout17 0x0000000e
899#define regk_iop_sw_cfg_spu0_gioout18 0x0000000e
900#define regk_iop_sw_cfg_spu0_gioout19 0x0000000e
901#define regk_iop_sw_cfg_spu0_gioout2 0x00000002
902#define regk_iop_sw_cfg_spu0_gioout20 0x0000000e
903#define regk_iop_sw_cfg_spu0_gioout21 0x0000000e
904#define regk_iop_sw_cfg_spu0_gioout22 0x0000000e
905#define regk_iop_sw_cfg_spu0_gioout23 0x0000000e
906#define regk_iop_sw_cfg_spu0_gioout24 0x0000000e
907#define regk_iop_sw_cfg_spu0_gioout25 0x0000000e
908#define regk_iop_sw_cfg_spu0_gioout26 0x0000000e
909#define regk_iop_sw_cfg_spu0_gioout27 0x0000000e
910#define regk_iop_sw_cfg_spu0_gioout28 0x0000000e
911#define regk_iop_sw_cfg_spu0_gioout29 0x0000000e
912#define regk_iop_sw_cfg_spu0_gioout3 0x00000002
913#define regk_iop_sw_cfg_spu0_gioout30 0x0000000e
914#define regk_iop_sw_cfg_spu0_gioout31 0x0000000e
915#define regk_iop_sw_cfg_spu0_gioout4 0x00000004
916#define regk_iop_sw_cfg_spu0_gioout5 0x00000004
917#define regk_iop_sw_cfg_spu0_gioout6 0x00000006
918#define regk_iop_sw_cfg_spu0_gioout7 0x00000006
919#define regk_iop_sw_cfg_spu0_gioout8 0x0000000e
920#define regk_iop_sw_cfg_spu0_gioout9 0x0000000e
921#define regk_iop_sw_cfg_spu1 0x00000003
922#define regk_iop_sw_cfg_spu1_bus_out0_hi 0x00000006
923#define regk_iop_sw_cfg_spu1_bus_out0_lo 0x00000006
924#define regk_iop_sw_cfg_spu1_bus_out1_hi 0x00000007
925#define regk_iop_sw_cfg_spu1_bus_out1_lo 0x00000007
926#define regk_iop_sw_cfg_spu1_g0 0x0000000f
927#define regk_iop_sw_cfg_spu1_g1 0x0000000f
928#define regk_iop_sw_cfg_spu1_g2 0x0000000f
929#define regk_iop_sw_cfg_spu1_g3 0x0000000f
930#define regk_iop_sw_cfg_spu1_g4 0x0000000f
931#define regk_iop_sw_cfg_spu1_g5 0x0000000f
932#define regk_iop_sw_cfg_spu1_g6 0x0000000f
933#define regk_iop_sw_cfg_spu1_g7 0x0000000f
934#define regk_iop_sw_cfg_spu1_gio0 0x00000002
935#define regk_iop_sw_cfg_spu1_gio1 0x00000003
936#define regk_iop_sw_cfg_spu1_gio2 0x00000002
937#define regk_iop_sw_cfg_spu1_gio5 0x00000005
938#define regk_iop_sw_cfg_spu1_gio6 0x00000006
939#define regk_iop_sw_cfg_spu1_gio7 0x00000007
940#define regk_iop_sw_cfg_spu1_gio_out0 0x00000008
941#define regk_iop_sw_cfg_spu1_gio_out1 0x00000009
942#define regk_iop_sw_cfg_spu1_gio_out2 0x0000000a
943#define regk_iop_sw_cfg_spu1_gio_out3 0x0000000b
944#define regk_iop_sw_cfg_spu1_gio_out4 0x0000000c
945#define regk_iop_sw_cfg_spu1_gio_out5 0x0000000d
946#define regk_iop_sw_cfg_spu1_gio_out6 0x0000000e
947#define regk_iop_sw_cfg_spu1_gio_out7 0x0000000f
948#define regk_iop_sw_cfg_spu1_gioout0 0x00000001
949#define regk_iop_sw_cfg_spu1_gioout1 0x00000001
950#define regk_iop_sw_cfg_spu1_gioout10 0x0000000f
951#define regk_iop_sw_cfg_spu1_gioout11 0x0000000f
952#define regk_iop_sw_cfg_spu1_gioout12 0x0000000f
953#define regk_iop_sw_cfg_spu1_gioout13 0x0000000f
954#define regk_iop_sw_cfg_spu1_gioout14 0x0000000f
955#define regk_iop_sw_cfg_spu1_gioout15 0x0000000f
956#define regk_iop_sw_cfg_spu1_gioout16 0x0000000f
957#define regk_iop_sw_cfg_spu1_gioout17 0x0000000f
958#define regk_iop_sw_cfg_spu1_gioout18 0x0000000f
959#define regk_iop_sw_cfg_spu1_gioout19 0x0000000f
960#define regk_iop_sw_cfg_spu1_gioout2 0x00000003
961#define regk_iop_sw_cfg_spu1_gioout20 0x0000000f
962#define regk_iop_sw_cfg_spu1_gioout21 0x0000000f
963#define regk_iop_sw_cfg_spu1_gioout22 0x0000000f
964#define regk_iop_sw_cfg_spu1_gioout23 0x0000000f
965#define regk_iop_sw_cfg_spu1_gioout24 0x0000000f
966#define regk_iop_sw_cfg_spu1_gioout25 0x0000000f
967#define regk_iop_sw_cfg_spu1_gioout26 0x0000000f
968#define regk_iop_sw_cfg_spu1_gioout27 0x0000000f
969#define regk_iop_sw_cfg_spu1_gioout28 0x0000000f
970#define regk_iop_sw_cfg_spu1_gioout29 0x0000000f
971#define regk_iop_sw_cfg_spu1_gioout3 0x00000003
972#define regk_iop_sw_cfg_spu1_gioout30 0x0000000f
973#define regk_iop_sw_cfg_spu1_gioout31 0x0000000f
974#define regk_iop_sw_cfg_spu1_gioout4 0x00000005
975#define regk_iop_sw_cfg_spu1_gioout5 0x00000005
976#define regk_iop_sw_cfg_spu1_gioout6 0x00000007
977#define regk_iop_sw_cfg_spu1_gioout7 0x00000007
978#define regk_iop_sw_cfg_spu1_gioout8 0x0000000f
979#define regk_iop_sw_cfg_spu1_gioout9 0x0000000f
980#define regk_iop_sw_cfg_strb_timer_grp0_tmr0 0x00000001
981#define regk_iop_sw_cfg_strb_timer_grp0_tmr1 0x00000002
982#define regk_iop_sw_cfg_strb_timer_grp1_tmr0 0x00000001
983#define regk_iop_sw_cfg_strb_timer_grp1_tmr1 0x00000002
984#define regk_iop_sw_cfg_strb_timer_grp2_tmr0 0x00000003
985#define regk_iop_sw_cfg_strb_timer_grp2_tmr1 0x00000002
986#define regk_iop_sw_cfg_strb_timer_grp3_tmr0 0x00000003
987#define regk_iop_sw_cfg_strb_timer_grp3_tmr1 0x00000002
988#define regk_iop_sw_cfg_timer_grp0 0x00000000
989#define regk_iop_sw_cfg_timer_grp0_rot 0x00000001
990#define regk_iop_sw_cfg_timer_grp0_strb0 0x0000000a
991#define regk_iop_sw_cfg_timer_grp0_strb1 0x0000000a
992#define regk_iop_sw_cfg_timer_grp0_strb2 0x0000000a
993#define regk_iop_sw_cfg_timer_grp0_strb3 0x0000000a
994#define regk_iop_sw_cfg_timer_grp0_tmr0 0x00000004
995#define regk_iop_sw_cfg_timer_grp0_tmr1 0x00000004
996#define regk_iop_sw_cfg_timer_grp1 0x00000000
997#define regk_iop_sw_cfg_timer_grp1_rot 0x00000001
998#define regk_iop_sw_cfg_timer_grp1_strb0 0x0000000b
999#define regk_iop_sw_cfg_timer_grp1_strb1 0x0000000b
1000#define regk_iop_sw_cfg_timer_grp1_strb2 0x0000000b
1001#define regk_iop_sw_cfg_timer_grp1_strb3 0x0000000b
1002#define regk_iop_sw_cfg_timer_grp1_tmr0 0x00000005
1003#define regk_iop_sw_cfg_timer_grp1_tmr1 0x00000005
1004#define regk_iop_sw_cfg_timer_grp2 0x00000000
1005#define regk_iop_sw_cfg_timer_grp2_rot 0x00000001
1006#define regk_iop_sw_cfg_timer_grp2_strb0 0x0000000c
1007#define regk_iop_sw_cfg_timer_grp2_strb1 0x0000000c
1008#define regk_iop_sw_cfg_timer_grp2_strb2 0x0000000c
1009#define regk_iop_sw_cfg_timer_grp2_strb3 0x0000000c
1010#define regk_iop_sw_cfg_timer_grp2_tmr0 0x00000006
1011#define regk_iop_sw_cfg_timer_grp2_tmr1 0x00000006
1012#define regk_iop_sw_cfg_timer_grp3 0x00000000
1013#define regk_iop_sw_cfg_timer_grp3_rot 0x00000001
1014#define regk_iop_sw_cfg_timer_grp3_strb0 0x0000000d
1015#define regk_iop_sw_cfg_timer_grp3_strb1 0x0000000d
1016#define regk_iop_sw_cfg_timer_grp3_strb2 0x0000000d
1017#define regk_iop_sw_cfg_timer_grp3_strb3 0x0000000d
1018#define regk_iop_sw_cfg_timer_grp3_tmr0 0x00000007
1019#define regk_iop_sw_cfg_timer_grp3_tmr1 0x00000007
1020#define regk_iop_sw_cfg_trig0_0 0x00000000
1021#define regk_iop_sw_cfg_trig0_1 0x00000000
1022#define regk_iop_sw_cfg_trig0_2 0x00000000
1023#define regk_iop_sw_cfg_trig0_3 0x00000000
1024#define regk_iop_sw_cfg_trig1_0 0x00000000
1025#define regk_iop_sw_cfg_trig1_1 0x00000000
1026#define regk_iop_sw_cfg_trig1_2 0x00000000
1027#define regk_iop_sw_cfg_trig1_3 0x00000000
1028#define regk_iop_sw_cfg_trig2_0 0x00000000
1029#define regk_iop_sw_cfg_trig2_1 0x00000000
1030#define regk_iop_sw_cfg_trig2_2 0x00000000
1031#define regk_iop_sw_cfg_trig2_3 0x00000000
1032#define regk_iop_sw_cfg_trig3_0 0x00000000
1033#define regk_iop_sw_cfg_trig3_1 0x00000000
1034#define regk_iop_sw_cfg_trig3_2 0x00000000
1035#define regk_iop_sw_cfg_trig3_3 0x00000000
1036#define regk_iop_sw_cfg_trig4_0 0x00000001
1037#define regk_iop_sw_cfg_trig4_1 0x00000001
1038#define regk_iop_sw_cfg_trig4_2 0x00000001
1039#define regk_iop_sw_cfg_trig4_3 0x00000001
1040#define regk_iop_sw_cfg_trig5_0 0x00000001
1041#define regk_iop_sw_cfg_trig5_1 0x00000001
1042#define regk_iop_sw_cfg_trig5_2 0x00000001
1043#define regk_iop_sw_cfg_trig5_3 0x00000001
1044#define regk_iop_sw_cfg_trig6_0 0x00000001
1045#define regk_iop_sw_cfg_trig6_1 0x00000001
1046#define regk_iop_sw_cfg_trig6_2 0x00000001
1047#define regk_iop_sw_cfg_trig6_3 0x00000001
1048#define regk_iop_sw_cfg_trig7_0 0x00000001
1049#define regk_iop_sw_cfg_trig7_1 0x00000001
1050#define regk_iop_sw_cfg_trig7_2 0x00000001
1051#define regk_iop_sw_cfg_trig7_3 0x00000001
1052#endif /* __iop_sw_cfg_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cpu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cpu_defs_asm.h
new file mode 100644
index 000000000000..db347bcba025
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_cpu_defs_asm.h
@@ -0,0 +1,1758 @@
1#ifndef __iop_sw_cpu_defs_asm_h
2#define __iop_sw_cpu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_cpu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sw_cpu_defs_asm.h ../../inst/io_proc/rtl/guinness/iop_sw_cpu.r
11 * id: $Id: iop_sw_cpu_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_mc_ctrl, scope iop_sw_cpu, type rw */
57#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___lsb 0
58#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___width 1
59#define reg_iop_sw_cpu_rw_mc_ctrl___keep_owner___bit 0
60#define reg_iop_sw_cpu_rw_mc_ctrl___cmd___lsb 1
61#define reg_iop_sw_cpu_rw_mc_ctrl___cmd___width 2
62#define reg_iop_sw_cpu_rw_mc_ctrl___size___lsb 3
63#define reg_iop_sw_cpu_rw_mc_ctrl___size___width 3
64#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu0_mem___lsb 6
65#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu0_mem___width 1
66#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu0_mem___bit 6
67#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu1_mem___lsb 7
68#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu1_mem___width 1
69#define reg_iop_sw_cpu_rw_mc_ctrl___wr_spu1_mem___bit 7
70#define reg_iop_sw_cpu_rw_mc_ctrl_offset 0
71
72/* Register rw_mc_data, scope iop_sw_cpu, type rw */
73#define reg_iop_sw_cpu_rw_mc_data___val___lsb 0
74#define reg_iop_sw_cpu_rw_mc_data___val___width 32
75#define reg_iop_sw_cpu_rw_mc_data_offset 4
76
77/* Register rw_mc_addr, scope iop_sw_cpu, type rw */
78#define reg_iop_sw_cpu_rw_mc_addr_offset 8
79
80/* Register rs_mc_data, scope iop_sw_cpu, type rs */
81#define reg_iop_sw_cpu_rs_mc_data_offset 12
82
83/* Register r_mc_data, scope iop_sw_cpu, type r */
84#define reg_iop_sw_cpu_r_mc_data_offset 16
85
86/* Register r_mc_stat, scope iop_sw_cpu, type r */
87#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___lsb 0
88#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___width 1
89#define reg_iop_sw_cpu_r_mc_stat___busy_cpu___bit 0
90#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___lsb 1
91#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___width 1
92#define reg_iop_sw_cpu_r_mc_stat___busy_mpu___bit 1
93#define reg_iop_sw_cpu_r_mc_stat___busy_spu0___lsb 2
94#define reg_iop_sw_cpu_r_mc_stat___busy_spu0___width 1
95#define reg_iop_sw_cpu_r_mc_stat___busy_spu0___bit 2
96#define reg_iop_sw_cpu_r_mc_stat___busy_spu1___lsb 3
97#define reg_iop_sw_cpu_r_mc_stat___busy_spu1___width 1
98#define reg_iop_sw_cpu_r_mc_stat___busy_spu1___bit 3
99#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___lsb 4
100#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___width 1
101#define reg_iop_sw_cpu_r_mc_stat___owned_by_cpu___bit 4
102#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___lsb 5
103#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___width 1
104#define reg_iop_sw_cpu_r_mc_stat___owned_by_mpu___bit 5
105#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu0___lsb 6
106#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu0___width 1
107#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu0___bit 6
108#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu1___lsb 7
109#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu1___width 1
110#define reg_iop_sw_cpu_r_mc_stat___owned_by_spu1___bit 7
111#define reg_iop_sw_cpu_r_mc_stat_offset 20
112
113/* Register rw_bus0_clr_mask, scope iop_sw_cpu, type rw */
114#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte0___lsb 0
115#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte0___width 8
116#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte1___lsb 8
117#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte1___width 8
118#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte2___lsb 16
119#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte2___width 8
120#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte3___lsb 24
121#define reg_iop_sw_cpu_rw_bus0_clr_mask___byte3___width 8
122#define reg_iop_sw_cpu_rw_bus0_clr_mask_offset 24
123
124/* Register rw_bus0_set_mask, scope iop_sw_cpu, type rw */
125#define reg_iop_sw_cpu_rw_bus0_set_mask___byte0___lsb 0
126#define reg_iop_sw_cpu_rw_bus0_set_mask___byte0___width 8
127#define reg_iop_sw_cpu_rw_bus0_set_mask___byte1___lsb 8
128#define reg_iop_sw_cpu_rw_bus0_set_mask___byte1___width 8
129#define reg_iop_sw_cpu_rw_bus0_set_mask___byte2___lsb 16
130#define reg_iop_sw_cpu_rw_bus0_set_mask___byte2___width 8
131#define reg_iop_sw_cpu_rw_bus0_set_mask___byte3___lsb 24
132#define reg_iop_sw_cpu_rw_bus0_set_mask___byte3___width 8
133#define reg_iop_sw_cpu_rw_bus0_set_mask_offset 28
134
135/* Register rw_bus0_oe_clr_mask, scope iop_sw_cpu, type rw */
136#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte0___lsb 0
137#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte0___width 1
138#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte0___bit 0
139#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte1___lsb 1
140#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte1___width 1
141#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte1___bit 1
142#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte2___lsb 2
143#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte2___width 1
144#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte2___bit 2
145#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte3___lsb 3
146#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte3___width 1
147#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask___byte3___bit 3
148#define reg_iop_sw_cpu_rw_bus0_oe_clr_mask_offset 32
149
150/* Register rw_bus0_oe_set_mask, scope iop_sw_cpu, type rw */
151#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte0___lsb 0
152#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte0___width 1
153#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte0___bit 0
154#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte1___lsb 1
155#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte1___width 1
156#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte1___bit 1
157#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte2___lsb 2
158#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte2___width 1
159#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte2___bit 2
160#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte3___lsb 3
161#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte3___width 1
162#define reg_iop_sw_cpu_rw_bus0_oe_set_mask___byte3___bit 3
163#define reg_iop_sw_cpu_rw_bus0_oe_set_mask_offset 36
164
165/* Register r_bus0_in, scope iop_sw_cpu, type r */
166#define reg_iop_sw_cpu_r_bus0_in_offset 40
167
168/* Register rw_bus1_clr_mask, scope iop_sw_cpu, type rw */
169#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte0___lsb 0
170#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte0___width 8
171#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte1___lsb 8
172#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte1___width 8
173#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte2___lsb 16
174#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte2___width 8
175#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte3___lsb 24
176#define reg_iop_sw_cpu_rw_bus1_clr_mask___byte3___width 8
177#define reg_iop_sw_cpu_rw_bus1_clr_mask_offset 44
178
179/* Register rw_bus1_set_mask, scope iop_sw_cpu, type rw */
180#define reg_iop_sw_cpu_rw_bus1_set_mask___byte0___lsb 0
181#define reg_iop_sw_cpu_rw_bus1_set_mask___byte0___width 8
182#define reg_iop_sw_cpu_rw_bus1_set_mask___byte1___lsb 8
183#define reg_iop_sw_cpu_rw_bus1_set_mask___byte1___width 8
184#define reg_iop_sw_cpu_rw_bus1_set_mask___byte2___lsb 16
185#define reg_iop_sw_cpu_rw_bus1_set_mask___byte2___width 8
186#define reg_iop_sw_cpu_rw_bus1_set_mask___byte3___lsb 24
187#define reg_iop_sw_cpu_rw_bus1_set_mask___byte3___width 8
188#define reg_iop_sw_cpu_rw_bus1_set_mask_offset 48
189
190/* Register rw_bus1_oe_clr_mask, scope iop_sw_cpu, type rw */
191#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte0___lsb 0
192#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte0___width 1
193#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte0___bit 0
194#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte1___lsb 1
195#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte1___width 1
196#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte1___bit 1
197#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte2___lsb 2
198#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte2___width 1
199#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte2___bit 2
200#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte3___lsb 3
201#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte3___width 1
202#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask___byte3___bit 3
203#define reg_iop_sw_cpu_rw_bus1_oe_clr_mask_offset 52
204
205/* Register rw_bus1_oe_set_mask, scope iop_sw_cpu, type rw */
206#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte0___lsb 0
207#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte0___width 1
208#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte0___bit 0
209#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte1___lsb 1
210#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte1___width 1
211#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte1___bit 1
212#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte2___lsb 2
213#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte2___width 1
214#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte2___bit 2
215#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte3___lsb 3
216#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte3___width 1
217#define reg_iop_sw_cpu_rw_bus1_oe_set_mask___byte3___bit 3
218#define reg_iop_sw_cpu_rw_bus1_oe_set_mask_offset 56
219
220/* Register r_bus1_in, scope iop_sw_cpu, type r */
221#define reg_iop_sw_cpu_r_bus1_in_offset 60
222
223/* Register rw_gio_clr_mask, scope iop_sw_cpu, type rw */
224#define reg_iop_sw_cpu_rw_gio_clr_mask___val___lsb 0
225#define reg_iop_sw_cpu_rw_gio_clr_mask___val___width 32
226#define reg_iop_sw_cpu_rw_gio_clr_mask_offset 64
227
228/* Register rw_gio_set_mask, scope iop_sw_cpu, type rw */
229#define reg_iop_sw_cpu_rw_gio_set_mask___val___lsb 0
230#define reg_iop_sw_cpu_rw_gio_set_mask___val___width 32
231#define reg_iop_sw_cpu_rw_gio_set_mask_offset 68
232
233/* Register rw_gio_oe_clr_mask, scope iop_sw_cpu, type rw */
234#define reg_iop_sw_cpu_rw_gio_oe_clr_mask___val___lsb 0
235#define reg_iop_sw_cpu_rw_gio_oe_clr_mask___val___width 32
236#define reg_iop_sw_cpu_rw_gio_oe_clr_mask_offset 72
237
238/* Register rw_gio_oe_set_mask, scope iop_sw_cpu, type rw */
239#define reg_iop_sw_cpu_rw_gio_oe_set_mask___val___lsb 0
240#define reg_iop_sw_cpu_rw_gio_oe_set_mask___val___width 32
241#define reg_iop_sw_cpu_rw_gio_oe_set_mask_offset 76
242
243/* Register r_gio_in, scope iop_sw_cpu, type r */
244#define reg_iop_sw_cpu_r_gio_in_offset 80
245
246/* Register rw_intr0_mask, scope iop_sw_cpu, type rw */
247#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___lsb 0
248#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___width 1
249#define reg_iop_sw_cpu_rw_intr0_mask___mpu_0___bit 0
250#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___lsb 1
251#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___width 1
252#define reg_iop_sw_cpu_rw_intr0_mask___mpu_1___bit 1
253#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___lsb 2
254#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___width 1
255#define reg_iop_sw_cpu_rw_intr0_mask___mpu_2___bit 2
256#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___lsb 3
257#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___width 1
258#define reg_iop_sw_cpu_rw_intr0_mask___mpu_3___bit 3
259#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___lsb 4
260#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___width 1
261#define reg_iop_sw_cpu_rw_intr0_mask___mpu_4___bit 4
262#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___lsb 5
263#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___width 1
264#define reg_iop_sw_cpu_rw_intr0_mask___mpu_5___bit 5
265#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___lsb 6
266#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___width 1
267#define reg_iop_sw_cpu_rw_intr0_mask___mpu_6___bit 6
268#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___lsb 7
269#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___width 1
270#define reg_iop_sw_cpu_rw_intr0_mask___mpu_7___bit 7
271#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___lsb 8
272#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___width 1
273#define reg_iop_sw_cpu_rw_intr0_mask___mpu_8___bit 8
274#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___lsb 9
275#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___width 1
276#define reg_iop_sw_cpu_rw_intr0_mask___mpu_9___bit 9
277#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___lsb 10
278#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___width 1
279#define reg_iop_sw_cpu_rw_intr0_mask___mpu_10___bit 10
280#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___lsb 11
281#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___width 1
282#define reg_iop_sw_cpu_rw_intr0_mask___mpu_11___bit 11
283#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___lsb 12
284#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___width 1
285#define reg_iop_sw_cpu_rw_intr0_mask___mpu_12___bit 12
286#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___lsb 13
287#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___width 1
288#define reg_iop_sw_cpu_rw_intr0_mask___mpu_13___bit 13
289#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___lsb 14
290#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___width 1
291#define reg_iop_sw_cpu_rw_intr0_mask___mpu_14___bit 14
292#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___lsb 15
293#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___width 1
294#define reg_iop_sw_cpu_rw_intr0_mask___mpu_15___bit 15
295#define reg_iop_sw_cpu_rw_intr0_mask___spu0_0___lsb 16
296#define reg_iop_sw_cpu_rw_intr0_mask___spu0_0___width 1
297#define reg_iop_sw_cpu_rw_intr0_mask___spu0_0___bit 16
298#define reg_iop_sw_cpu_rw_intr0_mask___spu0_1___lsb 17
299#define reg_iop_sw_cpu_rw_intr0_mask___spu0_1___width 1
300#define reg_iop_sw_cpu_rw_intr0_mask___spu0_1___bit 17
301#define reg_iop_sw_cpu_rw_intr0_mask___spu0_2___lsb 18
302#define reg_iop_sw_cpu_rw_intr0_mask___spu0_2___width 1
303#define reg_iop_sw_cpu_rw_intr0_mask___spu0_2___bit 18
304#define reg_iop_sw_cpu_rw_intr0_mask___spu0_3___lsb 19
305#define reg_iop_sw_cpu_rw_intr0_mask___spu0_3___width 1
306#define reg_iop_sw_cpu_rw_intr0_mask___spu0_3___bit 19
307#define reg_iop_sw_cpu_rw_intr0_mask___spu0_4___lsb 20
308#define reg_iop_sw_cpu_rw_intr0_mask___spu0_4___width 1
309#define reg_iop_sw_cpu_rw_intr0_mask___spu0_4___bit 20
310#define reg_iop_sw_cpu_rw_intr0_mask___spu0_5___lsb 21
311#define reg_iop_sw_cpu_rw_intr0_mask___spu0_5___width 1
312#define reg_iop_sw_cpu_rw_intr0_mask___spu0_5___bit 21
313#define reg_iop_sw_cpu_rw_intr0_mask___spu0_6___lsb 22
314#define reg_iop_sw_cpu_rw_intr0_mask___spu0_6___width 1
315#define reg_iop_sw_cpu_rw_intr0_mask___spu0_6___bit 22
316#define reg_iop_sw_cpu_rw_intr0_mask___spu0_7___lsb 23
317#define reg_iop_sw_cpu_rw_intr0_mask___spu0_7___width 1
318#define reg_iop_sw_cpu_rw_intr0_mask___spu0_7___bit 23
319#define reg_iop_sw_cpu_rw_intr0_mask___spu1_8___lsb 24
320#define reg_iop_sw_cpu_rw_intr0_mask___spu1_8___width 1
321#define reg_iop_sw_cpu_rw_intr0_mask___spu1_8___bit 24
322#define reg_iop_sw_cpu_rw_intr0_mask___spu1_9___lsb 25
323#define reg_iop_sw_cpu_rw_intr0_mask___spu1_9___width 1
324#define reg_iop_sw_cpu_rw_intr0_mask___spu1_9___bit 25
325#define reg_iop_sw_cpu_rw_intr0_mask___spu1_10___lsb 26
326#define reg_iop_sw_cpu_rw_intr0_mask___spu1_10___width 1
327#define reg_iop_sw_cpu_rw_intr0_mask___spu1_10___bit 26
328#define reg_iop_sw_cpu_rw_intr0_mask___spu1_11___lsb 27
329#define reg_iop_sw_cpu_rw_intr0_mask___spu1_11___width 1
330#define reg_iop_sw_cpu_rw_intr0_mask___spu1_11___bit 27
331#define reg_iop_sw_cpu_rw_intr0_mask___spu1_12___lsb 28
332#define reg_iop_sw_cpu_rw_intr0_mask___spu1_12___width 1
333#define reg_iop_sw_cpu_rw_intr0_mask___spu1_12___bit 28
334#define reg_iop_sw_cpu_rw_intr0_mask___spu1_13___lsb 29
335#define reg_iop_sw_cpu_rw_intr0_mask___spu1_13___width 1
336#define reg_iop_sw_cpu_rw_intr0_mask___spu1_13___bit 29
337#define reg_iop_sw_cpu_rw_intr0_mask___spu1_14___lsb 30
338#define reg_iop_sw_cpu_rw_intr0_mask___spu1_14___width 1
339#define reg_iop_sw_cpu_rw_intr0_mask___spu1_14___bit 30
340#define reg_iop_sw_cpu_rw_intr0_mask___spu1_15___lsb 31
341#define reg_iop_sw_cpu_rw_intr0_mask___spu1_15___width 1
342#define reg_iop_sw_cpu_rw_intr0_mask___spu1_15___bit 31
343#define reg_iop_sw_cpu_rw_intr0_mask_offset 84
344
345/* Register rw_ack_intr0, scope iop_sw_cpu, type rw */
346#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___lsb 0
347#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___width 1
348#define reg_iop_sw_cpu_rw_ack_intr0___mpu_0___bit 0
349#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___lsb 1
350#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___width 1
351#define reg_iop_sw_cpu_rw_ack_intr0___mpu_1___bit 1
352#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___lsb 2
353#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___width 1
354#define reg_iop_sw_cpu_rw_ack_intr0___mpu_2___bit 2
355#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___lsb 3
356#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___width 1
357#define reg_iop_sw_cpu_rw_ack_intr0___mpu_3___bit 3
358#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___lsb 4
359#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___width 1
360#define reg_iop_sw_cpu_rw_ack_intr0___mpu_4___bit 4
361#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___lsb 5
362#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___width 1
363#define reg_iop_sw_cpu_rw_ack_intr0___mpu_5___bit 5
364#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___lsb 6
365#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___width 1
366#define reg_iop_sw_cpu_rw_ack_intr0___mpu_6___bit 6
367#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___lsb 7
368#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___width 1
369#define reg_iop_sw_cpu_rw_ack_intr0___mpu_7___bit 7
370#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___lsb 8
371#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___width 1
372#define reg_iop_sw_cpu_rw_ack_intr0___mpu_8___bit 8
373#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___lsb 9
374#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___width 1
375#define reg_iop_sw_cpu_rw_ack_intr0___mpu_9___bit 9
376#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___lsb 10
377#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___width 1
378#define reg_iop_sw_cpu_rw_ack_intr0___mpu_10___bit 10
379#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___lsb 11
380#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___width 1
381#define reg_iop_sw_cpu_rw_ack_intr0___mpu_11___bit 11
382#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___lsb 12
383#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___width 1
384#define reg_iop_sw_cpu_rw_ack_intr0___mpu_12___bit 12
385#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___lsb 13
386#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___width 1
387#define reg_iop_sw_cpu_rw_ack_intr0___mpu_13___bit 13
388#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___lsb 14
389#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___width 1
390#define reg_iop_sw_cpu_rw_ack_intr0___mpu_14___bit 14
391#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___lsb 15
392#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___width 1
393#define reg_iop_sw_cpu_rw_ack_intr0___mpu_15___bit 15
394#define reg_iop_sw_cpu_rw_ack_intr0___spu0_0___lsb 16
395#define reg_iop_sw_cpu_rw_ack_intr0___spu0_0___width 1
396#define reg_iop_sw_cpu_rw_ack_intr0___spu0_0___bit 16
397#define reg_iop_sw_cpu_rw_ack_intr0___spu0_1___lsb 17
398#define reg_iop_sw_cpu_rw_ack_intr0___spu0_1___width 1
399#define reg_iop_sw_cpu_rw_ack_intr0___spu0_1___bit 17
400#define reg_iop_sw_cpu_rw_ack_intr0___spu0_2___lsb 18
401#define reg_iop_sw_cpu_rw_ack_intr0___spu0_2___width 1
402#define reg_iop_sw_cpu_rw_ack_intr0___spu0_2___bit 18
403#define reg_iop_sw_cpu_rw_ack_intr0___spu0_3___lsb 19
404#define reg_iop_sw_cpu_rw_ack_intr0___spu0_3___width 1
405#define reg_iop_sw_cpu_rw_ack_intr0___spu0_3___bit 19
406#define reg_iop_sw_cpu_rw_ack_intr0___spu0_4___lsb 20
407#define reg_iop_sw_cpu_rw_ack_intr0___spu0_4___width 1
408#define reg_iop_sw_cpu_rw_ack_intr0___spu0_4___bit 20
409#define reg_iop_sw_cpu_rw_ack_intr0___spu0_5___lsb 21
410#define reg_iop_sw_cpu_rw_ack_intr0___spu0_5___width 1
411#define reg_iop_sw_cpu_rw_ack_intr0___spu0_5___bit 21
412#define reg_iop_sw_cpu_rw_ack_intr0___spu0_6___lsb 22
413#define reg_iop_sw_cpu_rw_ack_intr0___spu0_6___width 1
414#define reg_iop_sw_cpu_rw_ack_intr0___spu0_6___bit 22
415#define reg_iop_sw_cpu_rw_ack_intr0___spu0_7___lsb 23
416#define reg_iop_sw_cpu_rw_ack_intr0___spu0_7___width 1
417#define reg_iop_sw_cpu_rw_ack_intr0___spu0_7___bit 23
418#define reg_iop_sw_cpu_rw_ack_intr0___spu1_8___lsb 24
419#define reg_iop_sw_cpu_rw_ack_intr0___spu1_8___width 1
420#define reg_iop_sw_cpu_rw_ack_intr0___spu1_8___bit 24
421#define reg_iop_sw_cpu_rw_ack_intr0___spu1_9___lsb 25
422#define reg_iop_sw_cpu_rw_ack_intr0___spu1_9___width 1
423#define reg_iop_sw_cpu_rw_ack_intr0___spu1_9___bit 25
424#define reg_iop_sw_cpu_rw_ack_intr0___spu1_10___lsb 26
425#define reg_iop_sw_cpu_rw_ack_intr0___spu1_10___width 1
426#define reg_iop_sw_cpu_rw_ack_intr0___spu1_10___bit 26
427#define reg_iop_sw_cpu_rw_ack_intr0___spu1_11___lsb 27
428#define reg_iop_sw_cpu_rw_ack_intr0___spu1_11___width 1
429#define reg_iop_sw_cpu_rw_ack_intr0___spu1_11___bit 27
430#define reg_iop_sw_cpu_rw_ack_intr0___spu1_12___lsb 28
431#define reg_iop_sw_cpu_rw_ack_intr0___spu1_12___width 1
432#define reg_iop_sw_cpu_rw_ack_intr0___spu1_12___bit 28
433#define reg_iop_sw_cpu_rw_ack_intr0___spu1_13___lsb 29
434#define reg_iop_sw_cpu_rw_ack_intr0___spu1_13___width 1
435#define reg_iop_sw_cpu_rw_ack_intr0___spu1_13___bit 29
436#define reg_iop_sw_cpu_rw_ack_intr0___spu1_14___lsb 30
437#define reg_iop_sw_cpu_rw_ack_intr0___spu1_14___width 1
438#define reg_iop_sw_cpu_rw_ack_intr0___spu1_14___bit 30
439#define reg_iop_sw_cpu_rw_ack_intr0___spu1_15___lsb 31
440#define reg_iop_sw_cpu_rw_ack_intr0___spu1_15___width 1
441#define reg_iop_sw_cpu_rw_ack_intr0___spu1_15___bit 31
442#define reg_iop_sw_cpu_rw_ack_intr0_offset 88
443
444/* Register r_intr0, scope iop_sw_cpu, type r */
445#define reg_iop_sw_cpu_r_intr0___mpu_0___lsb 0
446#define reg_iop_sw_cpu_r_intr0___mpu_0___width 1
447#define reg_iop_sw_cpu_r_intr0___mpu_0___bit 0
448#define reg_iop_sw_cpu_r_intr0___mpu_1___lsb 1
449#define reg_iop_sw_cpu_r_intr0___mpu_1___width 1
450#define reg_iop_sw_cpu_r_intr0___mpu_1___bit 1
451#define reg_iop_sw_cpu_r_intr0___mpu_2___lsb 2
452#define reg_iop_sw_cpu_r_intr0___mpu_2___width 1
453#define reg_iop_sw_cpu_r_intr0___mpu_2___bit 2
454#define reg_iop_sw_cpu_r_intr0___mpu_3___lsb 3
455#define reg_iop_sw_cpu_r_intr0___mpu_3___width 1
456#define reg_iop_sw_cpu_r_intr0___mpu_3___bit 3
457#define reg_iop_sw_cpu_r_intr0___mpu_4___lsb 4
458#define reg_iop_sw_cpu_r_intr0___mpu_4___width 1
459#define reg_iop_sw_cpu_r_intr0___mpu_4___bit 4
460#define reg_iop_sw_cpu_r_intr0___mpu_5___lsb 5
461#define reg_iop_sw_cpu_r_intr0___mpu_5___width 1
462#define reg_iop_sw_cpu_r_intr0___mpu_5___bit 5
463#define reg_iop_sw_cpu_r_intr0___mpu_6___lsb 6
464#define reg_iop_sw_cpu_r_intr0___mpu_6___width 1
465#define reg_iop_sw_cpu_r_intr0___mpu_6___bit 6
466#define reg_iop_sw_cpu_r_intr0___mpu_7___lsb 7
467#define reg_iop_sw_cpu_r_intr0___mpu_7___width 1
468#define reg_iop_sw_cpu_r_intr0___mpu_7___bit 7
469#define reg_iop_sw_cpu_r_intr0___mpu_8___lsb 8
470#define reg_iop_sw_cpu_r_intr0___mpu_8___width 1
471#define reg_iop_sw_cpu_r_intr0___mpu_8___bit 8
472#define reg_iop_sw_cpu_r_intr0___mpu_9___lsb 9
473#define reg_iop_sw_cpu_r_intr0___mpu_9___width 1
474#define reg_iop_sw_cpu_r_intr0___mpu_9___bit 9
475#define reg_iop_sw_cpu_r_intr0___mpu_10___lsb 10
476#define reg_iop_sw_cpu_r_intr0___mpu_10___width 1
477#define reg_iop_sw_cpu_r_intr0___mpu_10___bit 10
478#define reg_iop_sw_cpu_r_intr0___mpu_11___lsb 11
479#define reg_iop_sw_cpu_r_intr0___mpu_11___width 1
480#define reg_iop_sw_cpu_r_intr0___mpu_11___bit 11
481#define reg_iop_sw_cpu_r_intr0___mpu_12___lsb 12
482#define reg_iop_sw_cpu_r_intr0___mpu_12___width 1
483#define reg_iop_sw_cpu_r_intr0___mpu_12___bit 12
484#define reg_iop_sw_cpu_r_intr0___mpu_13___lsb 13
485#define reg_iop_sw_cpu_r_intr0___mpu_13___width 1
486#define reg_iop_sw_cpu_r_intr0___mpu_13___bit 13
487#define reg_iop_sw_cpu_r_intr0___mpu_14___lsb 14
488#define reg_iop_sw_cpu_r_intr0___mpu_14___width 1
489#define reg_iop_sw_cpu_r_intr0___mpu_14___bit 14
490#define reg_iop_sw_cpu_r_intr0___mpu_15___lsb 15
491#define reg_iop_sw_cpu_r_intr0___mpu_15___width 1
492#define reg_iop_sw_cpu_r_intr0___mpu_15___bit 15
493#define reg_iop_sw_cpu_r_intr0___spu0_0___lsb 16
494#define reg_iop_sw_cpu_r_intr0___spu0_0___width 1
495#define reg_iop_sw_cpu_r_intr0___spu0_0___bit 16
496#define reg_iop_sw_cpu_r_intr0___spu0_1___lsb 17
497#define reg_iop_sw_cpu_r_intr0___spu0_1___width 1
498#define reg_iop_sw_cpu_r_intr0___spu0_1___bit 17
499#define reg_iop_sw_cpu_r_intr0___spu0_2___lsb 18
500#define reg_iop_sw_cpu_r_intr0___spu0_2___width 1
501#define reg_iop_sw_cpu_r_intr0___spu0_2___bit 18
502#define reg_iop_sw_cpu_r_intr0___spu0_3___lsb 19
503#define reg_iop_sw_cpu_r_intr0___spu0_3___width 1
504#define reg_iop_sw_cpu_r_intr0___spu0_3___bit 19
505#define reg_iop_sw_cpu_r_intr0___spu0_4___lsb 20
506#define reg_iop_sw_cpu_r_intr0___spu0_4___width 1
507#define reg_iop_sw_cpu_r_intr0___spu0_4___bit 20
508#define reg_iop_sw_cpu_r_intr0___spu0_5___lsb 21
509#define reg_iop_sw_cpu_r_intr0___spu0_5___width 1
510#define reg_iop_sw_cpu_r_intr0___spu0_5___bit 21
511#define reg_iop_sw_cpu_r_intr0___spu0_6___lsb 22
512#define reg_iop_sw_cpu_r_intr0___spu0_6___width 1
513#define reg_iop_sw_cpu_r_intr0___spu0_6___bit 22
514#define reg_iop_sw_cpu_r_intr0___spu0_7___lsb 23
515#define reg_iop_sw_cpu_r_intr0___spu0_7___width 1
516#define reg_iop_sw_cpu_r_intr0___spu0_7___bit 23
517#define reg_iop_sw_cpu_r_intr0___spu1_8___lsb 24
518#define reg_iop_sw_cpu_r_intr0___spu1_8___width 1
519#define reg_iop_sw_cpu_r_intr0___spu1_8___bit 24
520#define reg_iop_sw_cpu_r_intr0___spu1_9___lsb 25
521#define reg_iop_sw_cpu_r_intr0___spu1_9___width 1
522#define reg_iop_sw_cpu_r_intr0___spu1_9___bit 25
523#define reg_iop_sw_cpu_r_intr0___spu1_10___lsb 26
524#define reg_iop_sw_cpu_r_intr0___spu1_10___width 1
525#define reg_iop_sw_cpu_r_intr0___spu1_10___bit 26
526#define reg_iop_sw_cpu_r_intr0___spu1_11___lsb 27
527#define reg_iop_sw_cpu_r_intr0___spu1_11___width 1
528#define reg_iop_sw_cpu_r_intr0___spu1_11___bit 27
529#define reg_iop_sw_cpu_r_intr0___spu1_12___lsb 28
530#define reg_iop_sw_cpu_r_intr0___spu1_12___width 1
531#define reg_iop_sw_cpu_r_intr0___spu1_12___bit 28
532#define reg_iop_sw_cpu_r_intr0___spu1_13___lsb 29
533#define reg_iop_sw_cpu_r_intr0___spu1_13___width 1
534#define reg_iop_sw_cpu_r_intr0___spu1_13___bit 29
535#define reg_iop_sw_cpu_r_intr0___spu1_14___lsb 30
536#define reg_iop_sw_cpu_r_intr0___spu1_14___width 1
537#define reg_iop_sw_cpu_r_intr0___spu1_14___bit 30
538#define reg_iop_sw_cpu_r_intr0___spu1_15___lsb 31
539#define reg_iop_sw_cpu_r_intr0___spu1_15___width 1
540#define reg_iop_sw_cpu_r_intr0___spu1_15___bit 31
541#define reg_iop_sw_cpu_r_intr0_offset 92
542
543/* Register r_masked_intr0, scope iop_sw_cpu, type r */
544#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___lsb 0
545#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___width 1
546#define reg_iop_sw_cpu_r_masked_intr0___mpu_0___bit 0
547#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___lsb 1
548#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___width 1
549#define reg_iop_sw_cpu_r_masked_intr0___mpu_1___bit 1
550#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___lsb 2
551#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___width 1
552#define reg_iop_sw_cpu_r_masked_intr0___mpu_2___bit 2
553#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___lsb 3
554#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___width 1
555#define reg_iop_sw_cpu_r_masked_intr0___mpu_3___bit 3
556#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___lsb 4
557#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___width 1
558#define reg_iop_sw_cpu_r_masked_intr0___mpu_4___bit 4
559#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___lsb 5
560#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___width 1
561#define reg_iop_sw_cpu_r_masked_intr0___mpu_5___bit 5
562#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___lsb 6
563#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___width 1
564#define reg_iop_sw_cpu_r_masked_intr0___mpu_6___bit 6
565#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___lsb 7
566#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___width 1
567#define reg_iop_sw_cpu_r_masked_intr0___mpu_7___bit 7
568#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___lsb 8
569#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___width 1
570#define reg_iop_sw_cpu_r_masked_intr0___mpu_8___bit 8
571#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___lsb 9
572#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___width 1
573#define reg_iop_sw_cpu_r_masked_intr0___mpu_9___bit 9
574#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___lsb 10
575#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___width 1
576#define reg_iop_sw_cpu_r_masked_intr0___mpu_10___bit 10
577#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___lsb 11
578#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___width 1
579#define reg_iop_sw_cpu_r_masked_intr0___mpu_11___bit 11
580#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___lsb 12
581#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___width 1
582#define reg_iop_sw_cpu_r_masked_intr0___mpu_12___bit 12
583#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___lsb 13
584#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___width 1
585#define reg_iop_sw_cpu_r_masked_intr0___mpu_13___bit 13
586#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___lsb 14
587#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___width 1
588#define reg_iop_sw_cpu_r_masked_intr0___mpu_14___bit 14
589#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___lsb 15
590#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___width 1
591#define reg_iop_sw_cpu_r_masked_intr0___mpu_15___bit 15
592#define reg_iop_sw_cpu_r_masked_intr0___spu0_0___lsb 16
593#define reg_iop_sw_cpu_r_masked_intr0___spu0_0___width 1
594#define reg_iop_sw_cpu_r_masked_intr0___spu0_0___bit 16
595#define reg_iop_sw_cpu_r_masked_intr0___spu0_1___lsb 17
596#define reg_iop_sw_cpu_r_masked_intr0___spu0_1___width 1
597#define reg_iop_sw_cpu_r_masked_intr0___spu0_1___bit 17
598#define reg_iop_sw_cpu_r_masked_intr0___spu0_2___lsb 18
599#define reg_iop_sw_cpu_r_masked_intr0___spu0_2___width 1
600#define reg_iop_sw_cpu_r_masked_intr0___spu0_2___bit 18
601#define reg_iop_sw_cpu_r_masked_intr0___spu0_3___lsb 19
602#define reg_iop_sw_cpu_r_masked_intr0___spu0_3___width 1
603#define reg_iop_sw_cpu_r_masked_intr0___spu0_3___bit 19
604#define reg_iop_sw_cpu_r_masked_intr0___spu0_4___lsb 20
605#define reg_iop_sw_cpu_r_masked_intr0___spu0_4___width 1
606#define reg_iop_sw_cpu_r_masked_intr0___spu0_4___bit 20
607#define reg_iop_sw_cpu_r_masked_intr0___spu0_5___lsb 21
608#define reg_iop_sw_cpu_r_masked_intr0___spu0_5___width 1
609#define reg_iop_sw_cpu_r_masked_intr0___spu0_5___bit 21
610#define reg_iop_sw_cpu_r_masked_intr0___spu0_6___lsb 22
611#define reg_iop_sw_cpu_r_masked_intr0___spu0_6___width 1
612#define reg_iop_sw_cpu_r_masked_intr0___spu0_6___bit 22
613#define reg_iop_sw_cpu_r_masked_intr0___spu0_7___lsb 23
614#define reg_iop_sw_cpu_r_masked_intr0___spu0_7___width 1
615#define reg_iop_sw_cpu_r_masked_intr0___spu0_7___bit 23
616#define reg_iop_sw_cpu_r_masked_intr0___spu1_8___lsb 24
617#define reg_iop_sw_cpu_r_masked_intr0___spu1_8___width 1
618#define reg_iop_sw_cpu_r_masked_intr0___spu1_8___bit 24
619#define reg_iop_sw_cpu_r_masked_intr0___spu1_9___lsb 25
620#define reg_iop_sw_cpu_r_masked_intr0___spu1_9___width 1
621#define reg_iop_sw_cpu_r_masked_intr0___spu1_9___bit 25
622#define reg_iop_sw_cpu_r_masked_intr0___spu1_10___lsb 26
623#define reg_iop_sw_cpu_r_masked_intr0___spu1_10___width 1
624#define reg_iop_sw_cpu_r_masked_intr0___spu1_10___bit 26
625#define reg_iop_sw_cpu_r_masked_intr0___spu1_11___lsb 27
626#define reg_iop_sw_cpu_r_masked_intr0___spu1_11___width 1
627#define reg_iop_sw_cpu_r_masked_intr0___spu1_11___bit 27
628#define reg_iop_sw_cpu_r_masked_intr0___spu1_12___lsb 28
629#define reg_iop_sw_cpu_r_masked_intr0___spu1_12___width 1
630#define reg_iop_sw_cpu_r_masked_intr0___spu1_12___bit 28
631#define reg_iop_sw_cpu_r_masked_intr0___spu1_13___lsb 29
632#define reg_iop_sw_cpu_r_masked_intr0___spu1_13___width 1
633#define reg_iop_sw_cpu_r_masked_intr0___spu1_13___bit 29
634#define reg_iop_sw_cpu_r_masked_intr0___spu1_14___lsb 30
635#define reg_iop_sw_cpu_r_masked_intr0___spu1_14___width 1
636#define reg_iop_sw_cpu_r_masked_intr0___spu1_14___bit 30
637#define reg_iop_sw_cpu_r_masked_intr0___spu1_15___lsb 31
638#define reg_iop_sw_cpu_r_masked_intr0___spu1_15___width 1
639#define reg_iop_sw_cpu_r_masked_intr0___spu1_15___bit 31
640#define reg_iop_sw_cpu_r_masked_intr0_offset 96
641
642/* Register rw_intr1_mask, scope iop_sw_cpu, type rw */
643#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___lsb 0
644#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___width 1
645#define reg_iop_sw_cpu_rw_intr1_mask___mpu_16___bit 0
646#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___lsb 1
647#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___width 1
648#define reg_iop_sw_cpu_rw_intr1_mask___mpu_17___bit 1
649#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___lsb 2
650#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___width 1
651#define reg_iop_sw_cpu_rw_intr1_mask___mpu_18___bit 2
652#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___lsb 3
653#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___width 1
654#define reg_iop_sw_cpu_rw_intr1_mask___mpu_19___bit 3
655#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___lsb 4
656#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___width 1
657#define reg_iop_sw_cpu_rw_intr1_mask___mpu_20___bit 4
658#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___lsb 5
659#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___width 1
660#define reg_iop_sw_cpu_rw_intr1_mask___mpu_21___bit 5
661#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___lsb 6
662#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___width 1
663#define reg_iop_sw_cpu_rw_intr1_mask___mpu_22___bit 6
664#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___lsb 7
665#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___width 1
666#define reg_iop_sw_cpu_rw_intr1_mask___mpu_23___bit 7
667#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___lsb 8
668#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___width 1
669#define reg_iop_sw_cpu_rw_intr1_mask___mpu_24___bit 8
670#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___lsb 9
671#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___width 1
672#define reg_iop_sw_cpu_rw_intr1_mask___mpu_25___bit 9
673#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___lsb 10
674#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___width 1
675#define reg_iop_sw_cpu_rw_intr1_mask___mpu_26___bit 10
676#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___lsb 11
677#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___width 1
678#define reg_iop_sw_cpu_rw_intr1_mask___mpu_27___bit 11
679#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___lsb 12
680#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___width 1
681#define reg_iop_sw_cpu_rw_intr1_mask___mpu_28___bit 12
682#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___lsb 13
683#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___width 1
684#define reg_iop_sw_cpu_rw_intr1_mask___mpu_29___bit 13
685#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___lsb 14
686#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___width 1
687#define reg_iop_sw_cpu_rw_intr1_mask___mpu_30___bit 14
688#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___lsb 15
689#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___width 1
690#define reg_iop_sw_cpu_rw_intr1_mask___mpu_31___bit 15
691#define reg_iop_sw_cpu_rw_intr1_mask___spu0_8___lsb 16
692#define reg_iop_sw_cpu_rw_intr1_mask___spu0_8___width 1
693#define reg_iop_sw_cpu_rw_intr1_mask___spu0_8___bit 16
694#define reg_iop_sw_cpu_rw_intr1_mask___spu0_9___lsb 17
695#define reg_iop_sw_cpu_rw_intr1_mask___spu0_9___width 1
696#define reg_iop_sw_cpu_rw_intr1_mask___spu0_9___bit 17
697#define reg_iop_sw_cpu_rw_intr1_mask___spu0_10___lsb 18
698#define reg_iop_sw_cpu_rw_intr1_mask___spu0_10___width 1
699#define reg_iop_sw_cpu_rw_intr1_mask___spu0_10___bit 18
700#define reg_iop_sw_cpu_rw_intr1_mask___spu0_11___lsb 19
701#define reg_iop_sw_cpu_rw_intr1_mask___spu0_11___width 1
702#define reg_iop_sw_cpu_rw_intr1_mask___spu0_11___bit 19
703#define reg_iop_sw_cpu_rw_intr1_mask___spu0_12___lsb 20
704#define reg_iop_sw_cpu_rw_intr1_mask___spu0_12___width 1
705#define reg_iop_sw_cpu_rw_intr1_mask___spu0_12___bit 20
706#define reg_iop_sw_cpu_rw_intr1_mask___spu0_13___lsb 21
707#define reg_iop_sw_cpu_rw_intr1_mask___spu0_13___width 1
708#define reg_iop_sw_cpu_rw_intr1_mask___spu0_13___bit 21
709#define reg_iop_sw_cpu_rw_intr1_mask___spu0_14___lsb 22
710#define reg_iop_sw_cpu_rw_intr1_mask___spu0_14___width 1
711#define reg_iop_sw_cpu_rw_intr1_mask___spu0_14___bit 22
712#define reg_iop_sw_cpu_rw_intr1_mask___spu0_15___lsb 23
713#define reg_iop_sw_cpu_rw_intr1_mask___spu0_15___width 1
714#define reg_iop_sw_cpu_rw_intr1_mask___spu0_15___bit 23
715#define reg_iop_sw_cpu_rw_intr1_mask___spu1_0___lsb 24
716#define reg_iop_sw_cpu_rw_intr1_mask___spu1_0___width 1
717#define reg_iop_sw_cpu_rw_intr1_mask___spu1_0___bit 24
718#define reg_iop_sw_cpu_rw_intr1_mask___spu1_1___lsb 25
719#define reg_iop_sw_cpu_rw_intr1_mask___spu1_1___width 1
720#define reg_iop_sw_cpu_rw_intr1_mask___spu1_1___bit 25
721#define reg_iop_sw_cpu_rw_intr1_mask___spu1_2___lsb 26
722#define reg_iop_sw_cpu_rw_intr1_mask___spu1_2___width 1
723#define reg_iop_sw_cpu_rw_intr1_mask___spu1_2___bit 26
724#define reg_iop_sw_cpu_rw_intr1_mask___spu1_3___lsb 27
725#define reg_iop_sw_cpu_rw_intr1_mask___spu1_3___width 1
726#define reg_iop_sw_cpu_rw_intr1_mask___spu1_3___bit 27
727#define reg_iop_sw_cpu_rw_intr1_mask___spu1_4___lsb 28
728#define reg_iop_sw_cpu_rw_intr1_mask___spu1_4___width 1
729#define reg_iop_sw_cpu_rw_intr1_mask___spu1_4___bit 28
730#define reg_iop_sw_cpu_rw_intr1_mask___spu1_5___lsb 29
731#define reg_iop_sw_cpu_rw_intr1_mask___spu1_5___width 1
732#define reg_iop_sw_cpu_rw_intr1_mask___spu1_5___bit 29
733#define reg_iop_sw_cpu_rw_intr1_mask___spu1_6___lsb 30
734#define reg_iop_sw_cpu_rw_intr1_mask___spu1_6___width 1
735#define reg_iop_sw_cpu_rw_intr1_mask___spu1_6___bit 30
736#define reg_iop_sw_cpu_rw_intr1_mask___spu1_7___lsb 31
737#define reg_iop_sw_cpu_rw_intr1_mask___spu1_7___width 1
738#define reg_iop_sw_cpu_rw_intr1_mask___spu1_7___bit 31
739#define reg_iop_sw_cpu_rw_intr1_mask_offset 100
740
741/* Register rw_ack_intr1, scope iop_sw_cpu, type rw */
742#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___lsb 0
743#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___width 1
744#define reg_iop_sw_cpu_rw_ack_intr1___mpu_16___bit 0
745#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___lsb 1
746#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___width 1
747#define reg_iop_sw_cpu_rw_ack_intr1___mpu_17___bit 1
748#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___lsb 2
749#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___width 1
750#define reg_iop_sw_cpu_rw_ack_intr1___mpu_18___bit 2
751#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___lsb 3
752#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___width 1
753#define reg_iop_sw_cpu_rw_ack_intr1___mpu_19___bit 3
754#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___lsb 4
755#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___width 1
756#define reg_iop_sw_cpu_rw_ack_intr1___mpu_20___bit 4
757#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___lsb 5
758#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___width 1
759#define reg_iop_sw_cpu_rw_ack_intr1___mpu_21___bit 5
760#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___lsb 6
761#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___width 1
762#define reg_iop_sw_cpu_rw_ack_intr1___mpu_22___bit 6
763#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___lsb 7
764#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___width 1
765#define reg_iop_sw_cpu_rw_ack_intr1___mpu_23___bit 7
766#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___lsb 8
767#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___width 1
768#define reg_iop_sw_cpu_rw_ack_intr1___mpu_24___bit 8
769#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___lsb 9
770#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___width 1
771#define reg_iop_sw_cpu_rw_ack_intr1___mpu_25___bit 9
772#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___lsb 10
773#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___width 1
774#define reg_iop_sw_cpu_rw_ack_intr1___mpu_26___bit 10
775#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___lsb 11
776#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___width 1
777#define reg_iop_sw_cpu_rw_ack_intr1___mpu_27___bit 11
778#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___lsb 12
779#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___width 1
780#define reg_iop_sw_cpu_rw_ack_intr1___mpu_28___bit 12
781#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___lsb 13
782#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___width 1
783#define reg_iop_sw_cpu_rw_ack_intr1___mpu_29___bit 13
784#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___lsb 14
785#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___width 1
786#define reg_iop_sw_cpu_rw_ack_intr1___mpu_30___bit 14
787#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___lsb 15
788#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___width 1
789#define reg_iop_sw_cpu_rw_ack_intr1___mpu_31___bit 15
790#define reg_iop_sw_cpu_rw_ack_intr1___spu0_8___lsb 16
791#define reg_iop_sw_cpu_rw_ack_intr1___spu0_8___width 1
792#define reg_iop_sw_cpu_rw_ack_intr1___spu0_8___bit 16
793#define reg_iop_sw_cpu_rw_ack_intr1___spu0_9___lsb 17
794#define reg_iop_sw_cpu_rw_ack_intr1___spu0_9___width 1
795#define reg_iop_sw_cpu_rw_ack_intr1___spu0_9___bit 17
796#define reg_iop_sw_cpu_rw_ack_intr1___spu0_10___lsb 18
797#define reg_iop_sw_cpu_rw_ack_intr1___spu0_10___width 1
798#define reg_iop_sw_cpu_rw_ack_intr1___spu0_10___bit 18
799#define reg_iop_sw_cpu_rw_ack_intr1___spu0_11___lsb 19
800#define reg_iop_sw_cpu_rw_ack_intr1___spu0_11___width 1
801#define reg_iop_sw_cpu_rw_ack_intr1___spu0_11___bit 19
802#define reg_iop_sw_cpu_rw_ack_intr1___spu0_12___lsb 20
803#define reg_iop_sw_cpu_rw_ack_intr1___spu0_12___width 1
804#define reg_iop_sw_cpu_rw_ack_intr1___spu0_12___bit 20
805#define reg_iop_sw_cpu_rw_ack_intr1___spu0_13___lsb 21
806#define reg_iop_sw_cpu_rw_ack_intr1___spu0_13___width 1
807#define reg_iop_sw_cpu_rw_ack_intr1___spu0_13___bit 21
808#define reg_iop_sw_cpu_rw_ack_intr1___spu0_14___lsb 22
809#define reg_iop_sw_cpu_rw_ack_intr1___spu0_14___width 1
810#define reg_iop_sw_cpu_rw_ack_intr1___spu0_14___bit 22
811#define reg_iop_sw_cpu_rw_ack_intr1___spu0_15___lsb 23
812#define reg_iop_sw_cpu_rw_ack_intr1___spu0_15___width 1
813#define reg_iop_sw_cpu_rw_ack_intr1___spu0_15___bit 23
814#define reg_iop_sw_cpu_rw_ack_intr1___spu1_0___lsb 24
815#define reg_iop_sw_cpu_rw_ack_intr1___spu1_0___width 1
816#define reg_iop_sw_cpu_rw_ack_intr1___spu1_0___bit 24
817#define reg_iop_sw_cpu_rw_ack_intr1___spu1_1___lsb 25
818#define reg_iop_sw_cpu_rw_ack_intr1___spu1_1___width 1
819#define reg_iop_sw_cpu_rw_ack_intr1___spu1_1___bit 25
820#define reg_iop_sw_cpu_rw_ack_intr1___spu1_2___lsb 26
821#define reg_iop_sw_cpu_rw_ack_intr1___spu1_2___width 1
822#define reg_iop_sw_cpu_rw_ack_intr1___spu1_2___bit 26
823#define reg_iop_sw_cpu_rw_ack_intr1___spu1_3___lsb 27
824#define reg_iop_sw_cpu_rw_ack_intr1___spu1_3___width 1
825#define reg_iop_sw_cpu_rw_ack_intr1___spu1_3___bit 27
826#define reg_iop_sw_cpu_rw_ack_intr1___spu1_4___lsb 28
827#define reg_iop_sw_cpu_rw_ack_intr1___spu1_4___width 1
828#define reg_iop_sw_cpu_rw_ack_intr1___spu1_4___bit 28
829#define reg_iop_sw_cpu_rw_ack_intr1___spu1_5___lsb 29
830#define reg_iop_sw_cpu_rw_ack_intr1___spu1_5___width 1
831#define reg_iop_sw_cpu_rw_ack_intr1___spu1_5___bit 29
832#define reg_iop_sw_cpu_rw_ack_intr1___spu1_6___lsb 30
833#define reg_iop_sw_cpu_rw_ack_intr1___spu1_6___width 1
834#define reg_iop_sw_cpu_rw_ack_intr1___spu1_6___bit 30
835#define reg_iop_sw_cpu_rw_ack_intr1___spu1_7___lsb 31
836#define reg_iop_sw_cpu_rw_ack_intr1___spu1_7___width 1
837#define reg_iop_sw_cpu_rw_ack_intr1___spu1_7___bit 31
838#define reg_iop_sw_cpu_rw_ack_intr1_offset 104
839
840/* Register r_intr1, scope iop_sw_cpu, type r */
841#define reg_iop_sw_cpu_r_intr1___mpu_16___lsb 0
842#define reg_iop_sw_cpu_r_intr1___mpu_16___width 1
843#define reg_iop_sw_cpu_r_intr1___mpu_16___bit 0
844#define reg_iop_sw_cpu_r_intr1___mpu_17___lsb 1
845#define reg_iop_sw_cpu_r_intr1___mpu_17___width 1
846#define reg_iop_sw_cpu_r_intr1___mpu_17___bit 1
847#define reg_iop_sw_cpu_r_intr1___mpu_18___lsb 2
848#define reg_iop_sw_cpu_r_intr1___mpu_18___width 1
849#define reg_iop_sw_cpu_r_intr1___mpu_18___bit 2
850#define reg_iop_sw_cpu_r_intr1___mpu_19___lsb 3
851#define reg_iop_sw_cpu_r_intr1___mpu_19___width 1
852#define reg_iop_sw_cpu_r_intr1___mpu_19___bit 3
853#define reg_iop_sw_cpu_r_intr1___mpu_20___lsb 4
854#define reg_iop_sw_cpu_r_intr1___mpu_20___width 1
855#define reg_iop_sw_cpu_r_intr1___mpu_20___bit 4
856#define reg_iop_sw_cpu_r_intr1___mpu_21___lsb 5
857#define reg_iop_sw_cpu_r_intr1___mpu_21___width 1
858#define reg_iop_sw_cpu_r_intr1___mpu_21___bit 5
859#define reg_iop_sw_cpu_r_intr1___mpu_22___lsb 6
860#define reg_iop_sw_cpu_r_intr1___mpu_22___width 1
861#define reg_iop_sw_cpu_r_intr1___mpu_22___bit 6
862#define reg_iop_sw_cpu_r_intr1___mpu_23___lsb 7
863#define reg_iop_sw_cpu_r_intr1___mpu_23___width 1
864#define reg_iop_sw_cpu_r_intr1___mpu_23___bit 7
865#define reg_iop_sw_cpu_r_intr1___mpu_24___lsb 8
866#define reg_iop_sw_cpu_r_intr1___mpu_24___width 1
867#define reg_iop_sw_cpu_r_intr1___mpu_24___bit 8
868#define reg_iop_sw_cpu_r_intr1___mpu_25___lsb 9
869#define reg_iop_sw_cpu_r_intr1___mpu_25___width 1
870#define reg_iop_sw_cpu_r_intr1___mpu_25___bit 9
871#define reg_iop_sw_cpu_r_intr1___mpu_26___lsb 10
872#define reg_iop_sw_cpu_r_intr1___mpu_26___width 1
873#define reg_iop_sw_cpu_r_intr1___mpu_26___bit 10
874#define reg_iop_sw_cpu_r_intr1___mpu_27___lsb 11
875#define reg_iop_sw_cpu_r_intr1___mpu_27___width 1
876#define reg_iop_sw_cpu_r_intr1___mpu_27___bit 11
877#define reg_iop_sw_cpu_r_intr1___mpu_28___lsb 12
878#define reg_iop_sw_cpu_r_intr1___mpu_28___width 1
879#define reg_iop_sw_cpu_r_intr1___mpu_28___bit 12
880#define reg_iop_sw_cpu_r_intr1___mpu_29___lsb 13
881#define reg_iop_sw_cpu_r_intr1___mpu_29___width 1
882#define reg_iop_sw_cpu_r_intr1___mpu_29___bit 13
883#define reg_iop_sw_cpu_r_intr1___mpu_30___lsb 14
884#define reg_iop_sw_cpu_r_intr1___mpu_30___width 1
885#define reg_iop_sw_cpu_r_intr1___mpu_30___bit 14
886#define reg_iop_sw_cpu_r_intr1___mpu_31___lsb 15
887#define reg_iop_sw_cpu_r_intr1___mpu_31___width 1
888#define reg_iop_sw_cpu_r_intr1___mpu_31___bit 15
889#define reg_iop_sw_cpu_r_intr1___spu0_8___lsb 16
890#define reg_iop_sw_cpu_r_intr1___spu0_8___width 1
891#define reg_iop_sw_cpu_r_intr1___spu0_8___bit 16
892#define reg_iop_sw_cpu_r_intr1___spu0_9___lsb 17
893#define reg_iop_sw_cpu_r_intr1___spu0_9___width 1
894#define reg_iop_sw_cpu_r_intr1___spu0_9___bit 17
895#define reg_iop_sw_cpu_r_intr1___spu0_10___lsb 18
896#define reg_iop_sw_cpu_r_intr1___spu0_10___width 1
897#define reg_iop_sw_cpu_r_intr1___spu0_10___bit 18
898#define reg_iop_sw_cpu_r_intr1___spu0_11___lsb 19
899#define reg_iop_sw_cpu_r_intr1___spu0_11___width 1
900#define reg_iop_sw_cpu_r_intr1___spu0_11___bit 19
901#define reg_iop_sw_cpu_r_intr1___spu0_12___lsb 20
902#define reg_iop_sw_cpu_r_intr1___spu0_12___width 1
903#define reg_iop_sw_cpu_r_intr1___spu0_12___bit 20
904#define reg_iop_sw_cpu_r_intr1___spu0_13___lsb 21
905#define reg_iop_sw_cpu_r_intr1___spu0_13___width 1
906#define reg_iop_sw_cpu_r_intr1___spu0_13___bit 21
907#define reg_iop_sw_cpu_r_intr1___spu0_14___lsb 22
908#define reg_iop_sw_cpu_r_intr1___spu0_14___width 1
909#define reg_iop_sw_cpu_r_intr1___spu0_14___bit 22
910#define reg_iop_sw_cpu_r_intr1___spu0_15___lsb 23
911#define reg_iop_sw_cpu_r_intr1___spu0_15___width 1
912#define reg_iop_sw_cpu_r_intr1___spu0_15___bit 23
913#define reg_iop_sw_cpu_r_intr1___spu1_0___lsb 24
914#define reg_iop_sw_cpu_r_intr1___spu1_0___width 1
915#define reg_iop_sw_cpu_r_intr1___spu1_0___bit 24
916#define reg_iop_sw_cpu_r_intr1___spu1_1___lsb 25
917#define reg_iop_sw_cpu_r_intr1___spu1_1___width 1
918#define reg_iop_sw_cpu_r_intr1___spu1_1___bit 25
919#define reg_iop_sw_cpu_r_intr1___spu1_2___lsb 26
920#define reg_iop_sw_cpu_r_intr1___spu1_2___width 1
921#define reg_iop_sw_cpu_r_intr1___spu1_2___bit 26
922#define reg_iop_sw_cpu_r_intr1___spu1_3___lsb 27
923#define reg_iop_sw_cpu_r_intr1___spu1_3___width 1
924#define reg_iop_sw_cpu_r_intr1___spu1_3___bit 27
925#define reg_iop_sw_cpu_r_intr1___spu1_4___lsb 28
926#define reg_iop_sw_cpu_r_intr1___spu1_4___width 1
927#define reg_iop_sw_cpu_r_intr1___spu1_4___bit 28
928#define reg_iop_sw_cpu_r_intr1___spu1_5___lsb 29
929#define reg_iop_sw_cpu_r_intr1___spu1_5___width 1
930#define reg_iop_sw_cpu_r_intr1___spu1_5___bit 29
931#define reg_iop_sw_cpu_r_intr1___spu1_6___lsb 30
932#define reg_iop_sw_cpu_r_intr1___spu1_6___width 1
933#define reg_iop_sw_cpu_r_intr1___spu1_6___bit 30
934#define reg_iop_sw_cpu_r_intr1___spu1_7___lsb 31
935#define reg_iop_sw_cpu_r_intr1___spu1_7___width 1
936#define reg_iop_sw_cpu_r_intr1___spu1_7___bit 31
937#define reg_iop_sw_cpu_r_intr1_offset 108
938
939/* Register r_masked_intr1, scope iop_sw_cpu, type r */
940#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___lsb 0
941#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___width 1
942#define reg_iop_sw_cpu_r_masked_intr1___mpu_16___bit 0
943#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___lsb 1
944#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___width 1
945#define reg_iop_sw_cpu_r_masked_intr1___mpu_17___bit 1
946#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___lsb 2
947#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___width 1
948#define reg_iop_sw_cpu_r_masked_intr1___mpu_18___bit 2
949#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___lsb 3
950#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___width 1
951#define reg_iop_sw_cpu_r_masked_intr1___mpu_19___bit 3
952#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___lsb 4
953#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___width 1
954#define reg_iop_sw_cpu_r_masked_intr1___mpu_20___bit 4
955#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___lsb 5
956#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___width 1
957#define reg_iop_sw_cpu_r_masked_intr1___mpu_21___bit 5
958#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___lsb 6
959#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___width 1
960#define reg_iop_sw_cpu_r_masked_intr1___mpu_22___bit 6
961#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___lsb 7
962#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___width 1
963#define reg_iop_sw_cpu_r_masked_intr1___mpu_23___bit 7
964#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___lsb 8
965#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___width 1
966#define reg_iop_sw_cpu_r_masked_intr1___mpu_24___bit 8
967#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___lsb 9
968#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___width 1
969#define reg_iop_sw_cpu_r_masked_intr1___mpu_25___bit 9
970#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___lsb 10
971#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___width 1
972#define reg_iop_sw_cpu_r_masked_intr1___mpu_26___bit 10
973#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___lsb 11
974#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___width 1
975#define reg_iop_sw_cpu_r_masked_intr1___mpu_27___bit 11
976#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___lsb 12
977#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___width 1
978#define reg_iop_sw_cpu_r_masked_intr1___mpu_28___bit 12
979#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___lsb 13
980#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___width 1
981#define reg_iop_sw_cpu_r_masked_intr1___mpu_29___bit 13
982#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___lsb 14
983#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___width 1
984#define reg_iop_sw_cpu_r_masked_intr1___mpu_30___bit 14
985#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___lsb 15
986#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___width 1
987#define reg_iop_sw_cpu_r_masked_intr1___mpu_31___bit 15
988#define reg_iop_sw_cpu_r_masked_intr1___spu0_8___lsb 16
989#define reg_iop_sw_cpu_r_masked_intr1___spu0_8___width 1
990#define reg_iop_sw_cpu_r_masked_intr1___spu0_8___bit 16
991#define reg_iop_sw_cpu_r_masked_intr1___spu0_9___lsb 17
992#define reg_iop_sw_cpu_r_masked_intr1___spu0_9___width 1
993#define reg_iop_sw_cpu_r_masked_intr1___spu0_9___bit 17
994#define reg_iop_sw_cpu_r_masked_intr1___spu0_10___lsb 18
995#define reg_iop_sw_cpu_r_masked_intr1___spu0_10___width 1
996#define reg_iop_sw_cpu_r_masked_intr1___spu0_10___bit 18
997#define reg_iop_sw_cpu_r_masked_intr1___spu0_11___lsb 19
998#define reg_iop_sw_cpu_r_masked_intr1___spu0_11___width 1
999#define reg_iop_sw_cpu_r_masked_intr1___spu0_11___bit 19
1000#define reg_iop_sw_cpu_r_masked_intr1___spu0_12___lsb 20
1001#define reg_iop_sw_cpu_r_masked_intr1___spu0_12___width 1
1002#define reg_iop_sw_cpu_r_masked_intr1___spu0_12___bit 20
1003#define reg_iop_sw_cpu_r_masked_intr1___spu0_13___lsb 21
1004#define reg_iop_sw_cpu_r_masked_intr1___spu0_13___width 1
1005#define reg_iop_sw_cpu_r_masked_intr1___spu0_13___bit 21
1006#define reg_iop_sw_cpu_r_masked_intr1___spu0_14___lsb 22
1007#define reg_iop_sw_cpu_r_masked_intr1___spu0_14___width 1
1008#define reg_iop_sw_cpu_r_masked_intr1___spu0_14___bit 22
1009#define reg_iop_sw_cpu_r_masked_intr1___spu0_15___lsb 23
1010#define reg_iop_sw_cpu_r_masked_intr1___spu0_15___width 1
1011#define reg_iop_sw_cpu_r_masked_intr1___spu0_15___bit 23
1012#define reg_iop_sw_cpu_r_masked_intr1___spu1_0___lsb 24
1013#define reg_iop_sw_cpu_r_masked_intr1___spu1_0___width 1
1014#define reg_iop_sw_cpu_r_masked_intr1___spu1_0___bit 24
1015#define reg_iop_sw_cpu_r_masked_intr1___spu1_1___lsb 25
1016#define reg_iop_sw_cpu_r_masked_intr1___spu1_1___width 1
1017#define reg_iop_sw_cpu_r_masked_intr1___spu1_1___bit 25
1018#define reg_iop_sw_cpu_r_masked_intr1___spu1_2___lsb 26
1019#define reg_iop_sw_cpu_r_masked_intr1___spu1_2___width 1
1020#define reg_iop_sw_cpu_r_masked_intr1___spu1_2___bit 26
1021#define reg_iop_sw_cpu_r_masked_intr1___spu1_3___lsb 27
1022#define reg_iop_sw_cpu_r_masked_intr1___spu1_3___width 1
1023#define reg_iop_sw_cpu_r_masked_intr1___spu1_3___bit 27
1024#define reg_iop_sw_cpu_r_masked_intr1___spu1_4___lsb 28
1025#define reg_iop_sw_cpu_r_masked_intr1___spu1_4___width 1
1026#define reg_iop_sw_cpu_r_masked_intr1___spu1_4___bit 28
1027#define reg_iop_sw_cpu_r_masked_intr1___spu1_5___lsb 29
1028#define reg_iop_sw_cpu_r_masked_intr1___spu1_5___width 1
1029#define reg_iop_sw_cpu_r_masked_intr1___spu1_5___bit 29
1030#define reg_iop_sw_cpu_r_masked_intr1___spu1_6___lsb 30
1031#define reg_iop_sw_cpu_r_masked_intr1___spu1_6___width 1
1032#define reg_iop_sw_cpu_r_masked_intr1___spu1_6___bit 30
1033#define reg_iop_sw_cpu_r_masked_intr1___spu1_7___lsb 31
1034#define reg_iop_sw_cpu_r_masked_intr1___spu1_7___width 1
1035#define reg_iop_sw_cpu_r_masked_intr1___spu1_7___bit 31
1036#define reg_iop_sw_cpu_r_masked_intr1_offset 112
1037
1038/* Register rw_intr2_mask, scope iop_sw_cpu, type rw */
1039#define reg_iop_sw_cpu_rw_intr2_mask___mpu_0___lsb 0
1040#define reg_iop_sw_cpu_rw_intr2_mask___mpu_0___width 1
1041#define reg_iop_sw_cpu_rw_intr2_mask___mpu_0___bit 0
1042#define reg_iop_sw_cpu_rw_intr2_mask___mpu_1___lsb 1
1043#define reg_iop_sw_cpu_rw_intr2_mask___mpu_1___width 1
1044#define reg_iop_sw_cpu_rw_intr2_mask___mpu_1___bit 1
1045#define reg_iop_sw_cpu_rw_intr2_mask___mpu_2___lsb 2
1046#define reg_iop_sw_cpu_rw_intr2_mask___mpu_2___width 1
1047#define reg_iop_sw_cpu_rw_intr2_mask___mpu_2___bit 2
1048#define reg_iop_sw_cpu_rw_intr2_mask___mpu_3___lsb 3
1049#define reg_iop_sw_cpu_rw_intr2_mask___mpu_3___width 1
1050#define reg_iop_sw_cpu_rw_intr2_mask___mpu_3___bit 3
1051#define reg_iop_sw_cpu_rw_intr2_mask___mpu_4___lsb 4
1052#define reg_iop_sw_cpu_rw_intr2_mask___mpu_4___width 1
1053#define reg_iop_sw_cpu_rw_intr2_mask___mpu_4___bit 4
1054#define reg_iop_sw_cpu_rw_intr2_mask___mpu_5___lsb 5
1055#define reg_iop_sw_cpu_rw_intr2_mask___mpu_5___width 1
1056#define reg_iop_sw_cpu_rw_intr2_mask___mpu_5___bit 5
1057#define reg_iop_sw_cpu_rw_intr2_mask___mpu_6___lsb 6
1058#define reg_iop_sw_cpu_rw_intr2_mask___mpu_6___width 1
1059#define reg_iop_sw_cpu_rw_intr2_mask___mpu_6___bit 6
1060#define reg_iop_sw_cpu_rw_intr2_mask___mpu_7___lsb 7
1061#define reg_iop_sw_cpu_rw_intr2_mask___mpu_7___width 1
1062#define reg_iop_sw_cpu_rw_intr2_mask___mpu_7___bit 7
1063#define reg_iop_sw_cpu_rw_intr2_mask___spu0_0___lsb 8
1064#define reg_iop_sw_cpu_rw_intr2_mask___spu0_0___width 1
1065#define reg_iop_sw_cpu_rw_intr2_mask___spu0_0___bit 8
1066#define reg_iop_sw_cpu_rw_intr2_mask___spu0_1___lsb 9
1067#define reg_iop_sw_cpu_rw_intr2_mask___spu0_1___width 1
1068#define reg_iop_sw_cpu_rw_intr2_mask___spu0_1___bit 9
1069#define reg_iop_sw_cpu_rw_intr2_mask___spu0_2___lsb 10
1070#define reg_iop_sw_cpu_rw_intr2_mask___spu0_2___width 1
1071#define reg_iop_sw_cpu_rw_intr2_mask___spu0_2___bit 10
1072#define reg_iop_sw_cpu_rw_intr2_mask___spu0_3___lsb 11
1073#define reg_iop_sw_cpu_rw_intr2_mask___spu0_3___width 1
1074#define reg_iop_sw_cpu_rw_intr2_mask___spu0_3___bit 11
1075#define reg_iop_sw_cpu_rw_intr2_mask___spu0_4___lsb 12
1076#define reg_iop_sw_cpu_rw_intr2_mask___spu0_4___width 1
1077#define reg_iop_sw_cpu_rw_intr2_mask___spu0_4___bit 12
1078#define reg_iop_sw_cpu_rw_intr2_mask___spu0_5___lsb 13
1079#define reg_iop_sw_cpu_rw_intr2_mask___spu0_5___width 1
1080#define reg_iop_sw_cpu_rw_intr2_mask___spu0_5___bit 13
1081#define reg_iop_sw_cpu_rw_intr2_mask___spu0_6___lsb 14
1082#define reg_iop_sw_cpu_rw_intr2_mask___spu0_6___width 1
1083#define reg_iop_sw_cpu_rw_intr2_mask___spu0_6___bit 14
1084#define reg_iop_sw_cpu_rw_intr2_mask___spu0_7___lsb 15
1085#define reg_iop_sw_cpu_rw_intr2_mask___spu0_7___width 1
1086#define reg_iop_sw_cpu_rw_intr2_mask___spu0_7___bit 15
1087#define reg_iop_sw_cpu_rw_intr2_mask___dmc_in0___lsb 16
1088#define reg_iop_sw_cpu_rw_intr2_mask___dmc_in0___width 1
1089#define reg_iop_sw_cpu_rw_intr2_mask___dmc_in0___bit 16
1090#define reg_iop_sw_cpu_rw_intr2_mask___dmc_out0___lsb 17
1091#define reg_iop_sw_cpu_rw_intr2_mask___dmc_out0___width 1
1092#define reg_iop_sw_cpu_rw_intr2_mask___dmc_out0___bit 17
1093#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0___lsb 18
1094#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0___width 1
1095#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0___bit 18
1096#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0___lsb 19
1097#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0___width 1
1098#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0___bit 19
1099#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0_extra___lsb 20
1100#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0_extra___width 1
1101#define reg_iop_sw_cpu_rw_intr2_mask___fifo_in0_extra___bit 20
1102#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0_extra___lsb 21
1103#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0_extra___width 1
1104#define reg_iop_sw_cpu_rw_intr2_mask___fifo_out0_extra___bit 21
1105#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp0___lsb 22
1106#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp0___width 1
1107#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp0___bit 22
1108#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp1___lsb 23
1109#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp1___width 1
1110#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp1___bit 23
1111#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp2___lsb 24
1112#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp2___width 1
1113#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp2___bit 24
1114#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp3___lsb 25
1115#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp3___width 1
1116#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp3___bit 25
1117#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp4___lsb 26
1118#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp4___width 1
1119#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp4___bit 26
1120#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp5___lsb 27
1121#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp5___width 1
1122#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp5___bit 27
1123#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp6___lsb 28
1124#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp6___width 1
1125#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp6___bit 28
1126#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp7___lsb 29
1127#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp7___width 1
1128#define reg_iop_sw_cpu_rw_intr2_mask___trigger_grp7___bit 29
1129#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp0___lsb 30
1130#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp0___width 1
1131#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp0___bit 30
1132#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp1___lsb 31
1133#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp1___width 1
1134#define reg_iop_sw_cpu_rw_intr2_mask___timer_grp1___bit 31
1135#define reg_iop_sw_cpu_rw_intr2_mask_offset 116
1136
1137/* Register rw_ack_intr2, scope iop_sw_cpu, type rw */
1138#define reg_iop_sw_cpu_rw_ack_intr2___mpu_0___lsb 0
1139#define reg_iop_sw_cpu_rw_ack_intr2___mpu_0___width 1
1140#define reg_iop_sw_cpu_rw_ack_intr2___mpu_0___bit 0
1141#define reg_iop_sw_cpu_rw_ack_intr2___mpu_1___lsb 1
1142#define reg_iop_sw_cpu_rw_ack_intr2___mpu_1___width 1
1143#define reg_iop_sw_cpu_rw_ack_intr2___mpu_1___bit 1
1144#define reg_iop_sw_cpu_rw_ack_intr2___mpu_2___lsb 2
1145#define reg_iop_sw_cpu_rw_ack_intr2___mpu_2___width 1
1146#define reg_iop_sw_cpu_rw_ack_intr2___mpu_2___bit 2
1147#define reg_iop_sw_cpu_rw_ack_intr2___mpu_3___lsb 3
1148#define reg_iop_sw_cpu_rw_ack_intr2___mpu_3___width 1
1149#define reg_iop_sw_cpu_rw_ack_intr2___mpu_3___bit 3
1150#define reg_iop_sw_cpu_rw_ack_intr2___mpu_4___lsb 4
1151#define reg_iop_sw_cpu_rw_ack_intr2___mpu_4___width 1
1152#define reg_iop_sw_cpu_rw_ack_intr2___mpu_4___bit 4
1153#define reg_iop_sw_cpu_rw_ack_intr2___mpu_5___lsb 5
1154#define reg_iop_sw_cpu_rw_ack_intr2___mpu_5___width 1
1155#define reg_iop_sw_cpu_rw_ack_intr2___mpu_5___bit 5
1156#define reg_iop_sw_cpu_rw_ack_intr2___mpu_6___lsb 6
1157#define reg_iop_sw_cpu_rw_ack_intr2___mpu_6___width 1
1158#define reg_iop_sw_cpu_rw_ack_intr2___mpu_6___bit 6
1159#define reg_iop_sw_cpu_rw_ack_intr2___mpu_7___lsb 7
1160#define reg_iop_sw_cpu_rw_ack_intr2___mpu_7___width 1
1161#define reg_iop_sw_cpu_rw_ack_intr2___mpu_7___bit 7
1162#define reg_iop_sw_cpu_rw_ack_intr2___spu0_0___lsb 8
1163#define reg_iop_sw_cpu_rw_ack_intr2___spu0_0___width 1
1164#define reg_iop_sw_cpu_rw_ack_intr2___spu0_0___bit 8
1165#define reg_iop_sw_cpu_rw_ack_intr2___spu0_1___lsb 9
1166#define reg_iop_sw_cpu_rw_ack_intr2___spu0_1___width 1
1167#define reg_iop_sw_cpu_rw_ack_intr2___spu0_1___bit 9
1168#define reg_iop_sw_cpu_rw_ack_intr2___spu0_2___lsb 10
1169#define reg_iop_sw_cpu_rw_ack_intr2___spu0_2___width 1
1170#define reg_iop_sw_cpu_rw_ack_intr2___spu0_2___bit 10
1171#define reg_iop_sw_cpu_rw_ack_intr2___spu0_3___lsb 11
1172#define reg_iop_sw_cpu_rw_ack_intr2___spu0_3___width 1
1173#define reg_iop_sw_cpu_rw_ack_intr2___spu0_3___bit 11
1174#define reg_iop_sw_cpu_rw_ack_intr2___spu0_4___lsb 12
1175#define reg_iop_sw_cpu_rw_ack_intr2___spu0_4___width 1
1176#define reg_iop_sw_cpu_rw_ack_intr2___spu0_4___bit 12
1177#define reg_iop_sw_cpu_rw_ack_intr2___spu0_5___lsb 13
1178#define reg_iop_sw_cpu_rw_ack_intr2___spu0_5___width 1
1179#define reg_iop_sw_cpu_rw_ack_intr2___spu0_5___bit 13
1180#define reg_iop_sw_cpu_rw_ack_intr2___spu0_6___lsb 14
1181#define reg_iop_sw_cpu_rw_ack_intr2___spu0_6___width 1
1182#define reg_iop_sw_cpu_rw_ack_intr2___spu0_6___bit 14
1183#define reg_iop_sw_cpu_rw_ack_intr2___spu0_7___lsb 15
1184#define reg_iop_sw_cpu_rw_ack_intr2___spu0_7___width 1
1185#define reg_iop_sw_cpu_rw_ack_intr2___spu0_7___bit 15
1186#define reg_iop_sw_cpu_rw_ack_intr2_offset 120
1187
1188/* Register r_intr2, scope iop_sw_cpu, type r */
1189#define reg_iop_sw_cpu_r_intr2___mpu_0___lsb 0
1190#define reg_iop_sw_cpu_r_intr2___mpu_0___width 1
1191#define reg_iop_sw_cpu_r_intr2___mpu_0___bit 0
1192#define reg_iop_sw_cpu_r_intr2___mpu_1___lsb 1
1193#define reg_iop_sw_cpu_r_intr2___mpu_1___width 1
1194#define reg_iop_sw_cpu_r_intr2___mpu_1___bit 1
1195#define reg_iop_sw_cpu_r_intr2___mpu_2___lsb 2
1196#define reg_iop_sw_cpu_r_intr2___mpu_2___width 1
1197#define reg_iop_sw_cpu_r_intr2___mpu_2___bit 2
1198#define reg_iop_sw_cpu_r_intr2___mpu_3___lsb 3
1199#define reg_iop_sw_cpu_r_intr2___mpu_3___width 1
1200#define reg_iop_sw_cpu_r_intr2___mpu_3___bit 3
1201#define reg_iop_sw_cpu_r_intr2___mpu_4___lsb 4
1202#define reg_iop_sw_cpu_r_intr2___mpu_4___width 1
1203#define reg_iop_sw_cpu_r_intr2___mpu_4___bit 4
1204#define reg_iop_sw_cpu_r_intr2___mpu_5___lsb 5
1205#define reg_iop_sw_cpu_r_intr2___mpu_5___width 1
1206#define reg_iop_sw_cpu_r_intr2___mpu_5___bit 5
1207#define reg_iop_sw_cpu_r_intr2___mpu_6___lsb 6
1208#define reg_iop_sw_cpu_r_intr2___mpu_6___width 1
1209#define reg_iop_sw_cpu_r_intr2___mpu_6___bit 6
1210#define reg_iop_sw_cpu_r_intr2___mpu_7___lsb 7
1211#define reg_iop_sw_cpu_r_intr2___mpu_7___width 1
1212#define reg_iop_sw_cpu_r_intr2___mpu_7___bit 7
1213#define reg_iop_sw_cpu_r_intr2___spu0_0___lsb 8
1214#define reg_iop_sw_cpu_r_intr2___spu0_0___width 1
1215#define reg_iop_sw_cpu_r_intr2___spu0_0___bit 8
1216#define reg_iop_sw_cpu_r_intr2___spu0_1___lsb 9
1217#define reg_iop_sw_cpu_r_intr2___spu0_1___width 1
1218#define reg_iop_sw_cpu_r_intr2___spu0_1___bit 9
1219#define reg_iop_sw_cpu_r_intr2___spu0_2___lsb 10
1220#define reg_iop_sw_cpu_r_intr2___spu0_2___width 1
1221#define reg_iop_sw_cpu_r_intr2___spu0_2___bit 10
1222#define reg_iop_sw_cpu_r_intr2___spu0_3___lsb 11
1223#define reg_iop_sw_cpu_r_intr2___spu0_3___width 1
1224#define reg_iop_sw_cpu_r_intr2___spu0_3___bit 11
1225#define reg_iop_sw_cpu_r_intr2___spu0_4___lsb 12
1226#define reg_iop_sw_cpu_r_intr2___spu0_4___width 1
1227#define reg_iop_sw_cpu_r_intr2___spu0_4___bit 12
1228#define reg_iop_sw_cpu_r_intr2___spu0_5___lsb 13
1229#define reg_iop_sw_cpu_r_intr2___spu0_5___width 1
1230#define reg_iop_sw_cpu_r_intr2___spu0_5___bit 13
1231#define reg_iop_sw_cpu_r_intr2___spu0_6___lsb 14
1232#define reg_iop_sw_cpu_r_intr2___spu0_6___width 1
1233#define reg_iop_sw_cpu_r_intr2___spu0_6___bit 14
1234#define reg_iop_sw_cpu_r_intr2___spu0_7___lsb 15
1235#define reg_iop_sw_cpu_r_intr2___spu0_7___width 1
1236#define reg_iop_sw_cpu_r_intr2___spu0_7___bit 15
1237#define reg_iop_sw_cpu_r_intr2___dmc_in0___lsb 16
1238#define reg_iop_sw_cpu_r_intr2___dmc_in0___width 1
1239#define reg_iop_sw_cpu_r_intr2___dmc_in0___bit 16
1240#define reg_iop_sw_cpu_r_intr2___dmc_out0___lsb 17
1241#define reg_iop_sw_cpu_r_intr2___dmc_out0___width 1
1242#define reg_iop_sw_cpu_r_intr2___dmc_out0___bit 17
1243#define reg_iop_sw_cpu_r_intr2___fifo_in0___lsb 18
1244#define reg_iop_sw_cpu_r_intr2___fifo_in0___width 1
1245#define reg_iop_sw_cpu_r_intr2___fifo_in0___bit 18
1246#define reg_iop_sw_cpu_r_intr2___fifo_out0___lsb 19
1247#define reg_iop_sw_cpu_r_intr2___fifo_out0___width 1
1248#define reg_iop_sw_cpu_r_intr2___fifo_out0___bit 19
1249#define reg_iop_sw_cpu_r_intr2___fifo_in0_extra___lsb 20
1250#define reg_iop_sw_cpu_r_intr2___fifo_in0_extra___width 1
1251#define reg_iop_sw_cpu_r_intr2___fifo_in0_extra___bit 20
1252#define reg_iop_sw_cpu_r_intr2___fifo_out0_extra___lsb 21
1253#define reg_iop_sw_cpu_r_intr2___fifo_out0_extra___width 1
1254#define reg_iop_sw_cpu_r_intr2___fifo_out0_extra___bit 21
1255#define reg_iop_sw_cpu_r_intr2___trigger_grp0___lsb 22
1256#define reg_iop_sw_cpu_r_intr2___trigger_grp0___width 1
1257#define reg_iop_sw_cpu_r_intr2___trigger_grp0___bit 22
1258#define reg_iop_sw_cpu_r_intr2___trigger_grp1___lsb 23
1259#define reg_iop_sw_cpu_r_intr2___trigger_grp1___width 1
1260#define reg_iop_sw_cpu_r_intr2___trigger_grp1___bit 23
1261#define reg_iop_sw_cpu_r_intr2___trigger_grp2___lsb 24
1262#define reg_iop_sw_cpu_r_intr2___trigger_grp2___width 1
1263#define reg_iop_sw_cpu_r_intr2___trigger_grp2___bit 24
1264#define reg_iop_sw_cpu_r_intr2___trigger_grp3___lsb 25
1265#define reg_iop_sw_cpu_r_intr2___trigger_grp3___width 1
1266#define reg_iop_sw_cpu_r_intr2___trigger_grp3___bit 25
1267#define reg_iop_sw_cpu_r_intr2___trigger_grp4___lsb 26
1268#define reg_iop_sw_cpu_r_intr2___trigger_grp4___width 1
1269#define reg_iop_sw_cpu_r_intr2___trigger_grp4___bit 26
1270#define reg_iop_sw_cpu_r_intr2___trigger_grp5___lsb 27
1271#define reg_iop_sw_cpu_r_intr2___trigger_grp5___width 1
1272#define reg_iop_sw_cpu_r_intr2___trigger_grp5___bit 27
1273#define reg_iop_sw_cpu_r_intr2___trigger_grp6___lsb 28
1274#define reg_iop_sw_cpu_r_intr2___trigger_grp6___width 1
1275#define reg_iop_sw_cpu_r_intr2___trigger_grp6___bit 28
1276#define reg_iop_sw_cpu_r_intr2___trigger_grp7___lsb 29
1277#define reg_iop_sw_cpu_r_intr2___trigger_grp7___width 1
1278#define reg_iop_sw_cpu_r_intr2___trigger_grp7___bit 29
1279#define reg_iop_sw_cpu_r_intr2___timer_grp0___lsb 30
1280#define reg_iop_sw_cpu_r_intr2___timer_grp0___width 1
1281#define reg_iop_sw_cpu_r_intr2___timer_grp0___bit 30
1282#define reg_iop_sw_cpu_r_intr2___timer_grp1___lsb 31
1283#define reg_iop_sw_cpu_r_intr2___timer_grp1___width 1
1284#define reg_iop_sw_cpu_r_intr2___timer_grp1___bit 31
1285#define reg_iop_sw_cpu_r_intr2_offset 124
1286
1287/* Register r_masked_intr2, scope iop_sw_cpu, type r */
1288#define reg_iop_sw_cpu_r_masked_intr2___mpu_0___lsb 0
1289#define reg_iop_sw_cpu_r_masked_intr2___mpu_0___width 1
1290#define reg_iop_sw_cpu_r_masked_intr2___mpu_0___bit 0
1291#define reg_iop_sw_cpu_r_masked_intr2___mpu_1___lsb 1
1292#define reg_iop_sw_cpu_r_masked_intr2___mpu_1___width 1
1293#define reg_iop_sw_cpu_r_masked_intr2___mpu_1___bit 1
1294#define reg_iop_sw_cpu_r_masked_intr2___mpu_2___lsb 2
1295#define reg_iop_sw_cpu_r_masked_intr2___mpu_2___width 1
1296#define reg_iop_sw_cpu_r_masked_intr2___mpu_2___bit 2
1297#define reg_iop_sw_cpu_r_masked_intr2___mpu_3___lsb 3
1298#define reg_iop_sw_cpu_r_masked_intr2___mpu_3___width 1
1299#define reg_iop_sw_cpu_r_masked_intr2___mpu_3___bit 3
1300#define reg_iop_sw_cpu_r_masked_intr2___mpu_4___lsb 4
1301#define reg_iop_sw_cpu_r_masked_intr2___mpu_4___width 1
1302#define reg_iop_sw_cpu_r_masked_intr2___mpu_4___bit 4
1303#define reg_iop_sw_cpu_r_masked_intr2___mpu_5___lsb 5
1304#define reg_iop_sw_cpu_r_masked_intr2___mpu_5___width 1
1305#define reg_iop_sw_cpu_r_masked_intr2___mpu_5___bit 5
1306#define reg_iop_sw_cpu_r_masked_intr2___mpu_6___lsb 6
1307#define reg_iop_sw_cpu_r_masked_intr2___mpu_6___width 1
1308#define reg_iop_sw_cpu_r_masked_intr2___mpu_6___bit 6
1309#define reg_iop_sw_cpu_r_masked_intr2___mpu_7___lsb 7
1310#define reg_iop_sw_cpu_r_masked_intr2___mpu_7___width 1
1311#define reg_iop_sw_cpu_r_masked_intr2___mpu_7___bit 7
1312#define reg_iop_sw_cpu_r_masked_intr2___spu0_0___lsb 8
1313#define reg_iop_sw_cpu_r_masked_intr2___spu0_0___width 1
1314#define reg_iop_sw_cpu_r_masked_intr2___spu0_0___bit 8
1315#define reg_iop_sw_cpu_r_masked_intr2___spu0_1___lsb 9
1316#define reg_iop_sw_cpu_r_masked_intr2___spu0_1___width 1
1317#define reg_iop_sw_cpu_r_masked_intr2___spu0_1___bit 9
1318#define reg_iop_sw_cpu_r_masked_intr2___spu0_2___lsb 10
1319#define reg_iop_sw_cpu_r_masked_intr2___spu0_2___width 1
1320#define reg_iop_sw_cpu_r_masked_intr2___spu0_2___bit 10
1321#define reg_iop_sw_cpu_r_masked_intr2___spu0_3___lsb 11
1322#define reg_iop_sw_cpu_r_masked_intr2___spu0_3___width 1
1323#define reg_iop_sw_cpu_r_masked_intr2___spu0_3___bit 11
1324#define reg_iop_sw_cpu_r_masked_intr2___spu0_4___lsb 12
1325#define reg_iop_sw_cpu_r_masked_intr2___spu0_4___width 1
1326#define reg_iop_sw_cpu_r_masked_intr2___spu0_4___bit 12
1327#define reg_iop_sw_cpu_r_masked_intr2___spu0_5___lsb 13
1328#define reg_iop_sw_cpu_r_masked_intr2___spu0_5___width 1
1329#define reg_iop_sw_cpu_r_masked_intr2___spu0_5___bit 13
1330#define reg_iop_sw_cpu_r_masked_intr2___spu0_6___lsb 14
1331#define reg_iop_sw_cpu_r_masked_intr2___spu0_6___width 1
1332#define reg_iop_sw_cpu_r_masked_intr2___spu0_6___bit 14
1333#define reg_iop_sw_cpu_r_masked_intr2___spu0_7___lsb 15
1334#define reg_iop_sw_cpu_r_masked_intr2___spu0_7___width 1
1335#define reg_iop_sw_cpu_r_masked_intr2___spu0_7___bit 15
1336#define reg_iop_sw_cpu_r_masked_intr2___dmc_in0___lsb 16
1337#define reg_iop_sw_cpu_r_masked_intr2___dmc_in0___width 1
1338#define reg_iop_sw_cpu_r_masked_intr2___dmc_in0___bit 16
1339#define reg_iop_sw_cpu_r_masked_intr2___dmc_out0___lsb 17
1340#define reg_iop_sw_cpu_r_masked_intr2___dmc_out0___width 1
1341#define reg_iop_sw_cpu_r_masked_intr2___dmc_out0___bit 17
1342#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0___lsb 18
1343#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0___width 1
1344#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0___bit 18
1345#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0___lsb 19
1346#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0___width 1
1347#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0___bit 19
1348#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0_extra___lsb 20
1349#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0_extra___width 1
1350#define reg_iop_sw_cpu_r_masked_intr2___fifo_in0_extra___bit 20
1351#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0_extra___lsb 21
1352#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0_extra___width 1
1353#define reg_iop_sw_cpu_r_masked_intr2___fifo_out0_extra___bit 21
1354#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp0___lsb 22
1355#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp0___width 1
1356#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp0___bit 22
1357#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp1___lsb 23
1358#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp1___width 1
1359#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp1___bit 23
1360#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp2___lsb 24
1361#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp2___width 1
1362#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp2___bit 24
1363#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp3___lsb 25
1364#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp3___width 1
1365#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp3___bit 25
1366#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp4___lsb 26
1367#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp4___width 1
1368#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp4___bit 26
1369#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp5___lsb 27
1370#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp5___width 1
1371#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp5___bit 27
1372#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp6___lsb 28
1373#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp6___width 1
1374#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp6___bit 28
1375#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp7___lsb 29
1376#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp7___width 1
1377#define reg_iop_sw_cpu_r_masked_intr2___trigger_grp7___bit 29
1378#define reg_iop_sw_cpu_r_masked_intr2___timer_grp0___lsb 30
1379#define reg_iop_sw_cpu_r_masked_intr2___timer_grp0___width 1
1380#define reg_iop_sw_cpu_r_masked_intr2___timer_grp0___bit 30
1381#define reg_iop_sw_cpu_r_masked_intr2___timer_grp1___lsb 31
1382#define reg_iop_sw_cpu_r_masked_intr2___timer_grp1___width 1
1383#define reg_iop_sw_cpu_r_masked_intr2___timer_grp1___bit 31
1384#define reg_iop_sw_cpu_r_masked_intr2_offset 128
1385
1386/* Register rw_intr3_mask, scope iop_sw_cpu, type rw */
1387#define reg_iop_sw_cpu_rw_intr3_mask___mpu_16___lsb 0
1388#define reg_iop_sw_cpu_rw_intr3_mask___mpu_16___width 1
1389#define reg_iop_sw_cpu_rw_intr3_mask___mpu_16___bit 0
1390#define reg_iop_sw_cpu_rw_intr3_mask___mpu_17___lsb 1
1391#define reg_iop_sw_cpu_rw_intr3_mask___mpu_17___width 1
1392#define reg_iop_sw_cpu_rw_intr3_mask___mpu_17___bit 1
1393#define reg_iop_sw_cpu_rw_intr3_mask___mpu_18___lsb 2
1394#define reg_iop_sw_cpu_rw_intr3_mask___mpu_18___width 1
1395#define reg_iop_sw_cpu_rw_intr3_mask___mpu_18___bit 2
1396#define reg_iop_sw_cpu_rw_intr3_mask___mpu_19___lsb 3
1397#define reg_iop_sw_cpu_rw_intr3_mask___mpu_19___width 1
1398#define reg_iop_sw_cpu_rw_intr3_mask___mpu_19___bit 3
1399#define reg_iop_sw_cpu_rw_intr3_mask___mpu_20___lsb 4
1400#define reg_iop_sw_cpu_rw_intr3_mask___mpu_20___width 1
1401#define reg_iop_sw_cpu_rw_intr3_mask___mpu_20___bit 4
1402#define reg_iop_sw_cpu_rw_intr3_mask___mpu_21___lsb 5
1403#define reg_iop_sw_cpu_rw_intr3_mask___mpu_21___width 1
1404#define reg_iop_sw_cpu_rw_intr3_mask___mpu_21___bit 5
1405#define reg_iop_sw_cpu_rw_intr3_mask___mpu_22___lsb 6
1406#define reg_iop_sw_cpu_rw_intr3_mask___mpu_22___width 1
1407#define reg_iop_sw_cpu_rw_intr3_mask___mpu_22___bit 6
1408#define reg_iop_sw_cpu_rw_intr3_mask___mpu_23___lsb 7
1409#define reg_iop_sw_cpu_rw_intr3_mask___mpu_23___width 1
1410#define reg_iop_sw_cpu_rw_intr3_mask___mpu_23___bit 7
1411#define reg_iop_sw_cpu_rw_intr3_mask___spu1_0___lsb 8
1412#define reg_iop_sw_cpu_rw_intr3_mask___spu1_0___width 1
1413#define reg_iop_sw_cpu_rw_intr3_mask___spu1_0___bit 8
1414#define reg_iop_sw_cpu_rw_intr3_mask___spu1_1___lsb 9
1415#define reg_iop_sw_cpu_rw_intr3_mask___spu1_1___width 1
1416#define reg_iop_sw_cpu_rw_intr3_mask___spu1_1___bit 9
1417#define reg_iop_sw_cpu_rw_intr3_mask___spu1_2___lsb 10
1418#define reg_iop_sw_cpu_rw_intr3_mask___spu1_2___width 1
1419#define reg_iop_sw_cpu_rw_intr3_mask___spu1_2___bit 10
1420#define reg_iop_sw_cpu_rw_intr3_mask___spu1_3___lsb 11
1421#define reg_iop_sw_cpu_rw_intr3_mask___spu1_3___width 1
1422#define reg_iop_sw_cpu_rw_intr3_mask___spu1_3___bit 11
1423#define reg_iop_sw_cpu_rw_intr3_mask___spu1_4___lsb 12
1424#define reg_iop_sw_cpu_rw_intr3_mask___spu1_4___width 1
1425#define reg_iop_sw_cpu_rw_intr3_mask___spu1_4___bit 12
1426#define reg_iop_sw_cpu_rw_intr3_mask___spu1_5___lsb 13
1427#define reg_iop_sw_cpu_rw_intr3_mask___spu1_5___width 1
1428#define reg_iop_sw_cpu_rw_intr3_mask___spu1_5___bit 13
1429#define reg_iop_sw_cpu_rw_intr3_mask___spu1_6___lsb 14
1430#define reg_iop_sw_cpu_rw_intr3_mask___spu1_6___width 1
1431#define reg_iop_sw_cpu_rw_intr3_mask___spu1_6___bit 14
1432#define reg_iop_sw_cpu_rw_intr3_mask___spu1_7___lsb 15
1433#define reg_iop_sw_cpu_rw_intr3_mask___spu1_7___width 1
1434#define reg_iop_sw_cpu_rw_intr3_mask___spu1_7___bit 15
1435#define reg_iop_sw_cpu_rw_intr3_mask___dmc_in1___lsb 16
1436#define reg_iop_sw_cpu_rw_intr3_mask___dmc_in1___width 1
1437#define reg_iop_sw_cpu_rw_intr3_mask___dmc_in1___bit 16
1438#define reg_iop_sw_cpu_rw_intr3_mask___dmc_out1___lsb 17
1439#define reg_iop_sw_cpu_rw_intr3_mask___dmc_out1___width 1
1440#define reg_iop_sw_cpu_rw_intr3_mask___dmc_out1___bit 17
1441#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1___lsb 18
1442#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1___width 1
1443#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1___bit 18
1444#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1___lsb 19
1445#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1___width 1
1446#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1___bit 19
1447#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1_extra___lsb 20
1448#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1_extra___width 1
1449#define reg_iop_sw_cpu_rw_intr3_mask___fifo_in1_extra___bit 20
1450#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1_extra___lsb 21
1451#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1_extra___width 1
1452#define reg_iop_sw_cpu_rw_intr3_mask___fifo_out1_extra___bit 21
1453#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp0___lsb 22
1454#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp0___width 1
1455#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp0___bit 22
1456#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp1___lsb 23
1457#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp1___width 1
1458#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp1___bit 23
1459#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp2___lsb 24
1460#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp2___width 1
1461#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp2___bit 24
1462#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp3___lsb 25
1463#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp3___width 1
1464#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp3___bit 25
1465#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp4___lsb 26
1466#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp4___width 1
1467#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp4___bit 26
1468#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp5___lsb 27
1469#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp5___width 1
1470#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp5___bit 27
1471#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp6___lsb 28
1472#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp6___width 1
1473#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp6___bit 28
1474#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp7___lsb 29
1475#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp7___width 1
1476#define reg_iop_sw_cpu_rw_intr3_mask___trigger_grp7___bit 29
1477#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp2___lsb 30
1478#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp2___width 1
1479#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp2___bit 30
1480#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp3___lsb 31
1481#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp3___width 1
1482#define reg_iop_sw_cpu_rw_intr3_mask___timer_grp3___bit 31
1483#define reg_iop_sw_cpu_rw_intr3_mask_offset 132
1484
1485/* Register rw_ack_intr3, scope iop_sw_cpu, type rw */
1486#define reg_iop_sw_cpu_rw_ack_intr3___mpu_16___lsb 0
1487#define reg_iop_sw_cpu_rw_ack_intr3___mpu_16___width 1
1488#define reg_iop_sw_cpu_rw_ack_intr3___mpu_16___bit 0
1489#define reg_iop_sw_cpu_rw_ack_intr3___mpu_17___lsb 1
1490#define reg_iop_sw_cpu_rw_ack_intr3___mpu_17___width 1
1491#define reg_iop_sw_cpu_rw_ack_intr3___mpu_17___bit 1
1492#define reg_iop_sw_cpu_rw_ack_intr3___mpu_18___lsb 2
1493#define reg_iop_sw_cpu_rw_ack_intr3___mpu_18___width 1
1494#define reg_iop_sw_cpu_rw_ack_intr3___mpu_18___bit 2
1495#define reg_iop_sw_cpu_rw_ack_intr3___mpu_19___lsb 3
1496#define reg_iop_sw_cpu_rw_ack_intr3___mpu_19___width 1
1497#define reg_iop_sw_cpu_rw_ack_intr3___mpu_19___bit 3
1498#define reg_iop_sw_cpu_rw_ack_intr3___mpu_20___lsb 4
1499#define reg_iop_sw_cpu_rw_ack_intr3___mpu_20___width 1
1500#define reg_iop_sw_cpu_rw_ack_intr3___mpu_20___bit 4
1501#define reg_iop_sw_cpu_rw_ack_intr3___mpu_21___lsb 5
1502#define reg_iop_sw_cpu_rw_ack_intr3___mpu_21___width 1
1503#define reg_iop_sw_cpu_rw_ack_intr3___mpu_21___bit 5
1504#define reg_iop_sw_cpu_rw_ack_intr3___mpu_22___lsb 6
1505#define reg_iop_sw_cpu_rw_ack_intr3___mpu_22___width 1
1506#define reg_iop_sw_cpu_rw_ack_intr3___mpu_22___bit 6
1507#define reg_iop_sw_cpu_rw_ack_intr3___mpu_23___lsb 7
1508#define reg_iop_sw_cpu_rw_ack_intr3___mpu_23___width 1
1509#define reg_iop_sw_cpu_rw_ack_intr3___mpu_23___bit 7
1510#define reg_iop_sw_cpu_rw_ack_intr3___spu1_0___lsb 8
1511#define reg_iop_sw_cpu_rw_ack_intr3___spu1_0___width 1
1512#define reg_iop_sw_cpu_rw_ack_intr3___spu1_0___bit 8
1513#define reg_iop_sw_cpu_rw_ack_intr3___spu1_1___lsb 9
1514#define reg_iop_sw_cpu_rw_ack_intr3___spu1_1___width 1
1515#define reg_iop_sw_cpu_rw_ack_intr3___spu1_1___bit 9
1516#define reg_iop_sw_cpu_rw_ack_intr3___spu1_2___lsb 10
1517#define reg_iop_sw_cpu_rw_ack_intr3___spu1_2___width 1
1518#define reg_iop_sw_cpu_rw_ack_intr3___spu1_2___bit 10
1519#define reg_iop_sw_cpu_rw_ack_intr3___spu1_3___lsb 11
1520#define reg_iop_sw_cpu_rw_ack_intr3___spu1_3___width 1
1521#define reg_iop_sw_cpu_rw_ack_intr3___spu1_3___bit 11
1522#define reg_iop_sw_cpu_rw_ack_intr3___spu1_4___lsb 12
1523#define reg_iop_sw_cpu_rw_ack_intr3___spu1_4___width 1
1524#define reg_iop_sw_cpu_rw_ack_intr3___spu1_4___bit 12
1525#define reg_iop_sw_cpu_rw_ack_intr3___spu1_5___lsb 13
1526#define reg_iop_sw_cpu_rw_ack_intr3___spu1_5___width 1
1527#define reg_iop_sw_cpu_rw_ack_intr3___spu1_5___bit 13
1528#define reg_iop_sw_cpu_rw_ack_intr3___spu1_6___lsb 14
1529#define reg_iop_sw_cpu_rw_ack_intr3___spu1_6___width 1
1530#define reg_iop_sw_cpu_rw_ack_intr3___spu1_6___bit 14
1531#define reg_iop_sw_cpu_rw_ack_intr3___spu1_7___lsb 15
1532#define reg_iop_sw_cpu_rw_ack_intr3___spu1_7___width 1
1533#define reg_iop_sw_cpu_rw_ack_intr3___spu1_7___bit 15
1534#define reg_iop_sw_cpu_rw_ack_intr3_offset 136
1535
1536/* Register r_intr3, scope iop_sw_cpu, type r */
1537#define reg_iop_sw_cpu_r_intr3___mpu_16___lsb 0
1538#define reg_iop_sw_cpu_r_intr3___mpu_16___width 1
1539#define reg_iop_sw_cpu_r_intr3___mpu_16___bit 0
1540#define reg_iop_sw_cpu_r_intr3___mpu_17___lsb 1
1541#define reg_iop_sw_cpu_r_intr3___mpu_17___width 1
1542#define reg_iop_sw_cpu_r_intr3___mpu_17___bit 1
1543#define reg_iop_sw_cpu_r_intr3___mpu_18___lsb 2
1544#define reg_iop_sw_cpu_r_intr3___mpu_18___width 1
1545#define reg_iop_sw_cpu_r_intr3___mpu_18___bit 2
1546#define reg_iop_sw_cpu_r_intr3___mpu_19___lsb 3
1547#define reg_iop_sw_cpu_r_intr3___mpu_19___width 1
1548#define reg_iop_sw_cpu_r_intr3___mpu_19___bit 3
1549#define reg_iop_sw_cpu_r_intr3___mpu_20___lsb 4
1550#define reg_iop_sw_cpu_r_intr3___mpu_20___width 1
1551#define reg_iop_sw_cpu_r_intr3___mpu_20___bit 4
1552#define reg_iop_sw_cpu_r_intr3___mpu_21___lsb 5
1553#define reg_iop_sw_cpu_r_intr3___mpu_21___width 1
1554#define reg_iop_sw_cpu_r_intr3___mpu_21___bit 5
1555#define reg_iop_sw_cpu_r_intr3___mpu_22___lsb 6
1556#define reg_iop_sw_cpu_r_intr3___mpu_22___width 1
1557#define reg_iop_sw_cpu_r_intr3___mpu_22___bit 6
1558#define reg_iop_sw_cpu_r_intr3___mpu_23___lsb 7
1559#define reg_iop_sw_cpu_r_intr3___mpu_23___width 1
1560#define reg_iop_sw_cpu_r_intr3___mpu_23___bit 7
1561#define reg_iop_sw_cpu_r_intr3___spu1_0___lsb 8
1562#define reg_iop_sw_cpu_r_intr3___spu1_0___width 1
1563#define reg_iop_sw_cpu_r_intr3___spu1_0___bit 8
1564#define reg_iop_sw_cpu_r_intr3___spu1_1___lsb 9
1565#define reg_iop_sw_cpu_r_intr3___spu1_1___width 1
1566#define reg_iop_sw_cpu_r_intr3___spu1_1___bit 9
1567#define reg_iop_sw_cpu_r_intr3___spu1_2___lsb 10
1568#define reg_iop_sw_cpu_r_intr3___spu1_2___width 1
1569#define reg_iop_sw_cpu_r_intr3___spu1_2___bit 10
1570#define reg_iop_sw_cpu_r_intr3___spu1_3___lsb 11
1571#define reg_iop_sw_cpu_r_intr3___spu1_3___width 1
1572#define reg_iop_sw_cpu_r_intr3___spu1_3___bit 11
1573#define reg_iop_sw_cpu_r_intr3___spu1_4___lsb 12
1574#define reg_iop_sw_cpu_r_intr3___spu1_4___width 1
1575#define reg_iop_sw_cpu_r_intr3___spu1_4___bit 12
1576#define reg_iop_sw_cpu_r_intr3___spu1_5___lsb 13
1577#define reg_iop_sw_cpu_r_intr3___spu1_5___width 1
1578#define reg_iop_sw_cpu_r_intr3___spu1_5___bit 13
1579#define reg_iop_sw_cpu_r_intr3___spu1_6___lsb 14
1580#define reg_iop_sw_cpu_r_intr3___spu1_6___width 1
1581#define reg_iop_sw_cpu_r_intr3___spu1_6___bit 14
1582#define reg_iop_sw_cpu_r_intr3___spu1_7___lsb 15
1583#define reg_iop_sw_cpu_r_intr3___spu1_7___width 1
1584#define reg_iop_sw_cpu_r_intr3___spu1_7___bit 15
1585#define reg_iop_sw_cpu_r_intr3___dmc_in1___lsb 16
1586#define reg_iop_sw_cpu_r_intr3___dmc_in1___width 1
1587#define reg_iop_sw_cpu_r_intr3___dmc_in1___bit 16
1588#define reg_iop_sw_cpu_r_intr3___dmc_out1___lsb 17
1589#define reg_iop_sw_cpu_r_intr3___dmc_out1___width 1
1590#define reg_iop_sw_cpu_r_intr3___dmc_out1___bit 17
1591#define reg_iop_sw_cpu_r_intr3___fifo_in1___lsb 18
1592#define reg_iop_sw_cpu_r_intr3___fifo_in1___width 1
1593#define reg_iop_sw_cpu_r_intr3___fifo_in1___bit 18
1594#define reg_iop_sw_cpu_r_intr3___fifo_out1___lsb 19
1595#define reg_iop_sw_cpu_r_intr3___fifo_out1___width 1
1596#define reg_iop_sw_cpu_r_intr3___fifo_out1___bit 19
1597#define reg_iop_sw_cpu_r_intr3___fifo_in1_extra___lsb 20
1598#define reg_iop_sw_cpu_r_intr3___fifo_in1_extra___width 1
1599#define reg_iop_sw_cpu_r_intr3___fifo_in1_extra___bit 20
1600#define reg_iop_sw_cpu_r_intr3___fifo_out1_extra___lsb 21
1601#define reg_iop_sw_cpu_r_intr3___fifo_out1_extra___width 1
1602#define reg_iop_sw_cpu_r_intr3___fifo_out1_extra___bit 21
1603#define reg_iop_sw_cpu_r_intr3___trigger_grp0___lsb 22
1604#define reg_iop_sw_cpu_r_intr3___trigger_grp0___width 1
1605#define reg_iop_sw_cpu_r_intr3___trigger_grp0___bit 22
1606#define reg_iop_sw_cpu_r_intr3___trigger_grp1___lsb 23
1607#define reg_iop_sw_cpu_r_intr3___trigger_grp1___width 1
1608#define reg_iop_sw_cpu_r_intr3___trigger_grp1___bit 23
1609#define reg_iop_sw_cpu_r_intr3___trigger_grp2___lsb 24
1610#define reg_iop_sw_cpu_r_intr3___trigger_grp2___width 1
1611#define reg_iop_sw_cpu_r_intr3___trigger_grp2___bit 24
1612#define reg_iop_sw_cpu_r_intr3___trigger_grp3___lsb 25
1613#define reg_iop_sw_cpu_r_intr3___trigger_grp3___width 1
1614#define reg_iop_sw_cpu_r_intr3___trigger_grp3___bit 25
1615#define reg_iop_sw_cpu_r_intr3___trigger_grp4___lsb 26
1616#define reg_iop_sw_cpu_r_intr3___trigger_grp4___width 1
1617#define reg_iop_sw_cpu_r_intr3___trigger_grp4___bit 26
1618#define reg_iop_sw_cpu_r_intr3___trigger_grp5___lsb 27
1619#define reg_iop_sw_cpu_r_intr3___trigger_grp5___width 1
1620#define reg_iop_sw_cpu_r_intr3___trigger_grp5___bit 27
1621#define reg_iop_sw_cpu_r_intr3___trigger_grp6___lsb 28
1622#define reg_iop_sw_cpu_r_intr3___trigger_grp6___width 1
1623#define reg_iop_sw_cpu_r_intr3___trigger_grp6___bit 28
1624#define reg_iop_sw_cpu_r_intr3___trigger_grp7___lsb 29
1625#define reg_iop_sw_cpu_r_intr3___trigger_grp7___width 1
1626#define reg_iop_sw_cpu_r_intr3___trigger_grp7___bit 29
1627#define reg_iop_sw_cpu_r_intr3___timer_grp2___lsb 30
1628#define reg_iop_sw_cpu_r_intr3___timer_grp2___width 1
1629#define reg_iop_sw_cpu_r_intr3___timer_grp2___bit 30
1630#define reg_iop_sw_cpu_r_intr3___timer_grp3___lsb 31
1631#define reg_iop_sw_cpu_r_intr3___timer_grp3___width 1
1632#define reg_iop_sw_cpu_r_intr3___timer_grp3___bit 31
1633#define reg_iop_sw_cpu_r_intr3_offset 140
1634
1635/* Register r_masked_intr3, scope iop_sw_cpu, type r */
1636#define reg_iop_sw_cpu_r_masked_intr3___mpu_16___lsb 0
1637#define reg_iop_sw_cpu_r_masked_intr3___mpu_16___width 1
1638#define reg_iop_sw_cpu_r_masked_intr3___mpu_16___bit 0
1639#define reg_iop_sw_cpu_r_masked_intr3___mpu_17___lsb 1
1640#define reg_iop_sw_cpu_r_masked_intr3___mpu_17___width 1
1641#define reg_iop_sw_cpu_r_masked_intr3___mpu_17___bit 1
1642#define reg_iop_sw_cpu_r_masked_intr3___mpu_18___lsb 2
1643#define reg_iop_sw_cpu_r_masked_intr3___mpu_18___width 1
1644#define reg_iop_sw_cpu_r_masked_intr3___mpu_18___bit 2
1645#define reg_iop_sw_cpu_r_masked_intr3___mpu_19___lsb 3
1646#define reg_iop_sw_cpu_r_masked_intr3___mpu_19___width 1
1647#define reg_iop_sw_cpu_r_masked_intr3___mpu_19___bit 3
1648#define reg_iop_sw_cpu_r_masked_intr3___mpu_20___lsb 4
1649#define reg_iop_sw_cpu_r_masked_intr3___mpu_20___width 1
1650#define reg_iop_sw_cpu_r_masked_intr3___mpu_20___bit 4
1651#define reg_iop_sw_cpu_r_masked_intr3___mpu_21___lsb 5
1652#define reg_iop_sw_cpu_r_masked_intr3___mpu_21___width 1
1653#define reg_iop_sw_cpu_r_masked_intr3___mpu_21___bit 5
1654#define reg_iop_sw_cpu_r_masked_intr3___mpu_22___lsb 6
1655#define reg_iop_sw_cpu_r_masked_intr3___mpu_22___width 1
1656#define reg_iop_sw_cpu_r_masked_intr3___mpu_22___bit 6
1657#define reg_iop_sw_cpu_r_masked_intr3___mpu_23___lsb 7
1658#define reg_iop_sw_cpu_r_masked_intr3___mpu_23___width 1
1659#define reg_iop_sw_cpu_r_masked_intr3___mpu_23___bit 7
1660#define reg_iop_sw_cpu_r_masked_intr3___spu1_0___lsb 8
1661#define reg_iop_sw_cpu_r_masked_intr3___spu1_0___width 1
1662#define reg_iop_sw_cpu_r_masked_intr3___spu1_0___bit 8
1663#define reg_iop_sw_cpu_r_masked_intr3___spu1_1___lsb 9
1664#define reg_iop_sw_cpu_r_masked_intr3___spu1_1___width 1
1665#define reg_iop_sw_cpu_r_masked_intr3___spu1_1___bit 9
1666#define reg_iop_sw_cpu_r_masked_intr3___spu1_2___lsb 10
1667#define reg_iop_sw_cpu_r_masked_intr3___spu1_2___width 1
1668#define reg_iop_sw_cpu_r_masked_intr3___spu1_2___bit 10
1669#define reg_iop_sw_cpu_r_masked_intr3___spu1_3___lsb 11
1670#define reg_iop_sw_cpu_r_masked_intr3___spu1_3___width 1
1671#define reg_iop_sw_cpu_r_masked_intr3___spu1_3___bit 11
1672#define reg_iop_sw_cpu_r_masked_intr3___spu1_4___lsb 12
1673#define reg_iop_sw_cpu_r_masked_intr3___spu1_4___width 1
1674#define reg_iop_sw_cpu_r_masked_intr3___spu1_4___bit 12
1675#define reg_iop_sw_cpu_r_masked_intr3___spu1_5___lsb 13
1676#define reg_iop_sw_cpu_r_masked_intr3___spu1_5___width 1
1677#define reg_iop_sw_cpu_r_masked_intr3___spu1_5___bit 13
1678#define reg_iop_sw_cpu_r_masked_intr3___spu1_6___lsb 14
1679#define reg_iop_sw_cpu_r_masked_intr3___spu1_6___width 1
1680#define reg_iop_sw_cpu_r_masked_intr3___spu1_6___bit 14
1681#define reg_iop_sw_cpu_r_masked_intr3___spu1_7___lsb 15
1682#define reg_iop_sw_cpu_r_masked_intr3___spu1_7___width 1
1683#define reg_iop_sw_cpu_r_masked_intr3___spu1_7___bit 15
1684#define reg_iop_sw_cpu_r_masked_intr3___dmc_in1___lsb 16
1685#define reg_iop_sw_cpu_r_masked_intr3___dmc_in1___width 1
1686#define reg_iop_sw_cpu_r_masked_intr3___dmc_in1___bit 16
1687#define reg_iop_sw_cpu_r_masked_intr3___dmc_out1___lsb 17
1688#define reg_iop_sw_cpu_r_masked_intr3___dmc_out1___width 1
1689#define reg_iop_sw_cpu_r_masked_intr3___dmc_out1___bit 17
1690#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1___lsb 18
1691#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1___width 1
1692#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1___bit 18
1693#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1___lsb 19
1694#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1___width 1
1695#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1___bit 19
1696#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1_extra___lsb 20
1697#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1_extra___width 1
1698#define reg_iop_sw_cpu_r_masked_intr3___fifo_in1_extra___bit 20
1699#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1_extra___lsb 21
1700#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1_extra___width 1
1701#define reg_iop_sw_cpu_r_masked_intr3___fifo_out1_extra___bit 21
1702#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp0___lsb 22
1703#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp0___width 1
1704#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp0___bit 22
1705#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp1___lsb 23
1706#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp1___width 1
1707#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp1___bit 23
1708#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp2___lsb 24
1709#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp2___width 1
1710#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp2___bit 24
1711#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp3___lsb 25
1712#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp3___width 1
1713#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp3___bit 25
1714#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp4___lsb 26
1715#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp4___width 1
1716#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp4___bit 26
1717#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp5___lsb 27
1718#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp5___width 1
1719#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp5___bit 27
1720#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp6___lsb 28
1721#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp6___width 1
1722#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp6___bit 28
1723#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp7___lsb 29
1724#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp7___width 1
1725#define reg_iop_sw_cpu_r_masked_intr3___trigger_grp7___bit 29
1726#define reg_iop_sw_cpu_r_masked_intr3___timer_grp2___lsb 30
1727#define reg_iop_sw_cpu_r_masked_intr3___timer_grp2___width 1
1728#define reg_iop_sw_cpu_r_masked_intr3___timer_grp2___bit 30
1729#define reg_iop_sw_cpu_r_masked_intr3___timer_grp3___lsb 31
1730#define reg_iop_sw_cpu_r_masked_intr3___timer_grp3___width 1
1731#define reg_iop_sw_cpu_r_masked_intr3___timer_grp3___bit 31
1732#define reg_iop_sw_cpu_r_masked_intr3_offset 144
1733
1734
1735/* Constants */
1736#define regk_iop_sw_cpu_copy 0x00000000
1737#define regk_iop_sw_cpu_no 0x00000000
1738#define regk_iop_sw_cpu_rd 0x00000002
1739#define regk_iop_sw_cpu_reg_copy 0x00000001
1740#define regk_iop_sw_cpu_rw_bus0_clr_mask_default 0x00000000
1741#define regk_iop_sw_cpu_rw_bus0_oe_clr_mask_default 0x00000000
1742#define regk_iop_sw_cpu_rw_bus0_oe_set_mask_default 0x00000000
1743#define regk_iop_sw_cpu_rw_bus0_set_mask_default 0x00000000
1744#define regk_iop_sw_cpu_rw_bus1_clr_mask_default 0x00000000
1745#define regk_iop_sw_cpu_rw_bus1_oe_clr_mask_default 0x00000000
1746#define regk_iop_sw_cpu_rw_bus1_oe_set_mask_default 0x00000000
1747#define regk_iop_sw_cpu_rw_bus1_set_mask_default 0x00000000
1748#define regk_iop_sw_cpu_rw_gio_clr_mask_default 0x00000000
1749#define regk_iop_sw_cpu_rw_gio_oe_clr_mask_default 0x00000000
1750#define regk_iop_sw_cpu_rw_gio_oe_set_mask_default 0x00000000
1751#define regk_iop_sw_cpu_rw_gio_set_mask_default 0x00000000
1752#define regk_iop_sw_cpu_rw_intr0_mask_default 0x00000000
1753#define regk_iop_sw_cpu_rw_intr1_mask_default 0x00000000
1754#define regk_iop_sw_cpu_rw_intr2_mask_default 0x00000000
1755#define regk_iop_sw_cpu_rw_intr3_mask_default 0x00000000
1756#define regk_iop_sw_cpu_wr 0x00000003
1757#define regk_iop_sw_cpu_yes 0x00000001
1758#endif /* __iop_sw_cpu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_mpu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_mpu_defs_asm.h
new file mode 100644
index 000000000000..ee7dc0435b59
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_mpu_defs_asm.h
@@ -0,0 +1,1776 @@
1#ifndef __iop_sw_mpu_defs_asm_h
2#define __iop_sw_mpu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_mpu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sw_mpu_defs_asm.h ../../inst/io_proc/rtl/guinness/iop_sw_mpu.r
11 * id: $Id: iop_sw_mpu_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_sw_cfg_owner, scope iop_sw_mpu, type rw */
57#define reg_iop_sw_mpu_rw_sw_cfg_owner___cfg___lsb 0
58#define reg_iop_sw_mpu_rw_sw_cfg_owner___cfg___width 2
59#define reg_iop_sw_mpu_rw_sw_cfg_owner_offset 0
60
61/* Register rw_mc_ctrl, scope iop_sw_mpu, type rw */
62#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___lsb 0
63#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___width 1
64#define reg_iop_sw_mpu_rw_mc_ctrl___keep_owner___bit 0
65#define reg_iop_sw_mpu_rw_mc_ctrl___cmd___lsb 1
66#define reg_iop_sw_mpu_rw_mc_ctrl___cmd___width 2
67#define reg_iop_sw_mpu_rw_mc_ctrl___size___lsb 3
68#define reg_iop_sw_mpu_rw_mc_ctrl___size___width 3
69#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu0_mem___lsb 6
70#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu0_mem___width 1
71#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu0_mem___bit 6
72#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu1_mem___lsb 7
73#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu1_mem___width 1
74#define reg_iop_sw_mpu_rw_mc_ctrl___wr_spu1_mem___bit 7
75#define reg_iop_sw_mpu_rw_mc_ctrl_offset 4
76
77/* Register rw_mc_data, scope iop_sw_mpu, type rw */
78#define reg_iop_sw_mpu_rw_mc_data___val___lsb 0
79#define reg_iop_sw_mpu_rw_mc_data___val___width 32
80#define reg_iop_sw_mpu_rw_mc_data_offset 8
81
82/* Register rw_mc_addr, scope iop_sw_mpu, type rw */
83#define reg_iop_sw_mpu_rw_mc_addr_offset 12
84
85/* Register rs_mc_data, scope iop_sw_mpu, type rs */
86#define reg_iop_sw_mpu_rs_mc_data_offset 16
87
88/* Register r_mc_data, scope iop_sw_mpu, type r */
89#define reg_iop_sw_mpu_r_mc_data_offset 20
90
91/* Register r_mc_stat, scope iop_sw_mpu, type r */
92#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___lsb 0
93#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___width 1
94#define reg_iop_sw_mpu_r_mc_stat___busy_cpu___bit 0
95#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___lsb 1
96#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___width 1
97#define reg_iop_sw_mpu_r_mc_stat___busy_mpu___bit 1
98#define reg_iop_sw_mpu_r_mc_stat___busy_spu0___lsb 2
99#define reg_iop_sw_mpu_r_mc_stat___busy_spu0___width 1
100#define reg_iop_sw_mpu_r_mc_stat___busy_spu0___bit 2
101#define reg_iop_sw_mpu_r_mc_stat___busy_spu1___lsb 3
102#define reg_iop_sw_mpu_r_mc_stat___busy_spu1___width 1
103#define reg_iop_sw_mpu_r_mc_stat___busy_spu1___bit 3
104#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___lsb 4
105#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___width 1
106#define reg_iop_sw_mpu_r_mc_stat___owned_by_cpu___bit 4
107#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___lsb 5
108#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___width 1
109#define reg_iop_sw_mpu_r_mc_stat___owned_by_mpu___bit 5
110#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu0___lsb 6
111#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu0___width 1
112#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu0___bit 6
113#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu1___lsb 7
114#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu1___width 1
115#define reg_iop_sw_mpu_r_mc_stat___owned_by_spu1___bit 7
116#define reg_iop_sw_mpu_r_mc_stat_offset 24
117
118/* Register rw_bus0_clr_mask, scope iop_sw_mpu, type rw */
119#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte0___lsb 0
120#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte0___width 8
121#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte1___lsb 8
122#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte1___width 8
123#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte2___lsb 16
124#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte2___width 8
125#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte3___lsb 24
126#define reg_iop_sw_mpu_rw_bus0_clr_mask___byte3___width 8
127#define reg_iop_sw_mpu_rw_bus0_clr_mask_offset 28
128
129/* Register rw_bus0_set_mask, scope iop_sw_mpu, type rw */
130#define reg_iop_sw_mpu_rw_bus0_set_mask___byte0___lsb 0
131#define reg_iop_sw_mpu_rw_bus0_set_mask___byte0___width 8
132#define reg_iop_sw_mpu_rw_bus0_set_mask___byte1___lsb 8
133#define reg_iop_sw_mpu_rw_bus0_set_mask___byte1___width 8
134#define reg_iop_sw_mpu_rw_bus0_set_mask___byte2___lsb 16
135#define reg_iop_sw_mpu_rw_bus0_set_mask___byte2___width 8
136#define reg_iop_sw_mpu_rw_bus0_set_mask___byte3___lsb 24
137#define reg_iop_sw_mpu_rw_bus0_set_mask___byte3___width 8
138#define reg_iop_sw_mpu_rw_bus0_set_mask_offset 32
139
140/* Register rw_bus0_oe_clr_mask, scope iop_sw_mpu, type rw */
141#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte0___lsb 0
142#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte0___width 1
143#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte0___bit 0
144#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte1___lsb 1
145#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte1___width 1
146#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte1___bit 1
147#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte2___lsb 2
148#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte2___width 1
149#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte2___bit 2
150#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte3___lsb 3
151#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte3___width 1
152#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask___byte3___bit 3
153#define reg_iop_sw_mpu_rw_bus0_oe_clr_mask_offset 36
154
155/* Register rw_bus0_oe_set_mask, scope iop_sw_mpu, type rw */
156#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte0___lsb 0
157#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte0___width 1
158#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte0___bit 0
159#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte1___lsb 1
160#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte1___width 1
161#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte1___bit 1
162#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte2___lsb 2
163#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte2___width 1
164#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte2___bit 2
165#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte3___lsb 3
166#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte3___width 1
167#define reg_iop_sw_mpu_rw_bus0_oe_set_mask___byte3___bit 3
168#define reg_iop_sw_mpu_rw_bus0_oe_set_mask_offset 40
169
170/* Register r_bus0_in, scope iop_sw_mpu, type r */
171#define reg_iop_sw_mpu_r_bus0_in_offset 44
172
173/* Register rw_bus1_clr_mask, scope iop_sw_mpu, type rw */
174#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte0___lsb 0
175#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte0___width 8
176#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte1___lsb 8
177#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte1___width 8
178#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte2___lsb 16
179#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte2___width 8
180#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte3___lsb 24
181#define reg_iop_sw_mpu_rw_bus1_clr_mask___byte3___width 8
182#define reg_iop_sw_mpu_rw_bus1_clr_mask_offset 48
183
184/* Register rw_bus1_set_mask, scope iop_sw_mpu, type rw */
185#define reg_iop_sw_mpu_rw_bus1_set_mask___byte0___lsb 0
186#define reg_iop_sw_mpu_rw_bus1_set_mask___byte0___width 8
187#define reg_iop_sw_mpu_rw_bus1_set_mask___byte1___lsb 8
188#define reg_iop_sw_mpu_rw_bus1_set_mask___byte1___width 8
189#define reg_iop_sw_mpu_rw_bus1_set_mask___byte2___lsb 16
190#define reg_iop_sw_mpu_rw_bus1_set_mask___byte2___width 8
191#define reg_iop_sw_mpu_rw_bus1_set_mask___byte3___lsb 24
192#define reg_iop_sw_mpu_rw_bus1_set_mask___byte3___width 8
193#define reg_iop_sw_mpu_rw_bus1_set_mask_offset 52
194
195/* Register rw_bus1_oe_clr_mask, scope iop_sw_mpu, type rw */
196#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte0___lsb 0
197#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte0___width 1
198#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte0___bit 0
199#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte1___lsb 1
200#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte1___width 1
201#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte1___bit 1
202#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte2___lsb 2
203#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte2___width 1
204#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte2___bit 2
205#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte3___lsb 3
206#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte3___width 1
207#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask___byte3___bit 3
208#define reg_iop_sw_mpu_rw_bus1_oe_clr_mask_offset 56
209
210/* Register rw_bus1_oe_set_mask, scope iop_sw_mpu, type rw */
211#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte0___lsb 0
212#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte0___width 1
213#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte0___bit 0
214#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte1___lsb 1
215#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte1___width 1
216#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte1___bit 1
217#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte2___lsb 2
218#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte2___width 1
219#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte2___bit 2
220#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte3___lsb 3
221#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte3___width 1
222#define reg_iop_sw_mpu_rw_bus1_oe_set_mask___byte3___bit 3
223#define reg_iop_sw_mpu_rw_bus1_oe_set_mask_offset 60
224
225/* Register r_bus1_in, scope iop_sw_mpu, type r */
226#define reg_iop_sw_mpu_r_bus1_in_offset 64
227
228/* Register rw_gio_clr_mask, scope iop_sw_mpu, type rw */
229#define reg_iop_sw_mpu_rw_gio_clr_mask___val___lsb 0
230#define reg_iop_sw_mpu_rw_gio_clr_mask___val___width 32
231#define reg_iop_sw_mpu_rw_gio_clr_mask_offset 68
232
233/* Register rw_gio_set_mask, scope iop_sw_mpu, type rw */
234#define reg_iop_sw_mpu_rw_gio_set_mask___val___lsb 0
235#define reg_iop_sw_mpu_rw_gio_set_mask___val___width 32
236#define reg_iop_sw_mpu_rw_gio_set_mask_offset 72
237
238/* Register rw_gio_oe_clr_mask, scope iop_sw_mpu, type rw */
239#define reg_iop_sw_mpu_rw_gio_oe_clr_mask___val___lsb 0
240#define reg_iop_sw_mpu_rw_gio_oe_clr_mask___val___width 32
241#define reg_iop_sw_mpu_rw_gio_oe_clr_mask_offset 76
242
243/* Register rw_gio_oe_set_mask, scope iop_sw_mpu, type rw */
244#define reg_iop_sw_mpu_rw_gio_oe_set_mask___val___lsb 0
245#define reg_iop_sw_mpu_rw_gio_oe_set_mask___val___width 32
246#define reg_iop_sw_mpu_rw_gio_oe_set_mask_offset 80
247
248/* Register r_gio_in, scope iop_sw_mpu, type r */
249#define reg_iop_sw_mpu_r_gio_in_offset 84
250
251/* Register rw_cpu_intr, scope iop_sw_mpu, type rw */
252#define reg_iop_sw_mpu_rw_cpu_intr___intr0___lsb 0
253#define reg_iop_sw_mpu_rw_cpu_intr___intr0___width 1
254#define reg_iop_sw_mpu_rw_cpu_intr___intr0___bit 0
255#define reg_iop_sw_mpu_rw_cpu_intr___intr1___lsb 1
256#define reg_iop_sw_mpu_rw_cpu_intr___intr1___width 1
257#define reg_iop_sw_mpu_rw_cpu_intr___intr1___bit 1
258#define reg_iop_sw_mpu_rw_cpu_intr___intr2___lsb 2
259#define reg_iop_sw_mpu_rw_cpu_intr___intr2___width 1
260#define reg_iop_sw_mpu_rw_cpu_intr___intr2___bit 2
261#define reg_iop_sw_mpu_rw_cpu_intr___intr3___lsb 3
262#define reg_iop_sw_mpu_rw_cpu_intr___intr3___width 1
263#define reg_iop_sw_mpu_rw_cpu_intr___intr3___bit 3
264#define reg_iop_sw_mpu_rw_cpu_intr___intr4___lsb 4
265#define reg_iop_sw_mpu_rw_cpu_intr___intr4___width 1
266#define reg_iop_sw_mpu_rw_cpu_intr___intr4___bit 4
267#define reg_iop_sw_mpu_rw_cpu_intr___intr5___lsb 5
268#define reg_iop_sw_mpu_rw_cpu_intr___intr5___width 1
269#define reg_iop_sw_mpu_rw_cpu_intr___intr5___bit 5
270#define reg_iop_sw_mpu_rw_cpu_intr___intr6___lsb 6
271#define reg_iop_sw_mpu_rw_cpu_intr___intr6___width 1
272#define reg_iop_sw_mpu_rw_cpu_intr___intr6___bit 6
273#define reg_iop_sw_mpu_rw_cpu_intr___intr7___lsb 7
274#define reg_iop_sw_mpu_rw_cpu_intr___intr7___width 1
275#define reg_iop_sw_mpu_rw_cpu_intr___intr7___bit 7
276#define reg_iop_sw_mpu_rw_cpu_intr___intr8___lsb 8
277#define reg_iop_sw_mpu_rw_cpu_intr___intr8___width 1
278#define reg_iop_sw_mpu_rw_cpu_intr___intr8___bit 8
279#define reg_iop_sw_mpu_rw_cpu_intr___intr9___lsb 9
280#define reg_iop_sw_mpu_rw_cpu_intr___intr9___width 1
281#define reg_iop_sw_mpu_rw_cpu_intr___intr9___bit 9
282#define reg_iop_sw_mpu_rw_cpu_intr___intr10___lsb 10
283#define reg_iop_sw_mpu_rw_cpu_intr___intr10___width 1
284#define reg_iop_sw_mpu_rw_cpu_intr___intr10___bit 10
285#define reg_iop_sw_mpu_rw_cpu_intr___intr11___lsb 11
286#define reg_iop_sw_mpu_rw_cpu_intr___intr11___width 1
287#define reg_iop_sw_mpu_rw_cpu_intr___intr11___bit 11
288#define reg_iop_sw_mpu_rw_cpu_intr___intr12___lsb 12
289#define reg_iop_sw_mpu_rw_cpu_intr___intr12___width 1
290#define reg_iop_sw_mpu_rw_cpu_intr___intr12___bit 12
291#define reg_iop_sw_mpu_rw_cpu_intr___intr13___lsb 13
292#define reg_iop_sw_mpu_rw_cpu_intr___intr13___width 1
293#define reg_iop_sw_mpu_rw_cpu_intr___intr13___bit 13
294#define reg_iop_sw_mpu_rw_cpu_intr___intr14___lsb 14
295#define reg_iop_sw_mpu_rw_cpu_intr___intr14___width 1
296#define reg_iop_sw_mpu_rw_cpu_intr___intr14___bit 14
297#define reg_iop_sw_mpu_rw_cpu_intr___intr15___lsb 15
298#define reg_iop_sw_mpu_rw_cpu_intr___intr15___width 1
299#define reg_iop_sw_mpu_rw_cpu_intr___intr15___bit 15
300#define reg_iop_sw_mpu_rw_cpu_intr___intr16___lsb 16
301#define reg_iop_sw_mpu_rw_cpu_intr___intr16___width 1
302#define reg_iop_sw_mpu_rw_cpu_intr___intr16___bit 16
303#define reg_iop_sw_mpu_rw_cpu_intr___intr17___lsb 17
304#define reg_iop_sw_mpu_rw_cpu_intr___intr17___width 1
305#define reg_iop_sw_mpu_rw_cpu_intr___intr17___bit 17
306#define reg_iop_sw_mpu_rw_cpu_intr___intr18___lsb 18
307#define reg_iop_sw_mpu_rw_cpu_intr___intr18___width 1
308#define reg_iop_sw_mpu_rw_cpu_intr___intr18___bit 18
309#define reg_iop_sw_mpu_rw_cpu_intr___intr19___lsb 19
310#define reg_iop_sw_mpu_rw_cpu_intr___intr19___width 1
311#define reg_iop_sw_mpu_rw_cpu_intr___intr19___bit 19
312#define reg_iop_sw_mpu_rw_cpu_intr___intr20___lsb 20
313#define reg_iop_sw_mpu_rw_cpu_intr___intr20___width 1
314#define reg_iop_sw_mpu_rw_cpu_intr___intr20___bit 20
315#define reg_iop_sw_mpu_rw_cpu_intr___intr21___lsb 21
316#define reg_iop_sw_mpu_rw_cpu_intr___intr21___width 1
317#define reg_iop_sw_mpu_rw_cpu_intr___intr21___bit 21
318#define reg_iop_sw_mpu_rw_cpu_intr___intr22___lsb 22
319#define reg_iop_sw_mpu_rw_cpu_intr___intr22___width 1
320#define reg_iop_sw_mpu_rw_cpu_intr___intr22___bit 22
321#define reg_iop_sw_mpu_rw_cpu_intr___intr23___lsb 23
322#define reg_iop_sw_mpu_rw_cpu_intr___intr23___width 1
323#define reg_iop_sw_mpu_rw_cpu_intr___intr23___bit 23
324#define reg_iop_sw_mpu_rw_cpu_intr___intr24___lsb 24
325#define reg_iop_sw_mpu_rw_cpu_intr___intr24___width 1
326#define reg_iop_sw_mpu_rw_cpu_intr___intr24___bit 24
327#define reg_iop_sw_mpu_rw_cpu_intr___intr25___lsb 25
328#define reg_iop_sw_mpu_rw_cpu_intr___intr25___width 1
329#define reg_iop_sw_mpu_rw_cpu_intr___intr25___bit 25
330#define reg_iop_sw_mpu_rw_cpu_intr___intr26___lsb 26
331#define reg_iop_sw_mpu_rw_cpu_intr___intr26___width 1
332#define reg_iop_sw_mpu_rw_cpu_intr___intr26___bit 26
333#define reg_iop_sw_mpu_rw_cpu_intr___intr27___lsb 27
334#define reg_iop_sw_mpu_rw_cpu_intr___intr27___width 1
335#define reg_iop_sw_mpu_rw_cpu_intr___intr27___bit 27
336#define reg_iop_sw_mpu_rw_cpu_intr___intr28___lsb 28
337#define reg_iop_sw_mpu_rw_cpu_intr___intr28___width 1
338#define reg_iop_sw_mpu_rw_cpu_intr___intr28___bit 28
339#define reg_iop_sw_mpu_rw_cpu_intr___intr29___lsb 29
340#define reg_iop_sw_mpu_rw_cpu_intr___intr29___width 1
341#define reg_iop_sw_mpu_rw_cpu_intr___intr29___bit 29
342#define reg_iop_sw_mpu_rw_cpu_intr___intr30___lsb 30
343#define reg_iop_sw_mpu_rw_cpu_intr___intr30___width 1
344#define reg_iop_sw_mpu_rw_cpu_intr___intr30___bit 30
345#define reg_iop_sw_mpu_rw_cpu_intr___intr31___lsb 31
346#define reg_iop_sw_mpu_rw_cpu_intr___intr31___width 1
347#define reg_iop_sw_mpu_rw_cpu_intr___intr31___bit 31
348#define reg_iop_sw_mpu_rw_cpu_intr_offset 88
349
350/* Register r_cpu_intr, scope iop_sw_mpu, type r */
351#define reg_iop_sw_mpu_r_cpu_intr___intr0___lsb 0
352#define reg_iop_sw_mpu_r_cpu_intr___intr0___width 1
353#define reg_iop_sw_mpu_r_cpu_intr___intr0___bit 0
354#define reg_iop_sw_mpu_r_cpu_intr___intr1___lsb 1
355#define reg_iop_sw_mpu_r_cpu_intr___intr1___width 1
356#define reg_iop_sw_mpu_r_cpu_intr___intr1___bit 1
357#define reg_iop_sw_mpu_r_cpu_intr___intr2___lsb 2
358#define reg_iop_sw_mpu_r_cpu_intr___intr2___width 1
359#define reg_iop_sw_mpu_r_cpu_intr___intr2___bit 2
360#define reg_iop_sw_mpu_r_cpu_intr___intr3___lsb 3
361#define reg_iop_sw_mpu_r_cpu_intr___intr3___width 1
362#define reg_iop_sw_mpu_r_cpu_intr___intr3___bit 3
363#define reg_iop_sw_mpu_r_cpu_intr___intr4___lsb 4
364#define reg_iop_sw_mpu_r_cpu_intr___intr4___width 1
365#define reg_iop_sw_mpu_r_cpu_intr___intr4___bit 4
366#define reg_iop_sw_mpu_r_cpu_intr___intr5___lsb 5
367#define reg_iop_sw_mpu_r_cpu_intr___intr5___width 1
368#define reg_iop_sw_mpu_r_cpu_intr___intr5___bit 5
369#define reg_iop_sw_mpu_r_cpu_intr___intr6___lsb 6
370#define reg_iop_sw_mpu_r_cpu_intr___intr6___width 1
371#define reg_iop_sw_mpu_r_cpu_intr___intr6___bit 6
372#define reg_iop_sw_mpu_r_cpu_intr___intr7___lsb 7
373#define reg_iop_sw_mpu_r_cpu_intr___intr7___width 1
374#define reg_iop_sw_mpu_r_cpu_intr___intr7___bit 7
375#define reg_iop_sw_mpu_r_cpu_intr___intr8___lsb 8
376#define reg_iop_sw_mpu_r_cpu_intr___intr8___width 1
377#define reg_iop_sw_mpu_r_cpu_intr___intr8___bit 8
378#define reg_iop_sw_mpu_r_cpu_intr___intr9___lsb 9
379#define reg_iop_sw_mpu_r_cpu_intr___intr9___width 1
380#define reg_iop_sw_mpu_r_cpu_intr___intr9___bit 9
381#define reg_iop_sw_mpu_r_cpu_intr___intr10___lsb 10
382#define reg_iop_sw_mpu_r_cpu_intr___intr10___width 1
383#define reg_iop_sw_mpu_r_cpu_intr___intr10___bit 10
384#define reg_iop_sw_mpu_r_cpu_intr___intr11___lsb 11
385#define reg_iop_sw_mpu_r_cpu_intr___intr11___width 1
386#define reg_iop_sw_mpu_r_cpu_intr___intr11___bit 11
387#define reg_iop_sw_mpu_r_cpu_intr___intr12___lsb 12
388#define reg_iop_sw_mpu_r_cpu_intr___intr12___width 1
389#define reg_iop_sw_mpu_r_cpu_intr___intr12___bit 12
390#define reg_iop_sw_mpu_r_cpu_intr___intr13___lsb 13
391#define reg_iop_sw_mpu_r_cpu_intr___intr13___width 1
392#define reg_iop_sw_mpu_r_cpu_intr___intr13___bit 13
393#define reg_iop_sw_mpu_r_cpu_intr___intr14___lsb 14
394#define reg_iop_sw_mpu_r_cpu_intr___intr14___width 1
395#define reg_iop_sw_mpu_r_cpu_intr___intr14___bit 14
396#define reg_iop_sw_mpu_r_cpu_intr___intr15___lsb 15
397#define reg_iop_sw_mpu_r_cpu_intr___intr15___width 1
398#define reg_iop_sw_mpu_r_cpu_intr___intr15___bit 15
399#define reg_iop_sw_mpu_r_cpu_intr___intr16___lsb 16
400#define reg_iop_sw_mpu_r_cpu_intr___intr16___width 1
401#define reg_iop_sw_mpu_r_cpu_intr___intr16___bit 16
402#define reg_iop_sw_mpu_r_cpu_intr___intr17___lsb 17
403#define reg_iop_sw_mpu_r_cpu_intr___intr17___width 1
404#define reg_iop_sw_mpu_r_cpu_intr___intr17___bit 17
405#define reg_iop_sw_mpu_r_cpu_intr___intr18___lsb 18
406#define reg_iop_sw_mpu_r_cpu_intr___intr18___width 1
407#define reg_iop_sw_mpu_r_cpu_intr___intr18___bit 18
408#define reg_iop_sw_mpu_r_cpu_intr___intr19___lsb 19
409#define reg_iop_sw_mpu_r_cpu_intr___intr19___width 1
410#define reg_iop_sw_mpu_r_cpu_intr___intr19___bit 19
411#define reg_iop_sw_mpu_r_cpu_intr___intr20___lsb 20
412#define reg_iop_sw_mpu_r_cpu_intr___intr20___width 1
413#define reg_iop_sw_mpu_r_cpu_intr___intr20___bit 20
414#define reg_iop_sw_mpu_r_cpu_intr___intr21___lsb 21
415#define reg_iop_sw_mpu_r_cpu_intr___intr21___width 1
416#define reg_iop_sw_mpu_r_cpu_intr___intr21___bit 21
417#define reg_iop_sw_mpu_r_cpu_intr___intr22___lsb 22
418#define reg_iop_sw_mpu_r_cpu_intr___intr22___width 1
419#define reg_iop_sw_mpu_r_cpu_intr___intr22___bit 22
420#define reg_iop_sw_mpu_r_cpu_intr___intr23___lsb 23
421#define reg_iop_sw_mpu_r_cpu_intr___intr23___width 1
422#define reg_iop_sw_mpu_r_cpu_intr___intr23___bit 23
423#define reg_iop_sw_mpu_r_cpu_intr___intr24___lsb 24
424#define reg_iop_sw_mpu_r_cpu_intr___intr24___width 1
425#define reg_iop_sw_mpu_r_cpu_intr___intr24___bit 24
426#define reg_iop_sw_mpu_r_cpu_intr___intr25___lsb 25
427#define reg_iop_sw_mpu_r_cpu_intr___intr25___width 1
428#define reg_iop_sw_mpu_r_cpu_intr___intr25___bit 25
429#define reg_iop_sw_mpu_r_cpu_intr___intr26___lsb 26
430#define reg_iop_sw_mpu_r_cpu_intr___intr26___width 1
431#define reg_iop_sw_mpu_r_cpu_intr___intr26___bit 26
432#define reg_iop_sw_mpu_r_cpu_intr___intr27___lsb 27
433#define reg_iop_sw_mpu_r_cpu_intr___intr27___width 1
434#define reg_iop_sw_mpu_r_cpu_intr___intr27___bit 27
435#define reg_iop_sw_mpu_r_cpu_intr___intr28___lsb 28
436#define reg_iop_sw_mpu_r_cpu_intr___intr28___width 1
437#define reg_iop_sw_mpu_r_cpu_intr___intr28___bit 28
438#define reg_iop_sw_mpu_r_cpu_intr___intr29___lsb 29
439#define reg_iop_sw_mpu_r_cpu_intr___intr29___width 1
440#define reg_iop_sw_mpu_r_cpu_intr___intr29___bit 29
441#define reg_iop_sw_mpu_r_cpu_intr___intr30___lsb 30
442#define reg_iop_sw_mpu_r_cpu_intr___intr30___width 1
443#define reg_iop_sw_mpu_r_cpu_intr___intr30___bit 30
444#define reg_iop_sw_mpu_r_cpu_intr___intr31___lsb 31
445#define reg_iop_sw_mpu_r_cpu_intr___intr31___width 1
446#define reg_iop_sw_mpu_r_cpu_intr___intr31___bit 31
447#define reg_iop_sw_mpu_r_cpu_intr_offset 92
448
449/* Register rw_intr_grp0_mask, scope iop_sw_mpu, type rw */
450#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr0___lsb 0
451#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr0___width 1
452#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr0___bit 0
453#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr0___lsb 1
454#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr0___width 1
455#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr0___bit 1
456#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___lsb 2
457#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___width 1
458#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp0___bit 2
459#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp4___lsb 3
460#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp4___width 1
461#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp4___bit 3
462#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___lsb 4
463#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___width 1
464#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp0___bit 4
465#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0___lsb 5
466#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0___width 1
467#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0___bit 5
468#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0_extra___lsb 6
469#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0_extra___width 1
470#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out0_extra___bit 6
471#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out0___lsb 7
472#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out0___width 1
473#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out0___bit 7
474#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr1___lsb 8
475#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr1___width 1
476#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr1___bit 8
477#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr1___lsb 9
478#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr1___width 1
479#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr1___bit 9
480#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___lsb 10
481#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___width 1
482#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp1___bit 10
483#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp5___lsb 11
484#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp5___width 1
485#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp5___bit 11
486#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___lsb 12
487#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___width 1
488#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp1___bit 12
489#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0___lsb 13
490#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0___width 1
491#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0___bit 13
492#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0_extra___lsb 14
493#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0_extra___width 1
494#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in0_extra___bit 14
495#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in0___lsb 15
496#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in0___width 1
497#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in0___bit 15
498#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr2___lsb 16
499#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr2___width 1
500#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr2___bit 16
501#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr2___lsb 17
502#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr2___width 1
503#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr2___bit 17
504#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___lsb 18
505#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___width 1
506#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp2___bit 18
507#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp6___lsb 19
508#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp6___width 1
509#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp6___bit 19
510#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp2___lsb 20
511#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp2___width 1
512#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp2___bit 20
513#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1___lsb 21
514#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1___width 1
515#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1___bit 21
516#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1_extra___lsb 22
517#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1_extra___width 1
518#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_out1_extra___bit 22
519#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out1___lsb 23
520#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out1___width 1
521#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_out1___bit 23
522#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr3___lsb 24
523#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr3___width 1
524#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu0_intr3___bit 24
525#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr3___lsb 25
526#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr3___width 1
527#define reg_iop_sw_mpu_rw_intr_grp0_mask___spu1_intr3___bit 25
528#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___lsb 26
529#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___width 1
530#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp3___bit 26
531#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp7___lsb 27
532#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp7___width 1
533#define reg_iop_sw_mpu_rw_intr_grp0_mask___trigger_grp7___bit 27
534#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp3___lsb 28
535#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp3___width 1
536#define reg_iop_sw_mpu_rw_intr_grp0_mask___timer_grp3___bit 28
537#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1___lsb 29
538#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1___width 1
539#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1___bit 29
540#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1_extra___lsb 30
541#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1_extra___width 1
542#define reg_iop_sw_mpu_rw_intr_grp0_mask___fifo_in1_extra___bit 30
543#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in1___lsb 31
544#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in1___width 1
545#define reg_iop_sw_mpu_rw_intr_grp0_mask___dmc_in1___bit 31
546#define reg_iop_sw_mpu_rw_intr_grp0_mask_offset 96
547
548/* Register rw_ack_intr_grp0, scope iop_sw_mpu, type rw */
549#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr0___lsb 0
550#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr0___width 1
551#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr0___bit 0
552#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr0___lsb 1
553#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr0___width 1
554#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr0___bit 1
555#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr1___lsb 8
556#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr1___width 1
557#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr1___bit 8
558#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr1___lsb 9
559#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr1___width 1
560#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr1___bit 9
561#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr2___lsb 16
562#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr2___width 1
563#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr2___bit 16
564#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr2___lsb 17
565#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr2___width 1
566#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr2___bit 17
567#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr3___lsb 24
568#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr3___width 1
569#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu0_intr3___bit 24
570#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr3___lsb 25
571#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr3___width 1
572#define reg_iop_sw_mpu_rw_ack_intr_grp0___spu1_intr3___bit 25
573#define reg_iop_sw_mpu_rw_ack_intr_grp0_offset 100
574
575/* Register r_intr_grp0, scope iop_sw_mpu, type r */
576#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr0___lsb 0
577#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr0___width 1
578#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr0___bit 0
579#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr0___lsb 1
580#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr0___width 1
581#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr0___bit 1
582#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___lsb 2
583#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___width 1
584#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp0___bit 2
585#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp4___lsb 3
586#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp4___width 1
587#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp4___bit 3
588#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___lsb 4
589#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___width 1
590#define reg_iop_sw_mpu_r_intr_grp0___timer_grp0___bit 4
591#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0___lsb 5
592#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0___width 1
593#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0___bit 5
594#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0_extra___lsb 6
595#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0_extra___width 1
596#define reg_iop_sw_mpu_r_intr_grp0___fifo_out0_extra___bit 6
597#define reg_iop_sw_mpu_r_intr_grp0___dmc_out0___lsb 7
598#define reg_iop_sw_mpu_r_intr_grp0___dmc_out0___width 1
599#define reg_iop_sw_mpu_r_intr_grp0___dmc_out0___bit 7
600#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr1___lsb 8
601#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr1___width 1
602#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr1___bit 8
603#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr1___lsb 9
604#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr1___width 1
605#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr1___bit 9
606#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___lsb 10
607#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___width 1
608#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp1___bit 10
609#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp5___lsb 11
610#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp5___width 1
611#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp5___bit 11
612#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___lsb 12
613#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___width 1
614#define reg_iop_sw_mpu_r_intr_grp0___timer_grp1___bit 12
615#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0___lsb 13
616#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0___width 1
617#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0___bit 13
618#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0_extra___lsb 14
619#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0_extra___width 1
620#define reg_iop_sw_mpu_r_intr_grp0___fifo_in0_extra___bit 14
621#define reg_iop_sw_mpu_r_intr_grp0___dmc_in0___lsb 15
622#define reg_iop_sw_mpu_r_intr_grp0___dmc_in0___width 1
623#define reg_iop_sw_mpu_r_intr_grp0___dmc_in0___bit 15
624#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr2___lsb 16
625#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr2___width 1
626#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr2___bit 16
627#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr2___lsb 17
628#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr2___width 1
629#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr2___bit 17
630#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___lsb 18
631#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___width 1
632#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp2___bit 18
633#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp6___lsb 19
634#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp6___width 1
635#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp6___bit 19
636#define reg_iop_sw_mpu_r_intr_grp0___timer_grp2___lsb 20
637#define reg_iop_sw_mpu_r_intr_grp0___timer_grp2___width 1
638#define reg_iop_sw_mpu_r_intr_grp0___timer_grp2___bit 20
639#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1___lsb 21
640#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1___width 1
641#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1___bit 21
642#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1_extra___lsb 22
643#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1_extra___width 1
644#define reg_iop_sw_mpu_r_intr_grp0___fifo_out1_extra___bit 22
645#define reg_iop_sw_mpu_r_intr_grp0___dmc_out1___lsb 23
646#define reg_iop_sw_mpu_r_intr_grp0___dmc_out1___width 1
647#define reg_iop_sw_mpu_r_intr_grp0___dmc_out1___bit 23
648#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr3___lsb 24
649#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr3___width 1
650#define reg_iop_sw_mpu_r_intr_grp0___spu0_intr3___bit 24
651#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr3___lsb 25
652#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr3___width 1
653#define reg_iop_sw_mpu_r_intr_grp0___spu1_intr3___bit 25
654#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___lsb 26
655#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___width 1
656#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp3___bit 26
657#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp7___lsb 27
658#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp7___width 1
659#define reg_iop_sw_mpu_r_intr_grp0___trigger_grp7___bit 27
660#define reg_iop_sw_mpu_r_intr_grp0___timer_grp3___lsb 28
661#define reg_iop_sw_mpu_r_intr_grp0___timer_grp3___width 1
662#define reg_iop_sw_mpu_r_intr_grp0___timer_grp3___bit 28
663#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1___lsb 29
664#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1___width 1
665#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1___bit 29
666#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1_extra___lsb 30
667#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1_extra___width 1
668#define reg_iop_sw_mpu_r_intr_grp0___fifo_in1_extra___bit 30
669#define reg_iop_sw_mpu_r_intr_grp0___dmc_in1___lsb 31
670#define reg_iop_sw_mpu_r_intr_grp0___dmc_in1___width 1
671#define reg_iop_sw_mpu_r_intr_grp0___dmc_in1___bit 31
672#define reg_iop_sw_mpu_r_intr_grp0_offset 104
673
674/* Register r_masked_intr_grp0, scope iop_sw_mpu, type r */
675#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr0___lsb 0
676#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr0___width 1
677#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr0___bit 0
678#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr0___lsb 1
679#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr0___width 1
680#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr0___bit 1
681#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___lsb 2
682#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___width 1
683#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp0___bit 2
684#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp4___lsb 3
685#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp4___width 1
686#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp4___bit 3
687#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___lsb 4
688#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___width 1
689#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp0___bit 4
690#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0___lsb 5
691#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0___width 1
692#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0___bit 5
693#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0_extra___lsb 6
694#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0_extra___width 1
695#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out0_extra___bit 6
696#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out0___lsb 7
697#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out0___width 1
698#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out0___bit 7
699#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr1___lsb 8
700#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr1___width 1
701#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr1___bit 8
702#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr1___lsb 9
703#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr1___width 1
704#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr1___bit 9
705#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___lsb 10
706#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___width 1
707#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp1___bit 10
708#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp5___lsb 11
709#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp5___width 1
710#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp5___bit 11
711#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___lsb 12
712#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___width 1
713#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp1___bit 12
714#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0___lsb 13
715#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0___width 1
716#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0___bit 13
717#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0_extra___lsb 14
718#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0_extra___width 1
719#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in0_extra___bit 14
720#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in0___lsb 15
721#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in0___width 1
722#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in0___bit 15
723#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr2___lsb 16
724#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr2___width 1
725#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr2___bit 16
726#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr2___lsb 17
727#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr2___width 1
728#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr2___bit 17
729#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___lsb 18
730#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___width 1
731#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp2___bit 18
732#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp6___lsb 19
733#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp6___width 1
734#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp6___bit 19
735#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp2___lsb 20
736#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp2___width 1
737#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp2___bit 20
738#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1___lsb 21
739#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1___width 1
740#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1___bit 21
741#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1_extra___lsb 22
742#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1_extra___width 1
743#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_out1_extra___bit 22
744#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out1___lsb 23
745#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out1___width 1
746#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_out1___bit 23
747#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr3___lsb 24
748#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr3___width 1
749#define reg_iop_sw_mpu_r_masked_intr_grp0___spu0_intr3___bit 24
750#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr3___lsb 25
751#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr3___width 1
752#define reg_iop_sw_mpu_r_masked_intr_grp0___spu1_intr3___bit 25
753#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___lsb 26
754#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___width 1
755#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp3___bit 26
756#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp7___lsb 27
757#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp7___width 1
758#define reg_iop_sw_mpu_r_masked_intr_grp0___trigger_grp7___bit 27
759#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp3___lsb 28
760#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp3___width 1
761#define reg_iop_sw_mpu_r_masked_intr_grp0___timer_grp3___bit 28
762#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1___lsb 29
763#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1___width 1
764#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1___bit 29
765#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1_extra___lsb 30
766#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1_extra___width 1
767#define reg_iop_sw_mpu_r_masked_intr_grp0___fifo_in1_extra___bit 30
768#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in1___lsb 31
769#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in1___width 1
770#define reg_iop_sw_mpu_r_masked_intr_grp0___dmc_in1___bit 31
771#define reg_iop_sw_mpu_r_masked_intr_grp0_offset 108
772
773/* Register rw_intr_grp1_mask, scope iop_sw_mpu, type rw */
774#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr4___lsb 0
775#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr4___width 1
776#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr4___bit 0
777#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr4___lsb 1
778#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr4___width 1
779#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr4___bit 1
780#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp0___lsb 2
781#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp0___width 1
782#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp0___bit 2
783#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___lsb 3
784#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___width 1
785#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp5___bit 3
786#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___lsb 4
787#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___width 1
788#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp0___bit 4
789#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0___lsb 5
790#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0___width 1
791#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0___bit 5
792#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0_extra___lsb 6
793#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0_extra___width 1
794#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in0_extra___bit 6
795#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out0___lsb 7
796#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out0___width 1
797#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out0___bit 7
798#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr5___lsb 8
799#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr5___width 1
800#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr5___bit 8
801#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr5___lsb 9
802#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr5___width 1
803#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr5___bit 9
804#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp1___lsb 10
805#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp1___width 1
806#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp1___bit 10
807#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___lsb 11
808#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___width 1
809#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp6___bit 11
810#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___lsb 12
811#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___width 1
812#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp1___bit 12
813#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1___lsb 13
814#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1___width 1
815#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1___bit 13
816#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0_extra___lsb 14
817#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0_extra___width 1
818#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0_extra___bit 14
819#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in0___lsb 15
820#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in0___width 1
821#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in0___bit 15
822#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr6___lsb 16
823#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr6___width 1
824#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr6___bit 16
825#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr6___lsb 17
826#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr6___width 1
827#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr6___bit 17
828#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp2___lsb 18
829#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp2___width 1
830#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp2___bit 18
831#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___lsb 19
832#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___width 1
833#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp7___bit 19
834#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp2___lsb 20
835#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp2___width 1
836#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp2___bit 20
837#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1___lsb 21
838#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1___width 1
839#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1___bit 21
840#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1_extra___lsb 22
841#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1_extra___width 1
842#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_in1_extra___bit 22
843#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out1___lsb 23
844#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out1___width 1
845#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_out1___bit 23
846#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr7___lsb 24
847#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr7___width 1
848#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu0_intr7___bit 24
849#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr7___lsb 25
850#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr7___width 1
851#define reg_iop_sw_mpu_rw_intr_grp1_mask___spu1_intr7___bit 25
852#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp3___lsb 26
853#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp3___width 1
854#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp3___bit 26
855#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___lsb 27
856#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___width 1
857#define reg_iop_sw_mpu_rw_intr_grp1_mask___trigger_grp4___bit 27
858#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp3___lsb 28
859#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp3___width 1
860#define reg_iop_sw_mpu_rw_intr_grp1_mask___timer_grp3___bit 28
861#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0___lsb 29
862#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0___width 1
863#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out0___bit 29
864#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1_extra___lsb 30
865#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1_extra___width 1
866#define reg_iop_sw_mpu_rw_intr_grp1_mask___fifo_out1_extra___bit 30
867#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in1___lsb 31
868#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in1___width 1
869#define reg_iop_sw_mpu_rw_intr_grp1_mask___dmc_in1___bit 31
870#define reg_iop_sw_mpu_rw_intr_grp1_mask_offset 112
871
872/* Register rw_ack_intr_grp1, scope iop_sw_mpu, type rw */
873#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr4___lsb 0
874#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr4___width 1
875#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr4___bit 0
876#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr4___lsb 1
877#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr4___width 1
878#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr4___bit 1
879#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr5___lsb 8
880#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr5___width 1
881#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr5___bit 8
882#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr5___lsb 9
883#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr5___width 1
884#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr5___bit 9
885#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr6___lsb 16
886#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr6___width 1
887#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr6___bit 16
888#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr6___lsb 17
889#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr6___width 1
890#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr6___bit 17
891#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr7___lsb 24
892#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr7___width 1
893#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu0_intr7___bit 24
894#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr7___lsb 25
895#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr7___width 1
896#define reg_iop_sw_mpu_rw_ack_intr_grp1___spu1_intr7___bit 25
897#define reg_iop_sw_mpu_rw_ack_intr_grp1_offset 116
898
899/* Register r_intr_grp1, scope iop_sw_mpu, type r */
900#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr4___lsb 0
901#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr4___width 1
902#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr4___bit 0
903#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr4___lsb 1
904#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr4___width 1
905#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr4___bit 1
906#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp0___lsb 2
907#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp0___width 1
908#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp0___bit 2
909#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___lsb 3
910#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___width 1
911#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp5___bit 3
912#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___lsb 4
913#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___width 1
914#define reg_iop_sw_mpu_r_intr_grp1___timer_grp0___bit 4
915#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0___lsb 5
916#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0___width 1
917#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0___bit 5
918#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0_extra___lsb 6
919#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0_extra___width 1
920#define reg_iop_sw_mpu_r_intr_grp1___fifo_in0_extra___bit 6
921#define reg_iop_sw_mpu_r_intr_grp1___dmc_out0___lsb 7
922#define reg_iop_sw_mpu_r_intr_grp1___dmc_out0___width 1
923#define reg_iop_sw_mpu_r_intr_grp1___dmc_out0___bit 7
924#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr5___lsb 8
925#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr5___width 1
926#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr5___bit 8
927#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr5___lsb 9
928#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr5___width 1
929#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr5___bit 9
930#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp1___lsb 10
931#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp1___width 1
932#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp1___bit 10
933#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___lsb 11
934#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___width 1
935#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp6___bit 11
936#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___lsb 12
937#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___width 1
938#define reg_iop_sw_mpu_r_intr_grp1___timer_grp1___bit 12
939#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1___lsb 13
940#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1___width 1
941#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1___bit 13
942#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0_extra___lsb 14
943#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0_extra___width 1
944#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0_extra___bit 14
945#define reg_iop_sw_mpu_r_intr_grp1___dmc_in0___lsb 15
946#define reg_iop_sw_mpu_r_intr_grp1___dmc_in0___width 1
947#define reg_iop_sw_mpu_r_intr_grp1___dmc_in0___bit 15
948#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr6___lsb 16
949#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr6___width 1
950#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr6___bit 16
951#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr6___lsb 17
952#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr6___width 1
953#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr6___bit 17
954#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp2___lsb 18
955#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp2___width 1
956#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp2___bit 18
957#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___lsb 19
958#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___width 1
959#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp7___bit 19
960#define reg_iop_sw_mpu_r_intr_grp1___timer_grp2___lsb 20
961#define reg_iop_sw_mpu_r_intr_grp1___timer_grp2___width 1
962#define reg_iop_sw_mpu_r_intr_grp1___timer_grp2___bit 20
963#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1___lsb 21
964#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1___width 1
965#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1___bit 21
966#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1_extra___lsb 22
967#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1_extra___width 1
968#define reg_iop_sw_mpu_r_intr_grp1___fifo_in1_extra___bit 22
969#define reg_iop_sw_mpu_r_intr_grp1___dmc_out1___lsb 23
970#define reg_iop_sw_mpu_r_intr_grp1___dmc_out1___width 1
971#define reg_iop_sw_mpu_r_intr_grp1___dmc_out1___bit 23
972#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr7___lsb 24
973#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr7___width 1
974#define reg_iop_sw_mpu_r_intr_grp1___spu0_intr7___bit 24
975#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr7___lsb 25
976#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr7___width 1
977#define reg_iop_sw_mpu_r_intr_grp1___spu1_intr7___bit 25
978#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp3___lsb 26
979#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp3___width 1
980#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp3___bit 26
981#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___lsb 27
982#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___width 1
983#define reg_iop_sw_mpu_r_intr_grp1___trigger_grp4___bit 27
984#define reg_iop_sw_mpu_r_intr_grp1___timer_grp3___lsb 28
985#define reg_iop_sw_mpu_r_intr_grp1___timer_grp3___width 1
986#define reg_iop_sw_mpu_r_intr_grp1___timer_grp3___bit 28
987#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0___lsb 29
988#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0___width 1
989#define reg_iop_sw_mpu_r_intr_grp1___fifo_out0___bit 29
990#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1_extra___lsb 30
991#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1_extra___width 1
992#define reg_iop_sw_mpu_r_intr_grp1___fifo_out1_extra___bit 30
993#define reg_iop_sw_mpu_r_intr_grp1___dmc_in1___lsb 31
994#define reg_iop_sw_mpu_r_intr_grp1___dmc_in1___width 1
995#define reg_iop_sw_mpu_r_intr_grp1___dmc_in1___bit 31
996#define reg_iop_sw_mpu_r_intr_grp1_offset 120
997
998/* Register r_masked_intr_grp1, scope iop_sw_mpu, type r */
999#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr4___lsb 0
1000#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr4___width 1
1001#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr4___bit 0
1002#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr4___lsb 1
1003#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr4___width 1
1004#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr4___bit 1
1005#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp0___lsb 2
1006#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp0___width 1
1007#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp0___bit 2
1008#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___lsb 3
1009#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___width 1
1010#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp5___bit 3
1011#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___lsb 4
1012#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___width 1
1013#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp0___bit 4
1014#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0___lsb 5
1015#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0___width 1
1016#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0___bit 5
1017#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0_extra___lsb 6
1018#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0_extra___width 1
1019#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in0_extra___bit 6
1020#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out0___lsb 7
1021#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out0___width 1
1022#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out0___bit 7
1023#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr5___lsb 8
1024#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr5___width 1
1025#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr5___bit 8
1026#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr5___lsb 9
1027#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr5___width 1
1028#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr5___bit 9
1029#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp1___lsb 10
1030#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp1___width 1
1031#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp1___bit 10
1032#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___lsb 11
1033#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___width 1
1034#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp6___bit 11
1035#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___lsb 12
1036#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___width 1
1037#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp1___bit 12
1038#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1___lsb 13
1039#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1___width 1
1040#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1___bit 13
1041#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0_extra___lsb 14
1042#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0_extra___width 1
1043#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0_extra___bit 14
1044#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in0___lsb 15
1045#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in0___width 1
1046#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in0___bit 15
1047#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr6___lsb 16
1048#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr6___width 1
1049#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr6___bit 16
1050#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr6___lsb 17
1051#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr6___width 1
1052#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr6___bit 17
1053#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp2___lsb 18
1054#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp2___width 1
1055#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp2___bit 18
1056#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___lsb 19
1057#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___width 1
1058#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp7___bit 19
1059#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp2___lsb 20
1060#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp2___width 1
1061#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp2___bit 20
1062#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1___lsb 21
1063#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1___width 1
1064#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1___bit 21
1065#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1_extra___lsb 22
1066#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1_extra___width 1
1067#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_in1_extra___bit 22
1068#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out1___lsb 23
1069#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out1___width 1
1070#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_out1___bit 23
1071#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr7___lsb 24
1072#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr7___width 1
1073#define reg_iop_sw_mpu_r_masked_intr_grp1___spu0_intr7___bit 24
1074#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr7___lsb 25
1075#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr7___width 1
1076#define reg_iop_sw_mpu_r_masked_intr_grp1___spu1_intr7___bit 25
1077#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp3___lsb 26
1078#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp3___width 1
1079#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp3___bit 26
1080#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___lsb 27
1081#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___width 1
1082#define reg_iop_sw_mpu_r_masked_intr_grp1___trigger_grp4___bit 27
1083#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp3___lsb 28
1084#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp3___width 1
1085#define reg_iop_sw_mpu_r_masked_intr_grp1___timer_grp3___bit 28
1086#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0___lsb 29
1087#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0___width 1
1088#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out0___bit 29
1089#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1_extra___lsb 30
1090#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1_extra___width 1
1091#define reg_iop_sw_mpu_r_masked_intr_grp1___fifo_out1_extra___bit 30
1092#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in1___lsb 31
1093#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in1___width 1
1094#define reg_iop_sw_mpu_r_masked_intr_grp1___dmc_in1___bit 31
1095#define reg_iop_sw_mpu_r_masked_intr_grp1_offset 124
1096
1097/* Register rw_intr_grp2_mask, scope iop_sw_mpu, type rw */
1098#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr8___lsb 0
1099#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr8___width 1
1100#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr8___bit 0
1101#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr8___lsb 1
1102#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr8___width 1
1103#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr8___bit 1
1104#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___lsb 2
1105#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___width 1
1106#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp0___bit 2
1107#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp6___lsb 3
1108#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp6___width 1
1109#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp6___bit 3
1110#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___lsb 4
1111#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___width 1
1112#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp0___bit 4
1113#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1___lsb 5
1114#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1___width 1
1115#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1___bit 5
1116#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1_extra___lsb 6
1117#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1_extra___width 1
1118#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out1_extra___bit 6
1119#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out0___lsb 7
1120#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out0___width 1
1121#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out0___bit 7
1122#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr9___lsb 8
1123#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr9___width 1
1124#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr9___bit 8
1125#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr9___lsb 9
1126#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr9___width 1
1127#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr9___bit 9
1128#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___lsb 10
1129#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___width 1
1130#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp1___bit 10
1131#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp7___lsb 11
1132#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp7___width 1
1133#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp7___bit 11
1134#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___lsb 12
1135#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___width 1
1136#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp1___bit 12
1137#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1___lsb 13
1138#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1___width 1
1139#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1___bit 13
1140#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1_extra___lsb 14
1141#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1_extra___width 1
1142#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in1_extra___bit 14
1143#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in0___lsb 15
1144#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in0___width 1
1145#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in0___bit 15
1146#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr10___lsb 16
1147#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr10___width 1
1148#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr10___bit 16
1149#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr10___lsb 17
1150#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr10___width 1
1151#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr10___bit 17
1152#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___lsb 18
1153#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___width 1
1154#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp2___bit 18
1155#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp4___lsb 19
1156#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp4___width 1
1157#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp4___bit 19
1158#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp2___lsb 20
1159#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp2___width 1
1160#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp2___bit 20
1161#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0___lsb 21
1162#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0___width 1
1163#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0___bit 21
1164#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0_extra___lsb 22
1165#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0_extra___width 1
1166#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_out0_extra___bit 22
1167#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out1___lsb 23
1168#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out1___width 1
1169#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_out1___bit 23
1170#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr11___lsb 24
1171#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr11___width 1
1172#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu0_intr11___bit 24
1173#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr11___lsb 25
1174#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr11___width 1
1175#define reg_iop_sw_mpu_rw_intr_grp2_mask___spu1_intr11___bit 25
1176#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___lsb 26
1177#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___width 1
1178#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp3___bit 26
1179#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp5___lsb 27
1180#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp5___width 1
1181#define reg_iop_sw_mpu_rw_intr_grp2_mask___trigger_grp5___bit 27
1182#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp3___lsb 28
1183#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp3___width 1
1184#define reg_iop_sw_mpu_rw_intr_grp2_mask___timer_grp3___bit 28
1185#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0___lsb 29
1186#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0___width 1
1187#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0___bit 29
1188#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0_extra___lsb 30
1189#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0_extra___width 1
1190#define reg_iop_sw_mpu_rw_intr_grp2_mask___fifo_in0_extra___bit 30
1191#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in1___lsb 31
1192#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in1___width 1
1193#define reg_iop_sw_mpu_rw_intr_grp2_mask___dmc_in1___bit 31
1194#define reg_iop_sw_mpu_rw_intr_grp2_mask_offset 128
1195
1196/* Register rw_ack_intr_grp2, scope iop_sw_mpu, type rw */
1197#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr8___lsb 0
1198#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr8___width 1
1199#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr8___bit 0
1200#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr8___lsb 1
1201#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr8___width 1
1202#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr8___bit 1
1203#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr9___lsb 8
1204#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr9___width 1
1205#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr9___bit 8
1206#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr9___lsb 9
1207#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr9___width 1
1208#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr9___bit 9
1209#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr10___lsb 16
1210#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr10___width 1
1211#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr10___bit 16
1212#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr10___lsb 17
1213#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr10___width 1
1214#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr10___bit 17
1215#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr11___lsb 24
1216#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr11___width 1
1217#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu0_intr11___bit 24
1218#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr11___lsb 25
1219#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr11___width 1
1220#define reg_iop_sw_mpu_rw_ack_intr_grp2___spu1_intr11___bit 25
1221#define reg_iop_sw_mpu_rw_ack_intr_grp2_offset 132
1222
1223/* Register r_intr_grp2, scope iop_sw_mpu, type r */
1224#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr8___lsb 0
1225#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr8___width 1
1226#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr8___bit 0
1227#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr8___lsb 1
1228#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr8___width 1
1229#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr8___bit 1
1230#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___lsb 2
1231#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___width 1
1232#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp0___bit 2
1233#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp6___lsb 3
1234#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp6___width 1
1235#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp6___bit 3
1236#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___lsb 4
1237#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___width 1
1238#define reg_iop_sw_mpu_r_intr_grp2___timer_grp0___bit 4
1239#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1___lsb 5
1240#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1___width 1
1241#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1___bit 5
1242#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1_extra___lsb 6
1243#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1_extra___width 1
1244#define reg_iop_sw_mpu_r_intr_grp2___fifo_out1_extra___bit 6
1245#define reg_iop_sw_mpu_r_intr_grp2___dmc_out0___lsb 7
1246#define reg_iop_sw_mpu_r_intr_grp2___dmc_out0___width 1
1247#define reg_iop_sw_mpu_r_intr_grp2___dmc_out0___bit 7
1248#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr9___lsb 8
1249#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr9___width 1
1250#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr9___bit 8
1251#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr9___lsb 9
1252#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr9___width 1
1253#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr9___bit 9
1254#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___lsb 10
1255#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___width 1
1256#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp1___bit 10
1257#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp7___lsb 11
1258#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp7___width 1
1259#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp7___bit 11
1260#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___lsb 12
1261#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___width 1
1262#define reg_iop_sw_mpu_r_intr_grp2___timer_grp1___bit 12
1263#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1___lsb 13
1264#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1___width 1
1265#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1___bit 13
1266#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1_extra___lsb 14
1267#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1_extra___width 1
1268#define reg_iop_sw_mpu_r_intr_grp2___fifo_in1_extra___bit 14
1269#define reg_iop_sw_mpu_r_intr_grp2___dmc_in0___lsb 15
1270#define reg_iop_sw_mpu_r_intr_grp2___dmc_in0___width 1
1271#define reg_iop_sw_mpu_r_intr_grp2___dmc_in0___bit 15
1272#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr10___lsb 16
1273#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr10___width 1
1274#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr10___bit 16
1275#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr10___lsb 17
1276#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr10___width 1
1277#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr10___bit 17
1278#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___lsb 18
1279#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___width 1
1280#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp2___bit 18
1281#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp4___lsb 19
1282#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp4___width 1
1283#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp4___bit 19
1284#define reg_iop_sw_mpu_r_intr_grp2___timer_grp2___lsb 20
1285#define reg_iop_sw_mpu_r_intr_grp2___timer_grp2___width 1
1286#define reg_iop_sw_mpu_r_intr_grp2___timer_grp2___bit 20
1287#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0___lsb 21
1288#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0___width 1
1289#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0___bit 21
1290#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0_extra___lsb 22
1291#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0_extra___width 1
1292#define reg_iop_sw_mpu_r_intr_grp2___fifo_out0_extra___bit 22
1293#define reg_iop_sw_mpu_r_intr_grp2___dmc_out1___lsb 23
1294#define reg_iop_sw_mpu_r_intr_grp2___dmc_out1___width 1
1295#define reg_iop_sw_mpu_r_intr_grp2___dmc_out1___bit 23
1296#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr11___lsb 24
1297#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr11___width 1
1298#define reg_iop_sw_mpu_r_intr_grp2___spu0_intr11___bit 24
1299#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr11___lsb 25
1300#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr11___width 1
1301#define reg_iop_sw_mpu_r_intr_grp2___spu1_intr11___bit 25
1302#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___lsb 26
1303#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___width 1
1304#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp3___bit 26
1305#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp5___lsb 27
1306#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp5___width 1
1307#define reg_iop_sw_mpu_r_intr_grp2___trigger_grp5___bit 27
1308#define reg_iop_sw_mpu_r_intr_grp2___timer_grp3___lsb 28
1309#define reg_iop_sw_mpu_r_intr_grp2___timer_grp3___width 1
1310#define reg_iop_sw_mpu_r_intr_grp2___timer_grp3___bit 28
1311#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0___lsb 29
1312#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0___width 1
1313#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0___bit 29
1314#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0_extra___lsb 30
1315#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0_extra___width 1
1316#define reg_iop_sw_mpu_r_intr_grp2___fifo_in0_extra___bit 30
1317#define reg_iop_sw_mpu_r_intr_grp2___dmc_in1___lsb 31
1318#define reg_iop_sw_mpu_r_intr_grp2___dmc_in1___width 1
1319#define reg_iop_sw_mpu_r_intr_grp2___dmc_in1___bit 31
1320#define reg_iop_sw_mpu_r_intr_grp2_offset 136
1321
1322/* Register r_masked_intr_grp2, scope iop_sw_mpu, type r */
1323#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr8___lsb 0
1324#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr8___width 1
1325#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr8___bit 0
1326#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr8___lsb 1
1327#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr8___width 1
1328#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr8___bit 1
1329#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___lsb 2
1330#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___width 1
1331#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp0___bit 2
1332#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp6___lsb 3
1333#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp6___width 1
1334#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp6___bit 3
1335#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___lsb 4
1336#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___width 1
1337#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp0___bit 4
1338#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1___lsb 5
1339#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1___width 1
1340#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1___bit 5
1341#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1_extra___lsb 6
1342#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1_extra___width 1
1343#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out1_extra___bit 6
1344#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out0___lsb 7
1345#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out0___width 1
1346#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out0___bit 7
1347#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr9___lsb 8
1348#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr9___width 1
1349#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr9___bit 8
1350#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr9___lsb 9
1351#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr9___width 1
1352#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr9___bit 9
1353#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___lsb 10
1354#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___width 1
1355#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp1___bit 10
1356#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp7___lsb 11
1357#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp7___width 1
1358#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp7___bit 11
1359#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___lsb 12
1360#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___width 1
1361#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp1___bit 12
1362#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1___lsb 13
1363#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1___width 1
1364#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1___bit 13
1365#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1_extra___lsb 14
1366#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1_extra___width 1
1367#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in1_extra___bit 14
1368#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in0___lsb 15
1369#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in0___width 1
1370#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in0___bit 15
1371#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr10___lsb 16
1372#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr10___width 1
1373#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr10___bit 16
1374#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr10___lsb 17
1375#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr10___width 1
1376#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr10___bit 17
1377#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___lsb 18
1378#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___width 1
1379#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp2___bit 18
1380#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp4___lsb 19
1381#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp4___width 1
1382#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp4___bit 19
1383#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp2___lsb 20
1384#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp2___width 1
1385#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp2___bit 20
1386#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0___lsb 21
1387#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0___width 1
1388#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0___bit 21
1389#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0_extra___lsb 22
1390#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0_extra___width 1
1391#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_out0_extra___bit 22
1392#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out1___lsb 23
1393#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out1___width 1
1394#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_out1___bit 23
1395#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr11___lsb 24
1396#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr11___width 1
1397#define reg_iop_sw_mpu_r_masked_intr_grp2___spu0_intr11___bit 24
1398#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr11___lsb 25
1399#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr11___width 1
1400#define reg_iop_sw_mpu_r_masked_intr_grp2___spu1_intr11___bit 25
1401#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___lsb 26
1402#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___width 1
1403#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp3___bit 26
1404#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp5___lsb 27
1405#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp5___width 1
1406#define reg_iop_sw_mpu_r_masked_intr_grp2___trigger_grp5___bit 27
1407#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp3___lsb 28
1408#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp3___width 1
1409#define reg_iop_sw_mpu_r_masked_intr_grp2___timer_grp3___bit 28
1410#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0___lsb 29
1411#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0___width 1
1412#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0___bit 29
1413#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0_extra___lsb 30
1414#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0_extra___width 1
1415#define reg_iop_sw_mpu_r_masked_intr_grp2___fifo_in0_extra___bit 30
1416#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in1___lsb 31
1417#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in1___width 1
1418#define reg_iop_sw_mpu_r_masked_intr_grp2___dmc_in1___bit 31
1419#define reg_iop_sw_mpu_r_masked_intr_grp2_offset 140
1420
1421/* Register rw_intr_grp3_mask, scope iop_sw_mpu, type rw */
1422#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr12___lsb 0
1423#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr12___width 1
1424#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr12___bit 0
1425#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr12___lsb 1
1426#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr12___width 1
1427#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr12___bit 1
1428#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp0___lsb 2
1429#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp0___width 1
1430#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp0___bit 2
1431#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___lsb 3
1432#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___width 1
1433#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp7___bit 3
1434#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___lsb 4
1435#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___width 1
1436#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp0___bit 4
1437#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1___lsb 5
1438#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1___width 1
1439#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1___bit 5
1440#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1_extra___lsb 6
1441#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1_extra___width 1
1442#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in1_extra___bit 6
1443#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out0___lsb 7
1444#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out0___width 1
1445#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out0___bit 7
1446#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr13___lsb 8
1447#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr13___width 1
1448#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr13___bit 8
1449#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr13___lsb 9
1450#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr13___width 1
1451#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr13___bit 9
1452#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp1___lsb 10
1453#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp1___width 1
1454#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp1___bit 10
1455#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___lsb 11
1456#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___width 1
1457#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp4___bit 11
1458#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___lsb 12
1459#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___width 1
1460#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp1___bit 12
1461#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0___lsb 13
1462#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0___width 1
1463#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0___bit 13
1464#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0_extra___lsb 14
1465#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0_extra___width 1
1466#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out0_extra___bit 14
1467#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in0___lsb 15
1468#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in0___width 1
1469#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in0___bit 15
1470#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr14___lsb 16
1471#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr14___width 1
1472#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr14___bit 16
1473#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr14___lsb 17
1474#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr14___width 1
1475#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr14___bit 17
1476#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp2___lsb 18
1477#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp2___width 1
1478#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp2___bit 18
1479#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___lsb 19
1480#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___width 1
1481#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp5___bit 19
1482#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp2___lsb 20
1483#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp2___width 1
1484#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp2___bit 20
1485#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0___lsb 21
1486#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0___width 1
1487#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0___bit 21
1488#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0_extra___lsb 22
1489#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0_extra___width 1
1490#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_in0_extra___bit 22
1491#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out1___lsb 23
1492#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out1___width 1
1493#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_out1___bit 23
1494#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr15___lsb 24
1495#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr15___width 1
1496#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu0_intr15___bit 24
1497#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr15___lsb 25
1498#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr15___width 1
1499#define reg_iop_sw_mpu_rw_intr_grp3_mask___spu1_intr15___bit 25
1500#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp3___lsb 26
1501#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp3___width 1
1502#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp3___bit 26
1503#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___lsb 27
1504#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___width 1
1505#define reg_iop_sw_mpu_rw_intr_grp3_mask___trigger_grp6___bit 27
1506#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp3___lsb 28
1507#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp3___width 1
1508#define reg_iop_sw_mpu_rw_intr_grp3_mask___timer_grp3___bit 28
1509#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1___lsb 29
1510#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1___width 1
1511#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1___bit 29
1512#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1_extra___lsb 30
1513#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1_extra___width 1
1514#define reg_iop_sw_mpu_rw_intr_grp3_mask___fifo_out1_extra___bit 30
1515#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in1___lsb 31
1516#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in1___width 1
1517#define reg_iop_sw_mpu_rw_intr_grp3_mask___dmc_in1___bit 31
1518#define reg_iop_sw_mpu_rw_intr_grp3_mask_offset 144
1519
1520/* Register rw_ack_intr_grp3, scope iop_sw_mpu, type rw */
1521#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr12___lsb 0
1522#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr12___width 1
1523#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr12___bit 0
1524#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr12___lsb 1
1525#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr12___width 1
1526#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr12___bit 1
1527#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr13___lsb 8
1528#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr13___width 1
1529#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr13___bit 8
1530#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr13___lsb 9
1531#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr13___width 1
1532#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr13___bit 9
1533#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr14___lsb 16
1534#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr14___width 1
1535#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr14___bit 16
1536#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr14___lsb 17
1537#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr14___width 1
1538#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr14___bit 17
1539#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr15___lsb 24
1540#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr15___width 1
1541#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu0_intr15___bit 24
1542#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr15___lsb 25
1543#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr15___width 1
1544#define reg_iop_sw_mpu_rw_ack_intr_grp3___spu1_intr15___bit 25
1545#define reg_iop_sw_mpu_rw_ack_intr_grp3_offset 148
1546
1547/* Register r_intr_grp3, scope iop_sw_mpu, type r */
1548#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr12___lsb 0
1549#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr12___width 1
1550#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr12___bit 0
1551#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr12___lsb 1
1552#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr12___width 1
1553#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr12___bit 1
1554#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp0___lsb 2
1555#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp0___width 1
1556#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp0___bit 2
1557#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___lsb 3
1558#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___width 1
1559#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp7___bit 3
1560#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___lsb 4
1561#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___width 1
1562#define reg_iop_sw_mpu_r_intr_grp3___timer_grp0___bit 4
1563#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1___lsb 5
1564#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1___width 1
1565#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1___bit 5
1566#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1_extra___lsb 6
1567#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1_extra___width 1
1568#define reg_iop_sw_mpu_r_intr_grp3___fifo_in1_extra___bit 6
1569#define reg_iop_sw_mpu_r_intr_grp3___dmc_out0___lsb 7
1570#define reg_iop_sw_mpu_r_intr_grp3___dmc_out0___width 1
1571#define reg_iop_sw_mpu_r_intr_grp3___dmc_out0___bit 7
1572#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr13___lsb 8
1573#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr13___width 1
1574#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr13___bit 8
1575#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr13___lsb 9
1576#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr13___width 1
1577#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr13___bit 9
1578#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp1___lsb 10
1579#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp1___width 1
1580#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp1___bit 10
1581#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___lsb 11
1582#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___width 1
1583#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp4___bit 11
1584#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___lsb 12
1585#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___width 1
1586#define reg_iop_sw_mpu_r_intr_grp3___timer_grp1___bit 12
1587#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0___lsb 13
1588#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0___width 1
1589#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0___bit 13
1590#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0_extra___lsb 14
1591#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0_extra___width 1
1592#define reg_iop_sw_mpu_r_intr_grp3___fifo_out0_extra___bit 14
1593#define reg_iop_sw_mpu_r_intr_grp3___dmc_in0___lsb 15
1594#define reg_iop_sw_mpu_r_intr_grp3___dmc_in0___width 1
1595#define reg_iop_sw_mpu_r_intr_grp3___dmc_in0___bit 15
1596#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr14___lsb 16
1597#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr14___width 1
1598#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr14___bit 16
1599#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr14___lsb 17
1600#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr14___width 1
1601#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr14___bit 17
1602#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp2___lsb 18
1603#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp2___width 1
1604#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp2___bit 18
1605#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___lsb 19
1606#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___width 1
1607#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp5___bit 19
1608#define reg_iop_sw_mpu_r_intr_grp3___timer_grp2___lsb 20
1609#define reg_iop_sw_mpu_r_intr_grp3___timer_grp2___width 1
1610#define reg_iop_sw_mpu_r_intr_grp3___timer_grp2___bit 20
1611#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0___lsb 21
1612#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0___width 1
1613#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0___bit 21
1614#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0_extra___lsb 22
1615#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0_extra___width 1
1616#define reg_iop_sw_mpu_r_intr_grp3___fifo_in0_extra___bit 22
1617#define reg_iop_sw_mpu_r_intr_grp3___dmc_out1___lsb 23
1618#define reg_iop_sw_mpu_r_intr_grp3___dmc_out1___width 1
1619#define reg_iop_sw_mpu_r_intr_grp3___dmc_out1___bit 23
1620#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr15___lsb 24
1621#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr15___width 1
1622#define reg_iop_sw_mpu_r_intr_grp3___spu0_intr15___bit 24
1623#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr15___lsb 25
1624#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr15___width 1
1625#define reg_iop_sw_mpu_r_intr_grp3___spu1_intr15___bit 25
1626#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp3___lsb 26
1627#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp3___width 1
1628#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp3___bit 26
1629#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___lsb 27
1630#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___width 1
1631#define reg_iop_sw_mpu_r_intr_grp3___trigger_grp6___bit 27
1632#define reg_iop_sw_mpu_r_intr_grp3___timer_grp3___lsb 28
1633#define reg_iop_sw_mpu_r_intr_grp3___timer_grp3___width 1
1634#define reg_iop_sw_mpu_r_intr_grp3___timer_grp3___bit 28
1635#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1___lsb 29
1636#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1___width 1
1637#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1___bit 29
1638#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1_extra___lsb 30
1639#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1_extra___width 1
1640#define reg_iop_sw_mpu_r_intr_grp3___fifo_out1_extra___bit 30
1641#define reg_iop_sw_mpu_r_intr_grp3___dmc_in1___lsb 31
1642#define reg_iop_sw_mpu_r_intr_grp3___dmc_in1___width 1
1643#define reg_iop_sw_mpu_r_intr_grp3___dmc_in1___bit 31
1644#define reg_iop_sw_mpu_r_intr_grp3_offset 152
1645
1646/* Register r_masked_intr_grp3, scope iop_sw_mpu, type r */
1647#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr12___lsb 0
1648#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr12___width 1
1649#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr12___bit 0
1650#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr12___lsb 1
1651#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr12___width 1
1652#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr12___bit 1
1653#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp0___lsb 2
1654#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp0___width 1
1655#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp0___bit 2
1656#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___lsb 3
1657#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___width 1
1658#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp7___bit 3
1659#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___lsb 4
1660#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___width 1
1661#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp0___bit 4
1662#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1___lsb 5
1663#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1___width 1
1664#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1___bit 5
1665#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1_extra___lsb 6
1666#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1_extra___width 1
1667#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in1_extra___bit 6
1668#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out0___lsb 7
1669#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out0___width 1
1670#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out0___bit 7
1671#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr13___lsb 8
1672#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr13___width 1
1673#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr13___bit 8
1674#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr13___lsb 9
1675#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr13___width 1
1676#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr13___bit 9
1677#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp1___lsb 10
1678#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp1___width 1
1679#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp1___bit 10
1680#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___lsb 11
1681#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___width 1
1682#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp4___bit 11
1683#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___lsb 12
1684#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___width 1
1685#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp1___bit 12
1686#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0___lsb 13
1687#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0___width 1
1688#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0___bit 13
1689#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0_extra___lsb 14
1690#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0_extra___width 1
1691#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out0_extra___bit 14
1692#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in0___lsb 15
1693#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in0___width 1
1694#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in0___bit 15
1695#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr14___lsb 16
1696#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr14___width 1
1697#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr14___bit 16
1698#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr14___lsb 17
1699#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr14___width 1
1700#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr14___bit 17
1701#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp2___lsb 18
1702#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp2___width 1
1703#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp2___bit 18
1704#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___lsb 19
1705#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___width 1
1706#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp5___bit 19
1707#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp2___lsb 20
1708#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp2___width 1
1709#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp2___bit 20
1710#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0___lsb 21
1711#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0___width 1
1712#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0___bit 21
1713#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0_extra___lsb 22
1714#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0_extra___width 1
1715#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_in0_extra___bit 22
1716#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out1___lsb 23
1717#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out1___width 1
1718#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_out1___bit 23
1719#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr15___lsb 24
1720#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr15___width 1
1721#define reg_iop_sw_mpu_r_masked_intr_grp3___spu0_intr15___bit 24
1722#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr15___lsb 25
1723#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr15___width 1
1724#define reg_iop_sw_mpu_r_masked_intr_grp3___spu1_intr15___bit 25
1725#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp3___lsb 26
1726#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp3___width 1
1727#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp3___bit 26
1728#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___lsb 27
1729#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___width 1
1730#define reg_iop_sw_mpu_r_masked_intr_grp3___trigger_grp6___bit 27
1731#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp3___lsb 28
1732#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp3___width 1
1733#define reg_iop_sw_mpu_r_masked_intr_grp3___timer_grp3___bit 28
1734#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1___lsb 29
1735#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1___width 1
1736#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1___bit 29
1737#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1_extra___lsb 30
1738#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1_extra___width 1
1739#define reg_iop_sw_mpu_r_masked_intr_grp3___fifo_out1_extra___bit 30
1740#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in1___lsb 31
1741#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in1___width 1
1742#define reg_iop_sw_mpu_r_masked_intr_grp3___dmc_in1___bit 31
1743#define reg_iop_sw_mpu_r_masked_intr_grp3_offset 156
1744
1745
1746/* Constants */
1747#define regk_iop_sw_mpu_copy 0x00000000
1748#define regk_iop_sw_mpu_cpu 0x00000000
1749#define regk_iop_sw_mpu_mpu 0x00000001
1750#define regk_iop_sw_mpu_no 0x00000000
1751#define regk_iop_sw_mpu_nop 0x00000000
1752#define regk_iop_sw_mpu_rd 0x00000002
1753#define regk_iop_sw_mpu_reg_copy 0x00000001
1754#define regk_iop_sw_mpu_rw_bus0_clr_mask_default 0x00000000
1755#define regk_iop_sw_mpu_rw_bus0_oe_clr_mask_default 0x00000000
1756#define regk_iop_sw_mpu_rw_bus0_oe_set_mask_default 0x00000000
1757#define regk_iop_sw_mpu_rw_bus0_set_mask_default 0x00000000
1758#define regk_iop_sw_mpu_rw_bus1_clr_mask_default 0x00000000
1759#define regk_iop_sw_mpu_rw_bus1_oe_clr_mask_default 0x00000000
1760#define regk_iop_sw_mpu_rw_bus1_oe_set_mask_default 0x00000000
1761#define regk_iop_sw_mpu_rw_bus1_set_mask_default 0x00000000
1762#define regk_iop_sw_mpu_rw_gio_clr_mask_default 0x00000000
1763#define regk_iop_sw_mpu_rw_gio_oe_clr_mask_default 0x00000000
1764#define regk_iop_sw_mpu_rw_gio_oe_set_mask_default 0x00000000
1765#define regk_iop_sw_mpu_rw_gio_set_mask_default 0x00000000
1766#define regk_iop_sw_mpu_rw_intr_grp0_mask_default 0x00000000
1767#define regk_iop_sw_mpu_rw_intr_grp1_mask_default 0x00000000
1768#define regk_iop_sw_mpu_rw_intr_grp2_mask_default 0x00000000
1769#define regk_iop_sw_mpu_rw_intr_grp3_mask_default 0x00000000
1770#define regk_iop_sw_mpu_rw_sw_cfg_owner_default 0x00000000
1771#define regk_iop_sw_mpu_set 0x00000001
1772#define regk_iop_sw_mpu_spu0 0x00000002
1773#define regk_iop_sw_mpu_spu1 0x00000003
1774#define regk_iop_sw_mpu_wr 0x00000003
1775#define regk_iop_sw_mpu_yes 0x00000001
1776#endif /* __iop_sw_mpu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_spu_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_spu_defs_asm.h
new file mode 100644
index 000000000000..0929f144cfa1
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_sw_spu_defs_asm.h
@@ -0,0 +1,691 @@
1#ifndef __iop_sw_spu_defs_asm_h
2#define __iop_sw_spu_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_spu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_sw_spu_defs_asm.h ../../inst/io_proc/rtl/guinness/iop_sw_spu.r
11 * id: $Id: iop_sw_spu_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_mc_ctrl, scope iop_sw_spu, type rw */
57#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___lsb 0
58#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___width 1
59#define reg_iop_sw_spu_rw_mc_ctrl___keep_owner___bit 0
60#define reg_iop_sw_spu_rw_mc_ctrl___cmd___lsb 1
61#define reg_iop_sw_spu_rw_mc_ctrl___cmd___width 2
62#define reg_iop_sw_spu_rw_mc_ctrl___size___lsb 3
63#define reg_iop_sw_spu_rw_mc_ctrl___size___width 3
64#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu0_mem___lsb 6
65#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu0_mem___width 1
66#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu0_mem___bit 6
67#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu1_mem___lsb 7
68#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu1_mem___width 1
69#define reg_iop_sw_spu_rw_mc_ctrl___wr_spu1_mem___bit 7
70#define reg_iop_sw_spu_rw_mc_ctrl_offset 0
71
72/* Register rw_mc_data, scope iop_sw_spu, type rw */
73#define reg_iop_sw_spu_rw_mc_data___val___lsb 0
74#define reg_iop_sw_spu_rw_mc_data___val___width 32
75#define reg_iop_sw_spu_rw_mc_data_offset 4
76
77/* Register rw_mc_addr, scope iop_sw_spu, type rw */
78#define reg_iop_sw_spu_rw_mc_addr_offset 8
79
80/* Register rs_mc_data, scope iop_sw_spu, type rs */
81#define reg_iop_sw_spu_rs_mc_data_offset 12
82
83/* Register r_mc_data, scope iop_sw_spu, type r */
84#define reg_iop_sw_spu_r_mc_data_offset 16
85
86/* Register r_mc_stat, scope iop_sw_spu, type r */
87#define reg_iop_sw_spu_r_mc_stat___busy_cpu___lsb 0
88#define reg_iop_sw_spu_r_mc_stat___busy_cpu___width 1
89#define reg_iop_sw_spu_r_mc_stat___busy_cpu___bit 0
90#define reg_iop_sw_spu_r_mc_stat___busy_mpu___lsb 1
91#define reg_iop_sw_spu_r_mc_stat___busy_mpu___width 1
92#define reg_iop_sw_spu_r_mc_stat___busy_mpu___bit 1
93#define reg_iop_sw_spu_r_mc_stat___busy_spu0___lsb 2
94#define reg_iop_sw_spu_r_mc_stat___busy_spu0___width 1
95#define reg_iop_sw_spu_r_mc_stat___busy_spu0___bit 2
96#define reg_iop_sw_spu_r_mc_stat___busy_spu1___lsb 3
97#define reg_iop_sw_spu_r_mc_stat___busy_spu1___width 1
98#define reg_iop_sw_spu_r_mc_stat___busy_spu1___bit 3
99#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___lsb 4
100#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___width 1
101#define reg_iop_sw_spu_r_mc_stat___owned_by_cpu___bit 4
102#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___lsb 5
103#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___width 1
104#define reg_iop_sw_spu_r_mc_stat___owned_by_mpu___bit 5
105#define reg_iop_sw_spu_r_mc_stat___owned_by_spu0___lsb 6
106#define reg_iop_sw_spu_r_mc_stat___owned_by_spu0___width 1
107#define reg_iop_sw_spu_r_mc_stat___owned_by_spu0___bit 6
108#define reg_iop_sw_spu_r_mc_stat___owned_by_spu1___lsb 7
109#define reg_iop_sw_spu_r_mc_stat___owned_by_spu1___width 1
110#define reg_iop_sw_spu_r_mc_stat___owned_by_spu1___bit 7
111#define reg_iop_sw_spu_r_mc_stat_offset 20
112
113/* Register rw_bus0_clr_mask, scope iop_sw_spu, type rw */
114#define reg_iop_sw_spu_rw_bus0_clr_mask___byte0___lsb 0
115#define reg_iop_sw_spu_rw_bus0_clr_mask___byte0___width 8
116#define reg_iop_sw_spu_rw_bus0_clr_mask___byte1___lsb 8
117#define reg_iop_sw_spu_rw_bus0_clr_mask___byte1___width 8
118#define reg_iop_sw_spu_rw_bus0_clr_mask___byte2___lsb 16
119#define reg_iop_sw_spu_rw_bus0_clr_mask___byte2___width 8
120#define reg_iop_sw_spu_rw_bus0_clr_mask___byte3___lsb 24
121#define reg_iop_sw_spu_rw_bus0_clr_mask___byte3___width 8
122#define reg_iop_sw_spu_rw_bus0_clr_mask_offset 24
123
124/* Register rw_bus0_set_mask, scope iop_sw_spu, type rw */
125#define reg_iop_sw_spu_rw_bus0_set_mask___byte0___lsb 0
126#define reg_iop_sw_spu_rw_bus0_set_mask___byte0___width 8
127#define reg_iop_sw_spu_rw_bus0_set_mask___byte1___lsb 8
128#define reg_iop_sw_spu_rw_bus0_set_mask___byte1___width 8
129#define reg_iop_sw_spu_rw_bus0_set_mask___byte2___lsb 16
130#define reg_iop_sw_spu_rw_bus0_set_mask___byte2___width 8
131#define reg_iop_sw_spu_rw_bus0_set_mask___byte3___lsb 24
132#define reg_iop_sw_spu_rw_bus0_set_mask___byte3___width 8
133#define reg_iop_sw_spu_rw_bus0_set_mask_offset 28
134
135/* Register rw_bus0_oe_clr_mask, scope iop_sw_spu, type rw */
136#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte0___lsb 0
137#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte0___width 1
138#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte0___bit 0
139#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte1___lsb 1
140#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte1___width 1
141#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte1___bit 1
142#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte2___lsb 2
143#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte2___width 1
144#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte2___bit 2
145#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte3___lsb 3
146#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte3___width 1
147#define reg_iop_sw_spu_rw_bus0_oe_clr_mask___byte3___bit 3
148#define reg_iop_sw_spu_rw_bus0_oe_clr_mask_offset 32
149
150/* Register rw_bus0_oe_set_mask, scope iop_sw_spu, type rw */
151#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte0___lsb 0
152#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte0___width 1
153#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte0___bit 0
154#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte1___lsb 1
155#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte1___width 1
156#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte1___bit 1
157#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte2___lsb 2
158#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte2___width 1
159#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte2___bit 2
160#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte3___lsb 3
161#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte3___width 1
162#define reg_iop_sw_spu_rw_bus0_oe_set_mask___byte3___bit 3
163#define reg_iop_sw_spu_rw_bus0_oe_set_mask_offset 36
164
165/* Register r_bus0_in, scope iop_sw_spu, type r */
166#define reg_iop_sw_spu_r_bus0_in_offset 40
167
168/* Register rw_bus1_clr_mask, scope iop_sw_spu, type rw */
169#define reg_iop_sw_spu_rw_bus1_clr_mask___byte0___lsb 0
170#define reg_iop_sw_spu_rw_bus1_clr_mask___byte0___width 8
171#define reg_iop_sw_spu_rw_bus1_clr_mask___byte1___lsb 8
172#define reg_iop_sw_spu_rw_bus1_clr_mask___byte1___width 8
173#define reg_iop_sw_spu_rw_bus1_clr_mask___byte2___lsb 16
174#define reg_iop_sw_spu_rw_bus1_clr_mask___byte2___width 8
175#define reg_iop_sw_spu_rw_bus1_clr_mask___byte3___lsb 24
176#define reg_iop_sw_spu_rw_bus1_clr_mask___byte3___width 8
177#define reg_iop_sw_spu_rw_bus1_clr_mask_offset 44
178
179/* Register rw_bus1_set_mask, scope iop_sw_spu, type rw */
180#define reg_iop_sw_spu_rw_bus1_set_mask___byte0___lsb 0
181#define reg_iop_sw_spu_rw_bus1_set_mask___byte0___width 8
182#define reg_iop_sw_spu_rw_bus1_set_mask___byte1___lsb 8
183#define reg_iop_sw_spu_rw_bus1_set_mask___byte1___width 8
184#define reg_iop_sw_spu_rw_bus1_set_mask___byte2___lsb 16
185#define reg_iop_sw_spu_rw_bus1_set_mask___byte2___width 8
186#define reg_iop_sw_spu_rw_bus1_set_mask___byte3___lsb 24
187#define reg_iop_sw_spu_rw_bus1_set_mask___byte3___width 8
188#define reg_iop_sw_spu_rw_bus1_set_mask_offset 48
189
190/* Register rw_bus1_oe_clr_mask, scope iop_sw_spu, type rw */
191#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte0___lsb 0
192#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte0___width 1
193#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte0___bit 0
194#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte1___lsb 1
195#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte1___width 1
196#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte1___bit 1
197#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte2___lsb 2
198#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte2___width 1
199#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte2___bit 2
200#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte3___lsb 3
201#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte3___width 1
202#define reg_iop_sw_spu_rw_bus1_oe_clr_mask___byte3___bit 3
203#define reg_iop_sw_spu_rw_bus1_oe_clr_mask_offset 52
204
205/* Register rw_bus1_oe_set_mask, scope iop_sw_spu, type rw */
206#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte0___lsb 0
207#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte0___width 1
208#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte0___bit 0
209#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte1___lsb 1
210#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte1___width 1
211#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte1___bit 1
212#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte2___lsb 2
213#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte2___width 1
214#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte2___bit 2
215#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte3___lsb 3
216#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte3___width 1
217#define reg_iop_sw_spu_rw_bus1_oe_set_mask___byte3___bit 3
218#define reg_iop_sw_spu_rw_bus1_oe_set_mask_offset 56
219
220/* Register r_bus1_in, scope iop_sw_spu, type r */
221#define reg_iop_sw_spu_r_bus1_in_offset 60
222
223/* Register rw_gio_clr_mask, scope iop_sw_spu, type rw */
224#define reg_iop_sw_spu_rw_gio_clr_mask___val___lsb 0
225#define reg_iop_sw_spu_rw_gio_clr_mask___val___width 32
226#define reg_iop_sw_spu_rw_gio_clr_mask_offset 64
227
228/* Register rw_gio_set_mask, scope iop_sw_spu, type rw */
229#define reg_iop_sw_spu_rw_gio_set_mask___val___lsb 0
230#define reg_iop_sw_spu_rw_gio_set_mask___val___width 32
231#define reg_iop_sw_spu_rw_gio_set_mask_offset 68
232
233/* Register rw_gio_oe_clr_mask, scope iop_sw_spu, type rw */
234#define reg_iop_sw_spu_rw_gio_oe_clr_mask___val___lsb 0
235#define reg_iop_sw_spu_rw_gio_oe_clr_mask___val___width 32
236#define reg_iop_sw_spu_rw_gio_oe_clr_mask_offset 72
237
238/* Register rw_gio_oe_set_mask, scope iop_sw_spu, type rw */
239#define reg_iop_sw_spu_rw_gio_oe_set_mask___val___lsb 0
240#define reg_iop_sw_spu_rw_gio_oe_set_mask___val___width 32
241#define reg_iop_sw_spu_rw_gio_oe_set_mask_offset 76
242
243/* Register r_gio_in, scope iop_sw_spu, type r */
244#define reg_iop_sw_spu_r_gio_in_offset 80
245
246/* Register rw_bus0_clr_mask_lo, scope iop_sw_spu, type rw */
247#define reg_iop_sw_spu_rw_bus0_clr_mask_lo___byte0___lsb 0
248#define reg_iop_sw_spu_rw_bus0_clr_mask_lo___byte0___width 8
249#define reg_iop_sw_spu_rw_bus0_clr_mask_lo___byte1___lsb 8
250#define reg_iop_sw_spu_rw_bus0_clr_mask_lo___byte1___width 8
251#define reg_iop_sw_spu_rw_bus0_clr_mask_lo_offset 84
252
253/* Register rw_bus0_clr_mask_hi, scope iop_sw_spu, type rw */
254#define reg_iop_sw_spu_rw_bus0_clr_mask_hi___byte2___lsb 0
255#define reg_iop_sw_spu_rw_bus0_clr_mask_hi___byte2___width 8
256#define reg_iop_sw_spu_rw_bus0_clr_mask_hi___byte3___lsb 8
257#define reg_iop_sw_spu_rw_bus0_clr_mask_hi___byte3___width 8
258#define reg_iop_sw_spu_rw_bus0_clr_mask_hi_offset 88
259
260/* Register rw_bus0_set_mask_lo, scope iop_sw_spu, type rw */
261#define reg_iop_sw_spu_rw_bus0_set_mask_lo___byte0___lsb 0
262#define reg_iop_sw_spu_rw_bus0_set_mask_lo___byte0___width 8
263#define reg_iop_sw_spu_rw_bus0_set_mask_lo___byte1___lsb 8
264#define reg_iop_sw_spu_rw_bus0_set_mask_lo___byte1___width 8
265#define reg_iop_sw_spu_rw_bus0_set_mask_lo_offset 92
266
267/* Register rw_bus0_set_mask_hi, scope iop_sw_spu, type rw */
268#define reg_iop_sw_spu_rw_bus0_set_mask_hi___byte2___lsb 0
269#define reg_iop_sw_spu_rw_bus0_set_mask_hi___byte2___width 8
270#define reg_iop_sw_spu_rw_bus0_set_mask_hi___byte3___lsb 8
271#define reg_iop_sw_spu_rw_bus0_set_mask_hi___byte3___width 8
272#define reg_iop_sw_spu_rw_bus0_set_mask_hi_offset 96
273
274/* Register rw_bus1_clr_mask_lo, scope iop_sw_spu, type rw */
275#define reg_iop_sw_spu_rw_bus1_clr_mask_lo___byte0___lsb 0
276#define reg_iop_sw_spu_rw_bus1_clr_mask_lo___byte0___width 8
277#define reg_iop_sw_spu_rw_bus1_clr_mask_lo___byte1___lsb 8
278#define reg_iop_sw_spu_rw_bus1_clr_mask_lo___byte1___width 8
279#define reg_iop_sw_spu_rw_bus1_clr_mask_lo_offset 100
280
281/* Register rw_bus1_clr_mask_hi, scope iop_sw_spu, type rw */
282#define reg_iop_sw_spu_rw_bus1_clr_mask_hi___byte2___lsb 0
283#define reg_iop_sw_spu_rw_bus1_clr_mask_hi___byte2___width 8
284#define reg_iop_sw_spu_rw_bus1_clr_mask_hi___byte3___lsb 8
285#define reg_iop_sw_spu_rw_bus1_clr_mask_hi___byte3___width 8
286#define reg_iop_sw_spu_rw_bus1_clr_mask_hi_offset 104
287
288/* Register rw_bus1_set_mask_lo, scope iop_sw_spu, type rw */
289#define reg_iop_sw_spu_rw_bus1_set_mask_lo___byte0___lsb 0
290#define reg_iop_sw_spu_rw_bus1_set_mask_lo___byte0___width 8
291#define reg_iop_sw_spu_rw_bus1_set_mask_lo___byte1___lsb 8
292#define reg_iop_sw_spu_rw_bus1_set_mask_lo___byte1___width 8
293#define reg_iop_sw_spu_rw_bus1_set_mask_lo_offset 108
294
295/* Register rw_bus1_set_mask_hi, scope iop_sw_spu, type rw */
296#define reg_iop_sw_spu_rw_bus1_set_mask_hi___byte2___lsb 0
297#define reg_iop_sw_spu_rw_bus1_set_mask_hi___byte2___width 8
298#define reg_iop_sw_spu_rw_bus1_set_mask_hi___byte3___lsb 8
299#define reg_iop_sw_spu_rw_bus1_set_mask_hi___byte3___width 8
300#define reg_iop_sw_spu_rw_bus1_set_mask_hi_offset 112
301
302/* Register rw_gio_clr_mask_lo, scope iop_sw_spu, type rw */
303#define reg_iop_sw_spu_rw_gio_clr_mask_lo___val___lsb 0
304#define reg_iop_sw_spu_rw_gio_clr_mask_lo___val___width 16
305#define reg_iop_sw_spu_rw_gio_clr_mask_lo_offset 116
306
307/* Register rw_gio_clr_mask_hi, scope iop_sw_spu, type rw */
308#define reg_iop_sw_spu_rw_gio_clr_mask_hi___val___lsb 0
309#define reg_iop_sw_spu_rw_gio_clr_mask_hi___val___width 16
310#define reg_iop_sw_spu_rw_gio_clr_mask_hi_offset 120
311
312/* Register rw_gio_set_mask_lo, scope iop_sw_spu, type rw */
313#define reg_iop_sw_spu_rw_gio_set_mask_lo___val___lsb 0
314#define reg_iop_sw_spu_rw_gio_set_mask_lo___val___width 16
315#define reg_iop_sw_spu_rw_gio_set_mask_lo_offset 124
316
317/* Register rw_gio_set_mask_hi, scope iop_sw_spu, type rw */
318#define reg_iop_sw_spu_rw_gio_set_mask_hi___val___lsb 0
319#define reg_iop_sw_spu_rw_gio_set_mask_hi___val___width 16
320#define reg_iop_sw_spu_rw_gio_set_mask_hi_offset 128
321
322/* Register rw_gio_oe_clr_mask_lo, scope iop_sw_spu, type rw */
323#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo___val___lsb 0
324#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo___val___width 16
325#define reg_iop_sw_spu_rw_gio_oe_clr_mask_lo_offset 132
326
327/* Register rw_gio_oe_clr_mask_hi, scope iop_sw_spu, type rw */
328#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi___val___lsb 0
329#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi___val___width 16
330#define reg_iop_sw_spu_rw_gio_oe_clr_mask_hi_offset 136
331
332/* Register rw_gio_oe_set_mask_lo, scope iop_sw_spu, type rw */
333#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo___val___lsb 0
334#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo___val___width 16
335#define reg_iop_sw_spu_rw_gio_oe_set_mask_lo_offset 140
336
337/* Register rw_gio_oe_set_mask_hi, scope iop_sw_spu, type rw */
338#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi___val___lsb 0
339#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi___val___width 16
340#define reg_iop_sw_spu_rw_gio_oe_set_mask_hi_offset 144
341
342/* Register rw_cpu_intr, scope iop_sw_spu, type rw */
343#define reg_iop_sw_spu_rw_cpu_intr___intr0___lsb 0
344#define reg_iop_sw_spu_rw_cpu_intr___intr0___width 1
345#define reg_iop_sw_spu_rw_cpu_intr___intr0___bit 0
346#define reg_iop_sw_spu_rw_cpu_intr___intr1___lsb 1
347#define reg_iop_sw_spu_rw_cpu_intr___intr1___width 1
348#define reg_iop_sw_spu_rw_cpu_intr___intr1___bit 1
349#define reg_iop_sw_spu_rw_cpu_intr___intr2___lsb 2
350#define reg_iop_sw_spu_rw_cpu_intr___intr2___width 1
351#define reg_iop_sw_spu_rw_cpu_intr___intr2___bit 2
352#define reg_iop_sw_spu_rw_cpu_intr___intr3___lsb 3
353#define reg_iop_sw_spu_rw_cpu_intr___intr3___width 1
354#define reg_iop_sw_spu_rw_cpu_intr___intr3___bit 3
355#define reg_iop_sw_spu_rw_cpu_intr___intr4___lsb 4
356#define reg_iop_sw_spu_rw_cpu_intr___intr4___width 1
357#define reg_iop_sw_spu_rw_cpu_intr___intr4___bit 4
358#define reg_iop_sw_spu_rw_cpu_intr___intr5___lsb 5
359#define reg_iop_sw_spu_rw_cpu_intr___intr5___width 1
360#define reg_iop_sw_spu_rw_cpu_intr___intr5___bit 5
361#define reg_iop_sw_spu_rw_cpu_intr___intr6___lsb 6
362#define reg_iop_sw_spu_rw_cpu_intr___intr6___width 1
363#define reg_iop_sw_spu_rw_cpu_intr___intr6___bit 6
364#define reg_iop_sw_spu_rw_cpu_intr___intr7___lsb 7
365#define reg_iop_sw_spu_rw_cpu_intr___intr7___width 1
366#define reg_iop_sw_spu_rw_cpu_intr___intr7___bit 7
367#define reg_iop_sw_spu_rw_cpu_intr___intr8___lsb 8
368#define reg_iop_sw_spu_rw_cpu_intr___intr8___width 1
369#define reg_iop_sw_spu_rw_cpu_intr___intr8___bit 8
370#define reg_iop_sw_spu_rw_cpu_intr___intr9___lsb 9
371#define reg_iop_sw_spu_rw_cpu_intr___intr9___width 1
372#define reg_iop_sw_spu_rw_cpu_intr___intr9___bit 9
373#define reg_iop_sw_spu_rw_cpu_intr___intr10___lsb 10
374#define reg_iop_sw_spu_rw_cpu_intr___intr10___width 1
375#define reg_iop_sw_spu_rw_cpu_intr___intr10___bit 10
376#define reg_iop_sw_spu_rw_cpu_intr___intr11___lsb 11
377#define reg_iop_sw_spu_rw_cpu_intr___intr11___width 1
378#define reg_iop_sw_spu_rw_cpu_intr___intr11___bit 11
379#define reg_iop_sw_spu_rw_cpu_intr___intr12___lsb 12
380#define reg_iop_sw_spu_rw_cpu_intr___intr12___width 1
381#define reg_iop_sw_spu_rw_cpu_intr___intr12___bit 12
382#define reg_iop_sw_spu_rw_cpu_intr___intr13___lsb 13
383#define reg_iop_sw_spu_rw_cpu_intr___intr13___width 1
384#define reg_iop_sw_spu_rw_cpu_intr___intr13___bit 13
385#define reg_iop_sw_spu_rw_cpu_intr___intr14___lsb 14
386#define reg_iop_sw_spu_rw_cpu_intr___intr14___width 1
387#define reg_iop_sw_spu_rw_cpu_intr___intr14___bit 14
388#define reg_iop_sw_spu_rw_cpu_intr___intr15___lsb 15
389#define reg_iop_sw_spu_rw_cpu_intr___intr15___width 1
390#define reg_iop_sw_spu_rw_cpu_intr___intr15___bit 15
391#define reg_iop_sw_spu_rw_cpu_intr_offset 148
392
393/* Register r_cpu_intr, scope iop_sw_spu, type r */
394#define reg_iop_sw_spu_r_cpu_intr___intr0___lsb 0
395#define reg_iop_sw_spu_r_cpu_intr___intr0___width 1
396#define reg_iop_sw_spu_r_cpu_intr___intr0___bit 0
397#define reg_iop_sw_spu_r_cpu_intr___intr1___lsb 1
398#define reg_iop_sw_spu_r_cpu_intr___intr1___width 1
399#define reg_iop_sw_spu_r_cpu_intr___intr1___bit 1
400#define reg_iop_sw_spu_r_cpu_intr___intr2___lsb 2
401#define reg_iop_sw_spu_r_cpu_intr___intr2___width 1
402#define reg_iop_sw_spu_r_cpu_intr___intr2___bit 2
403#define reg_iop_sw_spu_r_cpu_intr___intr3___lsb 3
404#define reg_iop_sw_spu_r_cpu_intr___intr3___width 1
405#define reg_iop_sw_spu_r_cpu_intr___intr3___bit 3
406#define reg_iop_sw_spu_r_cpu_intr___intr4___lsb 4
407#define reg_iop_sw_spu_r_cpu_intr___intr4___width 1
408#define reg_iop_sw_spu_r_cpu_intr___intr4___bit 4
409#define reg_iop_sw_spu_r_cpu_intr___intr5___lsb 5
410#define reg_iop_sw_spu_r_cpu_intr___intr5___width 1
411#define reg_iop_sw_spu_r_cpu_intr___intr5___bit 5
412#define reg_iop_sw_spu_r_cpu_intr___intr6___lsb 6
413#define reg_iop_sw_spu_r_cpu_intr___intr6___width 1
414#define reg_iop_sw_spu_r_cpu_intr___intr6___bit 6
415#define reg_iop_sw_spu_r_cpu_intr___intr7___lsb 7
416#define reg_iop_sw_spu_r_cpu_intr___intr7___width 1
417#define reg_iop_sw_spu_r_cpu_intr___intr7___bit 7
418#define reg_iop_sw_spu_r_cpu_intr___intr8___lsb 8
419#define reg_iop_sw_spu_r_cpu_intr___intr8___width 1
420#define reg_iop_sw_spu_r_cpu_intr___intr8___bit 8
421#define reg_iop_sw_spu_r_cpu_intr___intr9___lsb 9
422#define reg_iop_sw_spu_r_cpu_intr___intr9___width 1
423#define reg_iop_sw_spu_r_cpu_intr___intr9___bit 9
424#define reg_iop_sw_spu_r_cpu_intr___intr10___lsb 10
425#define reg_iop_sw_spu_r_cpu_intr___intr10___width 1
426#define reg_iop_sw_spu_r_cpu_intr___intr10___bit 10
427#define reg_iop_sw_spu_r_cpu_intr___intr11___lsb 11
428#define reg_iop_sw_spu_r_cpu_intr___intr11___width 1
429#define reg_iop_sw_spu_r_cpu_intr___intr11___bit 11
430#define reg_iop_sw_spu_r_cpu_intr___intr12___lsb 12
431#define reg_iop_sw_spu_r_cpu_intr___intr12___width 1
432#define reg_iop_sw_spu_r_cpu_intr___intr12___bit 12
433#define reg_iop_sw_spu_r_cpu_intr___intr13___lsb 13
434#define reg_iop_sw_spu_r_cpu_intr___intr13___width 1
435#define reg_iop_sw_spu_r_cpu_intr___intr13___bit 13
436#define reg_iop_sw_spu_r_cpu_intr___intr14___lsb 14
437#define reg_iop_sw_spu_r_cpu_intr___intr14___width 1
438#define reg_iop_sw_spu_r_cpu_intr___intr14___bit 14
439#define reg_iop_sw_spu_r_cpu_intr___intr15___lsb 15
440#define reg_iop_sw_spu_r_cpu_intr___intr15___width 1
441#define reg_iop_sw_spu_r_cpu_intr___intr15___bit 15
442#define reg_iop_sw_spu_r_cpu_intr_offset 152
443
444/* Register r_hw_intr, scope iop_sw_spu, type r */
445#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___lsb 0
446#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___width 1
447#define reg_iop_sw_spu_r_hw_intr___trigger_grp0___bit 0
448#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___lsb 1
449#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___width 1
450#define reg_iop_sw_spu_r_hw_intr___trigger_grp1___bit 1
451#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___lsb 2
452#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___width 1
453#define reg_iop_sw_spu_r_hw_intr___trigger_grp2___bit 2
454#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___lsb 3
455#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___width 1
456#define reg_iop_sw_spu_r_hw_intr___trigger_grp3___bit 3
457#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___lsb 4
458#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___width 1
459#define reg_iop_sw_spu_r_hw_intr___trigger_grp4___bit 4
460#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___lsb 5
461#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___width 1
462#define reg_iop_sw_spu_r_hw_intr___trigger_grp5___bit 5
463#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___lsb 6
464#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___width 1
465#define reg_iop_sw_spu_r_hw_intr___trigger_grp6___bit 6
466#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___lsb 7
467#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___width 1
468#define reg_iop_sw_spu_r_hw_intr___trigger_grp7___bit 7
469#define reg_iop_sw_spu_r_hw_intr___timer_grp0___lsb 8
470#define reg_iop_sw_spu_r_hw_intr___timer_grp0___width 1
471#define reg_iop_sw_spu_r_hw_intr___timer_grp0___bit 8
472#define reg_iop_sw_spu_r_hw_intr___timer_grp1___lsb 9
473#define reg_iop_sw_spu_r_hw_intr___timer_grp1___width 1
474#define reg_iop_sw_spu_r_hw_intr___timer_grp1___bit 9
475#define reg_iop_sw_spu_r_hw_intr___timer_grp2___lsb 10
476#define reg_iop_sw_spu_r_hw_intr___timer_grp2___width 1
477#define reg_iop_sw_spu_r_hw_intr___timer_grp2___bit 10
478#define reg_iop_sw_spu_r_hw_intr___timer_grp3___lsb 11
479#define reg_iop_sw_spu_r_hw_intr___timer_grp3___width 1
480#define reg_iop_sw_spu_r_hw_intr___timer_grp3___bit 11
481#define reg_iop_sw_spu_r_hw_intr___fifo_out0___lsb 12
482#define reg_iop_sw_spu_r_hw_intr___fifo_out0___width 1
483#define reg_iop_sw_spu_r_hw_intr___fifo_out0___bit 12
484#define reg_iop_sw_spu_r_hw_intr___fifo_out0_extra___lsb 13
485#define reg_iop_sw_spu_r_hw_intr___fifo_out0_extra___width 1
486#define reg_iop_sw_spu_r_hw_intr___fifo_out0_extra___bit 13
487#define reg_iop_sw_spu_r_hw_intr___fifo_in0___lsb 14
488#define reg_iop_sw_spu_r_hw_intr___fifo_in0___width 1
489#define reg_iop_sw_spu_r_hw_intr___fifo_in0___bit 14
490#define reg_iop_sw_spu_r_hw_intr___fifo_in0_extra___lsb 15
491#define reg_iop_sw_spu_r_hw_intr___fifo_in0_extra___width 1
492#define reg_iop_sw_spu_r_hw_intr___fifo_in0_extra___bit 15
493#define reg_iop_sw_spu_r_hw_intr___fifo_out1___lsb 16
494#define reg_iop_sw_spu_r_hw_intr___fifo_out1___width 1
495#define reg_iop_sw_spu_r_hw_intr___fifo_out1___bit 16
496#define reg_iop_sw_spu_r_hw_intr___fifo_out1_extra___lsb 17
497#define reg_iop_sw_spu_r_hw_intr___fifo_out1_extra___width 1
498#define reg_iop_sw_spu_r_hw_intr___fifo_out1_extra___bit 17
499#define reg_iop_sw_spu_r_hw_intr___fifo_in1___lsb 18
500#define reg_iop_sw_spu_r_hw_intr___fifo_in1___width 1
501#define reg_iop_sw_spu_r_hw_intr___fifo_in1___bit 18
502#define reg_iop_sw_spu_r_hw_intr___fifo_in1_extra___lsb 19
503#define reg_iop_sw_spu_r_hw_intr___fifo_in1_extra___width 1
504#define reg_iop_sw_spu_r_hw_intr___fifo_in1_extra___bit 19
505#define reg_iop_sw_spu_r_hw_intr___dmc_out0___lsb 20
506#define reg_iop_sw_spu_r_hw_intr___dmc_out0___width 1
507#define reg_iop_sw_spu_r_hw_intr___dmc_out0___bit 20
508#define reg_iop_sw_spu_r_hw_intr___dmc_in0___lsb 21
509#define reg_iop_sw_spu_r_hw_intr___dmc_in0___width 1
510#define reg_iop_sw_spu_r_hw_intr___dmc_in0___bit 21
511#define reg_iop_sw_spu_r_hw_intr___dmc_out1___lsb 22
512#define reg_iop_sw_spu_r_hw_intr___dmc_out1___width 1
513#define reg_iop_sw_spu_r_hw_intr___dmc_out1___bit 22
514#define reg_iop_sw_spu_r_hw_intr___dmc_in1___lsb 23
515#define reg_iop_sw_spu_r_hw_intr___dmc_in1___width 1
516#define reg_iop_sw_spu_r_hw_intr___dmc_in1___bit 23
517#define reg_iop_sw_spu_r_hw_intr_offset 156
518
519/* Register rw_mpu_intr, scope iop_sw_spu, type rw */
520#define reg_iop_sw_spu_rw_mpu_intr___intr0___lsb 0
521#define reg_iop_sw_spu_rw_mpu_intr___intr0___width 1
522#define reg_iop_sw_spu_rw_mpu_intr___intr0___bit 0
523#define reg_iop_sw_spu_rw_mpu_intr___intr1___lsb 1
524#define reg_iop_sw_spu_rw_mpu_intr___intr1___width 1
525#define reg_iop_sw_spu_rw_mpu_intr___intr1___bit 1
526#define reg_iop_sw_spu_rw_mpu_intr___intr2___lsb 2
527#define reg_iop_sw_spu_rw_mpu_intr___intr2___width 1
528#define reg_iop_sw_spu_rw_mpu_intr___intr2___bit 2
529#define reg_iop_sw_spu_rw_mpu_intr___intr3___lsb 3
530#define reg_iop_sw_spu_rw_mpu_intr___intr3___width 1
531#define reg_iop_sw_spu_rw_mpu_intr___intr3___bit 3
532#define reg_iop_sw_spu_rw_mpu_intr___intr4___lsb 4
533#define reg_iop_sw_spu_rw_mpu_intr___intr4___width 1
534#define reg_iop_sw_spu_rw_mpu_intr___intr4___bit 4
535#define reg_iop_sw_spu_rw_mpu_intr___intr5___lsb 5
536#define reg_iop_sw_spu_rw_mpu_intr___intr5___width 1
537#define reg_iop_sw_spu_rw_mpu_intr___intr5___bit 5
538#define reg_iop_sw_spu_rw_mpu_intr___intr6___lsb 6
539#define reg_iop_sw_spu_rw_mpu_intr___intr6___width 1
540#define reg_iop_sw_spu_rw_mpu_intr___intr6___bit 6
541#define reg_iop_sw_spu_rw_mpu_intr___intr7___lsb 7
542#define reg_iop_sw_spu_rw_mpu_intr___intr7___width 1
543#define reg_iop_sw_spu_rw_mpu_intr___intr7___bit 7
544#define reg_iop_sw_spu_rw_mpu_intr___intr8___lsb 8
545#define reg_iop_sw_spu_rw_mpu_intr___intr8___width 1
546#define reg_iop_sw_spu_rw_mpu_intr___intr8___bit 8
547#define reg_iop_sw_spu_rw_mpu_intr___intr9___lsb 9
548#define reg_iop_sw_spu_rw_mpu_intr___intr9___width 1
549#define reg_iop_sw_spu_rw_mpu_intr___intr9___bit 9
550#define reg_iop_sw_spu_rw_mpu_intr___intr10___lsb 10
551#define reg_iop_sw_spu_rw_mpu_intr___intr10___width 1
552#define reg_iop_sw_spu_rw_mpu_intr___intr10___bit 10
553#define reg_iop_sw_spu_rw_mpu_intr___intr11___lsb 11
554#define reg_iop_sw_spu_rw_mpu_intr___intr11___width 1
555#define reg_iop_sw_spu_rw_mpu_intr___intr11___bit 11
556#define reg_iop_sw_spu_rw_mpu_intr___intr12___lsb 12
557#define reg_iop_sw_spu_rw_mpu_intr___intr12___width 1
558#define reg_iop_sw_spu_rw_mpu_intr___intr12___bit 12
559#define reg_iop_sw_spu_rw_mpu_intr___intr13___lsb 13
560#define reg_iop_sw_spu_rw_mpu_intr___intr13___width 1
561#define reg_iop_sw_spu_rw_mpu_intr___intr13___bit 13
562#define reg_iop_sw_spu_rw_mpu_intr___intr14___lsb 14
563#define reg_iop_sw_spu_rw_mpu_intr___intr14___width 1
564#define reg_iop_sw_spu_rw_mpu_intr___intr14___bit 14
565#define reg_iop_sw_spu_rw_mpu_intr___intr15___lsb 15
566#define reg_iop_sw_spu_rw_mpu_intr___intr15___width 1
567#define reg_iop_sw_spu_rw_mpu_intr___intr15___bit 15
568#define reg_iop_sw_spu_rw_mpu_intr_offset 160
569
570/* Register r_mpu_intr, scope iop_sw_spu, type r */
571#define reg_iop_sw_spu_r_mpu_intr___intr0___lsb 0
572#define reg_iop_sw_spu_r_mpu_intr___intr0___width 1
573#define reg_iop_sw_spu_r_mpu_intr___intr0___bit 0
574#define reg_iop_sw_spu_r_mpu_intr___intr1___lsb 1
575#define reg_iop_sw_spu_r_mpu_intr___intr1___width 1
576#define reg_iop_sw_spu_r_mpu_intr___intr1___bit 1
577#define reg_iop_sw_spu_r_mpu_intr___intr2___lsb 2
578#define reg_iop_sw_spu_r_mpu_intr___intr2___width 1
579#define reg_iop_sw_spu_r_mpu_intr___intr2___bit 2
580#define reg_iop_sw_spu_r_mpu_intr___intr3___lsb 3
581#define reg_iop_sw_spu_r_mpu_intr___intr3___width 1
582#define reg_iop_sw_spu_r_mpu_intr___intr3___bit 3
583#define reg_iop_sw_spu_r_mpu_intr___intr4___lsb 4
584#define reg_iop_sw_spu_r_mpu_intr___intr4___width 1
585#define reg_iop_sw_spu_r_mpu_intr___intr4___bit 4
586#define reg_iop_sw_spu_r_mpu_intr___intr5___lsb 5
587#define reg_iop_sw_spu_r_mpu_intr___intr5___width 1
588#define reg_iop_sw_spu_r_mpu_intr___intr5___bit 5
589#define reg_iop_sw_spu_r_mpu_intr___intr6___lsb 6
590#define reg_iop_sw_spu_r_mpu_intr___intr6___width 1
591#define reg_iop_sw_spu_r_mpu_intr___intr6___bit 6
592#define reg_iop_sw_spu_r_mpu_intr___intr7___lsb 7
593#define reg_iop_sw_spu_r_mpu_intr___intr7___width 1
594#define reg_iop_sw_spu_r_mpu_intr___intr7___bit 7
595#define reg_iop_sw_spu_r_mpu_intr___intr8___lsb 8
596#define reg_iop_sw_spu_r_mpu_intr___intr8___width 1
597#define reg_iop_sw_spu_r_mpu_intr___intr8___bit 8
598#define reg_iop_sw_spu_r_mpu_intr___intr9___lsb 9
599#define reg_iop_sw_spu_r_mpu_intr___intr9___width 1
600#define reg_iop_sw_spu_r_mpu_intr___intr9___bit 9
601#define reg_iop_sw_spu_r_mpu_intr___intr10___lsb 10
602#define reg_iop_sw_spu_r_mpu_intr___intr10___width 1
603#define reg_iop_sw_spu_r_mpu_intr___intr10___bit 10
604#define reg_iop_sw_spu_r_mpu_intr___intr11___lsb 11
605#define reg_iop_sw_spu_r_mpu_intr___intr11___width 1
606#define reg_iop_sw_spu_r_mpu_intr___intr11___bit 11
607#define reg_iop_sw_spu_r_mpu_intr___intr12___lsb 12
608#define reg_iop_sw_spu_r_mpu_intr___intr12___width 1
609#define reg_iop_sw_spu_r_mpu_intr___intr12___bit 12
610#define reg_iop_sw_spu_r_mpu_intr___intr13___lsb 13
611#define reg_iop_sw_spu_r_mpu_intr___intr13___width 1
612#define reg_iop_sw_spu_r_mpu_intr___intr13___bit 13
613#define reg_iop_sw_spu_r_mpu_intr___intr14___lsb 14
614#define reg_iop_sw_spu_r_mpu_intr___intr14___width 1
615#define reg_iop_sw_spu_r_mpu_intr___intr14___bit 14
616#define reg_iop_sw_spu_r_mpu_intr___intr15___lsb 15
617#define reg_iop_sw_spu_r_mpu_intr___intr15___width 1
618#define reg_iop_sw_spu_r_mpu_intr___intr15___bit 15
619#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr0___lsb 16
620#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr0___width 1
621#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr0___bit 16
622#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr1___lsb 17
623#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr1___width 1
624#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr1___bit 17
625#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr2___lsb 18
626#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr2___width 1
627#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr2___bit 18
628#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr3___lsb 19
629#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr3___width 1
630#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr3___bit 19
631#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr4___lsb 20
632#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr4___width 1
633#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr4___bit 20
634#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr5___lsb 21
635#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr5___width 1
636#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr5___bit 21
637#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr6___lsb 22
638#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr6___width 1
639#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr6___bit 22
640#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr7___lsb 23
641#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr7___width 1
642#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr7___bit 23
643#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr8___lsb 24
644#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr8___width 1
645#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr8___bit 24
646#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr9___lsb 25
647#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr9___width 1
648#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr9___bit 25
649#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr10___lsb 26
650#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr10___width 1
651#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr10___bit 26
652#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr11___lsb 27
653#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr11___width 1
654#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr11___bit 27
655#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr12___lsb 28
656#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr12___width 1
657#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr12___bit 28
658#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr13___lsb 29
659#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr13___width 1
660#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr13___bit 29
661#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr14___lsb 30
662#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr14___width 1
663#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr14___bit 30
664#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr15___lsb 31
665#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr15___width 1
666#define reg_iop_sw_spu_r_mpu_intr___other_spu_intr15___bit 31
667#define reg_iop_sw_spu_r_mpu_intr_offset 164
668
669
670/* Constants */
671#define regk_iop_sw_spu_copy 0x00000000
672#define regk_iop_sw_spu_no 0x00000000
673#define regk_iop_sw_spu_nop 0x00000000
674#define regk_iop_sw_spu_rd 0x00000002
675#define regk_iop_sw_spu_reg_copy 0x00000001
676#define regk_iop_sw_spu_rw_bus0_clr_mask_default 0x00000000
677#define regk_iop_sw_spu_rw_bus0_oe_clr_mask_default 0x00000000
678#define regk_iop_sw_spu_rw_bus0_oe_set_mask_default 0x00000000
679#define regk_iop_sw_spu_rw_bus0_set_mask_default 0x00000000
680#define regk_iop_sw_spu_rw_bus1_clr_mask_default 0x00000000
681#define regk_iop_sw_spu_rw_bus1_oe_clr_mask_default 0x00000000
682#define regk_iop_sw_spu_rw_bus1_oe_set_mask_default 0x00000000
683#define regk_iop_sw_spu_rw_bus1_set_mask_default 0x00000000
684#define regk_iop_sw_spu_rw_gio_clr_mask_default 0x00000000
685#define regk_iop_sw_spu_rw_gio_oe_clr_mask_default 0x00000000
686#define regk_iop_sw_spu_rw_gio_oe_set_mask_default 0x00000000
687#define regk_iop_sw_spu_rw_gio_set_mask_default 0x00000000
688#define regk_iop_sw_spu_set 0x00000001
689#define regk_iop_sw_spu_wr 0x00000003
690#define regk_iop_sw_spu_yes 0x00000001
691#endif /* __iop_sw_spu_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_timer_grp_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_timer_grp_defs_asm.h
new file mode 100644
index 000000000000..7129a9a4bedc
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_timer_grp_defs_asm.h
@@ -0,0 +1,237 @@
1#ifndef __iop_timer_grp_defs_asm_h
2#define __iop_timer_grp_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_timer_grp.r
7 * id: iop_timer_grp.r,v 1.29 2005/02/16 09:13:27 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_timer_grp_defs_asm.h ../../inst/io_proc/rtl/iop_timer_grp.r
11 * id: $Id: iop_timer_grp_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register rw_cfg, scope iop_timer_grp, type rw */
57#define reg_iop_timer_grp_rw_cfg___clk_src___lsb 0
58#define reg_iop_timer_grp_rw_cfg___clk_src___width 1
59#define reg_iop_timer_grp_rw_cfg___clk_src___bit 0
60#define reg_iop_timer_grp_rw_cfg___trig___lsb 1
61#define reg_iop_timer_grp_rw_cfg___trig___width 2
62#define reg_iop_timer_grp_rw_cfg___clk_gen_div___lsb 3
63#define reg_iop_timer_grp_rw_cfg___clk_gen_div___width 8
64#define reg_iop_timer_grp_rw_cfg___clk_div___lsb 11
65#define reg_iop_timer_grp_rw_cfg___clk_div___width 8
66#define reg_iop_timer_grp_rw_cfg_offset 0
67
68/* Register rw_half_period, scope iop_timer_grp, type rw */
69#define reg_iop_timer_grp_rw_half_period___quota_lo___lsb 0
70#define reg_iop_timer_grp_rw_half_period___quota_lo___width 15
71#define reg_iop_timer_grp_rw_half_period___quota_hi___lsb 15
72#define reg_iop_timer_grp_rw_half_period___quota_hi___width 15
73#define reg_iop_timer_grp_rw_half_period___quota_hi_sel___lsb 30
74#define reg_iop_timer_grp_rw_half_period___quota_hi_sel___width 1
75#define reg_iop_timer_grp_rw_half_period___quota_hi_sel___bit 30
76#define reg_iop_timer_grp_rw_half_period_offset 4
77
78/* Register rw_half_period_len, scope iop_timer_grp, type rw */
79#define reg_iop_timer_grp_rw_half_period_len_offset 8
80
81#define STRIDE_iop_timer_grp_rw_tmr_cfg 4
82/* Register rw_tmr_cfg, scope iop_timer_grp, type rw */
83#define reg_iop_timer_grp_rw_tmr_cfg___clk_src___lsb 0
84#define reg_iop_timer_grp_rw_tmr_cfg___clk_src___width 3
85#define reg_iop_timer_grp_rw_tmr_cfg___strb___lsb 3
86#define reg_iop_timer_grp_rw_tmr_cfg___strb___width 2
87#define reg_iop_timer_grp_rw_tmr_cfg___run_mode___lsb 5
88#define reg_iop_timer_grp_rw_tmr_cfg___run_mode___width 2
89#define reg_iop_timer_grp_rw_tmr_cfg___out_mode___lsb 7
90#define reg_iop_timer_grp_rw_tmr_cfg___out_mode___width 1
91#define reg_iop_timer_grp_rw_tmr_cfg___out_mode___bit 7
92#define reg_iop_timer_grp_rw_tmr_cfg___active_on_tmr___lsb 8
93#define reg_iop_timer_grp_rw_tmr_cfg___active_on_tmr___width 2
94#define reg_iop_timer_grp_rw_tmr_cfg___inv___lsb 10
95#define reg_iop_timer_grp_rw_tmr_cfg___inv___width 1
96#define reg_iop_timer_grp_rw_tmr_cfg___inv___bit 10
97#define reg_iop_timer_grp_rw_tmr_cfg___en_by_tmr___lsb 11
98#define reg_iop_timer_grp_rw_tmr_cfg___en_by_tmr___width 2
99#define reg_iop_timer_grp_rw_tmr_cfg___dis_by_tmr___lsb 13
100#define reg_iop_timer_grp_rw_tmr_cfg___dis_by_tmr___width 2
101#define reg_iop_timer_grp_rw_tmr_cfg___en_only_by_reg___lsb 15
102#define reg_iop_timer_grp_rw_tmr_cfg___en_only_by_reg___width 1
103#define reg_iop_timer_grp_rw_tmr_cfg___en_only_by_reg___bit 15
104#define reg_iop_timer_grp_rw_tmr_cfg___dis_only_by_reg___lsb 16
105#define reg_iop_timer_grp_rw_tmr_cfg___dis_only_by_reg___width 1
106#define reg_iop_timer_grp_rw_tmr_cfg___dis_only_by_reg___bit 16
107#define reg_iop_timer_grp_rw_tmr_cfg___rst_at_en_strb___lsb 17
108#define reg_iop_timer_grp_rw_tmr_cfg___rst_at_en_strb___width 1
109#define reg_iop_timer_grp_rw_tmr_cfg___rst_at_en_strb___bit 17
110#define reg_iop_timer_grp_rw_tmr_cfg_offset 12
111
112#define STRIDE_iop_timer_grp_rw_tmr_len 4
113/* Register rw_tmr_len, scope iop_timer_grp, type rw */
114#define reg_iop_timer_grp_rw_tmr_len___val___lsb 0
115#define reg_iop_timer_grp_rw_tmr_len___val___width 16
116#define reg_iop_timer_grp_rw_tmr_len_offset 44
117
118/* Register rw_cmd, scope iop_timer_grp, type rw */
119#define reg_iop_timer_grp_rw_cmd___rst___lsb 0
120#define reg_iop_timer_grp_rw_cmd___rst___width 4
121#define reg_iop_timer_grp_rw_cmd___en___lsb 4
122#define reg_iop_timer_grp_rw_cmd___en___width 4
123#define reg_iop_timer_grp_rw_cmd___dis___lsb 8
124#define reg_iop_timer_grp_rw_cmd___dis___width 4
125#define reg_iop_timer_grp_rw_cmd___strb___lsb 12
126#define reg_iop_timer_grp_rw_cmd___strb___width 4
127#define reg_iop_timer_grp_rw_cmd_offset 60
128
129/* Register r_clk_gen_cnt, scope iop_timer_grp, type r */
130#define reg_iop_timer_grp_r_clk_gen_cnt_offset 64
131
132#define STRIDE_iop_timer_grp_rs_tmr_cnt 8
133/* Register rs_tmr_cnt, scope iop_timer_grp, type rs */
134#define reg_iop_timer_grp_rs_tmr_cnt___val___lsb 0
135#define reg_iop_timer_grp_rs_tmr_cnt___val___width 16
136#define reg_iop_timer_grp_rs_tmr_cnt_offset 68
137
138#define STRIDE_iop_timer_grp_r_tmr_cnt 8
139/* Register r_tmr_cnt, scope iop_timer_grp, type r */
140#define reg_iop_timer_grp_r_tmr_cnt___val___lsb 0
141#define reg_iop_timer_grp_r_tmr_cnt___val___width 16
142#define reg_iop_timer_grp_r_tmr_cnt_offset 72
143
144/* Register rw_intr_mask, scope iop_timer_grp, type rw */
145#define reg_iop_timer_grp_rw_intr_mask___tmr0___lsb 0
146#define reg_iop_timer_grp_rw_intr_mask___tmr0___width 1
147#define reg_iop_timer_grp_rw_intr_mask___tmr0___bit 0
148#define reg_iop_timer_grp_rw_intr_mask___tmr1___lsb 1
149#define reg_iop_timer_grp_rw_intr_mask___tmr1___width 1
150#define reg_iop_timer_grp_rw_intr_mask___tmr1___bit 1
151#define reg_iop_timer_grp_rw_intr_mask___tmr2___lsb 2
152#define reg_iop_timer_grp_rw_intr_mask___tmr2___width 1
153#define reg_iop_timer_grp_rw_intr_mask___tmr2___bit 2
154#define reg_iop_timer_grp_rw_intr_mask___tmr3___lsb 3
155#define reg_iop_timer_grp_rw_intr_mask___tmr3___width 1
156#define reg_iop_timer_grp_rw_intr_mask___tmr3___bit 3
157#define reg_iop_timer_grp_rw_intr_mask_offset 100
158
159/* Register rw_ack_intr, scope iop_timer_grp, type rw */
160#define reg_iop_timer_grp_rw_ack_intr___tmr0___lsb 0
161#define reg_iop_timer_grp_rw_ack_intr___tmr0___width 1
162#define reg_iop_timer_grp_rw_ack_intr___tmr0___bit 0
163#define reg_iop_timer_grp_rw_ack_intr___tmr1___lsb 1
164#define reg_iop_timer_grp_rw_ack_intr___tmr1___width 1
165#define reg_iop_timer_grp_rw_ack_intr___tmr1___bit 1
166#define reg_iop_timer_grp_rw_ack_intr___tmr2___lsb 2
167#define reg_iop_timer_grp_rw_ack_intr___tmr2___width 1
168#define reg_iop_timer_grp_rw_ack_intr___tmr2___bit 2
169#define reg_iop_timer_grp_rw_ack_intr___tmr3___lsb 3
170#define reg_iop_timer_grp_rw_ack_intr___tmr3___width 1
171#define reg_iop_timer_grp_rw_ack_intr___tmr3___bit 3
172#define reg_iop_timer_grp_rw_ack_intr_offset 104
173
174/* Register r_intr, scope iop_timer_grp, type r */
175#define reg_iop_timer_grp_r_intr___tmr0___lsb 0
176#define reg_iop_timer_grp_r_intr___tmr0___width 1
177#define reg_iop_timer_grp_r_intr___tmr0___bit 0
178#define reg_iop_timer_grp_r_intr___tmr1___lsb 1
179#define reg_iop_timer_grp_r_intr___tmr1___width 1
180#define reg_iop_timer_grp_r_intr___tmr1___bit 1
181#define reg_iop_timer_grp_r_intr___tmr2___lsb 2
182#define reg_iop_timer_grp_r_intr___tmr2___width 1
183#define reg_iop_timer_grp_r_intr___tmr2___bit 2
184#define reg_iop_timer_grp_r_intr___tmr3___lsb 3
185#define reg_iop_timer_grp_r_intr___tmr3___width 1
186#define reg_iop_timer_grp_r_intr___tmr3___bit 3
187#define reg_iop_timer_grp_r_intr_offset 108
188
189/* Register r_masked_intr, scope iop_timer_grp, type r */
190#define reg_iop_timer_grp_r_masked_intr___tmr0___lsb 0
191#define reg_iop_timer_grp_r_masked_intr___tmr0___width 1
192#define reg_iop_timer_grp_r_masked_intr___tmr0___bit 0
193#define reg_iop_timer_grp_r_masked_intr___tmr1___lsb 1
194#define reg_iop_timer_grp_r_masked_intr___tmr1___width 1
195#define reg_iop_timer_grp_r_masked_intr___tmr1___bit 1
196#define reg_iop_timer_grp_r_masked_intr___tmr2___lsb 2
197#define reg_iop_timer_grp_r_masked_intr___tmr2___width 1
198#define reg_iop_timer_grp_r_masked_intr___tmr2___bit 2
199#define reg_iop_timer_grp_r_masked_intr___tmr3___lsb 3
200#define reg_iop_timer_grp_r_masked_intr___tmr3___width 1
201#define reg_iop_timer_grp_r_masked_intr___tmr3___bit 3
202#define reg_iop_timer_grp_r_masked_intr_offset 112
203
204
205/* Constants */
206#define regk_iop_timer_grp_clk200 0x00000000
207#define regk_iop_timer_grp_clk_gen 0x00000002
208#define regk_iop_timer_grp_complete 0x00000002
209#define regk_iop_timer_grp_div_clk200 0x00000001
210#define regk_iop_timer_grp_div_clk_gen 0x00000003
211#define regk_iop_timer_grp_ext 0x00000001
212#define regk_iop_timer_grp_hi 0x00000000
213#define regk_iop_timer_grp_long_period 0x00000001
214#define regk_iop_timer_grp_neg 0x00000002
215#define regk_iop_timer_grp_no 0x00000000
216#define regk_iop_timer_grp_once 0x00000003
217#define regk_iop_timer_grp_pause 0x00000001
218#define regk_iop_timer_grp_pos 0x00000001
219#define regk_iop_timer_grp_pos_neg 0x00000003
220#define regk_iop_timer_grp_pulse 0x00000000
221#define regk_iop_timer_grp_r_tmr_cnt_size 0x00000004
222#define regk_iop_timer_grp_rs_tmr_cnt_size 0x00000004
223#define regk_iop_timer_grp_rw_cfg_default 0x00000002
224#define regk_iop_timer_grp_rw_intr_mask_default 0x00000000
225#define regk_iop_timer_grp_rw_tmr_cfg_default0 0x00018000
226#define regk_iop_timer_grp_rw_tmr_cfg_default1 0x0001a900
227#define regk_iop_timer_grp_rw_tmr_cfg_default2 0x0001d200
228#define regk_iop_timer_grp_rw_tmr_cfg_default3 0x0001fb00
229#define regk_iop_timer_grp_rw_tmr_cfg_size 0x00000004
230#define regk_iop_timer_grp_rw_tmr_len_default 0x00000000
231#define regk_iop_timer_grp_rw_tmr_len_size 0x00000004
232#define regk_iop_timer_grp_short_period 0x00000000
233#define regk_iop_timer_grp_stop 0x00000000
234#define regk_iop_timer_grp_tmr 0x00000004
235#define regk_iop_timer_grp_toggle 0x00000001
236#define regk_iop_timer_grp_yes 0x00000001
237#endif /* __iop_timer_grp_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_trigger_grp_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_trigger_grp_defs_asm.h
new file mode 100644
index 000000000000..1005d9db80dc
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_trigger_grp_defs_asm.h
@@ -0,0 +1,157 @@
1#ifndef __iop_trigger_grp_defs_asm_h
2#define __iop_trigger_grp_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_trigger_grp.r
7 * id: iop_trigger_grp.r,v 0.20 2005/02/16 09:13:20 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_trigger_grp_defs_asm.h ../../inst/io_proc/rtl/iop_trigger_grp.r
11 * id: $Id: iop_trigger_grp_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56#define STRIDE_iop_trigger_grp_rw_cfg 4
57/* Register rw_cfg, scope iop_trigger_grp, type rw */
58#define reg_iop_trigger_grp_rw_cfg___action___lsb 0
59#define reg_iop_trigger_grp_rw_cfg___action___width 2
60#define reg_iop_trigger_grp_rw_cfg___once___lsb 2
61#define reg_iop_trigger_grp_rw_cfg___once___width 1
62#define reg_iop_trigger_grp_rw_cfg___once___bit 2
63#define reg_iop_trigger_grp_rw_cfg___trig___lsb 3
64#define reg_iop_trigger_grp_rw_cfg___trig___width 3
65#define reg_iop_trigger_grp_rw_cfg___en_only_by_reg___lsb 6
66#define reg_iop_trigger_grp_rw_cfg___en_only_by_reg___width 1
67#define reg_iop_trigger_grp_rw_cfg___en_only_by_reg___bit 6
68#define reg_iop_trigger_grp_rw_cfg___dis_only_by_reg___lsb 7
69#define reg_iop_trigger_grp_rw_cfg___dis_only_by_reg___width 1
70#define reg_iop_trigger_grp_rw_cfg___dis_only_by_reg___bit 7
71#define reg_iop_trigger_grp_rw_cfg_offset 0
72
73/* Register rw_cmd, scope iop_trigger_grp, type rw */
74#define reg_iop_trigger_grp_rw_cmd___dis___lsb 0
75#define reg_iop_trigger_grp_rw_cmd___dis___width 4
76#define reg_iop_trigger_grp_rw_cmd___en___lsb 4
77#define reg_iop_trigger_grp_rw_cmd___en___width 4
78#define reg_iop_trigger_grp_rw_cmd_offset 16
79
80/* Register rw_intr_mask, scope iop_trigger_grp, type rw */
81#define reg_iop_trigger_grp_rw_intr_mask___trig0___lsb 0
82#define reg_iop_trigger_grp_rw_intr_mask___trig0___width 1
83#define reg_iop_trigger_grp_rw_intr_mask___trig0___bit 0
84#define reg_iop_trigger_grp_rw_intr_mask___trig1___lsb 1
85#define reg_iop_trigger_grp_rw_intr_mask___trig1___width 1
86#define reg_iop_trigger_grp_rw_intr_mask___trig1___bit 1
87#define reg_iop_trigger_grp_rw_intr_mask___trig2___lsb 2
88#define reg_iop_trigger_grp_rw_intr_mask___trig2___width 1
89#define reg_iop_trigger_grp_rw_intr_mask___trig2___bit 2
90#define reg_iop_trigger_grp_rw_intr_mask___trig3___lsb 3
91#define reg_iop_trigger_grp_rw_intr_mask___trig3___width 1
92#define reg_iop_trigger_grp_rw_intr_mask___trig3___bit 3
93#define reg_iop_trigger_grp_rw_intr_mask_offset 20
94
95/* Register rw_ack_intr, scope iop_trigger_grp, type rw */
96#define reg_iop_trigger_grp_rw_ack_intr___trig0___lsb 0
97#define reg_iop_trigger_grp_rw_ack_intr___trig0___width 1
98#define reg_iop_trigger_grp_rw_ack_intr___trig0___bit 0
99#define reg_iop_trigger_grp_rw_ack_intr___trig1___lsb 1
100#define reg_iop_trigger_grp_rw_ack_intr___trig1___width 1
101#define reg_iop_trigger_grp_rw_ack_intr___trig1___bit 1
102#define reg_iop_trigger_grp_rw_ack_intr___trig2___lsb 2
103#define reg_iop_trigger_grp_rw_ack_intr___trig2___width 1
104#define reg_iop_trigger_grp_rw_ack_intr___trig2___bit 2
105#define reg_iop_trigger_grp_rw_ack_intr___trig3___lsb 3
106#define reg_iop_trigger_grp_rw_ack_intr___trig3___width 1
107#define reg_iop_trigger_grp_rw_ack_intr___trig3___bit 3
108#define reg_iop_trigger_grp_rw_ack_intr_offset 24
109
110/* Register r_intr, scope iop_trigger_grp, type r */
111#define reg_iop_trigger_grp_r_intr___trig0___lsb 0
112#define reg_iop_trigger_grp_r_intr___trig0___width 1
113#define reg_iop_trigger_grp_r_intr___trig0___bit 0
114#define reg_iop_trigger_grp_r_intr___trig1___lsb 1
115#define reg_iop_trigger_grp_r_intr___trig1___width 1
116#define reg_iop_trigger_grp_r_intr___trig1___bit 1
117#define reg_iop_trigger_grp_r_intr___trig2___lsb 2
118#define reg_iop_trigger_grp_r_intr___trig2___width 1
119#define reg_iop_trigger_grp_r_intr___trig2___bit 2
120#define reg_iop_trigger_grp_r_intr___trig3___lsb 3
121#define reg_iop_trigger_grp_r_intr___trig3___width 1
122#define reg_iop_trigger_grp_r_intr___trig3___bit 3
123#define reg_iop_trigger_grp_r_intr_offset 28
124
125/* Register r_masked_intr, scope iop_trigger_grp, type r */
126#define reg_iop_trigger_grp_r_masked_intr___trig0___lsb 0
127#define reg_iop_trigger_grp_r_masked_intr___trig0___width 1
128#define reg_iop_trigger_grp_r_masked_intr___trig0___bit 0
129#define reg_iop_trigger_grp_r_masked_intr___trig1___lsb 1
130#define reg_iop_trigger_grp_r_masked_intr___trig1___width 1
131#define reg_iop_trigger_grp_r_masked_intr___trig1___bit 1
132#define reg_iop_trigger_grp_r_masked_intr___trig2___lsb 2
133#define reg_iop_trigger_grp_r_masked_intr___trig2___width 1
134#define reg_iop_trigger_grp_r_masked_intr___trig2___bit 2
135#define reg_iop_trigger_grp_r_masked_intr___trig3___lsb 3
136#define reg_iop_trigger_grp_r_masked_intr___trig3___width 1
137#define reg_iop_trigger_grp_r_masked_intr___trig3___bit 3
138#define reg_iop_trigger_grp_r_masked_intr_offset 32
139
140
141/* Constants */
142#define regk_iop_trigger_grp_fall 0x00000002
143#define regk_iop_trigger_grp_fall_lo 0x00000006
144#define regk_iop_trigger_grp_no 0x00000000
145#define regk_iop_trigger_grp_off 0x00000000
146#define regk_iop_trigger_grp_pulse 0x00000000
147#define regk_iop_trigger_grp_rise 0x00000001
148#define regk_iop_trigger_grp_rise_fall 0x00000003
149#define regk_iop_trigger_grp_rise_fall_hi 0x00000007
150#define regk_iop_trigger_grp_rise_fall_lo 0x00000004
151#define regk_iop_trigger_grp_rise_hi 0x00000005
152#define regk_iop_trigger_grp_rw_cfg_default 0x000000c0
153#define regk_iop_trigger_grp_rw_cfg_size 0x00000004
154#define regk_iop_trigger_grp_rw_intr_mask_default 0x00000000
155#define regk_iop_trigger_grp_toggle 0x00000003
156#define regk_iop_trigger_grp_yes 0x00000001
157#endif /* __iop_trigger_grp_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/asm/iop_version_defs_asm.h b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_version_defs_asm.h
new file mode 100644
index 000000000000..e13feb20a7e3
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/asm/iop_version_defs_asm.h
@@ -0,0 +1,64 @@
1#ifndef __iop_version_defs_asm_h
2#define __iop_version_defs_asm_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_version.r
7 * id: iop_version.r,v 1.3 2004/04/22 12:37:54 jonaso Exp
8 * last modfied: Mon Apr 11 16:08:44 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c -asm --outfile asm/iop_version_defs_asm.h ../../inst/io_proc/rtl/guinness/iop_version.r
11 * id: $Id: iop_version_defs_asm.h,v 1.5 2005/04/24 18:31:07 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16
17#ifndef REG_FIELD
18#define REG_FIELD( scope, reg, field, value ) \
19 REG_FIELD_X_( value, reg_##scope##_##reg##___##field##___lsb )
20#define REG_FIELD_X_( value, shift ) ((value) << shift)
21#endif
22
23#ifndef REG_STATE
24#define REG_STATE( scope, reg, field, symbolic_value ) \
25 REG_STATE_X_( regk_##scope##_##symbolic_value, reg_##scope##_##reg##___##field##___lsb )
26#define REG_STATE_X_( k, shift ) (k << shift)
27#endif
28
29#ifndef REG_MASK
30#define REG_MASK( scope, reg, field ) \
31 REG_MASK_X_( reg_##scope##_##reg##___##field##___width, reg_##scope##_##reg##___##field##___lsb )
32#define REG_MASK_X_( width, lsb ) (((1 << width)-1) << lsb)
33#endif
34
35#ifndef REG_LSB
36#define REG_LSB( scope, reg, field ) reg_##scope##_##reg##___##field##___lsb
37#endif
38
39#ifndef REG_BIT
40#define REG_BIT( scope, reg, field ) reg_##scope##_##reg##___##field##___bit
41#endif
42
43#ifndef REG_ADDR
44#define REG_ADDR( scope, inst, reg ) REG_ADDR_X_(inst, reg_##scope##_##reg##_offset)
45#define REG_ADDR_X_( inst, offs ) ((inst) + offs)
46#endif
47
48#ifndef REG_ADDR_VECT
49#define REG_ADDR_VECT( scope, inst, reg, index ) \
50 REG_ADDR_VECT_X_(inst, reg_##scope##_##reg##_offset, index, \
51 STRIDE_##scope##_##reg )
52#define REG_ADDR_VECT_X_( inst, offs, index, stride ) \
53 ((inst) + offs + (index) * stride)
54#endif
55
56/* Register r_version, scope iop_version, type r */
57#define reg_iop_version_r_version___nr___lsb 0
58#define reg_iop_version_r_version___nr___width 8
59#define reg_iop_version_r_version_offset 0
60
61
62/* Constants */
63#define regk_iop_version_v1_0 0x00000001
64#endif /* __iop_version_defs_asm_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_crc_par_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_crc_par_defs.h
new file mode 100644
index 000000000000..90e4785b6474
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_crc_par_defs.h
@@ -0,0 +1,232 @@
1#ifndef __iop_crc_par_defs_h
2#define __iop_crc_par_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_crc_par.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_crc_par_defs.h ../../inst/io_proc/rtl/iop_crc_par.r
11 * id: $Id: iop_crc_par_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_crc_par */
86
87/* Register rw_cfg, scope iop_crc_par, type rw */
88typedef struct {
89 unsigned int mode : 1;
90 unsigned int crc_out : 1;
91 unsigned int rev_out : 1;
92 unsigned int inv_out : 1;
93 unsigned int trig : 2;
94 unsigned int poly : 3;
95 unsigned int dummy1 : 23;
96} reg_iop_crc_par_rw_cfg;
97#define REG_RD_ADDR_iop_crc_par_rw_cfg 0
98#define REG_WR_ADDR_iop_crc_par_rw_cfg 0
99
100/* Register rw_init_crc, scope iop_crc_par, type rw */
101typedef unsigned int reg_iop_crc_par_rw_init_crc;
102#define REG_RD_ADDR_iop_crc_par_rw_init_crc 4
103#define REG_WR_ADDR_iop_crc_par_rw_init_crc 4
104
105/* Register rw_correct_crc, scope iop_crc_par, type rw */
106typedef unsigned int reg_iop_crc_par_rw_correct_crc;
107#define REG_RD_ADDR_iop_crc_par_rw_correct_crc 8
108#define REG_WR_ADDR_iop_crc_par_rw_correct_crc 8
109
110/* Register rw_ctrl, scope iop_crc_par, type rw */
111typedef struct {
112 unsigned int en : 1;
113 unsigned int dummy1 : 31;
114} reg_iop_crc_par_rw_ctrl;
115#define REG_RD_ADDR_iop_crc_par_rw_ctrl 12
116#define REG_WR_ADDR_iop_crc_par_rw_ctrl 12
117
118/* Register rw_set_last, scope iop_crc_par, type rw */
119typedef struct {
120 unsigned int tr_dif : 1;
121 unsigned int dummy1 : 31;
122} reg_iop_crc_par_rw_set_last;
123#define REG_RD_ADDR_iop_crc_par_rw_set_last 16
124#define REG_WR_ADDR_iop_crc_par_rw_set_last 16
125
126/* Register rw_wr1byte, scope iop_crc_par, type rw */
127typedef struct {
128 unsigned int data : 8;
129 unsigned int dummy1 : 24;
130} reg_iop_crc_par_rw_wr1byte;
131#define REG_RD_ADDR_iop_crc_par_rw_wr1byte 20
132#define REG_WR_ADDR_iop_crc_par_rw_wr1byte 20
133
134/* Register rw_wr2byte, scope iop_crc_par, type rw */
135typedef struct {
136 unsigned int data : 16;
137 unsigned int dummy1 : 16;
138} reg_iop_crc_par_rw_wr2byte;
139#define REG_RD_ADDR_iop_crc_par_rw_wr2byte 24
140#define REG_WR_ADDR_iop_crc_par_rw_wr2byte 24
141
142/* Register rw_wr3byte, scope iop_crc_par, type rw */
143typedef struct {
144 unsigned int data : 24;
145 unsigned int dummy1 : 8;
146} reg_iop_crc_par_rw_wr3byte;
147#define REG_RD_ADDR_iop_crc_par_rw_wr3byte 28
148#define REG_WR_ADDR_iop_crc_par_rw_wr3byte 28
149
150/* Register rw_wr4byte, scope iop_crc_par, type rw */
151typedef struct {
152 unsigned int data : 32;
153} reg_iop_crc_par_rw_wr4byte;
154#define REG_RD_ADDR_iop_crc_par_rw_wr4byte 32
155#define REG_WR_ADDR_iop_crc_par_rw_wr4byte 32
156
157/* Register rw_wr1byte_last, scope iop_crc_par, type rw */
158typedef struct {
159 unsigned int data : 8;
160 unsigned int dummy1 : 24;
161} reg_iop_crc_par_rw_wr1byte_last;
162#define REG_RD_ADDR_iop_crc_par_rw_wr1byte_last 36
163#define REG_WR_ADDR_iop_crc_par_rw_wr1byte_last 36
164
165/* Register rw_wr2byte_last, scope iop_crc_par, type rw */
166typedef struct {
167 unsigned int data : 16;
168 unsigned int dummy1 : 16;
169} reg_iop_crc_par_rw_wr2byte_last;
170#define REG_RD_ADDR_iop_crc_par_rw_wr2byte_last 40
171#define REG_WR_ADDR_iop_crc_par_rw_wr2byte_last 40
172
173/* Register rw_wr3byte_last, scope iop_crc_par, type rw */
174typedef struct {
175 unsigned int data : 24;
176 unsigned int dummy1 : 8;
177} reg_iop_crc_par_rw_wr3byte_last;
178#define REG_RD_ADDR_iop_crc_par_rw_wr3byte_last 44
179#define REG_WR_ADDR_iop_crc_par_rw_wr3byte_last 44
180
181/* Register rw_wr4byte_last, scope iop_crc_par, type rw */
182typedef struct {
183 unsigned int data : 32;
184} reg_iop_crc_par_rw_wr4byte_last;
185#define REG_RD_ADDR_iop_crc_par_rw_wr4byte_last 48
186#define REG_WR_ADDR_iop_crc_par_rw_wr4byte_last 48
187
188/* Register r_stat, scope iop_crc_par, type r */
189typedef struct {
190 unsigned int err : 1;
191 unsigned int busy : 1;
192 unsigned int dummy1 : 30;
193} reg_iop_crc_par_r_stat;
194#define REG_RD_ADDR_iop_crc_par_r_stat 52
195
196/* Register r_sh_reg, scope iop_crc_par, type r */
197typedef unsigned int reg_iop_crc_par_r_sh_reg;
198#define REG_RD_ADDR_iop_crc_par_r_sh_reg 56
199
200/* Register r_crc, scope iop_crc_par, type r */
201typedef unsigned int reg_iop_crc_par_r_crc;
202#define REG_RD_ADDR_iop_crc_par_r_crc 60
203
204/* Register rw_strb_rec_dif_in, scope iop_crc_par, type rw */
205typedef struct {
206 unsigned int last : 2;
207 unsigned int dummy1 : 30;
208} reg_iop_crc_par_rw_strb_rec_dif_in;
209#define REG_RD_ADDR_iop_crc_par_rw_strb_rec_dif_in 64
210#define REG_WR_ADDR_iop_crc_par_rw_strb_rec_dif_in 64
211
212
213/* Constants */
214enum {
215 regk_iop_crc_par_calc = 0x00000001,
216 regk_iop_crc_par_ccitt = 0x00000002,
217 regk_iop_crc_par_check = 0x00000000,
218 regk_iop_crc_par_crc16 = 0x00000001,
219 regk_iop_crc_par_crc32 = 0x00000000,
220 regk_iop_crc_par_crc5 = 0x00000003,
221 regk_iop_crc_par_crc5_11 = 0x00000004,
222 regk_iop_crc_par_dif_in = 0x00000002,
223 regk_iop_crc_par_hi = 0x00000000,
224 regk_iop_crc_par_neg = 0x00000002,
225 regk_iop_crc_par_no = 0x00000000,
226 regk_iop_crc_par_pos = 0x00000001,
227 regk_iop_crc_par_pos_neg = 0x00000003,
228 regk_iop_crc_par_rw_cfg_default = 0x00000000,
229 regk_iop_crc_par_rw_ctrl_default = 0x00000000,
230 regk_iop_crc_par_yes = 0x00000001
231};
232#endif /* __iop_crc_par_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_in_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_in_defs.h
new file mode 100644
index 000000000000..76aec6e37f3e
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_in_defs.h
@@ -0,0 +1,325 @@
1#ifndef __iop_dmc_in_defs_h
2#define __iop_dmc_in_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_dmc_in.r
7 * id: iop_dmc_in.r,v 1.26 2005/02/16 09:14:17 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_dmc_in_defs.h ../../inst/io_proc/rtl/iop_dmc_in.r
11 * id: $Id: iop_dmc_in_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_dmc_in */
86
87/* Register rw_cfg, scope iop_dmc_in, type rw */
88typedef struct {
89 unsigned int sth_intr : 3;
90 unsigned int last_dis_dif : 1;
91 unsigned int dummy1 : 28;
92} reg_iop_dmc_in_rw_cfg;
93#define REG_RD_ADDR_iop_dmc_in_rw_cfg 0
94#define REG_WR_ADDR_iop_dmc_in_rw_cfg 0
95
96/* Register rw_ctrl, scope iop_dmc_in, type rw */
97typedef struct {
98 unsigned int dif_en : 1;
99 unsigned int dif_dis : 1;
100 unsigned int stream_clr : 1;
101 unsigned int dummy1 : 29;
102} reg_iop_dmc_in_rw_ctrl;
103#define REG_RD_ADDR_iop_dmc_in_rw_ctrl 4
104#define REG_WR_ADDR_iop_dmc_in_rw_ctrl 4
105
106/* Register r_stat, scope iop_dmc_in, type r */
107typedef struct {
108 unsigned int dif_en : 1;
109 unsigned int dummy1 : 31;
110} reg_iop_dmc_in_r_stat;
111#define REG_RD_ADDR_iop_dmc_in_r_stat 8
112
113/* Register rw_stream_cmd, scope iop_dmc_in, type rw */
114typedef struct {
115 unsigned int cmd : 10;
116 unsigned int dummy1 : 6;
117 unsigned int n : 8;
118 unsigned int dummy2 : 8;
119} reg_iop_dmc_in_rw_stream_cmd;
120#define REG_RD_ADDR_iop_dmc_in_rw_stream_cmd 12
121#define REG_WR_ADDR_iop_dmc_in_rw_stream_cmd 12
122
123/* Register rw_stream_wr_data, scope iop_dmc_in, type rw */
124typedef unsigned int reg_iop_dmc_in_rw_stream_wr_data;
125#define REG_RD_ADDR_iop_dmc_in_rw_stream_wr_data 16
126#define REG_WR_ADDR_iop_dmc_in_rw_stream_wr_data 16
127
128/* Register rw_stream_wr_data_last, scope iop_dmc_in, type rw */
129typedef unsigned int reg_iop_dmc_in_rw_stream_wr_data_last;
130#define REG_RD_ADDR_iop_dmc_in_rw_stream_wr_data_last 20
131#define REG_WR_ADDR_iop_dmc_in_rw_stream_wr_data_last 20
132
133/* Register rw_stream_ctrl, scope iop_dmc_in, type rw */
134typedef struct {
135 unsigned int eop : 1;
136 unsigned int wait : 1;
137 unsigned int keep_md : 1;
138 unsigned int size : 3;
139 unsigned int dummy1 : 26;
140} reg_iop_dmc_in_rw_stream_ctrl;
141#define REG_RD_ADDR_iop_dmc_in_rw_stream_ctrl 24
142#define REG_WR_ADDR_iop_dmc_in_rw_stream_ctrl 24
143
144/* Register r_stream_stat, scope iop_dmc_in, type r */
145typedef struct {
146 unsigned int sth : 7;
147 unsigned int dummy1 : 9;
148 unsigned int full : 1;
149 unsigned int last_pkt : 1;
150 unsigned int data_md_valid : 1;
151 unsigned int ctxt_md_valid : 1;
152 unsigned int group_md_valid : 1;
153 unsigned int stream_busy : 1;
154 unsigned int cmd_rdy : 1;
155 unsigned int dummy2 : 9;
156} reg_iop_dmc_in_r_stream_stat;
157#define REG_RD_ADDR_iop_dmc_in_r_stream_stat 28
158
159/* Register r_data_descr, scope iop_dmc_in, type r */
160typedef struct {
161 unsigned int ctrl : 8;
162 unsigned int stat : 8;
163 unsigned int md : 16;
164} reg_iop_dmc_in_r_data_descr;
165#define REG_RD_ADDR_iop_dmc_in_r_data_descr 32
166
167/* Register r_ctxt_descr, scope iop_dmc_in, type r */
168typedef struct {
169 unsigned int ctrl : 8;
170 unsigned int stat : 8;
171 unsigned int md0 : 16;
172} reg_iop_dmc_in_r_ctxt_descr;
173#define REG_RD_ADDR_iop_dmc_in_r_ctxt_descr 36
174
175/* Register r_ctxt_descr_md1, scope iop_dmc_in, type r */
176typedef unsigned int reg_iop_dmc_in_r_ctxt_descr_md1;
177#define REG_RD_ADDR_iop_dmc_in_r_ctxt_descr_md1 40
178
179/* Register r_ctxt_descr_md2, scope iop_dmc_in, type r */
180typedef unsigned int reg_iop_dmc_in_r_ctxt_descr_md2;
181#define REG_RD_ADDR_iop_dmc_in_r_ctxt_descr_md2 44
182
183/* Register r_group_descr, scope iop_dmc_in, type r */
184typedef struct {
185 unsigned int ctrl : 8;
186 unsigned int stat : 8;
187 unsigned int md : 16;
188} reg_iop_dmc_in_r_group_descr;
189#define REG_RD_ADDR_iop_dmc_in_r_group_descr 56
190
191/* Register rw_data_descr, scope iop_dmc_in, type rw */
192typedef struct {
193 unsigned int dummy1 : 16;
194 unsigned int md : 16;
195} reg_iop_dmc_in_rw_data_descr;
196#define REG_RD_ADDR_iop_dmc_in_rw_data_descr 60
197#define REG_WR_ADDR_iop_dmc_in_rw_data_descr 60
198
199/* Register rw_ctxt_descr, scope iop_dmc_in, type rw */
200typedef struct {
201 unsigned int dummy1 : 16;
202 unsigned int md0 : 16;
203} reg_iop_dmc_in_rw_ctxt_descr;
204#define REG_RD_ADDR_iop_dmc_in_rw_ctxt_descr 64
205#define REG_WR_ADDR_iop_dmc_in_rw_ctxt_descr 64
206
207/* Register rw_ctxt_descr_md1, scope iop_dmc_in, type rw */
208typedef unsigned int reg_iop_dmc_in_rw_ctxt_descr_md1;
209#define REG_RD_ADDR_iop_dmc_in_rw_ctxt_descr_md1 68
210#define REG_WR_ADDR_iop_dmc_in_rw_ctxt_descr_md1 68
211
212/* Register rw_ctxt_descr_md2, scope iop_dmc_in, type rw */
213typedef unsigned int reg_iop_dmc_in_rw_ctxt_descr_md2;
214#define REG_RD_ADDR_iop_dmc_in_rw_ctxt_descr_md2 72
215#define REG_WR_ADDR_iop_dmc_in_rw_ctxt_descr_md2 72
216
217/* Register rw_group_descr, scope iop_dmc_in, type rw */
218typedef struct {
219 unsigned int dummy1 : 16;
220 unsigned int md : 16;
221} reg_iop_dmc_in_rw_group_descr;
222#define REG_RD_ADDR_iop_dmc_in_rw_group_descr 84
223#define REG_WR_ADDR_iop_dmc_in_rw_group_descr 84
224
225/* Register rw_intr_mask, scope iop_dmc_in, type rw */
226typedef struct {
227 unsigned int data_md : 1;
228 unsigned int ctxt_md : 1;
229 unsigned int group_md : 1;
230 unsigned int cmd_rdy : 1;
231 unsigned int sth : 1;
232 unsigned int full : 1;
233 unsigned int dummy1 : 26;
234} reg_iop_dmc_in_rw_intr_mask;
235#define REG_RD_ADDR_iop_dmc_in_rw_intr_mask 88
236#define REG_WR_ADDR_iop_dmc_in_rw_intr_mask 88
237
238/* Register rw_ack_intr, scope iop_dmc_in, type rw */
239typedef struct {
240 unsigned int data_md : 1;
241 unsigned int ctxt_md : 1;
242 unsigned int group_md : 1;
243 unsigned int cmd_rdy : 1;
244 unsigned int sth : 1;
245 unsigned int full : 1;
246 unsigned int dummy1 : 26;
247} reg_iop_dmc_in_rw_ack_intr;
248#define REG_RD_ADDR_iop_dmc_in_rw_ack_intr 92
249#define REG_WR_ADDR_iop_dmc_in_rw_ack_intr 92
250
251/* Register r_intr, scope iop_dmc_in, type r */
252typedef struct {
253 unsigned int data_md : 1;
254 unsigned int ctxt_md : 1;
255 unsigned int group_md : 1;
256 unsigned int cmd_rdy : 1;
257 unsigned int sth : 1;
258 unsigned int full : 1;
259 unsigned int dummy1 : 26;
260} reg_iop_dmc_in_r_intr;
261#define REG_RD_ADDR_iop_dmc_in_r_intr 96
262
263/* Register r_masked_intr, scope iop_dmc_in, type r */
264typedef struct {
265 unsigned int data_md : 1;
266 unsigned int ctxt_md : 1;
267 unsigned int group_md : 1;
268 unsigned int cmd_rdy : 1;
269 unsigned int sth : 1;
270 unsigned int full : 1;
271 unsigned int dummy1 : 26;
272} reg_iop_dmc_in_r_masked_intr;
273#define REG_RD_ADDR_iop_dmc_in_r_masked_intr 100
274
275
276/* Constants */
277enum {
278 regk_iop_dmc_in_ack_pkt = 0x00000100,
279 regk_iop_dmc_in_array = 0x00000008,
280 regk_iop_dmc_in_burst = 0x00000020,
281 regk_iop_dmc_in_copy_next = 0x00000010,
282 regk_iop_dmc_in_copy_up = 0x00000020,
283 regk_iop_dmc_in_dis_c = 0x00000010,
284 regk_iop_dmc_in_dis_g = 0x00000020,
285 regk_iop_dmc_in_lim1 = 0x00000000,
286 regk_iop_dmc_in_lim16 = 0x00000004,
287 regk_iop_dmc_in_lim2 = 0x00000001,
288 regk_iop_dmc_in_lim32 = 0x00000005,
289 regk_iop_dmc_in_lim4 = 0x00000002,
290 regk_iop_dmc_in_lim64 = 0x00000006,
291 regk_iop_dmc_in_lim8 = 0x00000003,
292 regk_iop_dmc_in_load_c = 0x00000200,
293 regk_iop_dmc_in_load_c_n = 0x00000280,
294 regk_iop_dmc_in_load_c_next = 0x00000240,
295 regk_iop_dmc_in_load_d = 0x00000140,
296 regk_iop_dmc_in_load_g = 0x00000300,
297 regk_iop_dmc_in_load_g_down = 0x000003c0,
298 regk_iop_dmc_in_load_g_next = 0x00000340,
299 regk_iop_dmc_in_load_g_up = 0x00000380,
300 regk_iop_dmc_in_next_en = 0x00000010,
301 regk_iop_dmc_in_next_pkt = 0x00000010,
302 regk_iop_dmc_in_no = 0x00000000,
303 regk_iop_dmc_in_restore = 0x00000020,
304 regk_iop_dmc_in_rw_cfg_default = 0x00000000,
305 regk_iop_dmc_in_rw_ctxt_descr_default = 0x00000000,
306 regk_iop_dmc_in_rw_ctxt_descr_md1_default = 0x00000000,
307 regk_iop_dmc_in_rw_ctxt_descr_md2_default = 0x00000000,
308 regk_iop_dmc_in_rw_data_descr_default = 0x00000000,
309 regk_iop_dmc_in_rw_group_descr_default = 0x00000000,
310 regk_iop_dmc_in_rw_intr_mask_default = 0x00000000,
311 regk_iop_dmc_in_rw_stream_ctrl_default = 0x00000000,
312 regk_iop_dmc_in_save_down = 0x00000020,
313 regk_iop_dmc_in_save_up = 0x00000020,
314 regk_iop_dmc_in_set_reg = 0x00000050,
315 regk_iop_dmc_in_set_w_size1 = 0x00000190,
316 regk_iop_dmc_in_set_w_size2 = 0x000001a0,
317 regk_iop_dmc_in_set_w_size4 = 0x000001c0,
318 regk_iop_dmc_in_store_c = 0x00000002,
319 regk_iop_dmc_in_store_descr = 0x00000000,
320 regk_iop_dmc_in_store_g = 0x00000004,
321 regk_iop_dmc_in_store_md = 0x00000001,
322 regk_iop_dmc_in_update_down = 0x00000020,
323 regk_iop_dmc_in_yes = 0x00000001
324};
325#endif /* __iop_dmc_in_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_out_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_out_defs.h
new file mode 100644
index 000000000000..938a0d4c4604
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_dmc_out_defs.h
@@ -0,0 +1,326 @@
1#ifndef __iop_dmc_out_defs_h
2#define __iop_dmc_out_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_dmc_out.r
7 * id: iop_dmc_out.r,v 1.30 2005/02/16 09:14:11 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_dmc_out_defs.h ../../inst/io_proc/rtl/iop_dmc_out.r
11 * id: $Id: iop_dmc_out_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_dmc_out */
86
87/* Register rw_cfg, scope iop_dmc_out, type rw */
88typedef struct {
89 unsigned int trf_lim : 16;
90 unsigned int last_at_trf_lim : 1;
91 unsigned int dth_intr : 3;
92 unsigned int dummy1 : 12;
93} reg_iop_dmc_out_rw_cfg;
94#define REG_RD_ADDR_iop_dmc_out_rw_cfg 0
95#define REG_WR_ADDR_iop_dmc_out_rw_cfg 0
96
97/* Register rw_ctrl, scope iop_dmc_out, type rw */
98typedef struct {
99 unsigned int dif_en : 1;
100 unsigned int dif_dis : 1;
101 unsigned int dummy1 : 30;
102} reg_iop_dmc_out_rw_ctrl;
103#define REG_RD_ADDR_iop_dmc_out_rw_ctrl 4
104#define REG_WR_ADDR_iop_dmc_out_rw_ctrl 4
105
106/* Register r_stat, scope iop_dmc_out, type r */
107typedef struct {
108 unsigned int dif_en : 1;
109 unsigned int dummy1 : 31;
110} reg_iop_dmc_out_r_stat;
111#define REG_RD_ADDR_iop_dmc_out_r_stat 8
112
113/* Register rw_stream_cmd, scope iop_dmc_out, type rw */
114typedef struct {
115 unsigned int cmd : 10;
116 unsigned int dummy1 : 6;
117 unsigned int n : 8;
118 unsigned int dummy2 : 8;
119} reg_iop_dmc_out_rw_stream_cmd;
120#define REG_RD_ADDR_iop_dmc_out_rw_stream_cmd 12
121#define REG_WR_ADDR_iop_dmc_out_rw_stream_cmd 12
122
123/* Register rs_stream_data, scope iop_dmc_out, type rs */
124typedef unsigned int reg_iop_dmc_out_rs_stream_data;
125#define REG_RD_ADDR_iop_dmc_out_rs_stream_data 16
126
127/* Register r_stream_data, scope iop_dmc_out, type r */
128typedef unsigned int reg_iop_dmc_out_r_stream_data;
129#define REG_RD_ADDR_iop_dmc_out_r_stream_data 20
130
131/* Register r_stream_stat, scope iop_dmc_out, type r */
132typedef struct {
133 unsigned int dth : 7;
134 unsigned int dummy1 : 9;
135 unsigned int dv : 1;
136 unsigned int all_avail : 1;
137 unsigned int last : 1;
138 unsigned int size : 3;
139 unsigned int data_md_valid : 1;
140 unsigned int ctxt_md_valid : 1;
141 unsigned int group_md_valid : 1;
142 unsigned int stream_busy : 1;
143 unsigned int cmd_rdy : 1;
144 unsigned int cmd_rq : 1;
145 unsigned int dummy2 : 4;
146} reg_iop_dmc_out_r_stream_stat;
147#define REG_RD_ADDR_iop_dmc_out_r_stream_stat 24
148
149/* Register r_data_descr, scope iop_dmc_out, type r */
150typedef struct {
151 unsigned int ctrl : 8;
152 unsigned int stat : 8;
153 unsigned int md : 16;
154} reg_iop_dmc_out_r_data_descr;
155#define REG_RD_ADDR_iop_dmc_out_r_data_descr 28
156
157/* Register r_ctxt_descr, scope iop_dmc_out, type r */
158typedef struct {
159 unsigned int ctrl : 8;
160 unsigned int stat : 8;
161 unsigned int md0 : 16;
162} reg_iop_dmc_out_r_ctxt_descr;
163#define REG_RD_ADDR_iop_dmc_out_r_ctxt_descr 32
164
165/* Register r_ctxt_descr_md1, scope iop_dmc_out, type r */
166typedef unsigned int reg_iop_dmc_out_r_ctxt_descr_md1;
167#define REG_RD_ADDR_iop_dmc_out_r_ctxt_descr_md1 36
168
169/* Register r_ctxt_descr_md2, scope iop_dmc_out, type r */
170typedef unsigned int reg_iop_dmc_out_r_ctxt_descr_md2;
171#define REG_RD_ADDR_iop_dmc_out_r_ctxt_descr_md2 40
172
173/* Register r_group_descr, scope iop_dmc_out, type r */
174typedef struct {
175 unsigned int ctrl : 8;
176 unsigned int stat : 8;
177 unsigned int md : 16;
178} reg_iop_dmc_out_r_group_descr;
179#define REG_RD_ADDR_iop_dmc_out_r_group_descr 52
180
181/* Register rw_data_descr, scope iop_dmc_out, type rw */
182typedef struct {
183 unsigned int dummy1 : 16;
184 unsigned int md : 16;
185} reg_iop_dmc_out_rw_data_descr;
186#define REG_RD_ADDR_iop_dmc_out_rw_data_descr 56
187#define REG_WR_ADDR_iop_dmc_out_rw_data_descr 56
188
189/* Register rw_ctxt_descr, scope iop_dmc_out, type rw */
190typedef struct {
191 unsigned int dummy1 : 16;
192 unsigned int md0 : 16;
193} reg_iop_dmc_out_rw_ctxt_descr;
194#define REG_RD_ADDR_iop_dmc_out_rw_ctxt_descr 60
195#define REG_WR_ADDR_iop_dmc_out_rw_ctxt_descr 60
196
197/* Register rw_ctxt_descr_md1, scope iop_dmc_out, type rw */
198typedef unsigned int reg_iop_dmc_out_rw_ctxt_descr_md1;
199#define REG_RD_ADDR_iop_dmc_out_rw_ctxt_descr_md1 64
200#define REG_WR_ADDR_iop_dmc_out_rw_ctxt_descr_md1 64
201
202/* Register rw_ctxt_descr_md2, scope iop_dmc_out, type rw */
203typedef unsigned int reg_iop_dmc_out_rw_ctxt_descr_md2;
204#define REG_RD_ADDR_iop_dmc_out_rw_ctxt_descr_md2 68
205#define REG_WR_ADDR_iop_dmc_out_rw_ctxt_descr_md2 68
206
207/* Register rw_group_descr, scope iop_dmc_out, type rw */
208typedef struct {
209 unsigned int dummy1 : 16;
210 unsigned int md : 16;
211} reg_iop_dmc_out_rw_group_descr;
212#define REG_RD_ADDR_iop_dmc_out_rw_group_descr 80
213#define REG_WR_ADDR_iop_dmc_out_rw_group_descr 80
214
215/* Register rw_intr_mask, scope iop_dmc_out, type rw */
216typedef struct {
217 unsigned int data_md : 1;
218 unsigned int ctxt_md : 1;
219 unsigned int group_md : 1;
220 unsigned int cmd_rdy : 1;
221 unsigned int dth : 1;
222 unsigned int dv : 1;
223 unsigned int last_data : 1;
224 unsigned int trf_lim : 1;
225 unsigned int cmd_rq : 1;
226 unsigned int dummy1 : 23;
227} reg_iop_dmc_out_rw_intr_mask;
228#define REG_RD_ADDR_iop_dmc_out_rw_intr_mask 84
229#define REG_WR_ADDR_iop_dmc_out_rw_intr_mask 84
230
231/* Register rw_ack_intr, scope iop_dmc_out, type rw */
232typedef struct {
233 unsigned int data_md : 1;
234 unsigned int ctxt_md : 1;
235 unsigned int group_md : 1;
236 unsigned int cmd_rdy : 1;
237 unsigned int dth : 1;
238 unsigned int dv : 1;
239 unsigned int last_data : 1;
240 unsigned int trf_lim : 1;
241 unsigned int cmd_rq : 1;
242 unsigned int dummy1 : 23;
243} reg_iop_dmc_out_rw_ack_intr;
244#define REG_RD_ADDR_iop_dmc_out_rw_ack_intr 88
245#define REG_WR_ADDR_iop_dmc_out_rw_ack_intr 88
246
247/* Register r_intr, scope iop_dmc_out, type r */
248typedef struct {
249 unsigned int data_md : 1;
250 unsigned int ctxt_md : 1;
251 unsigned int group_md : 1;
252 unsigned int cmd_rdy : 1;
253 unsigned int dth : 1;
254 unsigned int dv : 1;
255 unsigned int last_data : 1;
256 unsigned int trf_lim : 1;
257 unsigned int cmd_rq : 1;
258 unsigned int dummy1 : 23;
259} reg_iop_dmc_out_r_intr;
260#define REG_RD_ADDR_iop_dmc_out_r_intr 92
261
262/* Register r_masked_intr, scope iop_dmc_out, type r */
263typedef struct {
264 unsigned int data_md : 1;
265 unsigned int ctxt_md : 1;
266 unsigned int group_md : 1;
267 unsigned int cmd_rdy : 1;
268 unsigned int dth : 1;
269 unsigned int dv : 1;
270 unsigned int last_data : 1;
271 unsigned int trf_lim : 1;
272 unsigned int cmd_rq : 1;
273 unsigned int dummy1 : 23;
274} reg_iop_dmc_out_r_masked_intr;
275#define REG_RD_ADDR_iop_dmc_out_r_masked_intr 96
276
277
278/* Constants */
279enum {
280 regk_iop_dmc_out_ack_pkt = 0x00000100,
281 regk_iop_dmc_out_array = 0x00000008,
282 regk_iop_dmc_out_burst = 0x00000020,
283 regk_iop_dmc_out_copy_next = 0x00000010,
284 regk_iop_dmc_out_copy_up = 0x00000020,
285 regk_iop_dmc_out_dis_c = 0x00000010,
286 regk_iop_dmc_out_dis_g = 0x00000020,
287 regk_iop_dmc_out_lim1 = 0x00000000,
288 regk_iop_dmc_out_lim16 = 0x00000004,
289 regk_iop_dmc_out_lim2 = 0x00000001,
290 regk_iop_dmc_out_lim32 = 0x00000005,
291 regk_iop_dmc_out_lim4 = 0x00000002,
292 regk_iop_dmc_out_lim64 = 0x00000006,
293 regk_iop_dmc_out_lim8 = 0x00000003,
294 regk_iop_dmc_out_load_c = 0x00000200,
295 regk_iop_dmc_out_load_c_n = 0x00000280,
296 regk_iop_dmc_out_load_c_next = 0x00000240,
297 regk_iop_dmc_out_load_d = 0x00000140,
298 regk_iop_dmc_out_load_g = 0x00000300,
299 regk_iop_dmc_out_load_g_down = 0x000003c0,
300 regk_iop_dmc_out_load_g_next = 0x00000340,
301 regk_iop_dmc_out_load_g_up = 0x00000380,
302 regk_iop_dmc_out_next_en = 0x00000010,
303 regk_iop_dmc_out_next_pkt = 0x00000010,
304 regk_iop_dmc_out_no = 0x00000000,
305 regk_iop_dmc_out_restore = 0x00000020,
306 regk_iop_dmc_out_rw_cfg_default = 0x00000000,
307 regk_iop_dmc_out_rw_ctxt_descr_default = 0x00000000,
308 regk_iop_dmc_out_rw_ctxt_descr_md1_default = 0x00000000,
309 regk_iop_dmc_out_rw_ctxt_descr_md2_default = 0x00000000,
310 regk_iop_dmc_out_rw_data_descr_default = 0x00000000,
311 regk_iop_dmc_out_rw_group_descr_default = 0x00000000,
312 regk_iop_dmc_out_rw_intr_mask_default = 0x00000000,
313 regk_iop_dmc_out_save_down = 0x00000020,
314 regk_iop_dmc_out_save_up = 0x00000020,
315 regk_iop_dmc_out_set_reg = 0x00000050,
316 regk_iop_dmc_out_set_w_size1 = 0x00000190,
317 regk_iop_dmc_out_set_w_size2 = 0x000001a0,
318 regk_iop_dmc_out_set_w_size4 = 0x000001c0,
319 regk_iop_dmc_out_store_c = 0x00000002,
320 regk_iop_dmc_out_store_descr = 0x00000000,
321 regk_iop_dmc_out_store_g = 0x00000004,
322 regk_iop_dmc_out_store_md = 0x00000001,
323 regk_iop_dmc_out_update_down = 0x00000020,
324 regk_iop_dmc_out_yes = 0x00000001
325};
326#endif /* __iop_dmc_out_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_defs.h
new file mode 100644
index 000000000000..e0c982b263fa
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_defs.h
@@ -0,0 +1,255 @@
1#ifndef __iop_fifo_in_defs_h
2#define __iop_fifo_in_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_in.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:07 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_fifo_in_defs.h ../../inst/io_proc/rtl/iop_fifo_in.r
11 * id: $Id: iop_fifo_in_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_fifo_in */
86
87/* Register rw_cfg, scope iop_fifo_in, type rw */
88typedef struct {
89 unsigned int avail_lim : 3;
90 unsigned int byte_order : 2;
91 unsigned int trig : 2;
92 unsigned int last_dis_dif_in : 1;
93 unsigned int mode : 2;
94 unsigned int dummy1 : 22;
95} reg_iop_fifo_in_rw_cfg;
96#define REG_RD_ADDR_iop_fifo_in_rw_cfg 0
97#define REG_WR_ADDR_iop_fifo_in_rw_cfg 0
98
99/* Register rw_ctrl, scope iop_fifo_in, type rw */
100typedef struct {
101 unsigned int dif_in_en : 1;
102 unsigned int dif_out_en : 1;
103 unsigned int dummy1 : 30;
104} reg_iop_fifo_in_rw_ctrl;
105#define REG_RD_ADDR_iop_fifo_in_rw_ctrl 4
106#define REG_WR_ADDR_iop_fifo_in_rw_ctrl 4
107
108/* Register r_stat, scope iop_fifo_in, type r */
109typedef struct {
110 unsigned int avail_bytes : 4;
111 unsigned int last : 8;
112 unsigned int dif_in_en : 1;
113 unsigned int dif_out_en : 1;
114 unsigned int dummy1 : 18;
115} reg_iop_fifo_in_r_stat;
116#define REG_RD_ADDR_iop_fifo_in_r_stat 8
117
118/* Register rs_rd1byte, scope iop_fifo_in, type rs */
119typedef struct {
120 unsigned int data : 8;
121 unsigned int dummy1 : 24;
122} reg_iop_fifo_in_rs_rd1byte;
123#define REG_RD_ADDR_iop_fifo_in_rs_rd1byte 12
124
125/* Register r_rd1byte, scope iop_fifo_in, type r */
126typedef struct {
127 unsigned int data : 8;
128 unsigned int dummy1 : 24;
129} reg_iop_fifo_in_r_rd1byte;
130#define REG_RD_ADDR_iop_fifo_in_r_rd1byte 16
131
132/* Register rs_rd2byte, scope iop_fifo_in, type rs */
133typedef struct {
134 unsigned int data : 16;
135 unsigned int dummy1 : 16;
136} reg_iop_fifo_in_rs_rd2byte;
137#define REG_RD_ADDR_iop_fifo_in_rs_rd2byte 20
138
139/* Register r_rd2byte, scope iop_fifo_in, type r */
140typedef struct {
141 unsigned int data : 16;
142 unsigned int dummy1 : 16;
143} reg_iop_fifo_in_r_rd2byte;
144#define REG_RD_ADDR_iop_fifo_in_r_rd2byte 24
145
146/* Register rs_rd3byte, scope iop_fifo_in, type rs */
147typedef struct {
148 unsigned int data : 24;
149 unsigned int dummy1 : 8;
150} reg_iop_fifo_in_rs_rd3byte;
151#define REG_RD_ADDR_iop_fifo_in_rs_rd3byte 28
152
153/* Register r_rd3byte, scope iop_fifo_in, type r */
154typedef struct {
155 unsigned int data : 24;
156 unsigned int dummy1 : 8;
157} reg_iop_fifo_in_r_rd3byte;
158#define REG_RD_ADDR_iop_fifo_in_r_rd3byte 32
159
160/* Register rs_rd4byte, scope iop_fifo_in, type rs */
161typedef struct {
162 unsigned int data : 32;
163} reg_iop_fifo_in_rs_rd4byte;
164#define REG_RD_ADDR_iop_fifo_in_rs_rd4byte 36
165
166/* Register r_rd4byte, scope iop_fifo_in, type r */
167typedef struct {
168 unsigned int data : 32;
169} reg_iop_fifo_in_r_rd4byte;
170#define REG_RD_ADDR_iop_fifo_in_r_rd4byte 40
171
172/* Register rw_set_last, scope iop_fifo_in, type rw */
173typedef unsigned int reg_iop_fifo_in_rw_set_last;
174#define REG_RD_ADDR_iop_fifo_in_rw_set_last 44
175#define REG_WR_ADDR_iop_fifo_in_rw_set_last 44
176
177/* Register rw_strb_dif_in, scope iop_fifo_in, type rw */
178typedef struct {
179 unsigned int last : 2;
180 unsigned int dummy1 : 30;
181} reg_iop_fifo_in_rw_strb_dif_in;
182#define REG_RD_ADDR_iop_fifo_in_rw_strb_dif_in 48
183#define REG_WR_ADDR_iop_fifo_in_rw_strb_dif_in 48
184
185/* Register rw_intr_mask, scope iop_fifo_in, type rw */
186typedef struct {
187 unsigned int urun : 1;
188 unsigned int last_data : 1;
189 unsigned int dav : 1;
190 unsigned int avail : 1;
191 unsigned int orun : 1;
192 unsigned int dummy1 : 27;
193} reg_iop_fifo_in_rw_intr_mask;
194#define REG_RD_ADDR_iop_fifo_in_rw_intr_mask 52
195#define REG_WR_ADDR_iop_fifo_in_rw_intr_mask 52
196
197/* Register rw_ack_intr, scope iop_fifo_in, type rw */
198typedef struct {
199 unsigned int urun : 1;
200 unsigned int last_data : 1;
201 unsigned int dav : 1;
202 unsigned int avail : 1;
203 unsigned int orun : 1;
204 unsigned int dummy1 : 27;
205} reg_iop_fifo_in_rw_ack_intr;
206#define REG_RD_ADDR_iop_fifo_in_rw_ack_intr 56
207#define REG_WR_ADDR_iop_fifo_in_rw_ack_intr 56
208
209/* Register r_intr, scope iop_fifo_in, type r */
210typedef struct {
211 unsigned int urun : 1;
212 unsigned int last_data : 1;
213 unsigned int dav : 1;
214 unsigned int avail : 1;
215 unsigned int orun : 1;
216 unsigned int dummy1 : 27;
217} reg_iop_fifo_in_r_intr;
218#define REG_RD_ADDR_iop_fifo_in_r_intr 60
219
220/* Register r_masked_intr, scope iop_fifo_in, type r */
221typedef struct {
222 unsigned int urun : 1;
223 unsigned int last_data : 1;
224 unsigned int dav : 1;
225 unsigned int avail : 1;
226 unsigned int orun : 1;
227 unsigned int dummy1 : 27;
228} reg_iop_fifo_in_r_masked_intr;
229#define REG_RD_ADDR_iop_fifo_in_r_masked_intr 64
230
231
232/* Constants */
233enum {
234 regk_iop_fifo_in_dif_in = 0x00000002,
235 regk_iop_fifo_in_hi = 0x00000000,
236 regk_iop_fifo_in_neg = 0x00000002,
237 regk_iop_fifo_in_no = 0x00000000,
238 regk_iop_fifo_in_order16 = 0x00000001,
239 regk_iop_fifo_in_order24 = 0x00000002,
240 regk_iop_fifo_in_order32 = 0x00000003,
241 regk_iop_fifo_in_order8 = 0x00000000,
242 regk_iop_fifo_in_pos = 0x00000001,
243 regk_iop_fifo_in_pos_neg = 0x00000003,
244 regk_iop_fifo_in_rw_cfg_default = 0x00000024,
245 regk_iop_fifo_in_rw_ctrl_default = 0x00000000,
246 regk_iop_fifo_in_rw_intr_mask_default = 0x00000000,
247 regk_iop_fifo_in_rw_set_last_default = 0x00000000,
248 regk_iop_fifo_in_rw_strb_dif_in_default = 0x00000000,
249 regk_iop_fifo_in_size16 = 0x00000002,
250 regk_iop_fifo_in_size24 = 0x00000001,
251 regk_iop_fifo_in_size32 = 0x00000000,
252 regk_iop_fifo_in_size8 = 0x00000003,
253 regk_iop_fifo_in_yes = 0x00000001
254};
255#endif /* __iop_fifo_in_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_extra_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_extra_defs.h
new file mode 100644
index 000000000000..798ac95870e9
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_in_extra_defs.h
@@ -0,0 +1,164 @@
1#ifndef __iop_fifo_in_extra_defs_h
2#define __iop_fifo_in_extra_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_in_extra.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:08 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_fifo_in_extra_defs.h ../../inst/io_proc/rtl/iop_fifo_in_extra.r
11 * id: $Id: iop_fifo_in_extra_defs.h,v 1.1 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_fifo_in_extra */
86
87/* Register rw_wr_data, scope iop_fifo_in_extra, type rw */
88typedef unsigned int reg_iop_fifo_in_extra_rw_wr_data;
89#define REG_RD_ADDR_iop_fifo_in_extra_rw_wr_data 0
90#define REG_WR_ADDR_iop_fifo_in_extra_rw_wr_data 0
91
92/* Register r_stat, scope iop_fifo_in_extra, type r */
93typedef struct {
94 unsigned int avail_bytes : 4;
95 unsigned int last : 8;
96 unsigned int dif_in_en : 1;
97 unsigned int dif_out_en : 1;
98 unsigned int dummy1 : 18;
99} reg_iop_fifo_in_extra_r_stat;
100#define REG_RD_ADDR_iop_fifo_in_extra_r_stat 4
101
102/* Register rw_strb_dif_in, scope iop_fifo_in_extra, type rw */
103typedef struct {
104 unsigned int last : 2;
105 unsigned int dummy1 : 30;
106} reg_iop_fifo_in_extra_rw_strb_dif_in;
107#define REG_RD_ADDR_iop_fifo_in_extra_rw_strb_dif_in 8
108#define REG_WR_ADDR_iop_fifo_in_extra_rw_strb_dif_in 8
109
110/* Register rw_intr_mask, scope iop_fifo_in_extra, type rw */
111typedef struct {
112 unsigned int urun : 1;
113 unsigned int last_data : 1;
114 unsigned int dav : 1;
115 unsigned int avail : 1;
116 unsigned int orun : 1;
117 unsigned int dummy1 : 27;
118} reg_iop_fifo_in_extra_rw_intr_mask;
119#define REG_RD_ADDR_iop_fifo_in_extra_rw_intr_mask 12
120#define REG_WR_ADDR_iop_fifo_in_extra_rw_intr_mask 12
121
122/* Register rw_ack_intr, scope iop_fifo_in_extra, type rw */
123typedef struct {
124 unsigned int urun : 1;
125 unsigned int last_data : 1;
126 unsigned int dav : 1;
127 unsigned int avail : 1;
128 unsigned int orun : 1;
129 unsigned int dummy1 : 27;
130} reg_iop_fifo_in_extra_rw_ack_intr;
131#define REG_RD_ADDR_iop_fifo_in_extra_rw_ack_intr 16
132#define REG_WR_ADDR_iop_fifo_in_extra_rw_ack_intr 16
133
134/* Register r_intr, scope iop_fifo_in_extra, type r */
135typedef struct {
136 unsigned int urun : 1;
137 unsigned int last_data : 1;
138 unsigned int dav : 1;
139 unsigned int avail : 1;
140 unsigned int orun : 1;
141 unsigned int dummy1 : 27;
142} reg_iop_fifo_in_extra_r_intr;
143#define REG_RD_ADDR_iop_fifo_in_extra_r_intr 20
144
145/* Register r_masked_intr, scope iop_fifo_in_extra, type r */
146typedef struct {
147 unsigned int urun : 1;
148 unsigned int last_data : 1;
149 unsigned int dav : 1;
150 unsigned int avail : 1;
151 unsigned int orun : 1;
152 unsigned int dummy1 : 27;
153} reg_iop_fifo_in_extra_r_masked_intr;
154#define REG_RD_ADDR_iop_fifo_in_extra_r_masked_intr 24
155
156
157/* Constants */
158enum {
159 regk_iop_fifo_in_extra_fifo_in = 0x00000002,
160 regk_iop_fifo_in_extra_no = 0x00000000,
161 regk_iop_fifo_in_extra_rw_intr_mask_default = 0x00000000,
162 regk_iop_fifo_in_extra_yes = 0x00000001
163};
164#endif /* __iop_fifo_in_extra_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_defs.h
new file mode 100644
index 000000000000..833e10f02526
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_defs.h
@@ -0,0 +1,278 @@
1#ifndef __iop_fifo_out_defs_h
2#define __iop_fifo_out_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_out.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:09 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_fifo_out_defs.h ../../inst/io_proc/rtl/iop_fifo_out.r
11 * id: $Id: iop_fifo_out_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_fifo_out */
86
87/* Register rw_cfg, scope iop_fifo_out, type rw */
88typedef struct {
89 unsigned int free_lim : 3;
90 unsigned int byte_order : 2;
91 unsigned int trig : 2;
92 unsigned int last_dis_dif_in : 1;
93 unsigned int mode : 2;
94 unsigned int delay_out_last : 1;
95 unsigned int last_dis_dif_out : 1;
96 unsigned int dummy1 : 20;
97} reg_iop_fifo_out_rw_cfg;
98#define REG_RD_ADDR_iop_fifo_out_rw_cfg 0
99#define REG_WR_ADDR_iop_fifo_out_rw_cfg 0
100
101/* Register rw_ctrl, scope iop_fifo_out, type rw */
102typedef struct {
103 unsigned int dif_in_en : 1;
104 unsigned int dif_out_en : 1;
105 unsigned int dummy1 : 30;
106} reg_iop_fifo_out_rw_ctrl;
107#define REG_RD_ADDR_iop_fifo_out_rw_ctrl 4
108#define REG_WR_ADDR_iop_fifo_out_rw_ctrl 4
109
110/* Register r_stat, scope iop_fifo_out, type r */
111typedef struct {
112 unsigned int avail_bytes : 4;
113 unsigned int last : 8;
114 unsigned int dif_in_en : 1;
115 unsigned int dif_out_en : 1;
116 unsigned int zero_data_last : 1;
117 unsigned int dummy1 : 17;
118} reg_iop_fifo_out_r_stat;
119#define REG_RD_ADDR_iop_fifo_out_r_stat 8
120
121/* Register rw_wr1byte, scope iop_fifo_out, type rw */
122typedef struct {
123 unsigned int data : 8;
124 unsigned int dummy1 : 24;
125} reg_iop_fifo_out_rw_wr1byte;
126#define REG_RD_ADDR_iop_fifo_out_rw_wr1byte 12
127#define REG_WR_ADDR_iop_fifo_out_rw_wr1byte 12
128
129/* Register rw_wr2byte, scope iop_fifo_out, type rw */
130typedef struct {
131 unsigned int data : 16;
132 unsigned int dummy1 : 16;
133} reg_iop_fifo_out_rw_wr2byte;
134#define REG_RD_ADDR_iop_fifo_out_rw_wr2byte 16
135#define REG_WR_ADDR_iop_fifo_out_rw_wr2byte 16
136
137/* Register rw_wr3byte, scope iop_fifo_out, type rw */
138typedef struct {
139 unsigned int data : 24;
140 unsigned int dummy1 : 8;
141} reg_iop_fifo_out_rw_wr3byte;
142#define REG_RD_ADDR_iop_fifo_out_rw_wr3byte 20
143#define REG_WR_ADDR_iop_fifo_out_rw_wr3byte 20
144
145/* Register rw_wr4byte, scope iop_fifo_out, type rw */
146typedef struct {
147 unsigned int data : 32;
148} reg_iop_fifo_out_rw_wr4byte;
149#define REG_RD_ADDR_iop_fifo_out_rw_wr4byte 24
150#define REG_WR_ADDR_iop_fifo_out_rw_wr4byte 24
151
152/* Register rw_wr1byte_last, scope iop_fifo_out, type rw */
153typedef struct {
154 unsigned int data : 8;
155 unsigned int dummy1 : 24;
156} reg_iop_fifo_out_rw_wr1byte_last;
157#define REG_RD_ADDR_iop_fifo_out_rw_wr1byte_last 28
158#define REG_WR_ADDR_iop_fifo_out_rw_wr1byte_last 28
159
160/* Register rw_wr2byte_last, scope iop_fifo_out, type rw */
161typedef struct {
162 unsigned int data : 16;
163 unsigned int dummy1 : 16;
164} reg_iop_fifo_out_rw_wr2byte_last;
165#define REG_RD_ADDR_iop_fifo_out_rw_wr2byte_last 32
166#define REG_WR_ADDR_iop_fifo_out_rw_wr2byte_last 32
167
168/* Register rw_wr3byte_last, scope iop_fifo_out, type rw */
169typedef struct {
170 unsigned int data : 24;
171 unsigned int dummy1 : 8;
172} reg_iop_fifo_out_rw_wr3byte_last;
173#define REG_RD_ADDR_iop_fifo_out_rw_wr3byte_last 36
174#define REG_WR_ADDR_iop_fifo_out_rw_wr3byte_last 36
175
176/* Register rw_wr4byte_last, scope iop_fifo_out, type rw */
177typedef struct {
178 unsigned int data : 32;
179} reg_iop_fifo_out_rw_wr4byte_last;
180#define REG_RD_ADDR_iop_fifo_out_rw_wr4byte_last 40
181#define REG_WR_ADDR_iop_fifo_out_rw_wr4byte_last 40
182
183/* Register rw_set_last, scope iop_fifo_out, type rw */
184typedef unsigned int reg_iop_fifo_out_rw_set_last;
185#define REG_RD_ADDR_iop_fifo_out_rw_set_last 44
186#define REG_WR_ADDR_iop_fifo_out_rw_set_last 44
187
188/* Register rs_rd_data, scope iop_fifo_out, type rs */
189typedef unsigned int reg_iop_fifo_out_rs_rd_data;
190#define REG_RD_ADDR_iop_fifo_out_rs_rd_data 48
191
192/* Register r_rd_data, scope iop_fifo_out, type r */
193typedef unsigned int reg_iop_fifo_out_r_rd_data;
194#define REG_RD_ADDR_iop_fifo_out_r_rd_data 52
195
196/* Register rw_strb_dif_out, scope iop_fifo_out, type rw */
197typedef unsigned int reg_iop_fifo_out_rw_strb_dif_out;
198#define REG_RD_ADDR_iop_fifo_out_rw_strb_dif_out 56
199#define REG_WR_ADDR_iop_fifo_out_rw_strb_dif_out 56
200
201/* Register rw_intr_mask, scope iop_fifo_out, type rw */
202typedef struct {
203 unsigned int urun : 1;
204 unsigned int last_data : 1;
205 unsigned int dav : 1;
206 unsigned int free : 1;
207 unsigned int orun : 1;
208 unsigned int dummy1 : 27;
209} reg_iop_fifo_out_rw_intr_mask;
210#define REG_RD_ADDR_iop_fifo_out_rw_intr_mask 60
211#define REG_WR_ADDR_iop_fifo_out_rw_intr_mask 60
212
213/* Register rw_ack_intr, scope iop_fifo_out, type rw */
214typedef struct {
215 unsigned int urun : 1;
216 unsigned int last_data : 1;
217 unsigned int dav : 1;
218 unsigned int free : 1;
219 unsigned int orun : 1;
220 unsigned int dummy1 : 27;
221} reg_iop_fifo_out_rw_ack_intr;
222#define REG_RD_ADDR_iop_fifo_out_rw_ack_intr 64
223#define REG_WR_ADDR_iop_fifo_out_rw_ack_intr 64
224
225/* Register r_intr, scope iop_fifo_out, type r */
226typedef struct {
227 unsigned int urun : 1;
228 unsigned int last_data : 1;
229 unsigned int dav : 1;
230 unsigned int free : 1;
231 unsigned int orun : 1;
232 unsigned int dummy1 : 27;
233} reg_iop_fifo_out_r_intr;
234#define REG_RD_ADDR_iop_fifo_out_r_intr 68
235
236/* Register r_masked_intr, scope iop_fifo_out, type r */
237typedef struct {
238 unsigned int urun : 1;
239 unsigned int last_data : 1;
240 unsigned int dav : 1;
241 unsigned int free : 1;
242 unsigned int orun : 1;
243 unsigned int dummy1 : 27;
244} reg_iop_fifo_out_r_masked_intr;
245#define REG_RD_ADDR_iop_fifo_out_r_masked_intr 72
246
247
248/* Constants */
249enum {
250 regk_iop_fifo_out_hi = 0x00000000,
251 regk_iop_fifo_out_neg = 0x00000002,
252 regk_iop_fifo_out_no = 0x00000000,
253 regk_iop_fifo_out_order16 = 0x00000001,
254 regk_iop_fifo_out_order24 = 0x00000002,
255 regk_iop_fifo_out_order32 = 0x00000003,
256 regk_iop_fifo_out_order8 = 0x00000000,
257 regk_iop_fifo_out_pos = 0x00000001,
258 regk_iop_fifo_out_pos_neg = 0x00000003,
259 regk_iop_fifo_out_rw_cfg_default = 0x00000024,
260 regk_iop_fifo_out_rw_ctrl_default = 0x00000000,
261 regk_iop_fifo_out_rw_intr_mask_default = 0x00000000,
262 regk_iop_fifo_out_rw_set_last_default = 0x00000000,
263 regk_iop_fifo_out_rw_strb_dif_out_default = 0x00000000,
264 regk_iop_fifo_out_rw_wr1byte_default = 0x00000000,
265 regk_iop_fifo_out_rw_wr1byte_last_default = 0x00000000,
266 regk_iop_fifo_out_rw_wr2byte_default = 0x00000000,
267 regk_iop_fifo_out_rw_wr2byte_last_default = 0x00000000,
268 regk_iop_fifo_out_rw_wr3byte_default = 0x00000000,
269 regk_iop_fifo_out_rw_wr3byte_last_default = 0x00000000,
270 regk_iop_fifo_out_rw_wr4byte_default = 0x00000000,
271 regk_iop_fifo_out_rw_wr4byte_last_default = 0x00000000,
272 regk_iop_fifo_out_size16 = 0x00000002,
273 regk_iop_fifo_out_size24 = 0x00000001,
274 regk_iop_fifo_out_size32 = 0x00000000,
275 regk_iop_fifo_out_size8 = 0x00000003,
276 regk_iop_fifo_out_yes = 0x00000001
277};
278#endif /* __iop_fifo_out_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_extra_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_extra_defs.h
new file mode 100644
index 000000000000..4a840aae84ee
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_fifo_out_extra_defs.h
@@ -0,0 +1,164 @@
1#ifndef __iop_fifo_out_extra_defs_h
2#define __iop_fifo_out_extra_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_fifo_out_extra.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:10 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_fifo_out_extra_defs.h ../../inst/io_proc/rtl/iop_fifo_out_extra.r
11 * id: $Id: iop_fifo_out_extra_defs.h,v 1.1 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_fifo_out_extra */
86
87/* Register rs_rd_data, scope iop_fifo_out_extra, type rs */
88typedef unsigned int reg_iop_fifo_out_extra_rs_rd_data;
89#define REG_RD_ADDR_iop_fifo_out_extra_rs_rd_data 0
90
91/* Register r_rd_data, scope iop_fifo_out_extra, type r */
92typedef unsigned int reg_iop_fifo_out_extra_r_rd_data;
93#define REG_RD_ADDR_iop_fifo_out_extra_r_rd_data 4
94
95/* Register r_stat, scope iop_fifo_out_extra, type r */
96typedef struct {
97 unsigned int avail_bytes : 4;
98 unsigned int last : 8;
99 unsigned int dif_in_en : 1;
100 unsigned int dif_out_en : 1;
101 unsigned int zero_data_last : 1;
102 unsigned int dummy1 : 17;
103} reg_iop_fifo_out_extra_r_stat;
104#define REG_RD_ADDR_iop_fifo_out_extra_r_stat 8
105
106/* Register rw_strb_dif_out, scope iop_fifo_out_extra, type rw */
107typedef unsigned int reg_iop_fifo_out_extra_rw_strb_dif_out;
108#define REG_RD_ADDR_iop_fifo_out_extra_rw_strb_dif_out 12
109#define REG_WR_ADDR_iop_fifo_out_extra_rw_strb_dif_out 12
110
111/* Register rw_intr_mask, scope iop_fifo_out_extra, type rw */
112typedef struct {
113 unsigned int urun : 1;
114 unsigned int last_data : 1;
115 unsigned int dav : 1;
116 unsigned int free : 1;
117 unsigned int orun : 1;
118 unsigned int dummy1 : 27;
119} reg_iop_fifo_out_extra_rw_intr_mask;
120#define REG_RD_ADDR_iop_fifo_out_extra_rw_intr_mask 16
121#define REG_WR_ADDR_iop_fifo_out_extra_rw_intr_mask 16
122
123/* Register rw_ack_intr, scope iop_fifo_out_extra, type rw */
124typedef struct {
125 unsigned int urun : 1;
126 unsigned int last_data : 1;
127 unsigned int dav : 1;
128 unsigned int free : 1;
129 unsigned int orun : 1;
130 unsigned int dummy1 : 27;
131} reg_iop_fifo_out_extra_rw_ack_intr;
132#define REG_RD_ADDR_iop_fifo_out_extra_rw_ack_intr 20
133#define REG_WR_ADDR_iop_fifo_out_extra_rw_ack_intr 20
134
135/* Register r_intr, scope iop_fifo_out_extra, type r */
136typedef struct {
137 unsigned int urun : 1;
138 unsigned int last_data : 1;
139 unsigned int dav : 1;
140 unsigned int free : 1;
141 unsigned int orun : 1;
142 unsigned int dummy1 : 27;
143} reg_iop_fifo_out_extra_r_intr;
144#define REG_RD_ADDR_iop_fifo_out_extra_r_intr 24
145
146/* Register r_masked_intr, scope iop_fifo_out_extra, type r */
147typedef struct {
148 unsigned int urun : 1;
149 unsigned int last_data : 1;
150 unsigned int dav : 1;
151 unsigned int free : 1;
152 unsigned int orun : 1;
153 unsigned int dummy1 : 27;
154} reg_iop_fifo_out_extra_r_masked_intr;
155#define REG_RD_ADDR_iop_fifo_out_extra_r_masked_intr 28
156
157
158/* Constants */
159enum {
160 regk_iop_fifo_out_extra_no = 0x00000000,
161 regk_iop_fifo_out_extra_rw_intr_mask_default = 0x00000000,
162 regk_iop_fifo_out_extra_yes = 0x00000001
163};
164#endif /* __iop_fifo_out_extra_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_defs.h
new file mode 100644
index 000000000000..c2b0ba1be60f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_defs.h
@@ -0,0 +1,190 @@
1#ifndef __iop_mpu_defs_h
2#define __iop_mpu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_mpu.r
7 * id: iop_mpu.r,v 1.30 2005/02/17 08:12:33 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_mpu_defs.h ../../inst/io_proc/rtl/iop_mpu.r
11 * id: $Id: iop_mpu_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_mpu */
86
87#define STRIDE_iop_mpu_rw_r 4
88/* Register rw_r, scope iop_mpu, type rw */
89typedef unsigned int reg_iop_mpu_rw_r;
90#define REG_RD_ADDR_iop_mpu_rw_r 0
91#define REG_WR_ADDR_iop_mpu_rw_r 0
92
93/* Register rw_ctrl, scope iop_mpu, type rw */
94typedef struct {
95 unsigned int en : 1;
96 unsigned int dummy1 : 31;
97} reg_iop_mpu_rw_ctrl;
98#define REG_RD_ADDR_iop_mpu_rw_ctrl 128
99#define REG_WR_ADDR_iop_mpu_rw_ctrl 128
100
101/* Register r_pc, scope iop_mpu, type r */
102typedef struct {
103 unsigned int addr : 12;
104 unsigned int dummy1 : 20;
105} reg_iop_mpu_r_pc;
106#define REG_RD_ADDR_iop_mpu_r_pc 132
107
108/* Register r_stat, scope iop_mpu, type r */
109typedef struct {
110 unsigned int instr_reg_busy : 1;
111 unsigned int intr_busy : 1;
112 unsigned int intr_vect : 16;
113 unsigned int dummy1 : 14;
114} reg_iop_mpu_r_stat;
115#define REG_RD_ADDR_iop_mpu_r_stat 136
116
117/* Register rw_instr, scope iop_mpu, type rw */
118typedef unsigned int reg_iop_mpu_rw_instr;
119#define REG_RD_ADDR_iop_mpu_rw_instr 140
120#define REG_WR_ADDR_iop_mpu_rw_instr 140
121
122/* Register rw_immediate, scope iop_mpu, type rw */
123typedef unsigned int reg_iop_mpu_rw_immediate;
124#define REG_RD_ADDR_iop_mpu_rw_immediate 144
125#define REG_WR_ADDR_iop_mpu_rw_immediate 144
126
127/* Register r_trace, scope iop_mpu, type r */
128typedef struct {
129 unsigned int intr_vect : 16;
130 unsigned int pc : 12;
131 unsigned int en : 1;
132 unsigned int instr_reg_busy : 1;
133 unsigned int intr_busy : 1;
134 unsigned int dummy1 : 1;
135} reg_iop_mpu_r_trace;
136#define REG_RD_ADDR_iop_mpu_r_trace 148
137
138/* Register r_wr_stat, scope iop_mpu, type r */
139typedef struct {
140 unsigned int r0 : 1;
141 unsigned int r1 : 1;
142 unsigned int r2 : 1;
143 unsigned int r3 : 1;
144 unsigned int r4 : 1;
145 unsigned int r5 : 1;
146 unsigned int r6 : 1;
147 unsigned int r7 : 1;
148 unsigned int r8 : 1;
149 unsigned int r9 : 1;
150 unsigned int r10 : 1;
151 unsigned int r11 : 1;
152 unsigned int r12 : 1;
153 unsigned int r13 : 1;
154 unsigned int r14 : 1;
155 unsigned int r15 : 1;
156 unsigned int dummy1 : 16;
157} reg_iop_mpu_r_wr_stat;
158#define REG_RD_ADDR_iop_mpu_r_wr_stat 152
159
160#define STRIDE_iop_mpu_rw_thread 4
161/* Register rw_thread, scope iop_mpu, type rw */
162typedef struct {
163 unsigned int addr : 12;
164 unsigned int dummy1 : 20;
165} reg_iop_mpu_rw_thread;
166#define REG_RD_ADDR_iop_mpu_rw_thread 156
167#define REG_WR_ADDR_iop_mpu_rw_thread 156
168
169#define STRIDE_iop_mpu_rw_intr 4
170/* Register rw_intr, scope iop_mpu, type rw */
171typedef struct {
172 unsigned int addr : 12;
173 unsigned int dummy1 : 20;
174} reg_iop_mpu_rw_intr;
175#define REG_RD_ADDR_iop_mpu_rw_intr 196
176#define REG_WR_ADDR_iop_mpu_rw_intr 196
177
178
179/* Constants */
180enum {
181 regk_iop_mpu_no = 0x00000000,
182 regk_iop_mpu_r_pc_default = 0x00000000,
183 regk_iop_mpu_rw_ctrl_default = 0x00000000,
184 regk_iop_mpu_rw_intr_size = 0x00000010,
185 regk_iop_mpu_rw_r_size = 0x00000010,
186 regk_iop_mpu_rw_thread_default = 0x00000000,
187 regk_iop_mpu_rw_thread_size = 0x00000004,
188 regk_iop_mpu_yes = 0x00000001
189};
190#endif /* __iop_mpu_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_macros.h b/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_macros.h
new file mode 100644
index 000000000000..2ec897ced166
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_mpu_macros.h
@@ -0,0 +1,764 @@
1/* ************************************************************************* */
2/* This file is autogenerated by IOPASM Version 1.2 */
3/* DO NOT EDIT THIS FILE - All changes will be lost! */
4/* ************************************************************************* */
5
6
7
8#ifndef __IOP_MPU_MACROS_H__
9#define __IOP_MPU_MACROS_H__
10
11
12/* ************************************************************************* */
13/* REGISTER DEFINITIONS */
14/* ************************************************************************* */
15#define MPU_R0 (0x0)
16#define MPU_R1 (0x1)
17#define MPU_R2 (0x2)
18#define MPU_R3 (0x3)
19#define MPU_R4 (0x4)
20#define MPU_R5 (0x5)
21#define MPU_R6 (0x6)
22#define MPU_R7 (0x7)
23#define MPU_R8 (0x8)
24#define MPU_R9 (0x9)
25#define MPU_R10 (0xa)
26#define MPU_R11 (0xb)
27#define MPU_R12 (0xc)
28#define MPU_R13 (0xd)
29#define MPU_R14 (0xe)
30#define MPU_R15 (0xf)
31#define MPU_PC (0x2)
32#define MPU_WSTS (0x3)
33#define MPU_JADDR (0x4)
34#define MPU_IRP (0x5)
35#define MPU_SRP (0x6)
36#define MPU_T0 (0x8)
37#define MPU_T1 (0x9)
38#define MPU_T2 (0xa)
39#define MPU_T3 (0xb)
40#define MPU_I0 (0x10)
41#define MPU_I1 (0x11)
42#define MPU_I2 (0x12)
43#define MPU_I3 (0x13)
44#define MPU_I4 (0x14)
45#define MPU_I5 (0x15)
46#define MPU_I6 (0x16)
47#define MPU_I7 (0x17)
48#define MPU_I8 (0x18)
49#define MPU_I9 (0x19)
50#define MPU_I10 (0x1a)
51#define MPU_I11 (0x1b)
52#define MPU_I12 (0x1c)
53#define MPU_I13 (0x1d)
54#define MPU_I14 (0x1e)
55#define MPU_I15 (0x1f)
56#define MPU_P2 (0x2)
57#define MPU_P3 (0x3)
58#define MPU_P5 (0x5)
59#define MPU_P6 (0x6)
60#define MPU_P8 (0x8)
61#define MPU_P9 (0x9)
62#define MPU_P10 (0xa)
63#define MPU_P11 (0xb)
64#define MPU_P16 (0x10)
65#define MPU_P17 (0x12)
66#define MPU_P18 (0x12)
67#define MPU_P19 (0x13)
68#define MPU_P20 (0x14)
69#define MPU_P21 (0x15)
70#define MPU_P22 (0x16)
71#define MPU_P23 (0x17)
72#define MPU_P24 (0x18)
73#define MPU_P25 (0x19)
74#define MPU_P26 (0x1a)
75#define MPU_P27 (0x1b)
76#define MPU_P28 (0x1c)
77#define MPU_P29 (0x1d)
78#define MPU_P30 (0x1e)
79#define MPU_P31 (0x1f)
80#define MPU_P1 (0x1)
81#define MPU_REGA (0x1)
82
83
84
85/* ************************************************************************* */
86/* ADDRESS MACROS */
87/* ************************************************************************* */
88#define MK_DWORD_ADDR(ADDR) (ADDR >> 2)
89#define MK_BYTE_ADDR(ADDR) (ADDR)
90
91
92
93/* ************************************************************************* */
94/* INSTRUCTION MACROS */
95/* ************************************************************************* */
96#define MPU_ADD_RRR(S,N,D) (0x4000008C | ((S & ((1 << 5) - 1)) << 16)\
97 | ((N & ((1 << 5) - 1)) << 11)\
98 | ((D & ((1 << 5) - 1)) << 21))
99
100#define MPU_ADD_RRS(S,N,D) (0x4000048C | ((S & ((1 << 5) - 1)) << 16)\
101 | ((N & ((1 << 5) - 1)) << 11)\
102 | ((D & ((1 << 5) - 1)) << 21))
103
104#define MPU_ADD_RSR(S,N,D) (0x4000018C | ((S & ((1 << 5) - 1)) << 16)\
105 | ((N & ((1 << 5) - 1)) << 11)\
106 | ((D & ((1 << 5) - 1)) << 21))
107
108#define MPU_ADD_RSS(S,N,D) (0x4000058C | ((S & ((1 << 5) - 1)) << 16)\
109 | ((N & ((1 << 5) - 1)) << 11)\
110 | ((D & ((1 << 5) - 1)) << 21))
111
112#define MPU_ADD_SRR(S,N,D) (0x4000028C | ((S & ((1 << 5) - 1)) << 16)\
113 | ((N & ((1 << 5) - 1)) << 11)\
114 | ((D & ((1 << 5) - 1)) << 21))
115
116#define MPU_ADD_SRS(S,N,D) (0x4000068C | ((S & ((1 << 5) - 1)) << 16)\
117 | ((N & ((1 << 5) - 1)) << 11)\
118 | ((D & ((1 << 5) - 1)) << 21))
119
120#define MPU_ADD_SSR(S,N,D) (0x4000038C | ((S & ((1 << 5) - 1)) << 16)\
121 | ((N & ((1 << 5) - 1)) << 11)\
122 | ((D & ((1 << 5) - 1)) << 21))
123
124#define MPU_ADD_SSS(S,N,D) (0x4000078C | ((S & ((1 << 5) - 1)) << 16)\
125 | ((N & ((1 << 5) - 1)) << 11)\
126 | ((D & ((1 << 5) - 1)) << 21))
127
128#define MPU_ADDQ_RIR(S,N,D) (0x10000000 | ((S & ((1 << 5) - 1)) << 16)\
129 | ((N & ((1 << 16) - 1)) << 0)\
130 | ((D & ((1 << 5) - 1)) << 21))
131
132#define MPU_ADDQ_IRR(S,N,D) (0x10000000 | ((S & ((1 << 16) - 1)) << 0)\
133 | ((N & ((1 << 5) - 1)) << 16)\
134 | ((D & ((1 << 5) - 1)) << 21))
135
136#define MPU_ADDX_IRR_INSTR(S,N,D) (0xC000008C | ((N & ((1 << 5) - 1)) << 16)\
137 | ((D & ((1 << 5) - 1)) << 21))
138
139#define MPU_ADDX_IRR_IMM(S,N,D) (S & 0xFFFFFFFF)
140
141#define MPU_ADDX_RIR_INSTR(S,N,D) (0xC000008C | ((S & ((1 << 5) - 1)) << 16)\
142 | ((D & ((1 << 5) - 1)) << 21))
143
144#define MPU_ADDX_RIR_IMM(S,N,D) (N & 0xFFFFFFFF)
145
146#define MPU_ADDX_ISR_INSTR(S,N,D) (0xC000028C | ((N & ((1 << 5) - 1)) << 16)\
147 | ((D & ((1 << 5) - 1)) << 21))
148
149#define MPU_ADDX_ISR_IMM(S,N,D) (S & 0xFFFFFFFF)
150
151#define MPU_ADDX_SIR_INSTR(S,N,D) (0xC000028C | ((S & ((1 << 5) - 1)) << 16)\
152 | ((D & ((1 << 5) - 1)) << 21))
153
154#define MPU_ADDX_SIR_IMM(S,N,D) (N & 0xFFFFFFFF)
155
156#define MPU_ADDX_IRS_INSTR(S,N,D) (0xC000048C | ((N & ((1 << 5) - 1)) << 16)\
157 | ((D & ((1 << 5) - 1)) << 21))
158
159#define MPU_ADDX_IRS_IMM(S,N,D) (S & 0xFFFFFFFF)
160
161#define MPU_ADDX_RIS_INSTR(S,N,D) (0xC000048C | ((S & ((1 << 5) - 1)) << 16)\
162 | ((D & ((1 << 5) - 1)) << 21))
163
164#define MPU_ADDX_RIS_IMM(S,N,D) (N & 0xFFFFFFFF)
165
166#define MPU_ADDX_ISS_INSTR(S,N,D) (0xC000068C | ((N & ((1 << 5) - 1)) << 16)\
167 | ((D & ((1 << 5) - 1)) << 21))
168
169#define MPU_ADDX_ISS_IMM(S,N,D) (S & 0xFFFFFFFF)
170
171#define MPU_ADDX_SIS_INSTR(S,N,D) (0xC000068C | ((S & ((1 << 5) - 1)) << 16)\
172 | ((D & ((1 << 5) - 1)) << 21))
173
174#define MPU_ADDX_SIS_IMM(S,N,D) (N & 0xFFFFFFFF)
175
176#define MPU_AND_RRR(S,N,D) (0x4000008A | ((S & ((1 << 5) - 1)) << 16)\
177 | ((N & ((1 << 5) - 1)) << 11)\
178 | ((D & ((1 << 5) - 1)) << 21))
179
180#define MPU_AND_RRS(S,N,D) (0x4000048A | ((S & ((1 << 5) - 1)) << 16)\
181 | ((N & ((1 << 5) - 1)) << 11)\
182 | ((D & ((1 << 5) - 1)) << 21))
183
184#define MPU_AND_RSR(S,N,D) (0x4000018A | ((S & ((1 << 5) - 1)) << 16)\
185 | ((N & ((1 << 5) - 1)) << 11)\
186 | ((D & ((1 << 5) - 1)) << 21))
187
188#define MPU_AND_RSS(S,N,D) (0x4000058A | ((S & ((1 << 5) - 1)) << 16)\
189 | ((N & ((1 << 5) - 1)) << 11)\
190 | ((D & ((1 << 5) - 1)) << 21))
191
192#define MPU_AND_SRR(S,N,D) (0x4000028A | ((S & ((1 << 5) - 1)) << 16)\
193 | ((N & ((1 << 5) - 1)) << 11)\
194 | ((D & ((1 << 5) - 1)) << 21))
195
196#define MPU_AND_SRS(S,N,D) (0x4000068A | ((S & ((1 << 5) - 1)) << 16)\
197 | ((N & ((1 << 5) - 1)) << 11)\
198 | ((D & ((1 << 5) - 1)) << 21))
199
200#define MPU_AND_SSR(S,N,D) (0x4000038A | ((S & ((1 << 5) - 1)) << 16)\
201 | ((N & ((1 << 5) - 1)) << 11)\
202 | ((D & ((1 << 5) - 1)) << 21))
203
204#define MPU_AND_SSS(S,N,D) (0x4000078A | ((S & ((1 << 5) - 1)) << 16)\
205 | ((N & ((1 << 5) - 1)) << 11)\
206 | ((D & ((1 << 5) - 1)) << 21))
207
208#define MPU_ANDQ_RIR(S,N,D) (0x08000000 | ((S & ((1 << 5) - 1)) << 16)\
209 | ((N & ((1 << 16) - 1)) << 0)\
210 | ((D & ((1 << 5) - 1)) << 21))
211
212#define MPU_ANDQ_IRR(S,N,D) (0x08000000 | ((S & ((1 << 16) - 1)) << 0)\
213 | ((N & ((1 << 5) - 1)) << 16)\
214 | ((D & ((1 << 5) - 1)) << 21))
215
216#define MPU_ANDX_RIR_INSTR(S,N,D) (0xC000008A | ((S & ((1 << 5) - 1)) << 16)\
217 | ((D & ((1 << 5) - 1)) << 21))
218
219#define MPU_ANDX_RIR_IMM(S,N,D) (N & 0xFFFFFFFF)
220
221#define MPU_ANDX_IRR_INSTR(S,N,D) (0xC000008A | ((N & ((1 << 5) - 1)) << 16)\
222 | ((D & ((1 << 5) - 1)) << 21))
223
224#define MPU_ANDX_IRR_IMM(S,N,D) (S & 0xFFFFFFFF)
225
226#define MPU_ANDX_ISR_INSTR(S,N,D) (0xC000028A | ((N & ((1 << 5) - 1)) << 16)\
227 | ((D & ((1 << 5) - 1)) << 21))
228
229#define MPU_ANDX_ISR_IMM(S,N,D) (S & 0xFFFFFFFF)
230
231#define MPU_ANDX_SIR_INSTR(S,N,D) (0xC000028A | ((S & ((1 << 5) - 1)) << 16)\
232 | ((D & ((1 << 5) - 1)) << 21))
233
234#define MPU_ANDX_SIR_IMM(S,N,D) (N & 0xFFFFFFFF)
235
236#define MPU_ANDX_IRS_INSTR(S,N,D) (0xC000048A | ((N & ((1 << 5) - 1)) << 16)\
237 | ((D & ((1 << 5) - 1)) << 21))
238
239#define MPU_ANDX_IRS_IMM(S,N,D) (S & 0xFFFFFFFF)
240
241#define MPU_ANDX_ISS_INSTR(S,N,D) (0xC000068A | ((N & ((1 << 5) - 1)) << 16)\
242 | ((D & ((1 << 5) - 1)) << 21))
243
244#define MPU_ANDX_ISS_IMM(S,N,D) (S & 0xFFFFFFFF)
245
246#define MPU_ANDX_RIS_INSTR(S,N,D) (0xC000048A | ((S & ((1 << 5) - 1)) << 16)\
247 | ((D & ((1 << 5) - 1)) << 21))
248
249#define MPU_ANDX_RIS_IMM(S,N,D) (N & 0xFFFFFFFF)
250
251#define MPU_ANDX_SIS_INSTR(S,N,D) (0xC000068A | ((S & ((1 << 5) - 1)) << 16)\
252 | ((D & ((1 << 5) - 1)) << 21))
253
254#define MPU_ANDX_SIS_IMM(S,N,D) (N & 0xFFFFFFFF)
255
256#define MPU_BA_I(S) (0x60000000 | ((S & ((1 << 16) - 1)) << 0))
257
258#define MPU_BAR_R(S) (0x62000000 | ((S & ((1 << 5) - 1)) << 11))
259
260#define MPU_BAR_S(S) (0x63000000 | ((S & ((1 << 5) - 1)) << 11))
261
262#define MPU_BBC_RII(S,N,D) (0x78000000 | ((S & ((1 << 5) - 1)) << 16)\
263 | ((N & ((1 << 5) - 1)) << 21)\
264 | ((D & ((1 << 16) - 1)) << 0))
265
266#define MPU_BBS_RII(S,N,D) (0x7C000000 | ((S & ((1 << 5) - 1)) << 16)\
267 | ((N & ((1 << 5) - 1)) << 21)\
268 | ((D & ((1 << 16) - 1)) << 0))
269
270#define MPU_BNZ_RI(S,D) (0x74400000 | ((S & ((1 << 5) - 1)) << 16)\
271 | ((D & ((1 << 16) - 1)) << 0))
272
273#define MPU_BMI_RI(S,D) (0x7FE00000 | ((S & ((1 << 5) - 1)) << 16)\
274 | ((D & ((1 << 16) - 1)) << 0))
275
276#define MPU_BPL_RI(S,D) (0x7BE00000 | ((S & ((1 << 5) - 1)) << 16)\
277 | ((D & ((1 << 16) - 1)) << 0))
278
279#define MPU_BZ_RI(S,D) (0x74000000 | ((S & ((1 << 5) - 1)) << 16)\
280 | ((D & ((1 << 16) - 1)) << 0))
281
282#define MPU_DI() (0x40000001)
283
284#define MPU_EI() (0x40000003)
285
286#define MPU_HALT() (0x40000002)
287
288#define MPU_JIR_I(S) (0x60200000 | ((S & ((1 << 16) - 1)) << 0))
289
290#define MPU_JIR_R(S) (0x62200000 | ((S & ((1 << 5) - 1)) << 11))
291
292#define MPU_JIR_S(S) (0x63200000 | ((S & ((1 << 5) - 1)) << 11))
293
294#define MPU_JNT() (0x61000000)
295
296#define MPU_JSR_I(S) (0x60400000 | ((S & ((1 << 16) - 1)) << 0))
297
298#define MPU_JSR_R(S) (0x62400000 | ((S & ((1 << 5) - 1)) << 11))
299
300#define MPU_JSR_S(S) (0x63400000 | ((S & ((1 << 5) - 1)) << 11))
301
302#define MPU_LSL_RRR(S,N,D) (0x4000008E | ((S & ((1 << 5) - 1)) << 16)\
303 | ((N & ((1 << 5) - 1)) << 11)\
304 | ((D & ((1 << 5) - 1)) << 21))
305
306#define MPU_LSL_RRS(S,N,D) (0x4000048E | ((S & ((1 << 5) - 1)) << 16)\
307 | ((N & ((1 << 5) - 1)) << 11)\
308 | ((D & ((1 << 5) - 1)) << 21))
309
310#define MPU_LSL_RSR(S,N,D) (0x4000018E | ((S & ((1 << 5) - 1)) << 16)\
311 | ((N & ((1 << 5) - 1)) << 11)\
312 | ((D & ((1 << 5) - 1)) << 21))
313
314#define MPU_LSL_RSS(S,N,D) (0x4000058E | ((S & ((1 << 5) - 1)) << 16)\
315 | ((N & ((1 << 5) - 1)) << 11)\
316 | ((D & ((1 << 5) - 1)) << 21))
317
318#define MPU_LSL_SRR(S,N,D) (0x4000028E | ((S & ((1 << 5) - 1)) << 16)\
319 | ((N & ((1 << 5) - 1)) << 11)\
320 | ((D & ((1 << 5) - 1)) << 21))
321
322#define MPU_LSL_SRS(S,N,D) (0x4000068E | ((S & ((1 << 5) - 1)) << 16)\
323 | ((N & ((1 << 5) - 1)) << 11)\
324 | ((D & ((1 << 5) - 1)) << 21))
325
326#define MPU_LSL_SSR(S,N,D) (0x4000038E | ((S & ((1 << 5) - 1)) << 16)\
327 | ((N & ((1 << 5) - 1)) << 11)\
328 | ((D & ((1 << 5) - 1)) << 21))
329
330#define MPU_LSL_SSS(S,N,D) (0x4000078E | ((S & ((1 << 5) - 1)) << 16)\
331 | ((N & ((1 << 5) - 1)) << 11)\
332 | ((D & ((1 << 5) - 1)) << 21))
333
334#define MPU_LSLQ_RIR(S,N,D) (0x18000000 | ((S & ((1 << 5) - 1)) << 16)\
335 | ((N & ((1 << 16) - 1)) << 0)\
336 | ((D & ((1 << 5) - 1)) << 21))
337
338#define MPU_LSR_RRR(S,N,D) (0x4000008F | ((S & ((1 << 5) - 1)) << 16)\
339 | ((N & ((1 << 5) - 1)) << 11)\
340 | ((D & ((1 << 5) - 1)) << 21))
341
342#define MPU_LSR_RRS(S,N,D) (0x4000048F | ((S & ((1 << 5) - 1)) << 16)\
343 | ((N & ((1 << 5) - 1)) << 11)\
344 | ((D & ((1 << 5) - 1)) << 21))
345
346#define MPU_LSR_RSR(S,N,D) (0x4000018F | ((S & ((1 << 5) - 1)) << 16)\
347 | ((N & ((1 << 5) - 1)) << 11)\
348 | ((D & ((1 << 5) - 1)) << 21))
349
350#define MPU_LSR_RSS(S,N,D) (0x4000058F | ((S & ((1 << 5) - 1)) << 16)\
351 | ((N & ((1 << 5) - 1)) << 11)\
352 | ((D & ((1 << 5) - 1)) << 21))
353
354#define MPU_LSR_SRR(S,N,D) (0x4000028F | ((S & ((1 << 5) - 1)) << 16)\
355 | ((N & ((1 << 5) - 1)) << 11)\
356 | ((D & ((1 << 5) - 1)) << 21))
357
358#define MPU_LSR_SRS(S,N,D) (0x4000068F | ((S & ((1 << 5) - 1)) << 16)\
359 | ((N & ((1 << 5) - 1)) << 11)\
360 | ((D & ((1 << 5) - 1)) << 21))
361
362#define MPU_LSR_SSR(S,N,D) (0x4000038F | ((S & ((1 << 5) - 1)) << 16)\
363 | ((N & ((1 << 5) - 1)) << 11)\
364 | ((D & ((1 << 5) - 1)) << 21))
365
366#define MPU_LSR_SSS(S,N,D) (0x4000078F | ((S & ((1 << 5) - 1)) << 16)\
367 | ((N & ((1 << 5) - 1)) << 11)\
368 | ((D & ((1 << 5) - 1)) << 21))
369
370#define MPU_LSRQ_RIR(S,N,D) (0x1C000000 | ((S & ((1 << 5) - 1)) << 16)\
371 | ((N & ((1 << 16) - 1)) << 0)\
372 | ((D & ((1 << 5) - 1)) << 21))
373
374#define MPU_LW_IR(S,D) (0x64400000 | ((S & ((1 << 16) - 1)) << 0)\
375 | ((D & ((1 << 5) - 1)) << 16))
376
377#define MPU_LW_IS(S,D) (0x64600000 | ((S & ((1 << 16) - 1)) << 0)\
378 | ((D & ((1 << 5) - 1)) << 16))
379
380#define MPU_LW_RR(S,D) (0x66400000 | ((S & ((1 << 5) - 1)) << 11)\
381 | ((D & ((1 << 5) - 1)) << 16))
382
383#define MPU_LW_RS(S,D) (0x66600000 | ((S & ((1 << 5) - 1)) << 11)\
384 | ((D & ((1 << 5) - 1)) << 16))
385
386#define MPU_LW_SR(S,D) (0x67400000 | ((S & ((1 << 5) - 1)) << 11)\
387 | ((D & ((1 << 5) - 1)) << 16))
388
389#define MPU_LW_SS(S,D) (0x67600000 | ((S & ((1 << 5) - 1)) << 11)\
390 | ((D & ((1 << 5) - 1)) << 16))
391
392#define MPU_LW_RIR(S,N,D) (0x66400000 | ((S & ((1 << 5) - 1)) << 11)\
393 | ((N & ((1 << 8) - 1)) << 0)\
394 | ((D & ((1 << 5) - 1)) << 16))
395
396#define MPU_LW_RIS(S,N,D) (0x66600000 | ((S & ((1 << 5) - 1)) << 11)\
397 | ((N & ((1 << 8) - 1)) << 0)\
398 | ((D & ((1 << 5) - 1)) << 16))
399
400#define MPU_LW_SIR(S,N,D) (0x67400000 | ((S & ((1 << 5) - 1)) << 11)\
401 | ((N & ((1 << 8) - 1)) << 0)\
402 | ((D & ((1 << 5) - 1)) << 16))
403
404#define MPU_LW_SIS(S,N,D) (0x67600000 | ((S & ((1 << 5) - 1)) << 11)\
405 | ((N & ((1 << 8) - 1)) << 0)\
406 | ((D & ((1 << 5) - 1)) << 16))
407
408#define MPU_MOVE_RR(S,D) (0x40000081 | ((S & ((1 << 5) - 1)) << 11)\
409 | ((D & ((1 << 5) - 1)) << 21))
410
411#define MPU_MOVE_RS(S,D) (0x40000481 | ((S & ((1 << 5) - 1)) << 11)\
412 | ((D & ((1 << 5) - 1)) << 21))
413
414#define MPU_MOVE_SR(S,D) (0x40000181 | ((S & ((1 << 5) - 1)) << 11)\
415 | ((D & ((1 << 5) - 1)) << 21))
416
417#define MPU_MOVE_SS(S,D) (0x40000581 | ((S & ((1 << 5) - 1)) << 11)\
418 | ((D & ((1 << 5) - 1)) << 21))
419
420#define MPU_MOVEQ_IR(S,D) (0x24000000 | ((S & ((1 << 16) - 1)) << 0)\
421 | ((D & ((1 << 5) - 1)) << 21))
422
423#define MPU_MOVEQ_IS(S,D) (0x2C000000 | ((S & ((1 << 16) - 1)) << 0)\
424 | ((D & ((1 << 5) - 1)) << 21))
425
426#define MPU_MOVEX_IR_INSTR(S,D) (0xC0000081 | ((D & ((1 << 5) - 1)) << 21))
427
428#define MPU_MOVEX_IR_IMM(S,D) (S & 0xFFFFFFFF)
429
430#define MPU_MOVEX_IS_INSTR(S,D) (0xC0000481 | ((D & ((1 << 5) - 1)) << 21))
431
432#define MPU_MOVEX_IS_IMM(S,D) (S & 0xFFFFFFFF)
433
434#define MPU_NOP() (0x40000000)
435
436#define MPU_NOT_RR(S,D) (0x40100081 | ((S & ((1 << 5) - 1)) << 11)\
437 | ((D & ((1 << 5) - 1)) << 21))
438
439#define MPU_NOT_RS(S,D) (0x40100481 | ((S & ((1 << 5) - 1)) << 11)\
440 | ((D & ((1 << 5) - 1)) << 21))
441
442#define MPU_NOT_SR(S,D) (0x40100181 | ((S & ((1 << 5) - 1)) << 11)\
443 | ((D & ((1 << 5) - 1)) << 21))
444
445#define MPU_NOT_SS(S,D) (0x40100581 | ((S & ((1 << 5) - 1)) << 11)\
446 | ((D & ((1 << 5) - 1)) << 21))
447
448#define MPU_OR_RRR(S,N,D) (0x4000008B | ((S & ((1 << 5) - 1)) << 16)\
449 | ((N & ((1 << 5) - 1)) << 11)\
450 | ((D & ((1 << 5) - 1)) << 21))
451
452#define MPU_OR_RRS(S,N,D) (0x4000048B | ((S & ((1 << 5) - 1)) << 16)\
453 | ((N & ((1 << 5) - 1)) << 11)\
454 | ((D & ((1 << 5) - 1)) << 21))
455
456#define MPU_OR_RSR(S,N,D) (0x4000018B | ((S & ((1 << 5) - 1)) << 16)\
457 | ((N & ((1 << 5) - 1)) << 11)\
458 | ((D & ((1 << 5) - 1)) << 21))
459
460#define MPU_OR_RSS(S,N,D) (0x4000058B | ((S & ((1 << 5) - 1)) << 16)\
461 | ((N & ((1 << 5) - 1)) << 11)\
462 | ((D & ((1 << 5) - 1)) << 21))
463
464#define MPU_OR_SRR(S,N,D) (0x4000028B | ((S & ((1 << 5) - 1)) << 16)\
465 | ((N & ((1 << 5) - 1)) << 11)\
466 | ((D & ((1 << 5) - 1)) << 21))
467
468#define MPU_OR_SRS(S,N,D) (0x4000068B | ((S & ((1 << 5) - 1)) << 16)\
469 | ((N & ((1 << 5) - 1)) << 11)\
470 | ((D & ((1 << 5) - 1)) << 21))
471
472#define MPU_OR_SSR(S,N,D) (0x4000038B | ((S & ((1 << 5) - 1)) << 16)\
473 | ((N & ((1 << 5) - 1)) << 11)\
474 | ((D & ((1 << 5) - 1)) << 21))
475
476#define MPU_OR_SSS(S,N,D) (0x4000078B | ((S & ((1 << 5) - 1)) << 16)\
477 | ((N & ((1 << 5) - 1)) << 11)\
478 | ((D & ((1 << 5) - 1)) << 21))
479
480#define MPU_ORQ_RIR(S,N,D) (0x0C000000 | ((S & ((1 << 5) - 1)) << 16)\
481 | ((N & ((1 << 16) - 1)) << 0)\
482 | ((D & ((1 << 5) - 1)) << 21))
483
484#define MPU_ORQ_IRR(S,N,D) (0x0C000000 | ((S & ((1 << 16) - 1)) << 0)\
485 | ((N & ((1 << 5) - 1)) << 16)\
486 | ((D & ((1 << 5) - 1)) << 21))
487
488#define MPU_ORX_RIR_INSTR(S,N,D) (0xC000008B | ((S & ((1 << 5) - 1)) << 16)\
489 | ((D & ((1 << 5) - 1)) << 21))
490
491#define MPU_ORX_RIR_IMM(S,N,D) (N & 0xFFFFFFFF)
492
493#define MPU_ORX_IRR_INSTR(S,N,D) (0xC000008B | ((N & ((1 << 5) - 1)) << 16)\
494 | ((D & ((1 << 5) - 1)) << 21))
495
496#define MPU_ORX_IRR_IMM(S,N,D) (S & 0xFFFFFFFF)
497
498#define MPU_ORX_SIR_INSTR(S,N,D) (0xC000028B | ((S & ((1 << 5) - 1)) << 16)\
499 | ((D & ((1 << 5) - 1)) << 21))
500
501#define MPU_ORX_SIR_IMM(S,N,D) (N & 0xFFFFFFFF)
502
503#define MPU_ORX_ISR_INSTR(S,N,D) (0xC000028B | ((N & ((1 << 5) - 1)) << 16)\
504 | ((D & ((1 << 5) - 1)) << 21))
505
506#define MPU_ORX_ISR_IMM(S,N,D) (S & 0xFFFFFFFF)
507
508#define MPU_ORX_RIS_INSTR(S,N,D) (0xC000048B | ((S & ((1 << 5) - 1)) << 16)\
509 | ((D & ((1 << 5) - 1)) << 21))
510
511#define MPU_ORX_RIS_IMM(S,N,D) (N & 0xFFFFFFFF)
512
513#define MPU_ORX_IRS_INSTR(S,N,D) (0xC000048B | ((N & ((1 << 5) - 1)) << 16)\
514 | ((D & ((1 << 5) - 1)) << 21))
515
516#define MPU_ORX_IRS_IMM(S,N,D) (S & 0xFFFFFFFF)
517
518#define MPU_ORX_SIS_INSTR(S,N,D) (0xC000068B | ((S & ((1 << 5) - 1)) << 16)\
519 | ((D & ((1 << 5) - 1)) << 21))
520
521#define MPU_ORX_SIS_IMM(S,N,D) (N & 0xFFFFFFFF)
522
523#define MPU_ORX_ISS_INSTR(S,N,D) (0xC000068B | ((N & ((1 << 5) - 1)) << 16)\
524 | ((D & ((1 << 5) - 1)) << 21))
525
526#define MPU_ORX_ISS_IMM(S,N,D) (S & 0xFFFFFFFF)
527
528#define MPU_RET() (0x63003000)
529
530#define MPU_RETI() (0x63602800)
531
532#define MPU_RR_IR(S,D) (0x50000000 | ((S & ((1 << 11) - 1)) << 0)\
533 | ((D & ((1 << 5) - 1)) << 21))
534
535#define MPU_RR_SR(S,D) (0x50008000 | ((S & ((1 << 5) - 1)) << 16)\
536 | ((D & ((1 << 5) - 1)) << 21))
537
538#define MPU_RW_RI(S,D) (0x56000000 | ((S & ((1 << 5) - 1)) << 11)\
539 | ((D & ((1 << 11) - 1)) << 0))
540
541#define MPU_RW_RS(S,D) (0x57000000 | ((S & ((1 << 5) - 1)) << 11)\
542 | ((D & ((1 << 5) - 1)) << 16))
543
544#define MPU_RWQ_II(S,D) (0x58000000 | ((S & ((1 << 16) - 1)) << 11)\
545 | ((D & ((1 << 11) - 1)) << 0))
546
547#define MPU_RWQ_IS(S,D) (0x55000000 | ((S & ((1 << 16) - 1)) << 0)\
548 | ((D & ((1 << 5) - 1)) << 16))
549
550#define MPU_RWX_II_INSTR(S,D) (0xD4000000 | ((D & ((1 << 11) - 1)) << 0))
551
552#define MPU_RWX_II_IMM(S,D) (S & 0xFFFFFFFF)
553
554#define MPU_RWX_IS_INSTR(S,D) (0xD5000000 | ((D & ((1 << 5) - 1)) << 16))
555
556#define MPU_RWX_IS_IMM(S,D) (S & 0xFFFFFFFF)
557
558#define MPU_SUB_RRR(S,N,D) (0x4000008D | ((S & ((1 << 5) - 1)) << 16)\
559 | ((N & ((1 << 5) - 1)) << 11)\
560 | ((D & ((1 << 5) - 1)) << 21))
561
562#define MPU_SUB_RRS(S,N,D) (0x4000048D | ((S & ((1 << 5) - 1)) << 16)\
563 | ((N & ((1 << 5) - 1)) << 11)\
564 | ((D & ((1 << 5) - 1)) << 21))
565
566#define MPU_SUB_RSR(S,N,D) (0x4000018D | ((S & ((1 << 5) - 1)) << 16)\
567 | ((N & ((1 << 5) - 1)) << 11)\
568 | ((D & ((1 << 5) - 1)) << 21))
569
570#define MPU_SUB_RSS(S,N,D) (0x4000058D | ((S & ((1 << 5) - 1)) << 16)\
571 | ((N & ((1 << 5) - 1)) << 11)\
572 | ((D & ((1 << 5) - 1)) << 21))
573
574#define MPU_SUB_SRR(S,N,D) (0x4000028D | ((S & ((1 << 5) - 1)) << 16)\
575 | ((N & ((1 << 5) - 1)) << 11)\
576 | ((D & ((1 << 5) - 1)) << 21))
577
578#define MPU_SUB_SRS(S,N,D) (0x4000068D | ((S & ((1 << 5) - 1)) << 16)\
579 | ((N & ((1 << 5) - 1)) << 11)\
580 | ((D & ((1 << 5) - 1)) << 21))
581
582#define MPU_SUB_SSR(S,N,D) (0x4000038D | ((S & ((1 << 5) - 1)) << 16)\
583 | ((N & ((1 << 5) - 1)) << 11)\
584 | ((D & ((1 << 5) - 1)) << 21))
585
586#define MPU_SUB_SSS(S,N,D) (0x4000078D | ((S & ((1 << 5) - 1)) << 16)\
587 | ((N & ((1 << 5) - 1)) << 11)\
588 | ((D & ((1 << 5) - 1)) << 21))
589
590#define MPU_SUBQ_RIR(S,N,D) (0x14000000 | ((S & ((1 << 5) - 1)) << 16)\
591 | ((N & ((1 << 16) - 1)) << 0)\
592 | ((D & ((1 << 5) - 1)) << 21))
593
594#define MPU_SUBX_RIR_INSTR(S,N,D) (0xC000008D | ((S & ((1 << 5) - 1)) << 16)\
595 | ((D & ((1 << 5) - 1)) << 21))
596
597#define MPU_SUBX_RIR_IMM(S,N,D) (N & 0xFFFFFFFF)
598
599#define MPU_SUBX_SIR_INSTR(S,N,D) (0xC000028D | ((S & ((1 << 5) - 1)) << 16)\
600 | ((D & ((1 << 5) - 1)) << 21))
601
602#define MPU_SUBX_SIR_IMM(S,N,D) (N & 0xFFFFFFFF)
603
604#define MPU_SUBX_RIS_INSTR(S,N,D) (0xC000048D | ((S & ((1 << 5) - 1)) << 16)\
605 | ((D & ((1 << 5) - 1)) << 21))
606
607#define MPU_SUBX_RIS_IMM(S,N,D) (N & 0xFFFFFFFF)
608
609#define MPU_SUBX_SIS_INSTR(S,N,D) (0xC000068D | ((S & ((1 << 5) - 1)) << 16)\
610 | ((D & ((1 << 5) - 1)) << 21))
611
612#define MPU_SUBX_SIS_IMM(S,N,D) (N & 0xFFFFFFFF)
613
614#define MPU_SW_RI(S,D) (0x64000000 | ((S & ((1 << 5) - 1)) << 16)\
615 | ((D & ((1 << 16) - 1)) << 0))
616
617#define MPU_SW_SI(S,D) (0x64200000 | ((S & ((1 << 5) - 1)) << 16)\
618 | ((D & ((1 << 16) - 1)) << 0))
619
620#define MPU_SW_RR(S,D) (0x66000000 | ((S & ((1 << 5) - 1)) << 16)\
621 | ((D & ((1 << 5) - 1)) << 11))
622
623#define MPU_SW_SR(S,D) (0x66200000 | ((S & ((1 << 5) - 1)) << 16)\
624 | ((D & ((1 << 5) - 1)) << 11))
625
626#define MPU_SW_RS(S,D) (0x67000000 | ((S & ((1 << 5) - 1)) << 16)\
627 | ((D & ((1 << 5) - 1)) << 11))
628
629#define MPU_SW_SS(S,D) (0x67200000 | ((S & ((1 << 5) - 1)) << 16)\
630 | ((D & ((1 << 5) - 1)) << 11))
631
632#define MPU_SW_RIR(S,N,D) (0x66000000 | ((S & ((1 << 5) - 1)) << 16)\
633 | ((N & ((1 << 8) - 1)) << 0)\
634 | ((D & ((1 << 5) - 1)) << 11))
635
636#define MPU_SW_SIR(S,N,D) (0x66200000 | ((S & ((1 << 5) - 1)) << 16)\
637 | ((N & ((1 << 8) - 1)) << 0)\
638 | ((D & ((1 << 5) - 1)) << 11))
639
640#define MPU_SW_RIS(S,N,D) (0x67000000 | ((S & ((1 << 5) - 1)) << 16)\
641 | ((N & ((1 << 8) - 1)) << 0)\
642 | ((D & ((1 << 5) - 1)) << 11))
643
644#define MPU_SW_SIS(S,N,D) (0x67200000 | ((S & ((1 << 5) - 1)) << 16)\
645 | ((N & ((1 << 8) - 1)) << 0)\
646 | ((D & ((1 << 5) - 1)) << 11))
647
648#define MPU_SWX_II_INSTR(S,D) (0xE4000000 | ((D & ((1 << 16) - 1)) << 0))
649
650#define MPU_SWX_II_IMM(S,D) (S & 0xFFFFFFFF)
651
652#define MPU_SWX_IR_INSTR(S,D) (0xE6000000 | ((D & ((1 << 5) - 1)) << 11))
653
654#define MPU_SWX_IR_IMM(S,D) (S & 0xFFFFFFFF)
655
656#define MPU_SWX_IS_INSTR(S,D) (0xE7000000 | ((D & ((1 << 5) - 1)) << 11))
657
658#define MPU_SWX_IS_IMM(S,D) (S & 0xFFFFFFFF)
659
660#define MPU_SWX_IIR_INSTR(S,N,D) (0xE6000000 | ((N & ((1 << 8) - 1)) << 0)\
661 | ((D & ((1 << 5) - 1)) << 11))
662
663#define MPU_SWX_IIR_IMM(S,N,D) (S & 0xFFFFFFFF)
664
665#define MPU_SWX_IIS_INSTR(S,N,D) (0xE7000000 | ((N & ((1 << 8) - 1)) << 0)\
666 | ((D & ((1 << 5) - 1)) << 11))
667
668#define MPU_SWX_IIS_IMM(S,N,D) (S & 0xFFFFFFFF)
669
670#define MPU_XOR_RRR(S,N,D) (0x40000089 | ((S & ((1 << 5) - 1)) << 16)\
671 | ((N & ((1 << 5) - 1)) << 11)\
672 | ((D & ((1 << 5) - 1)) << 21))
673
674#define MPU_XOR_RRS(S,N,D) (0x40000489 | ((S & ((1 << 5) - 1)) << 16)\
675 | ((N & ((1 << 5) - 1)) << 11)\
676 | ((D & ((1 << 5) - 1)) << 21))
677
678#define MPU_XOR_RSR(S,N,D) (0x40000189 | ((S & ((1 << 5) - 1)) << 16)\
679 | ((N & ((1 << 5) - 1)) << 11)\
680 | ((D & ((1 << 5) - 1)) << 21))
681
682#define MPU_XOR_RSS(S,N,D) (0x40000589 | ((S & ((1 << 5) - 1)) << 16)\
683 | ((N & ((1 << 5) - 1)) << 11)\
684 | ((D & ((1 << 5) - 1)) << 21))
685
686#define MPU_XOR_SRR(S,N,D) (0x40000289 | ((S & ((1 << 5) - 1)) << 16)\
687 | ((N & ((1 << 5) - 1)) << 11)\
688 | ((D & ((1 << 5) - 1)) << 21))
689
690#define MPU_XOR_SRS(S,N,D) (0x40000689 | ((S & ((1 << 5) - 1)) << 16)\
691 | ((N & ((1 << 5) - 1)) << 11)\
692 | ((D & ((1 << 5) - 1)) << 21))
693
694#define MPU_XOR_SSR(S,N,D) (0x40000389 | ((S & ((1 << 5) - 1)) << 16)\
695 | ((N & ((1 << 5) - 1)) << 11)\
696 | ((D & ((1 << 5) - 1)) << 21))
697
698#define MPU_XOR_SSS(S,N,D) (0x40000789 | ((S & ((1 << 5) - 1)) << 16)\
699 | ((N & ((1 << 5) - 1)) << 11)\
700 | ((D & ((1 << 5) - 1)) << 21))
701
702#define MPU_XOR_RR(S,D) (0x40000088 | ((S & ((1 << 5) - 1)) << 11)\
703 | ((D & ((1 << 5) - 1)) << 21))
704
705#define MPU_XOR_RS(S,D) (0x40000488 | ((S & ((1 << 5) - 1)) << 11)\
706 | ((D & ((1 << 5) - 1)) << 21))
707
708#define MPU_XOR_SR(S,D) (0x40000188 | ((S & ((1 << 5) - 1)) << 11)\
709 | ((D & ((1 << 5) - 1)) << 21))
710
711#define MPU_XOR_SS(S,D) (0x40000588 | ((S & ((1 << 5) - 1)) << 11)\
712 | ((D & ((1 << 5) - 1)) << 21))
713
714#define MPU_XORQ_RIR(S,N,D) (0x04000000 | ((S & ((1 << 5) - 1)) << 16)\
715 | ((N & ((1 << 16) - 1)) << 0)\
716 | ((D & ((1 << 5) - 1)) << 21))
717
718#define MPU_XORQ_IRR(S,N,D) (0x04000000 | ((S & ((1 << 16) - 1)) << 0)\
719 | ((N & ((1 << 5) - 1)) << 16)\
720 | ((D & ((1 << 5) - 1)) << 21))
721
722#define MPU_XORX_RIR_INSTR(S,N,D) (0xC0000089 | ((S & ((1 << 5) - 1)) << 16)\
723 | ((D & ((1 << 5) - 1)) << 21))
724
725#define MPU_XORX_RIR_IMM(S,N,D) (N & 0xFFFFFFFF)
726
727#define MPU_XORX_IRR_INSTR(S,N,D) (0xC0000089 | ((N & ((1 << 5) - 1)) << 16)\
728 | ((D & ((1 << 5) - 1)) << 21))
729
730#define MPU_XORX_IRR_IMM(S,N,D) (S & 0xFFFFFFFF)
731
732#define MPU_XORX_SIR_INSTR(S,N,D) (0xC0000289 | ((S & ((1 << 5) - 1)) << 16)\
733 | ((D & ((1 << 5) - 1)) << 21))
734
735#define MPU_XORX_SIR_IMM(S,N,D) (N & 0xFFFFFFFF)
736
737#define MPU_XORX_ISR_INSTR(S,N,D) (0xC0000289 | ((N & ((1 << 5) - 1)) << 16)\
738 | ((D & ((1 << 5) - 1)) << 21))
739
740#define MPU_XORX_ISR_IMM(S,N,D) (S & 0xFFFFFFFF)
741
742#define MPU_XORX_RIS_INSTR(S,N,D) (0xC0000489 | ((S & ((1 << 5) - 1)) << 16)\
743 | ((D & ((1 << 5) - 1)) << 21))
744
745#define MPU_XORX_RIS_IMM(S,N,D) (N & 0xFFFFFFFF)
746
747#define MPU_XORX_IRS_INSTR(S,N,D) (0xC0000489 | ((N & ((1 << 5) - 1)) << 16)\
748 | ((D & ((1 << 5) - 1)) << 21))
749
750#define MPU_XORX_IRS_IMM(S,N,D) (S & 0xFFFFFFFF)
751
752#define MPU_XORX_SIS_INSTR(S,N,D) (0xC0000689 | ((S & ((1 << 5) - 1)) << 16)\
753 | ((D & ((1 << 5) - 1)) << 21))
754
755#define MPU_XORX_SIS_IMM(S,N,D) (N & 0xFFFFFFFF)
756
757#define MPU_XORX_ISS_INSTR(S,N,D) (0xC0000689 | ((N & ((1 << 5) - 1)) << 16)\
758 | ((D & ((1 << 5) - 1)) << 21))
759
760#define MPU_XORX_ISS_IMM(S,N,D) (S & 0xFFFFFFFF)
761
762
763#endif /* end of __IOP_MPU_MACROS_H__ */
764/* End of iop_mpu_macros.h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_reg_space.h b/include/asm-cris/arch-v32/hwregs/iop/iop_reg_space.h
new file mode 100644
index 000000000000..756550f5d6cb
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_reg_space.h
@@ -0,0 +1,44 @@
1/* Autogenerated Changes here will be lost!
2 * generated by ../gen_sw.pl Mon Apr 11 16:10:18 2005 iop_sw.cfg
3 */
4#define regi_iop_version (regi_iop + 0)
5#define regi_iop_fifo_in0_extra (regi_iop + 64)
6#define regi_iop_fifo_in1_extra (regi_iop + 128)
7#define regi_iop_fifo_out0_extra (regi_iop + 192)
8#define regi_iop_fifo_out1_extra (regi_iop + 256)
9#define regi_iop_trigger_grp0 (regi_iop + 320)
10#define regi_iop_trigger_grp1 (regi_iop + 384)
11#define regi_iop_trigger_grp2 (regi_iop + 448)
12#define regi_iop_trigger_grp3 (regi_iop + 512)
13#define regi_iop_trigger_grp4 (regi_iop + 576)
14#define regi_iop_trigger_grp5 (regi_iop + 640)
15#define regi_iop_trigger_grp6 (regi_iop + 704)
16#define regi_iop_trigger_grp7 (regi_iop + 768)
17#define regi_iop_crc_par0 (regi_iop + 896)
18#define regi_iop_crc_par1 (regi_iop + 1024)
19#define regi_iop_dmc_in0 (regi_iop + 1152)
20#define regi_iop_dmc_in1 (regi_iop + 1280)
21#define regi_iop_dmc_out0 (regi_iop + 1408)
22#define regi_iop_dmc_out1 (regi_iop + 1536)
23#define regi_iop_fifo_in0 (regi_iop + 1664)
24#define regi_iop_fifo_in1 (regi_iop + 1792)
25#define regi_iop_fifo_out0 (regi_iop + 1920)
26#define regi_iop_fifo_out1 (regi_iop + 2048)
27#define regi_iop_scrc_in0 (regi_iop + 2176)
28#define regi_iop_scrc_in1 (regi_iop + 2304)
29#define regi_iop_scrc_out0 (regi_iop + 2432)
30#define regi_iop_scrc_out1 (regi_iop + 2560)
31#define regi_iop_timer_grp0 (regi_iop + 2688)
32#define regi_iop_timer_grp1 (regi_iop + 2816)
33#define regi_iop_timer_grp2 (regi_iop + 2944)
34#define regi_iop_timer_grp3 (regi_iop + 3072)
35#define regi_iop_sap_in (regi_iop + 3328)
36#define regi_iop_sap_out (regi_iop + 3584)
37#define regi_iop_spu0 (regi_iop + 3840)
38#define regi_iop_spu1 (regi_iop + 4096)
39#define regi_iop_sw_cfg (regi_iop + 4352)
40#define regi_iop_sw_cpu (regi_iop + 4608)
41#define regi_iop_sw_mpu (regi_iop + 4864)
42#define regi_iop_sw_spu0 (regi_iop + 5120)
43#define regi_iop_sw_spu1 (regi_iop + 5376)
44#define regi_iop_mpu (regi_iop + 5632)
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sap_in_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sap_in_defs.h
new file mode 100644
index 000000000000..5548ac10074f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sap_in_defs.h
@@ -0,0 +1,179 @@
1#ifndef __iop_sap_in_defs_h
2#define __iop_sap_in_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_sap_in.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:45 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sap_in_defs.h ../../inst/io_proc/rtl/iop_sap_in.r
11 * id: $Id: iop_sap_in_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sap_in */
86
87/* Register rw_bus0_sync, scope iop_sap_in, type rw */
88typedef struct {
89 unsigned int byte0_sel : 2;
90 unsigned int byte0_ext_src : 3;
91 unsigned int byte0_edge : 2;
92 unsigned int byte0_delay : 1;
93 unsigned int byte1_sel : 2;
94 unsigned int byte1_ext_src : 3;
95 unsigned int byte1_edge : 2;
96 unsigned int byte1_delay : 1;
97 unsigned int byte2_sel : 2;
98 unsigned int byte2_ext_src : 3;
99 unsigned int byte2_edge : 2;
100 unsigned int byte2_delay : 1;
101 unsigned int byte3_sel : 2;
102 unsigned int byte3_ext_src : 3;
103 unsigned int byte3_edge : 2;
104 unsigned int byte3_delay : 1;
105} reg_iop_sap_in_rw_bus0_sync;
106#define REG_RD_ADDR_iop_sap_in_rw_bus0_sync 0
107#define REG_WR_ADDR_iop_sap_in_rw_bus0_sync 0
108
109/* Register rw_bus1_sync, scope iop_sap_in, type rw */
110typedef struct {
111 unsigned int byte0_sel : 2;
112 unsigned int byte0_ext_src : 3;
113 unsigned int byte0_edge : 2;
114 unsigned int byte0_delay : 1;
115 unsigned int byte1_sel : 2;
116 unsigned int byte1_ext_src : 3;
117 unsigned int byte1_edge : 2;
118 unsigned int byte1_delay : 1;
119 unsigned int byte2_sel : 2;
120 unsigned int byte2_ext_src : 3;
121 unsigned int byte2_edge : 2;
122 unsigned int byte2_delay : 1;
123 unsigned int byte3_sel : 2;
124 unsigned int byte3_ext_src : 3;
125 unsigned int byte3_edge : 2;
126 unsigned int byte3_delay : 1;
127} reg_iop_sap_in_rw_bus1_sync;
128#define REG_RD_ADDR_iop_sap_in_rw_bus1_sync 4
129#define REG_WR_ADDR_iop_sap_in_rw_bus1_sync 4
130
131#define STRIDE_iop_sap_in_rw_gio 4
132/* Register rw_gio, scope iop_sap_in, type rw */
133typedef struct {
134 unsigned int sync_sel : 2;
135 unsigned int sync_ext_src : 3;
136 unsigned int sync_edge : 2;
137 unsigned int delay : 1;
138 unsigned int logic : 2;
139 unsigned int dummy1 : 22;
140} reg_iop_sap_in_rw_gio;
141#define REG_RD_ADDR_iop_sap_in_rw_gio 8
142#define REG_WR_ADDR_iop_sap_in_rw_gio 8
143
144
145/* Constants */
146enum {
147 regk_iop_sap_in_and = 0x00000002,
148 regk_iop_sap_in_ext_clk200 = 0x00000003,
149 regk_iop_sap_in_gio1 = 0x00000000,
150 regk_iop_sap_in_gio13 = 0x00000005,
151 regk_iop_sap_in_gio18 = 0x00000003,
152 regk_iop_sap_in_gio19 = 0x00000004,
153 regk_iop_sap_in_gio21 = 0x00000006,
154 regk_iop_sap_in_gio23 = 0x00000005,
155 regk_iop_sap_in_gio29 = 0x00000007,
156 regk_iop_sap_in_gio5 = 0x00000004,
157 regk_iop_sap_in_gio6 = 0x00000001,
158 regk_iop_sap_in_gio7 = 0x00000002,
159 regk_iop_sap_in_inv = 0x00000001,
160 regk_iop_sap_in_neg = 0x00000002,
161 regk_iop_sap_in_no = 0x00000000,
162 regk_iop_sap_in_no_del_ext_clk200 = 0x00000001,
163 regk_iop_sap_in_none = 0x00000000,
164 regk_iop_sap_in_or = 0x00000003,
165 regk_iop_sap_in_pos = 0x00000001,
166 regk_iop_sap_in_pos_neg = 0x00000003,
167 regk_iop_sap_in_rw_bus0_sync_default = 0x02020202,
168 regk_iop_sap_in_rw_bus1_sync_default = 0x02020202,
169 regk_iop_sap_in_rw_gio_default = 0x00000002,
170 regk_iop_sap_in_rw_gio_size = 0x00000020,
171 regk_iop_sap_in_timer_grp0_tmr3 = 0x00000006,
172 regk_iop_sap_in_timer_grp1_tmr3 = 0x00000004,
173 regk_iop_sap_in_timer_grp2_tmr3 = 0x00000005,
174 regk_iop_sap_in_timer_grp3_tmr3 = 0x00000007,
175 regk_iop_sap_in_tmr_clk200 = 0x00000000,
176 regk_iop_sap_in_two_clk200 = 0x00000002,
177 regk_iop_sap_in_yes = 0x00000001
178};
179#endif /* __iop_sap_in_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sap_out_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sap_out_defs.h
new file mode 100644
index 000000000000..273936996183
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sap_out_defs.h
@@ -0,0 +1,306 @@
1#ifndef __iop_sap_out_defs_h
2#define __iop_sap_out_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_sap_out.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sap_out_defs.h ../../inst/io_proc/rtl/iop_sap_out.r
11 * id: $Id: iop_sap_out_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sap_out */
86
87/* Register rw_gen_gated, scope iop_sap_out, type rw */
88typedef struct {
89 unsigned int clk0_src : 2;
90 unsigned int clk0_gate_src : 2;
91 unsigned int clk0_force_src : 3;
92 unsigned int clk1_src : 2;
93 unsigned int clk1_gate_src : 2;
94 unsigned int clk1_force_src : 3;
95 unsigned int clk2_src : 2;
96 unsigned int clk2_gate_src : 2;
97 unsigned int clk2_force_src : 3;
98 unsigned int clk3_src : 2;
99 unsigned int clk3_gate_src : 2;
100 unsigned int clk3_force_src : 3;
101 unsigned int dummy1 : 4;
102} reg_iop_sap_out_rw_gen_gated;
103#define REG_RD_ADDR_iop_sap_out_rw_gen_gated 0
104#define REG_WR_ADDR_iop_sap_out_rw_gen_gated 0
105
106/* Register rw_bus0, scope iop_sap_out, type rw */
107typedef struct {
108 unsigned int byte0_clk_sel : 3;
109 unsigned int byte0_gated_clk : 2;
110 unsigned int byte0_clk_inv : 1;
111 unsigned int byte1_clk_sel : 3;
112 unsigned int byte1_gated_clk : 2;
113 unsigned int byte1_clk_inv : 1;
114 unsigned int byte2_clk_sel : 3;
115 unsigned int byte2_gated_clk : 2;
116 unsigned int byte2_clk_inv : 1;
117 unsigned int byte3_clk_sel : 3;
118 unsigned int byte3_gated_clk : 2;
119 unsigned int byte3_clk_inv : 1;
120 unsigned int dummy1 : 8;
121} reg_iop_sap_out_rw_bus0;
122#define REG_RD_ADDR_iop_sap_out_rw_bus0 4
123#define REG_WR_ADDR_iop_sap_out_rw_bus0 4
124
125/* Register rw_bus1, scope iop_sap_out, type rw */
126typedef struct {
127 unsigned int byte0_clk_sel : 3;
128 unsigned int byte0_gated_clk : 2;
129 unsigned int byte0_clk_inv : 1;
130 unsigned int byte1_clk_sel : 3;
131 unsigned int byte1_gated_clk : 2;
132 unsigned int byte1_clk_inv : 1;
133 unsigned int byte2_clk_sel : 3;
134 unsigned int byte2_gated_clk : 2;
135 unsigned int byte2_clk_inv : 1;
136 unsigned int byte3_clk_sel : 3;
137 unsigned int byte3_gated_clk : 2;
138 unsigned int byte3_clk_inv : 1;
139 unsigned int dummy1 : 8;
140} reg_iop_sap_out_rw_bus1;
141#define REG_RD_ADDR_iop_sap_out_rw_bus1 8
142#define REG_WR_ADDR_iop_sap_out_rw_bus1 8
143
144/* Register rw_bus0_lo_oe, scope iop_sap_out, type rw */
145typedef struct {
146 unsigned int byte0_clk_sel : 3;
147 unsigned int byte0_clk_ext : 3;
148 unsigned int byte0_gated_clk : 2;
149 unsigned int byte0_clk_inv : 1;
150 unsigned int byte0_logic : 2;
151 unsigned int byte1_clk_sel : 3;
152 unsigned int byte1_clk_ext : 3;
153 unsigned int byte1_gated_clk : 2;
154 unsigned int byte1_clk_inv : 1;
155 unsigned int byte1_logic : 2;
156 unsigned int dummy1 : 10;
157} reg_iop_sap_out_rw_bus0_lo_oe;
158#define REG_RD_ADDR_iop_sap_out_rw_bus0_lo_oe 12
159#define REG_WR_ADDR_iop_sap_out_rw_bus0_lo_oe 12
160
161/* Register rw_bus0_hi_oe, scope iop_sap_out, type rw */
162typedef struct {
163 unsigned int byte2_clk_sel : 3;
164 unsigned int byte2_clk_ext : 3;
165 unsigned int byte2_gated_clk : 2;
166 unsigned int byte2_clk_inv : 1;
167 unsigned int byte2_logic : 2;
168 unsigned int byte3_clk_sel : 3;
169 unsigned int byte3_clk_ext : 3;
170 unsigned int byte3_gated_clk : 2;
171 unsigned int byte3_clk_inv : 1;
172 unsigned int byte3_logic : 2;
173 unsigned int dummy1 : 10;
174} reg_iop_sap_out_rw_bus0_hi_oe;
175#define REG_RD_ADDR_iop_sap_out_rw_bus0_hi_oe 16
176#define REG_WR_ADDR_iop_sap_out_rw_bus0_hi_oe 16
177
178/* Register rw_bus1_lo_oe, scope iop_sap_out, type rw */
179typedef struct {
180 unsigned int byte0_clk_sel : 3;
181 unsigned int byte0_clk_ext : 3;
182 unsigned int byte0_gated_clk : 2;
183 unsigned int byte0_clk_inv : 1;
184 unsigned int byte0_logic : 2;
185 unsigned int byte1_clk_sel : 3;
186 unsigned int byte1_clk_ext : 3;
187 unsigned int byte1_gated_clk : 2;
188 unsigned int byte1_clk_inv : 1;
189 unsigned int byte1_logic : 2;
190 unsigned int dummy1 : 10;
191} reg_iop_sap_out_rw_bus1_lo_oe;
192#define REG_RD_ADDR_iop_sap_out_rw_bus1_lo_oe 20
193#define REG_WR_ADDR_iop_sap_out_rw_bus1_lo_oe 20
194
195/* Register rw_bus1_hi_oe, scope iop_sap_out, type rw */
196typedef struct {
197 unsigned int byte2_clk_sel : 3;
198 unsigned int byte2_clk_ext : 3;
199 unsigned int byte2_gated_clk : 2;
200 unsigned int byte2_clk_inv : 1;
201 unsigned int byte2_logic : 2;
202 unsigned int byte3_clk_sel : 3;
203 unsigned int byte3_clk_ext : 3;
204 unsigned int byte3_gated_clk : 2;
205 unsigned int byte3_clk_inv : 1;
206 unsigned int byte3_logic : 2;
207 unsigned int dummy1 : 10;
208} reg_iop_sap_out_rw_bus1_hi_oe;
209#define REG_RD_ADDR_iop_sap_out_rw_bus1_hi_oe 24
210#define REG_WR_ADDR_iop_sap_out_rw_bus1_hi_oe 24
211
212#define STRIDE_iop_sap_out_rw_gio 4
213/* Register rw_gio, scope iop_sap_out, type rw */
214typedef struct {
215 unsigned int out_clk_sel : 3;
216 unsigned int out_clk_ext : 4;
217 unsigned int out_gated_clk : 2;
218 unsigned int out_clk_inv : 1;
219 unsigned int out_logic : 1;
220 unsigned int oe_clk_sel : 3;
221 unsigned int oe_clk_ext : 3;
222 unsigned int oe_gated_clk : 2;
223 unsigned int oe_clk_inv : 1;
224 unsigned int oe_logic : 2;
225 unsigned int dummy1 : 10;
226} reg_iop_sap_out_rw_gio;
227#define REG_RD_ADDR_iop_sap_out_rw_gio 28
228#define REG_WR_ADDR_iop_sap_out_rw_gio 28
229
230
231/* Constants */
232enum {
233 regk_iop_sap_out_and = 0x00000002,
234 regk_iop_sap_out_clk0 = 0x00000000,
235 regk_iop_sap_out_clk1 = 0x00000001,
236 regk_iop_sap_out_clk12 = 0x00000002,
237 regk_iop_sap_out_clk2 = 0x00000002,
238 regk_iop_sap_out_clk200 = 0x00000001,
239 regk_iop_sap_out_clk3 = 0x00000003,
240 regk_iop_sap_out_ext = 0x00000003,
241 regk_iop_sap_out_gated = 0x00000004,
242 regk_iop_sap_out_gio1 = 0x00000000,
243 regk_iop_sap_out_gio13 = 0x00000002,
244 regk_iop_sap_out_gio13_clk = 0x0000000c,
245 regk_iop_sap_out_gio15 = 0x00000001,
246 regk_iop_sap_out_gio18 = 0x00000003,
247 regk_iop_sap_out_gio18_clk = 0x0000000d,
248 regk_iop_sap_out_gio1_clk = 0x00000008,
249 regk_iop_sap_out_gio21_clk = 0x0000000e,
250 regk_iop_sap_out_gio23 = 0x00000002,
251 regk_iop_sap_out_gio29_clk = 0x0000000f,
252 regk_iop_sap_out_gio31 = 0x00000003,
253 regk_iop_sap_out_gio5 = 0x00000001,
254 regk_iop_sap_out_gio5_clk = 0x00000009,
255 regk_iop_sap_out_gio6_clk = 0x0000000a,
256 regk_iop_sap_out_gio7 = 0x00000000,
257 regk_iop_sap_out_gio7_clk = 0x0000000b,
258 regk_iop_sap_out_gio_in13 = 0x00000001,
259 regk_iop_sap_out_gio_in21 = 0x00000002,
260 regk_iop_sap_out_gio_in29 = 0x00000003,
261 regk_iop_sap_out_gio_in5 = 0x00000000,
262 regk_iop_sap_out_inv = 0x00000001,
263 regk_iop_sap_out_nand = 0x00000003,
264 regk_iop_sap_out_no = 0x00000000,
265 regk_iop_sap_out_none = 0x00000000,
266 regk_iop_sap_out_rw_bus0_default = 0x00000000,
267 regk_iop_sap_out_rw_bus0_hi_oe_default = 0x00000000,
268 regk_iop_sap_out_rw_bus0_lo_oe_default = 0x00000000,
269 regk_iop_sap_out_rw_bus1_default = 0x00000000,
270 regk_iop_sap_out_rw_bus1_hi_oe_default = 0x00000000,
271 regk_iop_sap_out_rw_bus1_lo_oe_default = 0x00000000,
272 regk_iop_sap_out_rw_gen_gated_default = 0x00000000,
273 regk_iop_sap_out_rw_gio_default = 0x00000000,
274 regk_iop_sap_out_rw_gio_size = 0x00000020,
275 regk_iop_sap_out_spu0_gio0 = 0x00000002,
276 regk_iop_sap_out_spu0_gio1 = 0x00000003,
277 regk_iop_sap_out_spu0_gio12 = 0x00000004,
278 regk_iop_sap_out_spu0_gio13 = 0x00000004,
279 regk_iop_sap_out_spu0_gio14 = 0x00000004,
280 regk_iop_sap_out_spu0_gio15 = 0x00000004,
281 regk_iop_sap_out_spu0_gio2 = 0x00000002,
282 regk_iop_sap_out_spu0_gio3 = 0x00000003,
283 regk_iop_sap_out_spu0_gio4 = 0x00000002,
284 regk_iop_sap_out_spu0_gio5 = 0x00000003,
285 regk_iop_sap_out_spu0_gio6 = 0x00000002,
286 regk_iop_sap_out_spu0_gio7 = 0x00000003,
287 regk_iop_sap_out_spu1_gio0 = 0x00000005,
288 regk_iop_sap_out_spu1_gio1 = 0x00000006,
289 regk_iop_sap_out_spu1_gio12 = 0x00000007,
290 regk_iop_sap_out_spu1_gio13 = 0x00000007,
291 regk_iop_sap_out_spu1_gio14 = 0x00000007,
292 regk_iop_sap_out_spu1_gio15 = 0x00000007,
293 regk_iop_sap_out_spu1_gio2 = 0x00000005,
294 regk_iop_sap_out_spu1_gio3 = 0x00000006,
295 regk_iop_sap_out_spu1_gio4 = 0x00000005,
296 regk_iop_sap_out_spu1_gio5 = 0x00000006,
297 regk_iop_sap_out_spu1_gio6 = 0x00000005,
298 regk_iop_sap_out_spu1_gio7 = 0x00000006,
299 regk_iop_sap_out_timer_grp0_tmr2 = 0x00000004,
300 regk_iop_sap_out_timer_grp1_tmr2 = 0x00000005,
301 regk_iop_sap_out_timer_grp2_tmr2 = 0x00000006,
302 regk_iop_sap_out_timer_grp3_tmr2 = 0x00000007,
303 regk_iop_sap_out_tmr = 0x00000005,
304 regk_iop_sap_out_yes = 0x00000001
305};
306#endif /* __iop_sap_out_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_in_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_in_defs.h
new file mode 100644
index 000000000000..4f0a9a81e737
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_in_defs.h
@@ -0,0 +1,160 @@
1#ifndef __iop_scrc_in_defs_h
2#define __iop_scrc_in_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_scrc_in.r
7 * id: iop_scrc_in.r,v 1.10 2005/02/16 09:13:58 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_scrc_in_defs.h ../../inst/io_proc/rtl/iop_scrc_in.r
11 * id: $Id: iop_scrc_in_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_scrc_in */
86
87/* Register rw_cfg, scope iop_scrc_in, type rw */
88typedef struct {
89 unsigned int trig : 2;
90 unsigned int dummy1 : 30;
91} reg_iop_scrc_in_rw_cfg;
92#define REG_RD_ADDR_iop_scrc_in_rw_cfg 0
93#define REG_WR_ADDR_iop_scrc_in_rw_cfg 0
94
95/* Register rw_ctrl, scope iop_scrc_in, type rw */
96typedef struct {
97 unsigned int dif_in_en : 1;
98 unsigned int dummy1 : 31;
99} reg_iop_scrc_in_rw_ctrl;
100#define REG_RD_ADDR_iop_scrc_in_rw_ctrl 4
101#define REG_WR_ADDR_iop_scrc_in_rw_ctrl 4
102
103/* Register r_stat, scope iop_scrc_in, type r */
104typedef struct {
105 unsigned int err : 1;
106 unsigned int dummy1 : 31;
107} reg_iop_scrc_in_r_stat;
108#define REG_RD_ADDR_iop_scrc_in_r_stat 8
109
110/* Register rw_init_crc, scope iop_scrc_in, type rw */
111typedef unsigned int reg_iop_scrc_in_rw_init_crc;
112#define REG_RD_ADDR_iop_scrc_in_rw_init_crc 12
113#define REG_WR_ADDR_iop_scrc_in_rw_init_crc 12
114
115/* Register rs_computed_crc, scope iop_scrc_in, type rs */
116typedef unsigned int reg_iop_scrc_in_rs_computed_crc;
117#define REG_RD_ADDR_iop_scrc_in_rs_computed_crc 16
118
119/* Register r_computed_crc, scope iop_scrc_in, type r */
120typedef unsigned int reg_iop_scrc_in_r_computed_crc;
121#define REG_RD_ADDR_iop_scrc_in_r_computed_crc 20
122
123/* Register rw_crc, scope iop_scrc_in, type rw */
124typedef unsigned int reg_iop_scrc_in_rw_crc;
125#define REG_RD_ADDR_iop_scrc_in_rw_crc 24
126#define REG_WR_ADDR_iop_scrc_in_rw_crc 24
127
128/* Register rw_correct_crc, scope iop_scrc_in, type rw */
129typedef unsigned int reg_iop_scrc_in_rw_correct_crc;
130#define REG_RD_ADDR_iop_scrc_in_rw_correct_crc 28
131#define REG_WR_ADDR_iop_scrc_in_rw_correct_crc 28
132
133/* Register rw_wr1bit, scope iop_scrc_in, type rw */
134typedef struct {
135 unsigned int data : 2;
136 unsigned int last : 2;
137 unsigned int dummy1 : 28;
138} reg_iop_scrc_in_rw_wr1bit;
139#define REG_RD_ADDR_iop_scrc_in_rw_wr1bit 32
140#define REG_WR_ADDR_iop_scrc_in_rw_wr1bit 32
141
142
143/* Constants */
144enum {
145 regk_iop_scrc_in_dif_in = 0x00000002,
146 regk_iop_scrc_in_hi = 0x00000000,
147 regk_iop_scrc_in_neg = 0x00000002,
148 regk_iop_scrc_in_no = 0x00000000,
149 regk_iop_scrc_in_pos = 0x00000001,
150 regk_iop_scrc_in_pos_neg = 0x00000003,
151 regk_iop_scrc_in_r_computed_crc_default = 0x00000000,
152 regk_iop_scrc_in_rs_computed_crc_default = 0x00000000,
153 regk_iop_scrc_in_rw_cfg_default = 0x00000000,
154 regk_iop_scrc_in_rw_ctrl_default = 0x00000000,
155 regk_iop_scrc_in_rw_init_crc_default = 0x00000000,
156 regk_iop_scrc_in_set0 = 0x00000000,
157 regk_iop_scrc_in_set1 = 0x00000001,
158 regk_iop_scrc_in_yes = 0x00000001
159};
160#endif /* __iop_scrc_in_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_out_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_out_defs.h
new file mode 100644
index 000000000000..fd1d6ea1d484
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_scrc_out_defs.h
@@ -0,0 +1,146 @@
1#ifndef __iop_scrc_out_defs_h
2#define __iop_scrc_out_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_scrc_out.r
7 * id: iop_scrc_out.r,v 1.11 2005/02/16 09:13:38 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_scrc_out_defs.h ../../inst/io_proc/rtl/iop_scrc_out.r
11 * id: $Id: iop_scrc_out_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_scrc_out */
86
87/* Register rw_cfg, scope iop_scrc_out, type rw */
88typedef struct {
89 unsigned int trig : 2;
90 unsigned int inv_crc : 1;
91 unsigned int dummy1 : 29;
92} reg_iop_scrc_out_rw_cfg;
93#define REG_RD_ADDR_iop_scrc_out_rw_cfg 0
94#define REG_WR_ADDR_iop_scrc_out_rw_cfg 0
95
96/* Register rw_ctrl, scope iop_scrc_out, type rw */
97typedef struct {
98 unsigned int strb_src : 1;
99 unsigned int out_src : 1;
100 unsigned int dummy1 : 30;
101} reg_iop_scrc_out_rw_ctrl;
102#define REG_RD_ADDR_iop_scrc_out_rw_ctrl 4
103#define REG_WR_ADDR_iop_scrc_out_rw_ctrl 4
104
105/* Register rw_init_crc, scope iop_scrc_out, type rw */
106typedef unsigned int reg_iop_scrc_out_rw_init_crc;
107#define REG_RD_ADDR_iop_scrc_out_rw_init_crc 8
108#define REG_WR_ADDR_iop_scrc_out_rw_init_crc 8
109
110/* Register rw_crc, scope iop_scrc_out, type rw */
111typedef unsigned int reg_iop_scrc_out_rw_crc;
112#define REG_RD_ADDR_iop_scrc_out_rw_crc 12
113#define REG_WR_ADDR_iop_scrc_out_rw_crc 12
114
115/* Register rw_data, scope iop_scrc_out, type rw */
116typedef struct {
117 unsigned int val : 1;
118 unsigned int dummy1 : 31;
119} reg_iop_scrc_out_rw_data;
120#define REG_RD_ADDR_iop_scrc_out_rw_data 16
121#define REG_WR_ADDR_iop_scrc_out_rw_data 16
122
123/* Register r_computed_crc, scope iop_scrc_out, type r */
124typedef unsigned int reg_iop_scrc_out_r_computed_crc;
125#define REG_RD_ADDR_iop_scrc_out_r_computed_crc 20
126
127
128/* Constants */
129enum {
130 regk_iop_scrc_out_crc = 0x00000001,
131 regk_iop_scrc_out_data = 0x00000000,
132 regk_iop_scrc_out_dif = 0x00000001,
133 regk_iop_scrc_out_hi = 0x00000000,
134 regk_iop_scrc_out_neg = 0x00000002,
135 regk_iop_scrc_out_no = 0x00000000,
136 regk_iop_scrc_out_pos = 0x00000001,
137 regk_iop_scrc_out_pos_neg = 0x00000003,
138 regk_iop_scrc_out_reg = 0x00000000,
139 regk_iop_scrc_out_rw_cfg_default = 0x00000000,
140 regk_iop_scrc_out_rw_crc_default = 0x00000000,
141 regk_iop_scrc_out_rw_ctrl_default = 0x00000000,
142 regk_iop_scrc_out_rw_data_default = 0x00000000,
143 regk_iop_scrc_out_rw_init_crc_default = 0x00000000,
144 regk_iop_scrc_out_yes = 0x00000001
145};
146#endif /* __iop_scrc_out_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_spu_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_spu_defs.h
new file mode 100644
index 000000000000..0fda26e2f06f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_spu_defs.h
@@ -0,0 +1,453 @@
1#ifndef __iop_spu_defs_h
2#define __iop_spu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_spu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_spu_defs.h ../../inst/io_proc/rtl/iop_spu.r
11 * id: $Id: iop_spu_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_spu */
86
87#define STRIDE_iop_spu_rw_r 4
88/* Register rw_r, scope iop_spu, type rw */
89typedef unsigned int reg_iop_spu_rw_r;
90#define REG_RD_ADDR_iop_spu_rw_r 0
91#define REG_WR_ADDR_iop_spu_rw_r 0
92
93/* Register rw_seq_pc, scope iop_spu, type rw */
94typedef struct {
95 unsigned int addr : 12;
96 unsigned int dummy1 : 20;
97} reg_iop_spu_rw_seq_pc;
98#define REG_RD_ADDR_iop_spu_rw_seq_pc 64
99#define REG_WR_ADDR_iop_spu_rw_seq_pc 64
100
101/* Register rw_fsm_pc, scope iop_spu, type rw */
102typedef struct {
103 unsigned int addr : 12;
104 unsigned int dummy1 : 20;
105} reg_iop_spu_rw_fsm_pc;
106#define REG_RD_ADDR_iop_spu_rw_fsm_pc 68
107#define REG_WR_ADDR_iop_spu_rw_fsm_pc 68
108
109/* Register rw_ctrl, scope iop_spu, type rw */
110typedef struct {
111 unsigned int fsm : 1;
112 unsigned int en : 1;
113 unsigned int dummy1 : 30;
114} reg_iop_spu_rw_ctrl;
115#define REG_RD_ADDR_iop_spu_rw_ctrl 72
116#define REG_WR_ADDR_iop_spu_rw_ctrl 72
117
118/* Register rw_fsm_inputs3_0, scope iop_spu, type rw */
119typedef struct {
120 unsigned int val0 : 5;
121 unsigned int src0 : 3;
122 unsigned int val1 : 5;
123 unsigned int src1 : 3;
124 unsigned int val2 : 5;
125 unsigned int src2 : 3;
126 unsigned int val3 : 5;
127 unsigned int src3 : 3;
128} reg_iop_spu_rw_fsm_inputs3_0;
129#define REG_RD_ADDR_iop_spu_rw_fsm_inputs3_0 76
130#define REG_WR_ADDR_iop_spu_rw_fsm_inputs3_0 76
131
132/* Register rw_fsm_inputs7_4, scope iop_spu, type rw */
133typedef struct {
134 unsigned int val4 : 5;
135 unsigned int src4 : 3;
136 unsigned int val5 : 5;
137 unsigned int src5 : 3;
138 unsigned int val6 : 5;
139 unsigned int src6 : 3;
140 unsigned int val7 : 5;
141 unsigned int src7 : 3;
142} reg_iop_spu_rw_fsm_inputs7_4;
143#define REG_RD_ADDR_iop_spu_rw_fsm_inputs7_4 80
144#define REG_WR_ADDR_iop_spu_rw_fsm_inputs7_4 80
145
146/* Register rw_gio_out, scope iop_spu, type rw */
147typedef unsigned int reg_iop_spu_rw_gio_out;
148#define REG_RD_ADDR_iop_spu_rw_gio_out 84
149#define REG_WR_ADDR_iop_spu_rw_gio_out 84
150
151/* Register rw_bus0_out, scope iop_spu, type rw */
152typedef unsigned int reg_iop_spu_rw_bus0_out;
153#define REG_RD_ADDR_iop_spu_rw_bus0_out 88
154#define REG_WR_ADDR_iop_spu_rw_bus0_out 88
155
156/* Register rw_bus1_out, scope iop_spu, type rw */
157typedef unsigned int reg_iop_spu_rw_bus1_out;
158#define REG_RD_ADDR_iop_spu_rw_bus1_out 92
159#define REG_WR_ADDR_iop_spu_rw_bus1_out 92
160
161/* Register r_gio_in, scope iop_spu, type r */
162typedef unsigned int reg_iop_spu_r_gio_in;
163#define REG_RD_ADDR_iop_spu_r_gio_in 96
164
165/* Register r_bus0_in, scope iop_spu, type r */
166typedef unsigned int reg_iop_spu_r_bus0_in;
167#define REG_RD_ADDR_iop_spu_r_bus0_in 100
168
169/* Register r_bus1_in, scope iop_spu, type r */
170typedef unsigned int reg_iop_spu_r_bus1_in;
171#define REG_RD_ADDR_iop_spu_r_bus1_in 104
172
173/* Register rw_gio_out_set, scope iop_spu, type rw */
174typedef unsigned int reg_iop_spu_rw_gio_out_set;
175#define REG_RD_ADDR_iop_spu_rw_gio_out_set 108
176#define REG_WR_ADDR_iop_spu_rw_gio_out_set 108
177
178/* Register rw_gio_out_clr, scope iop_spu, type rw */
179typedef unsigned int reg_iop_spu_rw_gio_out_clr;
180#define REG_RD_ADDR_iop_spu_rw_gio_out_clr 112
181#define REG_WR_ADDR_iop_spu_rw_gio_out_clr 112
182
183/* Register rs_wr_stat, scope iop_spu, type rs */
184typedef struct {
185 unsigned int r0 : 1;
186 unsigned int r1 : 1;
187 unsigned int r2 : 1;
188 unsigned int r3 : 1;
189 unsigned int r4 : 1;
190 unsigned int r5 : 1;
191 unsigned int r6 : 1;
192 unsigned int r7 : 1;
193 unsigned int r8 : 1;
194 unsigned int r9 : 1;
195 unsigned int r10 : 1;
196 unsigned int r11 : 1;
197 unsigned int r12 : 1;
198 unsigned int r13 : 1;
199 unsigned int r14 : 1;
200 unsigned int r15 : 1;
201 unsigned int dummy1 : 16;
202} reg_iop_spu_rs_wr_stat;
203#define REG_RD_ADDR_iop_spu_rs_wr_stat 116
204
205/* Register r_wr_stat, scope iop_spu, type r */
206typedef struct {
207 unsigned int r0 : 1;
208 unsigned int r1 : 1;
209 unsigned int r2 : 1;
210 unsigned int r3 : 1;
211 unsigned int r4 : 1;
212 unsigned int r5 : 1;
213 unsigned int r6 : 1;
214 unsigned int r7 : 1;
215 unsigned int r8 : 1;
216 unsigned int r9 : 1;
217 unsigned int r10 : 1;
218 unsigned int r11 : 1;
219 unsigned int r12 : 1;
220 unsigned int r13 : 1;
221 unsigned int r14 : 1;
222 unsigned int r15 : 1;
223 unsigned int dummy1 : 16;
224} reg_iop_spu_r_wr_stat;
225#define REG_RD_ADDR_iop_spu_r_wr_stat 120
226
227/* Register r_reg_indexed_by_bus0_in, scope iop_spu, type r */
228typedef unsigned int reg_iop_spu_r_reg_indexed_by_bus0_in;
229#define REG_RD_ADDR_iop_spu_r_reg_indexed_by_bus0_in 124
230
231/* Register r_stat_in, scope iop_spu, type r */
232typedef struct {
233 unsigned int timer_grp_lo : 4;
234 unsigned int fifo_out_last : 1;
235 unsigned int fifo_out_rdy : 1;
236 unsigned int fifo_out_all : 1;
237 unsigned int fifo_in_rdy : 1;
238 unsigned int dmc_out_all : 1;
239 unsigned int dmc_out_dth : 1;
240 unsigned int dmc_out_eop : 1;
241 unsigned int dmc_out_dv : 1;
242 unsigned int dmc_out_last : 1;
243 unsigned int dmc_out_cmd_rq : 1;
244 unsigned int dmc_out_cmd_rdy : 1;
245 unsigned int pcrc_correct : 1;
246 unsigned int timer_grp_hi : 4;
247 unsigned int dmc_in_sth : 1;
248 unsigned int dmc_in_full : 1;
249 unsigned int dmc_in_cmd_rdy : 1;
250 unsigned int spu_gio_out : 4;
251 unsigned int sync_clk12 : 1;
252 unsigned int scrc_out_data : 1;
253 unsigned int scrc_in_err : 1;
254 unsigned int mc_busy : 1;
255 unsigned int mc_owned : 1;
256} reg_iop_spu_r_stat_in;
257#define REG_RD_ADDR_iop_spu_r_stat_in 128
258
259/* Register r_trigger_in, scope iop_spu, type r */
260typedef unsigned int reg_iop_spu_r_trigger_in;
261#define REG_RD_ADDR_iop_spu_r_trigger_in 132
262
263/* Register r_special_stat, scope iop_spu, type r */
264typedef struct {
265 unsigned int c_flag : 1;
266 unsigned int v_flag : 1;
267 unsigned int z_flag : 1;
268 unsigned int n_flag : 1;
269 unsigned int xor_bus0_r2_0 : 1;
270 unsigned int xor_bus1_r3_0 : 1;
271 unsigned int xor_bus0m_r2_0 : 1;
272 unsigned int xor_bus1m_r3_0 : 1;
273 unsigned int fsm_in0 : 1;
274 unsigned int fsm_in1 : 1;
275 unsigned int fsm_in2 : 1;
276 unsigned int fsm_in3 : 1;
277 unsigned int fsm_in4 : 1;
278 unsigned int fsm_in5 : 1;
279 unsigned int fsm_in6 : 1;
280 unsigned int fsm_in7 : 1;
281 unsigned int event0 : 1;
282 unsigned int event1 : 1;
283 unsigned int event2 : 1;
284 unsigned int event3 : 1;
285 unsigned int dummy1 : 12;
286} reg_iop_spu_r_special_stat;
287#define REG_RD_ADDR_iop_spu_r_special_stat 136
288
289/* Register rw_reg_access, scope iop_spu, type rw */
290typedef struct {
291 unsigned int addr : 13;
292 unsigned int dummy1 : 3;
293 unsigned int imm_hi : 16;
294} reg_iop_spu_rw_reg_access;
295#define REG_RD_ADDR_iop_spu_rw_reg_access 140
296#define REG_WR_ADDR_iop_spu_rw_reg_access 140
297
298#define STRIDE_iop_spu_rw_event_cfg 4
299/* Register rw_event_cfg, scope iop_spu, type rw */
300typedef struct {
301 unsigned int addr : 12;
302 unsigned int src : 2;
303 unsigned int eq_en : 1;
304 unsigned int eq_inv : 1;
305 unsigned int gt_en : 1;
306 unsigned int gt_inv : 1;
307 unsigned int dummy1 : 14;
308} reg_iop_spu_rw_event_cfg;
309#define REG_RD_ADDR_iop_spu_rw_event_cfg 144
310#define REG_WR_ADDR_iop_spu_rw_event_cfg 144
311
312#define STRIDE_iop_spu_rw_event_mask 4
313/* Register rw_event_mask, scope iop_spu, type rw */
314typedef unsigned int reg_iop_spu_rw_event_mask;
315#define REG_RD_ADDR_iop_spu_rw_event_mask 160
316#define REG_WR_ADDR_iop_spu_rw_event_mask 160
317
318#define STRIDE_iop_spu_rw_event_val 4
319/* Register rw_event_val, scope iop_spu, type rw */
320typedef unsigned int reg_iop_spu_rw_event_val;
321#define REG_RD_ADDR_iop_spu_rw_event_val 176
322#define REG_WR_ADDR_iop_spu_rw_event_val 176
323
324/* Register rw_event_ret, scope iop_spu, type rw */
325typedef struct {
326 unsigned int addr : 12;
327 unsigned int dummy1 : 20;
328} reg_iop_spu_rw_event_ret;
329#define REG_RD_ADDR_iop_spu_rw_event_ret 192
330#define REG_WR_ADDR_iop_spu_rw_event_ret 192
331
332/* Register r_trace, scope iop_spu, type r */
333typedef struct {
334 unsigned int fsm : 1;
335 unsigned int en : 1;
336 unsigned int c_flag : 1;
337 unsigned int v_flag : 1;
338 unsigned int z_flag : 1;
339 unsigned int n_flag : 1;
340 unsigned int seq_addr : 12;
341 unsigned int dummy1 : 2;
342 unsigned int fsm_addr : 12;
343} reg_iop_spu_r_trace;
344#define REG_RD_ADDR_iop_spu_r_trace 196
345
346/* Register r_fsm_trace, scope iop_spu, type r */
347typedef struct {
348 unsigned int fsm : 1;
349 unsigned int en : 1;
350 unsigned int tmr_done : 1;
351 unsigned int inp0 : 1;
352 unsigned int inp1 : 1;
353 unsigned int inp2 : 1;
354 unsigned int inp3 : 1;
355 unsigned int event0 : 1;
356 unsigned int event1 : 1;
357 unsigned int event2 : 1;
358 unsigned int event3 : 1;
359 unsigned int gio_out : 8;
360 unsigned int dummy1 : 1;
361 unsigned int fsm_addr : 12;
362} reg_iop_spu_r_fsm_trace;
363#define REG_RD_ADDR_iop_spu_r_fsm_trace 200
364
365#define STRIDE_iop_spu_rw_brp 4
366/* Register rw_brp, scope iop_spu, type rw */
367typedef struct {
368 unsigned int addr : 12;
369 unsigned int fsm : 1;
370 unsigned int en : 1;
371 unsigned int dummy1 : 18;
372} reg_iop_spu_rw_brp;
373#define REG_RD_ADDR_iop_spu_rw_brp 204
374#define REG_WR_ADDR_iop_spu_rw_brp 204
375
376
377/* Constants */
378enum {
379 regk_iop_spu_attn_hi = 0x00000005,
380 regk_iop_spu_attn_lo = 0x00000005,
381 regk_iop_spu_attn_r0 = 0x00000000,
382 regk_iop_spu_attn_r1 = 0x00000001,
383 regk_iop_spu_attn_r10 = 0x00000002,
384 regk_iop_spu_attn_r11 = 0x00000003,
385 regk_iop_spu_attn_r12 = 0x00000004,
386 regk_iop_spu_attn_r13 = 0x00000005,
387 regk_iop_spu_attn_r14 = 0x00000006,
388 regk_iop_spu_attn_r15 = 0x00000007,
389 regk_iop_spu_attn_r2 = 0x00000002,
390 regk_iop_spu_attn_r3 = 0x00000003,
391 regk_iop_spu_attn_r4 = 0x00000004,
392 regk_iop_spu_attn_r5 = 0x00000005,
393 regk_iop_spu_attn_r6 = 0x00000006,
394 regk_iop_spu_attn_r7 = 0x00000007,
395 regk_iop_spu_attn_r8 = 0x00000000,
396 regk_iop_spu_attn_r9 = 0x00000001,
397 regk_iop_spu_c = 0x00000000,
398 regk_iop_spu_flag = 0x00000002,
399 regk_iop_spu_gio_in = 0x00000000,
400 regk_iop_spu_gio_out = 0x00000005,
401 regk_iop_spu_gio_out0 = 0x00000008,
402 regk_iop_spu_gio_out1 = 0x00000009,
403 regk_iop_spu_gio_out2 = 0x0000000a,
404 regk_iop_spu_gio_out3 = 0x0000000b,
405 regk_iop_spu_gio_out4 = 0x0000000c,
406 regk_iop_spu_gio_out5 = 0x0000000d,
407 regk_iop_spu_gio_out6 = 0x0000000e,
408 regk_iop_spu_gio_out7 = 0x0000000f,
409 regk_iop_spu_n = 0x00000003,
410 regk_iop_spu_no = 0x00000000,
411 regk_iop_spu_r0 = 0x00000008,
412 regk_iop_spu_r1 = 0x00000009,
413 regk_iop_spu_r10 = 0x0000000a,
414 regk_iop_spu_r11 = 0x0000000b,
415 regk_iop_spu_r12 = 0x0000000c,
416 regk_iop_spu_r13 = 0x0000000d,
417 regk_iop_spu_r14 = 0x0000000e,
418 regk_iop_spu_r15 = 0x0000000f,
419 regk_iop_spu_r2 = 0x0000000a,
420 regk_iop_spu_r3 = 0x0000000b,
421 regk_iop_spu_r4 = 0x0000000c,
422 regk_iop_spu_r5 = 0x0000000d,
423 regk_iop_spu_r6 = 0x0000000e,
424 regk_iop_spu_r7 = 0x0000000f,
425 regk_iop_spu_r8 = 0x00000008,
426 regk_iop_spu_r9 = 0x00000009,
427 regk_iop_spu_reg_hi = 0x00000002,
428 regk_iop_spu_reg_lo = 0x00000002,
429 regk_iop_spu_rw_brp_default = 0x00000000,
430 regk_iop_spu_rw_brp_size = 0x00000004,
431 regk_iop_spu_rw_ctrl_default = 0x00000000,
432 regk_iop_spu_rw_event_cfg_size = 0x00000004,
433 regk_iop_spu_rw_event_mask_size = 0x00000004,
434 regk_iop_spu_rw_event_val_size = 0x00000004,
435 regk_iop_spu_rw_gio_out_default = 0x00000000,
436 regk_iop_spu_rw_r_size = 0x00000010,
437 regk_iop_spu_rw_reg_access_default = 0x00000000,
438 regk_iop_spu_stat_in = 0x00000002,
439 regk_iop_spu_statin_hi = 0x00000004,
440 regk_iop_spu_statin_lo = 0x00000004,
441 regk_iop_spu_trig = 0x00000003,
442 regk_iop_spu_trigger = 0x00000006,
443 regk_iop_spu_v = 0x00000001,
444 regk_iop_spu_wsts_gioout_spec = 0x00000001,
445 regk_iop_spu_xor = 0x00000003,
446 regk_iop_spu_xor_bus0_r2_0 = 0x00000000,
447 regk_iop_spu_xor_bus0m_r2_0 = 0x00000002,
448 regk_iop_spu_xor_bus1_r3_0 = 0x00000001,
449 regk_iop_spu_xor_bus1m_r3_0 = 0x00000003,
450 regk_iop_spu_yes = 0x00000001,
451 regk_iop_spu_z = 0x00000002
452};
453#endif /* __iop_spu_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cfg_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cfg_defs.h
new file mode 100644
index 000000000000..d7b6d75884d2
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cfg_defs.h
@@ -0,0 +1,1042 @@
1#ifndef __iop_sw_cfg_defs_h
2#define __iop_sw_cfg_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_cfg.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sw_cfg_defs.h ../../inst/io_proc/rtl/guinness/iop_sw_cfg.r
11 * id: $Id: iop_sw_cfg_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sw_cfg */
86
87/* Register rw_crc_par0_owner, scope iop_sw_cfg, type rw */
88typedef struct {
89 unsigned int cfg : 2;
90 unsigned int dummy1 : 30;
91} reg_iop_sw_cfg_rw_crc_par0_owner;
92#define REG_RD_ADDR_iop_sw_cfg_rw_crc_par0_owner 0
93#define REG_WR_ADDR_iop_sw_cfg_rw_crc_par0_owner 0
94
95/* Register rw_crc_par1_owner, scope iop_sw_cfg, type rw */
96typedef struct {
97 unsigned int cfg : 2;
98 unsigned int dummy1 : 30;
99} reg_iop_sw_cfg_rw_crc_par1_owner;
100#define REG_RD_ADDR_iop_sw_cfg_rw_crc_par1_owner 4
101#define REG_WR_ADDR_iop_sw_cfg_rw_crc_par1_owner 4
102
103/* Register rw_dmc_in0_owner, scope iop_sw_cfg, type rw */
104typedef struct {
105 unsigned int cfg : 2;
106 unsigned int dummy1 : 30;
107} reg_iop_sw_cfg_rw_dmc_in0_owner;
108#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_in0_owner 8
109#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_in0_owner 8
110
111/* Register rw_dmc_in1_owner, scope iop_sw_cfg, type rw */
112typedef struct {
113 unsigned int cfg : 2;
114 unsigned int dummy1 : 30;
115} reg_iop_sw_cfg_rw_dmc_in1_owner;
116#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_in1_owner 12
117#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_in1_owner 12
118
119/* Register rw_dmc_out0_owner, scope iop_sw_cfg, type rw */
120typedef struct {
121 unsigned int cfg : 2;
122 unsigned int dummy1 : 30;
123} reg_iop_sw_cfg_rw_dmc_out0_owner;
124#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_out0_owner 16
125#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_out0_owner 16
126
127/* Register rw_dmc_out1_owner, scope iop_sw_cfg, type rw */
128typedef struct {
129 unsigned int cfg : 2;
130 unsigned int dummy1 : 30;
131} reg_iop_sw_cfg_rw_dmc_out1_owner;
132#define REG_RD_ADDR_iop_sw_cfg_rw_dmc_out1_owner 20
133#define REG_WR_ADDR_iop_sw_cfg_rw_dmc_out1_owner 20
134
135/* Register rw_fifo_in0_owner, scope iop_sw_cfg, type rw */
136typedef struct {
137 unsigned int cfg : 2;
138 unsigned int dummy1 : 30;
139} reg_iop_sw_cfg_rw_fifo_in0_owner;
140#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in0_owner 24
141#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in0_owner 24
142
143/* Register rw_fifo_in0_extra_owner, scope iop_sw_cfg, type rw */
144typedef struct {
145 unsigned int cfg : 2;
146 unsigned int dummy1 : 30;
147} reg_iop_sw_cfg_rw_fifo_in0_extra_owner;
148#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in0_extra_owner 28
149#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in0_extra_owner 28
150
151/* Register rw_fifo_in1_owner, scope iop_sw_cfg, type rw */
152typedef struct {
153 unsigned int cfg : 2;
154 unsigned int dummy1 : 30;
155} reg_iop_sw_cfg_rw_fifo_in1_owner;
156#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in1_owner 32
157#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in1_owner 32
158
159/* Register rw_fifo_in1_extra_owner, scope iop_sw_cfg, type rw */
160typedef struct {
161 unsigned int cfg : 2;
162 unsigned int dummy1 : 30;
163} reg_iop_sw_cfg_rw_fifo_in1_extra_owner;
164#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_in1_extra_owner 36
165#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_in1_extra_owner 36
166
167/* Register rw_fifo_out0_owner, scope iop_sw_cfg, type rw */
168typedef struct {
169 unsigned int cfg : 2;
170 unsigned int dummy1 : 30;
171} reg_iop_sw_cfg_rw_fifo_out0_owner;
172#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out0_owner 40
173#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out0_owner 40
174
175/* Register rw_fifo_out0_extra_owner, scope iop_sw_cfg, type rw */
176typedef struct {
177 unsigned int cfg : 2;
178 unsigned int dummy1 : 30;
179} reg_iop_sw_cfg_rw_fifo_out0_extra_owner;
180#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out0_extra_owner 44
181#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out0_extra_owner 44
182
183/* Register rw_fifo_out1_owner, scope iop_sw_cfg, type rw */
184typedef struct {
185 unsigned int cfg : 2;
186 unsigned int dummy1 : 30;
187} reg_iop_sw_cfg_rw_fifo_out1_owner;
188#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out1_owner 48
189#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out1_owner 48
190
191/* Register rw_fifo_out1_extra_owner, scope iop_sw_cfg, type rw */
192typedef struct {
193 unsigned int cfg : 2;
194 unsigned int dummy1 : 30;
195} reg_iop_sw_cfg_rw_fifo_out1_extra_owner;
196#define REG_RD_ADDR_iop_sw_cfg_rw_fifo_out1_extra_owner 52
197#define REG_WR_ADDR_iop_sw_cfg_rw_fifo_out1_extra_owner 52
198
199/* Register rw_sap_in_owner, scope iop_sw_cfg, type rw */
200typedef struct {
201 unsigned int cfg : 2;
202 unsigned int dummy1 : 30;
203} reg_iop_sw_cfg_rw_sap_in_owner;
204#define REG_RD_ADDR_iop_sw_cfg_rw_sap_in_owner 56
205#define REG_WR_ADDR_iop_sw_cfg_rw_sap_in_owner 56
206
207/* Register rw_sap_out_owner, scope iop_sw_cfg, type rw */
208typedef struct {
209 unsigned int cfg : 2;
210 unsigned int dummy1 : 30;
211} reg_iop_sw_cfg_rw_sap_out_owner;
212#define REG_RD_ADDR_iop_sw_cfg_rw_sap_out_owner 60
213#define REG_WR_ADDR_iop_sw_cfg_rw_sap_out_owner 60
214
215/* Register rw_scrc_in0_owner, scope iop_sw_cfg, type rw */
216typedef struct {
217 unsigned int cfg : 2;
218 unsigned int dummy1 : 30;
219} reg_iop_sw_cfg_rw_scrc_in0_owner;
220#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_in0_owner 64
221#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_in0_owner 64
222
223/* Register rw_scrc_in1_owner, scope iop_sw_cfg, type rw */
224typedef struct {
225 unsigned int cfg : 2;
226 unsigned int dummy1 : 30;
227} reg_iop_sw_cfg_rw_scrc_in1_owner;
228#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_in1_owner 68
229#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_in1_owner 68
230
231/* Register rw_scrc_out0_owner, scope iop_sw_cfg, type rw */
232typedef struct {
233 unsigned int cfg : 2;
234 unsigned int dummy1 : 30;
235} reg_iop_sw_cfg_rw_scrc_out0_owner;
236#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_out0_owner 72
237#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_out0_owner 72
238
239/* Register rw_scrc_out1_owner, scope iop_sw_cfg, type rw */
240typedef struct {
241 unsigned int cfg : 2;
242 unsigned int dummy1 : 30;
243} reg_iop_sw_cfg_rw_scrc_out1_owner;
244#define REG_RD_ADDR_iop_sw_cfg_rw_scrc_out1_owner 76
245#define REG_WR_ADDR_iop_sw_cfg_rw_scrc_out1_owner 76
246
247/* Register rw_spu0_owner, scope iop_sw_cfg, type rw */
248typedef struct {
249 unsigned int cfg : 2;
250 unsigned int dummy1 : 30;
251} reg_iop_sw_cfg_rw_spu0_owner;
252#define REG_RD_ADDR_iop_sw_cfg_rw_spu0_owner 80
253#define REG_WR_ADDR_iop_sw_cfg_rw_spu0_owner 80
254
255/* Register rw_spu1_owner, scope iop_sw_cfg, type rw */
256typedef struct {
257 unsigned int cfg : 2;
258 unsigned int dummy1 : 30;
259} reg_iop_sw_cfg_rw_spu1_owner;
260#define REG_RD_ADDR_iop_sw_cfg_rw_spu1_owner 84
261#define REG_WR_ADDR_iop_sw_cfg_rw_spu1_owner 84
262
263/* Register rw_timer_grp0_owner, scope iop_sw_cfg, type rw */
264typedef struct {
265 unsigned int cfg : 2;
266 unsigned int dummy1 : 30;
267} reg_iop_sw_cfg_rw_timer_grp0_owner;
268#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp0_owner 88
269#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp0_owner 88
270
271/* Register rw_timer_grp1_owner, scope iop_sw_cfg, type rw */
272typedef struct {
273 unsigned int cfg : 2;
274 unsigned int dummy1 : 30;
275} reg_iop_sw_cfg_rw_timer_grp1_owner;
276#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp1_owner 92
277#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp1_owner 92
278
279/* Register rw_timer_grp2_owner, scope iop_sw_cfg, type rw */
280typedef struct {
281 unsigned int cfg : 2;
282 unsigned int dummy1 : 30;
283} reg_iop_sw_cfg_rw_timer_grp2_owner;
284#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp2_owner 96
285#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp2_owner 96
286
287/* Register rw_timer_grp3_owner, scope iop_sw_cfg, type rw */
288typedef struct {
289 unsigned int cfg : 2;
290 unsigned int dummy1 : 30;
291} reg_iop_sw_cfg_rw_timer_grp3_owner;
292#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp3_owner 100
293#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp3_owner 100
294
295/* Register rw_trigger_grp0_owner, scope iop_sw_cfg, type rw */
296typedef struct {
297 unsigned int cfg : 2;
298 unsigned int dummy1 : 30;
299} reg_iop_sw_cfg_rw_trigger_grp0_owner;
300#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp0_owner 104
301#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp0_owner 104
302
303/* Register rw_trigger_grp1_owner, scope iop_sw_cfg, type rw */
304typedef struct {
305 unsigned int cfg : 2;
306 unsigned int dummy1 : 30;
307} reg_iop_sw_cfg_rw_trigger_grp1_owner;
308#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp1_owner 108
309#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp1_owner 108
310
311/* Register rw_trigger_grp2_owner, scope iop_sw_cfg, type rw */
312typedef struct {
313 unsigned int cfg : 2;
314 unsigned int dummy1 : 30;
315} reg_iop_sw_cfg_rw_trigger_grp2_owner;
316#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp2_owner 112
317#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp2_owner 112
318
319/* Register rw_trigger_grp3_owner, scope iop_sw_cfg, type rw */
320typedef struct {
321 unsigned int cfg : 2;
322 unsigned int dummy1 : 30;
323} reg_iop_sw_cfg_rw_trigger_grp3_owner;
324#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp3_owner 116
325#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp3_owner 116
326
327/* Register rw_trigger_grp4_owner, scope iop_sw_cfg, type rw */
328typedef struct {
329 unsigned int cfg : 2;
330 unsigned int dummy1 : 30;
331} reg_iop_sw_cfg_rw_trigger_grp4_owner;
332#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp4_owner 120
333#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp4_owner 120
334
335/* Register rw_trigger_grp5_owner, scope iop_sw_cfg, type rw */
336typedef struct {
337 unsigned int cfg : 2;
338 unsigned int dummy1 : 30;
339} reg_iop_sw_cfg_rw_trigger_grp5_owner;
340#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp5_owner 124
341#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp5_owner 124
342
343/* Register rw_trigger_grp6_owner, scope iop_sw_cfg, type rw */
344typedef struct {
345 unsigned int cfg : 2;
346 unsigned int dummy1 : 30;
347} reg_iop_sw_cfg_rw_trigger_grp6_owner;
348#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp6_owner 128
349#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp6_owner 128
350
351/* Register rw_trigger_grp7_owner, scope iop_sw_cfg, type rw */
352typedef struct {
353 unsigned int cfg : 2;
354 unsigned int dummy1 : 30;
355} reg_iop_sw_cfg_rw_trigger_grp7_owner;
356#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grp7_owner 132
357#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grp7_owner 132
358
359/* Register rw_bus0_mask, scope iop_sw_cfg, type rw */
360typedef struct {
361 unsigned int byte0 : 8;
362 unsigned int byte1 : 8;
363 unsigned int byte2 : 8;
364 unsigned int byte3 : 8;
365} reg_iop_sw_cfg_rw_bus0_mask;
366#define REG_RD_ADDR_iop_sw_cfg_rw_bus0_mask 136
367#define REG_WR_ADDR_iop_sw_cfg_rw_bus0_mask 136
368
369/* Register rw_bus0_oe_mask, scope iop_sw_cfg, type rw */
370typedef struct {
371 unsigned int byte0 : 1;
372 unsigned int byte1 : 1;
373 unsigned int byte2 : 1;
374 unsigned int byte3 : 1;
375 unsigned int dummy1 : 28;
376} reg_iop_sw_cfg_rw_bus0_oe_mask;
377#define REG_RD_ADDR_iop_sw_cfg_rw_bus0_oe_mask 140
378#define REG_WR_ADDR_iop_sw_cfg_rw_bus0_oe_mask 140
379
380/* Register rw_bus1_mask, scope iop_sw_cfg, type rw */
381typedef struct {
382 unsigned int byte0 : 8;
383 unsigned int byte1 : 8;
384 unsigned int byte2 : 8;
385 unsigned int byte3 : 8;
386} reg_iop_sw_cfg_rw_bus1_mask;
387#define REG_RD_ADDR_iop_sw_cfg_rw_bus1_mask 144
388#define REG_WR_ADDR_iop_sw_cfg_rw_bus1_mask 144
389
390/* Register rw_bus1_oe_mask, scope iop_sw_cfg, type rw */
391typedef struct {
392 unsigned int byte0 : 1;
393 unsigned int byte1 : 1;
394 unsigned int byte2 : 1;
395 unsigned int byte3 : 1;
396 unsigned int dummy1 : 28;
397} reg_iop_sw_cfg_rw_bus1_oe_mask;
398#define REG_RD_ADDR_iop_sw_cfg_rw_bus1_oe_mask 148
399#define REG_WR_ADDR_iop_sw_cfg_rw_bus1_oe_mask 148
400
401/* Register rw_gio_mask, scope iop_sw_cfg, type rw */
402typedef struct {
403 unsigned int val : 32;
404} reg_iop_sw_cfg_rw_gio_mask;
405#define REG_RD_ADDR_iop_sw_cfg_rw_gio_mask 152
406#define REG_WR_ADDR_iop_sw_cfg_rw_gio_mask 152
407
408/* Register rw_gio_oe_mask, scope iop_sw_cfg, type rw */
409typedef struct {
410 unsigned int val : 32;
411} reg_iop_sw_cfg_rw_gio_oe_mask;
412#define REG_RD_ADDR_iop_sw_cfg_rw_gio_oe_mask 156
413#define REG_WR_ADDR_iop_sw_cfg_rw_gio_oe_mask 156
414
415/* Register rw_pinmapping, scope iop_sw_cfg, type rw */
416typedef struct {
417 unsigned int bus0_byte0 : 2;
418 unsigned int bus0_byte1 : 2;
419 unsigned int bus0_byte2 : 2;
420 unsigned int bus0_byte3 : 2;
421 unsigned int bus1_byte0 : 2;
422 unsigned int bus1_byte1 : 2;
423 unsigned int bus1_byte2 : 2;
424 unsigned int bus1_byte3 : 2;
425 unsigned int gio3_0 : 2;
426 unsigned int gio7_4 : 2;
427 unsigned int gio11_8 : 2;
428 unsigned int gio15_12 : 2;
429 unsigned int gio19_16 : 2;
430 unsigned int gio23_20 : 2;
431 unsigned int gio27_24 : 2;
432 unsigned int gio31_28 : 2;
433} reg_iop_sw_cfg_rw_pinmapping;
434#define REG_RD_ADDR_iop_sw_cfg_rw_pinmapping 160
435#define REG_WR_ADDR_iop_sw_cfg_rw_pinmapping 160
436
437/* Register rw_bus_out_cfg, scope iop_sw_cfg, type rw */
438typedef struct {
439 unsigned int bus0_lo : 3;
440 unsigned int bus0_hi : 3;
441 unsigned int bus0_lo_oe : 3;
442 unsigned int bus0_hi_oe : 3;
443 unsigned int bus1_lo : 3;
444 unsigned int bus1_hi : 3;
445 unsigned int bus1_lo_oe : 3;
446 unsigned int bus1_hi_oe : 3;
447 unsigned int dummy1 : 8;
448} reg_iop_sw_cfg_rw_bus_out_cfg;
449#define REG_RD_ADDR_iop_sw_cfg_rw_bus_out_cfg 164
450#define REG_WR_ADDR_iop_sw_cfg_rw_bus_out_cfg 164
451
452/* Register rw_gio_out_grp0_cfg, scope iop_sw_cfg, type rw */
453typedef struct {
454 unsigned int gio0 : 4;
455 unsigned int gio0_oe : 2;
456 unsigned int gio1 : 4;
457 unsigned int gio1_oe : 2;
458 unsigned int gio2 : 4;
459 unsigned int gio2_oe : 2;
460 unsigned int gio3 : 4;
461 unsigned int gio3_oe : 2;
462 unsigned int dummy1 : 8;
463} reg_iop_sw_cfg_rw_gio_out_grp0_cfg;
464#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp0_cfg 168
465#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp0_cfg 168
466
467/* Register rw_gio_out_grp1_cfg, scope iop_sw_cfg, type rw */
468typedef struct {
469 unsigned int gio4 : 4;
470 unsigned int gio4_oe : 2;
471 unsigned int gio5 : 4;
472 unsigned int gio5_oe : 2;
473 unsigned int gio6 : 4;
474 unsigned int gio6_oe : 2;
475 unsigned int gio7 : 4;
476 unsigned int gio7_oe : 2;
477 unsigned int dummy1 : 8;
478} reg_iop_sw_cfg_rw_gio_out_grp1_cfg;
479#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp1_cfg 172
480#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp1_cfg 172
481
482/* Register rw_gio_out_grp2_cfg, scope iop_sw_cfg, type rw */
483typedef struct {
484 unsigned int gio8 : 4;
485 unsigned int gio8_oe : 2;
486 unsigned int gio9 : 4;
487 unsigned int gio9_oe : 2;
488 unsigned int gio10 : 4;
489 unsigned int gio10_oe : 2;
490 unsigned int gio11 : 4;
491 unsigned int gio11_oe : 2;
492 unsigned int dummy1 : 8;
493} reg_iop_sw_cfg_rw_gio_out_grp2_cfg;
494#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp2_cfg 176
495#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp2_cfg 176
496
497/* Register rw_gio_out_grp3_cfg, scope iop_sw_cfg, type rw */
498typedef struct {
499 unsigned int gio12 : 4;
500 unsigned int gio12_oe : 2;
501 unsigned int gio13 : 4;
502 unsigned int gio13_oe : 2;
503 unsigned int gio14 : 4;
504 unsigned int gio14_oe : 2;
505 unsigned int gio15 : 4;
506 unsigned int gio15_oe : 2;
507 unsigned int dummy1 : 8;
508} reg_iop_sw_cfg_rw_gio_out_grp3_cfg;
509#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp3_cfg 180
510#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp3_cfg 180
511
512/* Register rw_gio_out_grp4_cfg, scope iop_sw_cfg, type rw */
513typedef struct {
514 unsigned int gio16 : 4;
515 unsigned int gio16_oe : 2;
516 unsigned int gio17 : 4;
517 unsigned int gio17_oe : 2;
518 unsigned int gio18 : 4;
519 unsigned int gio18_oe : 2;
520 unsigned int gio19 : 4;
521 unsigned int gio19_oe : 2;
522 unsigned int dummy1 : 8;
523} reg_iop_sw_cfg_rw_gio_out_grp4_cfg;
524#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp4_cfg 184
525#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp4_cfg 184
526
527/* Register rw_gio_out_grp5_cfg, scope iop_sw_cfg, type rw */
528typedef struct {
529 unsigned int gio20 : 4;
530 unsigned int gio20_oe : 2;
531 unsigned int gio21 : 4;
532 unsigned int gio21_oe : 2;
533 unsigned int gio22 : 4;
534 unsigned int gio22_oe : 2;
535 unsigned int gio23 : 4;
536 unsigned int gio23_oe : 2;
537 unsigned int dummy1 : 8;
538} reg_iop_sw_cfg_rw_gio_out_grp5_cfg;
539#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp5_cfg 188
540#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp5_cfg 188
541
542/* Register rw_gio_out_grp6_cfg, scope iop_sw_cfg, type rw */
543typedef struct {
544 unsigned int gio24 : 4;
545 unsigned int gio24_oe : 2;
546 unsigned int gio25 : 4;
547 unsigned int gio25_oe : 2;
548 unsigned int gio26 : 4;
549 unsigned int gio26_oe : 2;
550 unsigned int gio27 : 4;
551 unsigned int gio27_oe : 2;
552 unsigned int dummy1 : 8;
553} reg_iop_sw_cfg_rw_gio_out_grp6_cfg;
554#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp6_cfg 192
555#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp6_cfg 192
556
557/* Register rw_gio_out_grp7_cfg, scope iop_sw_cfg, type rw */
558typedef struct {
559 unsigned int gio28 : 4;
560 unsigned int gio28_oe : 2;
561 unsigned int gio29 : 4;
562 unsigned int gio29_oe : 2;
563 unsigned int gio30 : 4;
564 unsigned int gio30_oe : 2;
565 unsigned int gio31 : 4;
566 unsigned int gio31_oe : 2;
567 unsigned int dummy1 : 8;
568} reg_iop_sw_cfg_rw_gio_out_grp7_cfg;
569#define REG_RD_ADDR_iop_sw_cfg_rw_gio_out_grp7_cfg 196
570#define REG_WR_ADDR_iop_sw_cfg_rw_gio_out_grp7_cfg 196
571
572/* Register rw_spu0_cfg, scope iop_sw_cfg, type rw */
573typedef struct {
574 unsigned int bus0_in : 2;
575 unsigned int bus1_in : 2;
576 unsigned int dummy1 : 28;
577} reg_iop_sw_cfg_rw_spu0_cfg;
578#define REG_RD_ADDR_iop_sw_cfg_rw_spu0_cfg 200
579#define REG_WR_ADDR_iop_sw_cfg_rw_spu0_cfg 200
580
581/* Register rw_spu1_cfg, scope iop_sw_cfg, type rw */
582typedef struct {
583 unsigned int bus0_in : 2;
584 unsigned int bus1_in : 2;
585 unsigned int dummy1 : 28;
586} reg_iop_sw_cfg_rw_spu1_cfg;
587#define REG_RD_ADDR_iop_sw_cfg_rw_spu1_cfg 204
588#define REG_WR_ADDR_iop_sw_cfg_rw_spu1_cfg 204
589
590/* Register rw_timer_grp0_cfg, scope iop_sw_cfg, type rw */
591typedef struct {
592 unsigned int ext_clk : 3;
593 unsigned int tmr0_en : 1;
594 unsigned int tmr1_en : 1;
595 unsigned int tmr2_en : 1;
596 unsigned int tmr3_en : 1;
597 unsigned int tmr0_dis : 1;
598 unsigned int tmr1_dis : 1;
599 unsigned int tmr2_dis : 1;
600 unsigned int tmr3_dis : 1;
601 unsigned int dummy1 : 21;
602} reg_iop_sw_cfg_rw_timer_grp0_cfg;
603#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp0_cfg 208
604#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp0_cfg 208
605
606/* Register rw_timer_grp1_cfg, scope iop_sw_cfg, type rw */
607typedef struct {
608 unsigned int ext_clk : 3;
609 unsigned int tmr0_en : 1;
610 unsigned int tmr1_en : 1;
611 unsigned int tmr2_en : 1;
612 unsigned int tmr3_en : 1;
613 unsigned int tmr0_dis : 1;
614 unsigned int tmr1_dis : 1;
615 unsigned int tmr2_dis : 1;
616 unsigned int tmr3_dis : 1;
617 unsigned int dummy1 : 21;
618} reg_iop_sw_cfg_rw_timer_grp1_cfg;
619#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp1_cfg 212
620#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp1_cfg 212
621
622/* Register rw_timer_grp2_cfg, scope iop_sw_cfg, type rw */
623typedef struct {
624 unsigned int ext_clk : 3;
625 unsigned int tmr0_en : 1;
626 unsigned int tmr1_en : 1;
627 unsigned int tmr2_en : 1;
628 unsigned int tmr3_en : 1;
629 unsigned int tmr0_dis : 1;
630 unsigned int tmr1_dis : 1;
631 unsigned int tmr2_dis : 1;
632 unsigned int tmr3_dis : 1;
633 unsigned int dummy1 : 21;
634} reg_iop_sw_cfg_rw_timer_grp2_cfg;
635#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp2_cfg 216
636#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp2_cfg 216
637
638/* Register rw_timer_grp3_cfg, scope iop_sw_cfg, type rw */
639typedef struct {
640 unsigned int ext_clk : 3;
641 unsigned int tmr0_en : 1;
642 unsigned int tmr1_en : 1;
643 unsigned int tmr2_en : 1;
644 unsigned int tmr3_en : 1;
645 unsigned int tmr0_dis : 1;
646 unsigned int tmr1_dis : 1;
647 unsigned int tmr2_dis : 1;
648 unsigned int tmr3_dis : 1;
649 unsigned int dummy1 : 21;
650} reg_iop_sw_cfg_rw_timer_grp3_cfg;
651#define REG_RD_ADDR_iop_sw_cfg_rw_timer_grp3_cfg 220
652#define REG_WR_ADDR_iop_sw_cfg_rw_timer_grp3_cfg 220
653
654/* Register rw_trigger_grps_cfg, scope iop_sw_cfg, type rw */
655typedef struct {
656 unsigned int grp0_dis : 1;
657 unsigned int grp0_en : 1;
658 unsigned int grp1_dis : 1;
659 unsigned int grp1_en : 1;
660 unsigned int grp2_dis : 1;
661 unsigned int grp2_en : 1;
662 unsigned int grp3_dis : 1;
663 unsigned int grp3_en : 1;
664 unsigned int grp4_dis : 1;
665 unsigned int grp4_en : 1;
666 unsigned int grp5_dis : 1;
667 unsigned int grp5_en : 1;
668 unsigned int grp6_dis : 1;
669 unsigned int grp6_en : 1;
670 unsigned int grp7_dis : 1;
671 unsigned int grp7_en : 1;
672 unsigned int dummy1 : 16;
673} reg_iop_sw_cfg_rw_trigger_grps_cfg;
674#define REG_RD_ADDR_iop_sw_cfg_rw_trigger_grps_cfg 224
675#define REG_WR_ADDR_iop_sw_cfg_rw_trigger_grps_cfg 224
676
677/* Register rw_pdp0_cfg, scope iop_sw_cfg, type rw */
678typedef struct {
679 unsigned int dmc0_usr : 1;
680 unsigned int out_strb : 5;
681 unsigned int in_src : 3;
682 unsigned int in_size : 3;
683 unsigned int in_last : 2;
684 unsigned int in_strb : 4;
685 unsigned int out_src : 1;
686 unsigned int dummy1 : 13;
687} reg_iop_sw_cfg_rw_pdp0_cfg;
688#define REG_RD_ADDR_iop_sw_cfg_rw_pdp0_cfg 228
689#define REG_WR_ADDR_iop_sw_cfg_rw_pdp0_cfg 228
690
691/* Register rw_pdp1_cfg, scope iop_sw_cfg, type rw */
692typedef struct {
693 unsigned int dmc1_usr : 1;
694 unsigned int out_strb : 5;
695 unsigned int in_src : 3;
696 unsigned int in_size : 3;
697 unsigned int in_last : 2;
698 unsigned int in_strb : 4;
699 unsigned int out_src : 1;
700 unsigned int dummy1 : 13;
701} reg_iop_sw_cfg_rw_pdp1_cfg;
702#define REG_RD_ADDR_iop_sw_cfg_rw_pdp1_cfg 232
703#define REG_WR_ADDR_iop_sw_cfg_rw_pdp1_cfg 232
704
705/* Register rw_sdp_cfg, scope iop_sw_cfg, type rw */
706typedef struct {
707 unsigned int sdp_out0_strb : 3;
708 unsigned int sdp_out1_strb : 3;
709 unsigned int sdp_in0_data : 3;
710 unsigned int sdp_in0_last : 2;
711 unsigned int sdp_in0_strb : 3;
712 unsigned int sdp_in1_data : 3;
713 unsigned int sdp_in1_last : 2;
714 unsigned int sdp_in1_strb : 3;
715 unsigned int dummy1 : 10;
716} reg_iop_sw_cfg_rw_sdp_cfg;
717#define REG_RD_ADDR_iop_sw_cfg_rw_sdp_cfg 236
718#define REG_WR_ADDR_iop_sw_cfg_rw_sdp_cfg 236
719
720
721/* Constants */
722enum {
723 regk_iop_sw_cfg_a = 0x00000001,
724 regk_iop_sw_cfg_b = 0x00000002,
725 regk_iop_sw_cfg_bus0 = 0x00000000,
726 regk_iop_sw_cfg_bus0_rot16 = 0x00000004,
727 regk_iop_sw_cfg_bus0_rot24 = 0x00000006,
728 regk_iop_sw_cfg_bus0_rot8 = 0x00000002,
729 regk_iop_sw_cfg_bus1 = 0x00000001,
730 regk_iop_sw_cfg_bus1_rot16 = 0x00000005,
731 regk_iop_sw_cfg_bus1_rot24 = 0x00000007,
732 regk_iop_sw_cfg_bus1_rot8 = 0x00000003,
733 regk_iop_sw_cfg_clk12 = 0x00000000,
734 regk_iop_sw_cfg_cpu = 0x00000000,
735 regk_iop_sw_cfg_dmc0 = 0x00000000,
736 regk_iop_sw_cfg_dmc1 = 0x00000001,
737 regk_iop_sw_cfg_gated_clk0 = 0x00000010,
738 regk_iop_sw_cfg_gated_clk1 = 0x00000011,
739 regk_iop_sw_cfg_gated_clk2 = 0x00000012,
740 regk_iop_sw_cfg_gated_clk3 = 0x00000013,
741 regk_iop_sw_cfg_gio0 = 0x00000004,
742 regk_iop_sw_cfg_gio1 = 0x00000001,
743 regk_iop_sw_cfg_gio2 = 0x00000005,
744 regk_iop_sw_cfg_gio3 = 0x00000002,
745 regk_iop_sw_cfg_gio4 = 0x00000006,
746 regk_iop_sw_cfg_gio5 = 0x00000003,
747 regk_iop_sw_cfg_gio6 = 0x00000007,
748 regk_iop_sw_cfg_gio7 = 0x00000004,
749 regk_iop_sw_cfg_gio_in0 = 0x00000000,
750 regk_iop_sw_cfg_gio_in1 = 0x00000001,
751 regk_iop_sw_cfg_gio_in10 = 0x00000002,
752 regk_iop_sw_cfg_gio_in11 = 0x00000003,
753 regk_iop_sw_cfg_gio_in14 = 0x00000004,
754 regk_iop_sw_cfg_gio_in15 = 0x00000005,
755 regk_iop_sw_cfg_gio_in18 = 0x00000002,
756 regk_iop_sw_cfg_gio_in19 = 0x00000003,
757 regk_iop_sw_cfg_gio_in20 = 0x00000004,
758 regk_iop_sw_cfg_gio_in21 = 0x00000005,
759 regk_iop_sw_cfg_gio_in26 = 0x00000006,
760 regk_iop_sw_cfg_gio_in27 = 0x00000007,
761 regk_iop_sw_cfg_gio_in28 = 0x00000006,
762 regk_iop_sw_cfg_gio_in29 = 0x00000007,
763 regk_iop_sw_cfg_gio_in4 = 0x00000000,
764 regk_iop_sw_cfg_gio_in5 = 0x00000001,
765 regk_iop_sw_cfg_last_timer_grp0_tmr2 = 0x00000001,
766 regk_iop_sw_cfg_last_timer_grp1_tmr2 = 0x00000001,
767 regk_iop_sw_cfg_last_timer_grp2_tmr2 = 0x00000002,
768 regk_iop_sw_cfg_last_timer_grp2_tmr3 = 0x00000003,
769 regk_iop_sw_cfg_last_timer_grp3_tmr2 = 0x00000002,
770 regk_iop_sw_cfg_last_timer_grp3_tmr3 = 0x00000003,
771 regk_iop_sw_cfg_mpu = 0x00000001,
772 regk_iop_sw_cfg_none = 0x00000000,
773 regk_iop_sw_cfg_par0 = 0x00000000,
774 regk_iop_sw_cfg_par1 = 0x00000001,
775 regk_iop_sw_cfg_pdp_out0 = 0x00000002,
776 regk_iop_sw_cfg_pdp_out0_hi = 0x00000001,
777 regk_iop_sw_cfg_pdp_out0_hi_rot8 = 0x00000005,
778 regk_iop_sw_cfg_pdp_out0_lo = 0x00000000,
779 regk_iop_sw_cfg_pdp_out0_lo_rot8 = 0x00000004,
780 regk_iop_sw_cfg_pdp_out1 = 0x00000003,
781 regk_iop_sw_cfg_pdp_out1_hi = 0x00000003,
782 regk_iop_sw_cfg_pdp_out1_hi_rot8 = 0x00000005,
783 regk_iop_sw_cfg_pdp_out1_lo = 0x00000002,
784 regk_iop_sw_cfg_pdp_out1_lo_rot8 = 0x00000004,
785 regk_iop_sw_cfg_rw_bus0_mask_default = 0x00000000,
786 regk_iop_sw_cfg_rw_bus0_oe_mask_default = 0x00000000,
787 regk_iop_sw_cfg_rw_bus1_mask_default = 0x00000000,
788 regk_iop_sw_cfg_rw_bus1_oe_mask_default = 0x00000000,
789 regk_iop_sw_cfg_rw_bus_out_cfg_default = 0x00000000,
790 regk_iop_sw_cfg_rw_crc_par0_owner_default = 0x00000000,
791 regk_iop_sw_cfg_rw_crc_par1_owner_default = 0x00000000,
792 regk_iop_sw_cfg_rw_dmc_in0_owner_default = 0x00000000,
793 regk_iop_sw_cfg_rw_dmc_in1_owner_default = 0x00000000,
794 regk_iop_sw_cfg_rw_dmc_out0_owner_default = 0x00000000,
795 regk_iop_sw_cfg_rw_dmc_out1_owner_default = 0x00000000,
796 regk_iop_sw_cfg_rw_fifo_in0_extra_owner_default = 0x00000000,
797 regk_iop_sw_cfg_rw_fifo_in0_owner_default = 0x00000000,
798 regk_iop_sw_cfg_rw_fifo_in1_extra_owner_default = 0x00000000,
799 regk_iop_sw_cfg_rw_fifo_in1_owner_default = 0x00000000,
800 regk_iop_sw_cfg_rw_fifo_out0_extra_owner_default = 0x00000000,
801 regk_iop_sw_cfg_rw_fifo_out0_owner_default = 0x00000000,
802 regk_iop_sw_cfg_rw_fifo_out1_extra_owner_default = 0x00000000,
803 regk_iop_sw_cfg_rw_fifo_out1_owner_default = 0x00000000,
804 regk_iop_sw_cfg_rw_gio_mask_default = 0x00000000,
805 regk_iop_sw_cfg_rw_gio_oe_mask_default = 0x00000000,
806 regk_iop_sw_cfg_rw_gio_out_grp0_cfg_default = 0x00000000,
807 regk_iop_sw_cfg_rw_gio_out_grp1_cfg_default = 0x00000000,
808 regk_iop_sw_cfg_rw_gio_out_grp2_cfg_default = 0x00000000,
809 regk_iop_sw_cfg_rw_gio_out_grp3_cfg_default = 0x00000000,
810 regk_iop_sw_cfg_rw_gio_out_grp4_cfg_default = 0x00000000,
811 regk_iop_sw_cfg_rw_gio_out_grp5_cfg_default = 0x00000000,
812 regk_iop_sw_cfg_rw_gio_out_grp6_cfg_default = 0x00000000,
813 regk_iop_sw_cfg_rw_gio_out_grp7_cfg_default = 0x00000000,
814 regk_iop_sw_cfg_rw_pdp0_cfg_default = 0x00000000,
815 regk_iop_sw_cfg_rw_pdp1_cfg_default = 0x00000000,
816 regk_iop_sw_cfg_rw_pinmapping_default = 0x55555555,
817 regk_iop_sw_cfg_rw_sap_in_owner_default = 0x00000000,
818 regk_iop_sw_cfg_rw_sap_out_owner_default = 0x00000000,
819 regk_iop_sw_cfg_rw_scrc_in0_owner_default = 0x00000000,
820 regk_iop_sw_cfg_rw_scrc_in1_owner_default = 0x00000000,
821 regk_iop_sw_cfg_rw_scrc_out0_owner_default = 0x00000000,
822 regk_iop_sw_cfg_rw_scrc_out1_owner_default = 0x00000000,
823 regk_iop_sw_cfg_rw_sdp_cfg_default = 0x00000000,
824 regk_iop_sw_cfg_rw_spu0_cfg_default = 0x00000000,
825 regk_iop_sw_cfg_rw_spu0_owner_default = 0x00000000,
826 regk_iop_sw_cfg_rw_spu1_cfg_default = 0x00000000,
827 regk_iop_sw_cfg_rw_spu1_owner_default = 0x00000000,
828 regk_iop_sw_cfg_rw_timer_grp0_cfg_default = 0x00000000,
829 regk_iop_sw_cfg_rw_timer_grp0_owner_default = 0x00000000,
830 regk_iop_sw_cfg_rw_timer_grp1_cfg_default = 0x00000000,
831 regk_iop_sw_cfg_rw_timer_grp1_owner_default = 0x00000000,
832 regk_iop_sw_cfg_rw_timer_grp2_cfg_default = 0x00000000,
833 regk_iop_sw_cfg_rw_timer_grp2_owner_default = 0x00000000,
834 regk_iop_sw_cfg_rw_timer_grp3_cfg_default = 0x00000000,
835 regk_iop_sw_cfg_rw_timer_grp3_owner_default = 0x00000000,
836 regk_iop_sw_cfg_rw_trigger_grp0_owner_default = 0x00000000,
837 regk_iop_sw_cfg_rw_trigger_grp1_owner_default = 0x00000000,
838 regk_iop_sw_cfg_rw_trigger_grp2_owner_default = 0x00000000,
839 regk_iop_sw_cfg_rw_trigger_grp3_owner_default = 0x00000000,
840 regk_iop_sw_cfg_rw_trigger_grp4_owner_default = 0x00000000,
841 regk_iop_sw_cfg_rw_trigger_grp5_owner_default = 0x00000000,
842 regk_iop_sw_cfg_rw_trigger_grp6_owner_default = 0x00000000,
843 regk_iop_sw_cfg_rw_trigger_grp7_owner_default = 0x00000000,
844 regk_iop_sw_cfg_rw_trigger_grps_cfg_default = 0x00000000,
845 regk_iop_sw_cfg_sdp_out0 = 0x00000008,
846 regk_iop_sw_cfg_sdp_out1 = 0x00000009,
847 regk_iop_sw_cfg_size16 = 0x00000002,
848 regk_iop_sw_cfg_size24 = 0x00000003,
849 regk_iop_sw_cfg_size32 = 0x00000004,
850 regk_iop_sw_cfg_size8 = 0x00000001,
851 regk_iop_sw_cfg_spu0 = 0x00000002,
852 regk_iop_sw_cfg_spu0_bus_out0_hi = 0x00000006,
853 regk_iop_sw_cfg_spu0_bus_out0_lo = 0x00000006,
854 regk_iop_sw_cfg_spu0_bus_out1_hi = 0x00000007,
855 regk_iop_sw_cfg_spu0_bus_out1_lo = 0x00000007,
856 regk_iop_sw_cfg_spu0_g0 = 0x0000000e,
857 regk_iop_sw_cfg_spu0_g1 = 0x0000000e,
858 regk_iop_sw_cfg_spu0_g2 = 0x0000000e,
859 regk_iop_sw_cfg_spu0_g3 = 0x0000000e,
860 regk_iop_sw_cfg_spu0_g4 = 0x0000000e,
861 regk_iop_sw_cfg_spu0_g5 = 0x0000000e,
862 regk_iop_sw_cfg_spu0_g6 = 0x0000000e,
863 regk_iop_sw_cfg_spu0_g7 = 0x0000000e,
864 regk_iop_sw_cfg_spu0_gio0 = 0x00000000,
865 regk_iop_sw_cfg_spu0_gio1 = 0x00000001,
866 regk_iop_sw_cfg_spu0_gio2 = 0x00000000,
867 regk_iop_sw_cfg_spu0_gio5 = 0x00000005,
868 regk_iop_sw_cfg_spu0_gio6 = 0x00000006,
869 regk_iop_sw_cfg_spu0_gio7 = 0x00000007,
870 regk_iop_sw_cfg_spu0_gio_out0 = 0x00000008,
871 regk_iop_sw_cfg_spu0_gio_out1 = 0x00000009,
872 regk_iop_sw_cfg_spu0_gio_out2 = 0x0000000a,
873 regk_iop_sw_cfg_spu0_gio_out3 = 0x0000000b,
874 regk_iop_sw_cfg_spu0_gio_out4 = 0x0000000c,
875 regk_iop_sw_cfg_spu0_gio_out5 = 0x0000000d,
876 regk_iop_sw_cfg_spu0_gio_out6 = 0x0000000e,
877 regk_iop_sw_cfg_spu0_gio_out7 = 0x0000000f,
878 regk_iop_sw_cfg_spu0_gioout0 = 0x00000000,
879 regk_iop_sw_cfg_spu0_gioout1 = 0x00000000,
880 regk_iop_sw_cfg_spu0_gioout10 = 0x0000000e,
881 regk_iop_sw_cfg_spu0_gioout11 = 0x0000000e,
882 regk_iop_sw_cfg_spu0_gioout12 = 0x0000000e,
883 regk_iop_sw_cfg_spu0_gioout13 = 0x0000000e,
884 regk_iop_sw_cfg_spu0_gioout14 = 0x0000000e,
885 regk_iop_sw_cfg_spu0_gioout15 = 0x0000000e,
886 regk_iop_sw_cfg_spu0_gioout16 = 0x0000000e,
887 regk_iop_sw_cfg_spu0_gioout17 = 0x0000000e,
888 regk_iop_sw_cfg_spu0_gioout18 = 0x0000000e,
889 regk_iop_sw_cfg_spu0_gioout19 = 0x0000000e,
890 regk_iop_sw_cfg_spu0_gioout2 = 0x00000002,
891 regk_iop_sw_cfg_spu0_gioout20 = 0x0000000e,
892 regk_iop_sw_cfg_spu0_gioout21 = 0x0000000e,
893 regk_iop_sw_cfg_spu0_gioout22 = 0x0000000e,
894 regk_iop_sw_cfg_spu0_gioout23 = 0x0000000e,
895 regk_iop_sw_cfg_spu0_gioout24 = 0x0000000e,
896 regk_iop_sw_cfg_spu0_gioout25 = 0x0000000e,
897 regk_iop_sw_cfg_spu0_gioout26 = 0x0000000e,
898 regk_iop_sw_cfg_spu0_gioout27 = 0x0000000e,
899 regk_iop_sw_cfg_spu0_gioout28 = 0x0000000e,
900 regk_iop_sw_cfg_spu0_gioout29 = 0x0000000e,
901 regk_iop_sw_cfg_spu0_gioout3 = 0x00000002,
902 regk_iop_sw_cfg_spu0_gioout30 = 0x0000000e,
903 regk_iop_sw_cfg_spu0_gioout31 = 0x0000000e,
904 regk_iop_sw_cfg_spu0_gioout4 = 0x00000004,
905 regk_iop_sw_cfg_spu0_gioout5 = 0x00000004,
906 regk_iop_sw_cfg_spu0_gioout6 = 0x00000006,
907 regk_iop_sw_cfg_spu0_gioout7 = 0x00000006,
908 regk_iop_sw_cfg_spu0_gioout8 = 0x0000000e,
909 regk_iop_sw_cfg_spu0_gioout9 = 0x0000000e,
910 regk_iop_sw_cfg_spu1 = 0x00000003,
911 regk_iop_sw_cfg_spu1_bus_out0_hi = 0x00000006,
912 regk_iop_sw_cfg_spu1_bus_out0_lo = 0x00000006,
913 regk_iop_sw_cfg_spu1_bus_out1_hi = 0x00000007,
914 regk_iop_sw_cfg_spu1_bus_out1_lo = 0x00000007,
915 regk_iop_sw_cfg_spu1_g0 = 0x0000000f,
916 regk_iop_sw_cfg_spu1_g1 = 0x0000000f,
917 regk_iop_sw_cfg_spu1_g2 = 0x0000000f,
918 regk_iop_sw_cfg_spu1_g3 = 0x0000000f,
919 regk_iop_sw_cfg_spu1_g4 = 0x0000000f,
920 regk_iop_sw_cfg_spu1_g5 = 0x0000000f,
921 regk_iop_sw_cfg_spu1_g6 = 0x0000000f,
922 regk_iop_sw_cfg_spu1_g7 = 0x0000000f,
923 regk_iop_sw_cfg_spu1_gio0 = 0x00000002,
924 regk_iop_sw_cfg_spu1_gio1 = 0x00000003,
925 regk_iop_sw_cfg_spu1_gio2 = 0x00000002,
926 regk_iop_sw_cfg_spu1_gio5 = 0x00000005,
927 regk_iop_sw_cfg_spu1_gio6 = 0x00000006,
928 regk_iop_sw_cfg_spu1_gio7 = 0x00000007,
929 regk_iop_sw_cfg_spu1_gio_out0 = 0x00000008,
930 regk_iop_sw_cfg_spu1_gio_out1 = 0x00000009,
931 regk_iop_sw_cfg_spu1_gio_out2 = 0x0000000a,
932 regk_iop_sw_cfg_spu1_gio_out3 = 0x0000000b,
933 regk_iop_sw_cfg_spu1_gio_out4 = 0x0000000c,
934 regk_iop_sw_cfg_spu1_gio_out5 = 0x0000000d,
935 regk_iop_sw_cfg_spu1_gio_out6 = 0x0000000e,
936 regk_iop_sw_cfg_spu1_gio_out7 = 0x0000000f,
937 regk_iop_sw_cfg_spu1_gioout0 = 0x00000001,
938 regk_iop_sw_cfg_spu1_gioout1 = 0x00000001,
939 regk_iop_sw_cfg_spu1_gioout10 = 0x0000000f,
940 regk_iop_sw_cfg_spu1_gioout11 = 0x0000000f,
941 regk_iop_sw_cfg_spu1_gioout12 = 0x0000000f,
942 regk_iop_sw_cfg_spu1_gioout13 = 0x0000000f,
943 regk_iop_sw_cfg_spu1_gioout14 = 0x0000000f,
944 regk_iop_sw_cfg_spu1_gioout15 = 0x0000000f,
945 regk_iop_sw_cfg_spu1_gioout16 = 0x0000000f,
946 regk_iop_sw_cfg_spu1_gioout17 = 0x0000000f,
947 regk_iop_sw_cfg_spu1_gioout18 = 0x0000000f,
948 regk_iop_sw_cfg_spu1_gioout19 = 0x0000000f,
949 regk_iop_sw_cfg_spu1_gioout2 = 0x00000003,
950 regk_iop_sw_cfg_spu1_gioout20 = 0x0000000f,
951 regk_iop_sw_cfg_spu1_gioout21 = 0x0000000f,
952 regk_iop_sw_cfg_spu1_gioout22 = 0x0000000f,
953 regk_iop_sw_cfg_spu1_gioout23 = 0x0000000f,
954 regk_iop_sw_cfg_spu1_gioout24 = 0x0000000f,
955 regk_iop_sw_cfg_spu1_gioout25 = 0x0000000f,
956 regk_iop_sw_cfg_spu1_gioout26 = 0x0000000f,
957 regk_iop_sw_cfg_spu1_gioout27 = 0x0000000f,
958 regk_iop_sw_cfg_spu1_gioout28 = 0x0000000f,
959 regk_iop_sw_cfg_spu1_gioout29 = 0x0000000f,
960 regk_iop_sw_cfg_spu1_gioout3 = 0x00000003,
961 regk_iop_sw_cfg_spu1_gioout30 = 0x0000000f,
962 regk_iop_sw_cfg_spu1_gioout31 = 0x0000000f,
963 regk_iop_sw_cfg_spu1_gioout4 = 0x00000005,
964 regk_iop_sw_cfg_spu1_gioout5 = 0x00000005,
965 regk_iop_sw_cfg_spu1_gioout6 = 0x00000007,
966 regk_iop_sw_cfg_spu1_gioout7 = 0x00000007,
967 regk_iop_sw_cfg_spu1_gioout8 = 0x0000000f,
968 regk_iop_sw_cfg_spu1_gioout9 = 0x0000000f,
969 regk_iop_sw_cfg_strb_timer_grp0_tmr0 = 0x00000001,
970 regk_iop_sw_cfg_strb_timer_grp0_tmr1 = 0x00000002,
971 regk_iop_sw_cfg_strb_timer_grp1_tmr0 = 0x00000001,
972 regk_iop_sw_cfg_strb_timer_grp1_tmr1 = 0x00000002,
973 regk_iop_sw_cfg_strb_timer_grp2_tmr0 = 0x00000003,
974 regk_iop_sw_cfg_strb_timer_grp2_tmr1 = 0x00000002,
975 regk_iop_sw_cfg_strb_timer_grp3_tmr0 = 0x00000003,
976 regk_iop_sw_cfg_strb_timer_grp3_tmr1 = 0x00000002,
977 regk_iop_sw_cfg_timer_grp0 = 0x00000000,
978 regk_iop_sw_cfg_timer_grp0_rot = 0x00000001,
979 regk_iop_sw_cfg_timer_grp0_strb0 = 0x0000000a,
980 regk_iop_sw_cfg_timer_grp0_strb1 = 0x0000000a,
981 regk_iop_sw_cfg_timer_grp0_strb2 = 0x0000000a,
982 regk_iop_sw_cfg_timer_grp0_strb3 = 0x0000000a,
983 regk_iop_sw_cfg_timer_grp0_tmr0 = 0x00000004,
984 regk_iop_sw_cfg_timer_grp0_tmr1 = 0x00000004,
985 regk_iop_sw_cfg_timer_grp1 = 0x00000000,
986 regk_iop_sw_cfg_timer_grp1_rot = 0x00000001,
987 regk_iop_sw_cfg_timer_grp1_strb0 = 0x0000000b,
988 regk_iop_sw_cfg_timer_grp1_strb1 = 0x0000000b,
989 regk_iop_sw_cfg_timer_grp1_strb2 = 0x0000000b,
990 regk_iop_sw_cfg_timer_grp1_strb3 = 0x0000000b,
991 regk_iop_sw_cfg_timer_grp1_tmr0 = 0x00000005,
992 regk_iop_sw_cfg_timer_grp1_tmr1 = 0x00000005,
993 regk_iop_sw_cfg_timer_grp2 = 0x00000000,
994 regk_iop_sw_cfg_timer_grp2_rot = 0x00000001,
995 regk_iop_sw_cfg_timer_grp2_strb0 = 0x0000000c,
996 regk_iop_sw_cfg_timer_grp2_strb1 = 0x0000000c,
997 regk_iop_sw_cfg_timer_grp2_strb2 = 0x0000000c,
998 regk_iop_sw_cfg_timer_grp2_strb3 = 0x0000000c,
999 regk_iop_sw_cfg_timer_grp2_tmr0 = 0x00000006,
1000 regk_iop_sw_cfg_timer_grp2_tmr1 = 0x00000006,
1001 regk_iop_sw_cfg_timer_grp3 = 0x00000000,
1002 regk_iop_sw_cfg_timer_grp3_rot = 0x00000001,
1003 regk_iop_sw_cfg_timer_grp3_strb0 = 0x0000000d,
1004 regk_iop_sw_cfg_timer_grp3_strb1 = 0x0000000d,
1005 regk_iop_sw_cfg_timer_grp3_strb2 = 0x0000000d,
1006 regk_iop_sw_cfg_timer_grp3_strb3 = 0x0000000d,
1007 regk_iop_sw_cfg_timer_grp3_tmr0 = 0x00000007,
1008 regk_iop_sw_cfg_timer_grp3_tmr1 = 0x00000007,
1009 regk_iop_sw_cfg_trig0_0 = 0x00000000,
1010 regk_iop_sw_cfg_trig0_1 = 0x00000000,
1011 regk_iop_sw_cfg_trig0_2 = 0x00000000,
1012 regk_iop_sw_cfg_trig0_3 = 0x00000000,
1013 regk_iop_sw_cfg_trig1_0 = 0x00000000,
1014 regk_iop_sw_cfg_trig1_1 = 0x00000000,
1015 regk_iop_sw_cfg_trig1_2 = 0x00000000,
1016 regk_iop_sw_cfg_trig1_3 = 0x00000000,
1017 regk_iop_sw_cfg_trig2_0 = 0x00000000,
1018 regk_iop_sw_cfg_trig2_1 = 0x00000000,
1019 regk_iop_sw_cfg_trig2_2 = 0x00000000,
1020 regk_iop_sw_cfg_trig2_3 = 0x00000000,
1021 regk_iop_sw_cfg_trig3_0 = 0x00000000,
1022 regk_iop_sw_cfg_trig3_1 = 0x00000000,
1023 regk_iop_sw_cfg_trig3_2 = 0x00000000,
1024 regk_iop_sw_cfg_trig3_3 = 0x00000000,
1025 regk_iop_sw_cfg_trig4_0 = 0x00000001,
1026 regk_iop_sw_cfg_trig4_1 = 0x00000001,
1027 regk_iop_sw_cfg_trig4_2 = 0x00000001,
1028 regk_iop_sw_cfg_trig4_3 = 0x00000001,
1029 regk_iop_sw_cfg_trig5_0 = 0x00000001,
1030 regk_iop_sw_cfg_trig5_1 = 0x00000001,
1031 regk_iop_sw_cfg_trig5_2 = 0x00000001,
1032 regk_iop_sw_cfg_trig5_3 = 0x00000001,
1033 regk_iop_sw_cfg_trig6_0 = 0x00000001,
1034 regk_iop_sw_cfg_trig6_1 = 0x00000001,
1035 regk_iop_sw_cfg_trig6_2 = 0x00000001,
1036 regk_iop_sw_cfg_trig6_3 = 0x00000001,
1037 regk_iop_sw_cfg_trig7_0 = 0x00000001,
1038 regk_iop_sw_cfg_trig7_1 = 0x00000001,
1039 regk_iop_sw_cfg_trig7_2 = 0x00000001,
1040 regk_iop_sw_cfg_trig7_3 = 0x00000001
1041};
1042#endif /* __iop_sw_cfg_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cpu_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cpu_defs.h
new file mode 100644
index 000000000000..5fed844b19e2
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_cpu_defs.h
@@ -0,0 +1,853 @@
1#ifndef __iop_sw_cpu_defs_h
2#define __iop_sw_cpu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_cpu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sw_cpu_defs.h ../../inst/io_proc/rtl/guinness/iop_sw_cpu.r
11 * id: $Id: iop_sw_cpu_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sw_cpu */
86
87/* Register rw_mc_ctrl, scope iop_sw_cpu, type rw */
88typedef struct {
89 unsigned int keep_owner : 1;
90 unsigned int cmd : 2;
91 unsigned int size : 3;
92 unsigned int wr_spu0_mem : 1;
93 unsigned int wr_spu1_mem : 1;
94 unsigned int dummy1 : 24;
95} reg_iop_sw_cpu_rw_mc_ctrl;
96#define REG_RD_ADDR_iop_sw_cpu_rw_mc_ctrl 0
97#define REG_WR_ADDR_iop_sw_cpu_rw_mc_ctrl 0
98
99/* Register rw_mc_data, scope iop_sw_cpu, type rw */
100typedef struct {
101 unsigned int val : 32;
102} reg_iop_sw_cpu_rw_mc_data;
103#define REG_RD_ADDR_iop_sw_cpu_rw_mc_data 4
104#define REG_WR_ADDR_iop_sw_cpu_rw_mc_data 4
105
106/* Register rw_mc_addr, scope iop_sw_cpu, type rw */
107typedef unsigned int reg_iop_sw_cpu_rw_mc_addr;
108#define REG_RD_ADDR_iop_sw_cpu_rw_mc_addr 8
109#define REG_WR_ADDR_iop_sw_cpu_rw_mc_addr 8
110
111/* Register rs_mc_data, scope iop_sw_cpu, type rs */
112typedef unsigned int reg_iop_sw_cpu_rs_mc_data;
113#define REG_RD_ADDR_iop_sw_cpu_rs_mc_data 12
114
115/* Register r_mc_data, scope iop_sw_cpu, type r */
116typedef unsigned int reg_iop_sw_cpu_r_mc_data;
117#define REG_RD_ADDR_iop_sw_cpu_r_mc_data 16
118
119/* Register r_mc_stat, scope iop_sw_cpu, type r */
120typedef struct {
121 unsigned int busy_cpu : 1;
122 unsigned int busy_mpu : 1;
123 unsigned int busy_spu0 : 1;
124 unsigned int busy_spu1 : 1;
125 unsigned int owned_by_cpu : 1;
126 unsigned int owned_by_mpu : 1;
127 unsigned int owned_by_spu0 : 1;
128 unsigned int owned_by_spu1 : 1;
129 unsigned int dummy1 : 24;
130} reg_iop_sw_cpu_r_mc_stat;
131#define REG_RD_ADDR_iop_sw_cpu_r_mc_stat 20
132
133/* Register rw_bus0_clr_mask, scope iop_sw_cpu, type rw */
134typedef struct {
135 unsigned int byte0 : 8;
136 unsigned int byte1 : 8;
137 unsigned int byte2 : 8;
138 unsigned int byte3 : 8;
139} reg_iop_sw_cpu_rw_bus0_clr_mask;
140#define REG_RD_ADDR_iop_sw_cpu_rw_bus0_clr_mask 24
141#define REG_WR_ADDR_iop_sw_cpu_rw_bus0_clr_mask 24
142
143/* Register rw_bus0_set_mask, scope iop_sw_cpu, type rw */
144typedef struct {
145 unsigned int byte0 : 8;
146 unsigned int byte1 : 8;
147 unsigned int byte2 : 8;
148 unsigned int byte3 : 8;
149} reg_iop_sw_cpu_rw_bus0_set_mask;
150#define REG_RD_ADDR_iop_sw_cpu_rw_bus0_set_mask 28
151#define REG_WR_ADDR_iop_sw_cpu_rw_bus0_set_mask 28
152
153/* Register rw_bus0_oe_clr_mask, scope iop_sw_cpu, type rw */
154typedef struct {
155 unsigned int byte0 : 1;
156 unsigned int byte1 : 1;
157 unsigned int byte2 : 1;
158 unsigned int byte3 : 1;
159 unsigned int dummy1 : 28;
160} reg_iop_sw_cpu_rw_bus0_oe_clr_mask;
161#define REG_RD_ADDR_iop_sw_cpu_rw_bus0_oe_clr_mask 32
162#define REG_WR_ADDR_iop_sw_cpu_rw_bus0_oe_clr_mask 32
163
164/* Register rw_bus0_oe_set_mask, scope iop_sw_cpu, type rw */
165typedef struct {
166 unsigned int byte0 : 1;
167 unsigned int byte1 : 1;
168 unsigned int byte2 : 1;
169 unsigned int byte3 : 1;
170 unsigned int dummy1 : 28;
171} reg_iop_sw_cpu_rw_bus0_oe_set_mask;
172#define REG_RD_ADDR_iop_sw_cpu_rw_bus0_oe_set_mask 36
173#define REG_WR_ADDR_iop_sw_cpu_rw_bus0_oe_set_mask 36
174
175/* Register r_bus0_in, scope iop_sw_cpu, type r */
176typedef unsigned int reg_iop_sw_cpu_r_bus0_in;
177#define REG_RD_ADDR_iop_sw_cpu_r_bus0_in 40
178
179/* Register rw_bus1_clr_mask, scope iop_sw_cpu, type rw */
180typedef struct {
181 unsigned int byte0 : 8;
182 unsigned int byte1 : 8;
183 unsigned int byte2 : 8;
184 unsigned int byte3 : 8;
185} reg_iop_sw_cpu_rw_bus1_clr_mask;
186#define REG_RD_ADDR_iop_sw_cpu_rw_bus1_clr_mask 44
187#define REG_WR_ADDR_iop_sw_cpu_rw_bus1_clr_mask 44
188
189/* Register rw_bus1_set_mask, scope iop_sw_cpu, type rw */
190typedef struct {
191 unsigned int byte0 : 8;
192 unsigned int byte1 : 8;
193 unsigned int byte2 : 8;
194 unsigned int byte3 : 8;
195} reg_iop_sw_cpu_rw_bus1_set_mask;
196#define REG_RD_ADDR_iop_sw_cpu_rw_bus1_set_mask 48
197#define REG_WR_ADDR_iop_sw_cpu_rw_bus1_set_mask 48
198
199/* Register rw_bus1_oe_clr_mask, scope iop_sw_cpu, type rw */
200typedef struct {
201 unsigned int byte0 : 1;
202 unsigned int byte1 : 1;
203 unsigned int byte2 : 1;
204 unsigned int byte3 : 1;
205 unsigned int dummy1 : 28;
206} reg_iop_sw_cpu_rw_bus1_oe_clr_mask;
207#define REG_RD_ADDR_iop_sw_cpu_rw_bus1_oe_clr_mask 52
208#define REG_WR_ADDR_iop_sw_cpu_rw_bus1_oe_clr_mask 52
209
210/* Register rw_bus1_oe_set_mask, scope iop_sw_cpu, type rw */
211typedef struct {
212 unsigned int byte0 : 1;
213 unsigned int byte1 : 1;
214 unsigned int byte2 : 1;
215 unsigned int byte3 : 1;
216 unsigned int dummy1 : 28;
217} reg_iop_sw_cpu_rw_bus1_oe_set_mask;
218#define REG_RD_ADDR_iop_sw_cpu_rw_bus1_oe_set_mask 56
219#define REG_WR_ADDR_iop_sw_cpu_rw_bus1_oe_set_mask 56
220
221/* Register r_bus1_in, scope iop_sw_cpu, type r */
222typedef unsigned int reg_iop_sw_cpu_r_bus1_in;
223#define REG_RD_ADDR_iop_sw_cpu_r_bus1_in 60
224
225/* Register rw_gio_clr_mask, scope iop_sw_cpu, type rw */
226typedef struct {
227 unsigned int val : 32;
228} reg_iop_sw_cpu_rw_gio_clr_mask;
229#define REG_RD_ADDR_iop_sw_cpu_rw_gio_clr_mask 64
230#define REG_WR_ADDR_iop_sw_cpu_rw_gio_clr_mask 64
231
232/* Register rw_gio_set_mask, scope iop_sw_cpu, type rw */
233typedef struct {
234 unsigned int val : 32;
235} reg_iop_sw_cpu_rw_gio_set_mask;
236#define REG_RD_ADDR_iop_sw_cpu_rw_gio_set_mask 68
237#define REG_WR_ADDR_iop_sw_cpu_rw_gio_set_mask 68
238
239/* Register rw_gio_oe_clr_mask, scope iop_sw_cpu, type rw */
240typedef struct {
241 unsigned int val : 32;
242} reg_iop_sw_cpu_rw_gio_oe_clr_mask;
243#define REG_RD_ADDR_iop_sw_cpu_rw_gio_oe_clr_mask 72
244#define REG_WR_ADDR_iop_sw_cpu_rw_gio_oe_clr_mask 72
245
246/* Register rw_gio_oe_set_mask, scope iop_sw_cpu, type rw */
247typedef struct {
248 unsigned int val : 32;
249} reg_iop_sw_cpu_rw_gio_oe_set_mask;
250#define REG_RD_ADDR_iop_sw_cpu_rw_gio_oe_set_mask 76
251#define REG_WR_ADDR_iop_sw_cpu_rw_gio_oe_set_mask 76
252
253/* Register r_gio_in, scope iop_sw_cpu, type r */
254typedef unsigned int reg_iop_sw_cpu_r_gio_in;
255#define REG_RD_ADDR_iop_sw_cpu_r_gio_in 80
256
257/* Register rw_intr0_mask, scope iop_sw_cpu, type rw */
258typedef struct {
259 unsigned int mpu_0 : 1;
260 unsigned int mpu_1 : 1;
261 unsigned int mpu_2 : 1;
262 unsigned int mpu_3 : 1;
263 unsigned int mpu_4 : 1;
264 unsigned int mpu_5 : 1;
265 unsigned int mpu_6 : 1;
266 unsigned int mpu_7 : 1;
267 unsigned int mpu_8 : 1;
268 unsigned int mpu_9 : 1;
269 unsigned int mpu_10 : 1;
270 unsigned int mpu_11 : 1;
271 unsigned int mpu_12 : 1;
272 unsigned int mpu_13 : 1;
273 unsigned int mpu_14 : 1;
274 unsigned int mpu_15 : 1;
275 unsigned int spu0_0 : 1;
276 unsigned int spu0_1 : 1;
277 unsigned int spu0_2 : 1;
278 unsigned int spu0_3 : 1;
279 unsigned int spu0_4 : 1;
280 unsigned int spu0_5 : 1;
281 unsigned int spu0_6 : 1;
282 unsigned int spu0_7 : 1;
283 unsigned int spu1_8 : 1;
284 unsigned int spu1_9 : 1;
285 unsigned int spu1_10 : 1;
286 unsigned int spu1_11 : 1;
287 unsigned int spu1_12 : 1;
288 unsigned int spu1_13 : 1;
289 unsigned int spu1_14 : 1;
290 unsigned int spu1_15 : 1;
291} reg_iop_sw_cpu_rw_intr0_mask;
292#define REG_RD_ADDR_iop_sw_cpu_rw_intr0_mask 84
293#define REG_WR_ADDR_iop_sw_cpu_rw_intr0_mask 84
294
295/* Register rw_ack_intr0, scope iop_sw_cpu, type rw */
296typedef struct {
297 unsigned int mpu_0 : 1;
298 unsigned int mpu_1 : 1;
299 unsigned int mpu_2 : 1;
300 unsigned int mpu_3 : 1;
301 unsigned int mpu_4 : 1;
302 unsigned int mpu_5 : 1;
303 unsigned int mpu_6 : 1;
304 unsigned int mpu_7 : 1;
305 unsigned int mpu_8 : 1;
306 unsigned int mpu_9 : 1;
307 unsigned int mpu_10 : 1;
308 unsigned int mpu_11 : 1;
309 unsigned int mpu_12 : 1;
310 unsigned int mpu_13 : 1;
311 unsigned int mpu_14 : 1;
312 unsigned int mpu_15 : 1;
313 unsigned int spu0_0 : 1;
314 unsigned int spu0_1 : 1;
315 unsigned int spu0_2 : 1;
316 unsigned int spu0_3 : 1;
317 unsigned int spu0_4 : 1;
318 unsigned int spu0_5 : 1;
319 unsigned int spu0_6 : 1;
320 unsigned int spu0_7 : 1;
321 unsigned int spu1_8 : 1;
322 unsigned int spu1_9 : 1;
323 unsigned int spu1_10 : 1;
324 unsigned int spu1_11 : 1;
325 unsigned int spu1_12 : 1;
326 unsigned int spu1_13 : 1;
327 unsigned int spu1_14 : 1;
328 unsigned int spu1_15 : 1;
329} reg_iop_sw_cpu_rw_ack_intr0;
330#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr0 88
331#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr0 88
332
333/* Register r_intr0, scope iop_sw_cpu, type r */
334typedef struct {
335 unsigned int mpu_0 : 1;
336 unsigned int mpu_1 : 1;
337 unsigned int mpu_2 : 1;
338 unsigned int mpu_3 : 1;
339 unsigned int mpu_4 : 1;
340 unsigned int mpu_5 : 1;
341 unsigned int mpu_6 : 1;
342 unsigned int mpu_7 : 1;
343 unsigned int mpu_8 : 1;
344 unsigned int mpu_9 : 1;
345 unsigned int mpu_10 : 1;
346 unsigned int mpu_11 : 1;
347 unsigned int mpu_12 : 1;
348 unsigned int mpu_13 : 1;
349 unsigned int mpu_14 : 1;
350 unsigned int mpu_15 : 1;
351 unsigned int spu0_0 : 1;
352 unsigned int spu0_1 : 1;
353 unsigned int spu0_2 : 1;
354 unsigned int spu0_3 : 1;
355 unsigned int spu0_4 : 1;
356 unsigned int spu0_5 : 1;
357 unsigned int spu0_6 : 1;
358 unsigned int spu0_7 : 1;
359 unsigned int spu1_8 : 1;
360 unsigned int spu1_9 : 1;
361 unsigned int spu1_10 : 1;
362 unsigned int spu1_11 : 1;
363 unsigned int spu1_12 : 1;
364 unsigned int spu1_13 : 1;
365 unsigned int spu1_14 : 1;
366 unsigned int spu1_15 : 1;
367} reg_iop_sw_cpu_r_intr0;
368#define REG_RD_ADDR_iop_sw_cpu_r_intr0 92
369
370/* Register r_masked_intr0, scope iop_sw_cpu, type r */
371typedef struct {
372 unsigned int mpu_0 : 1;
373 unsigned int mpu_1 : 1;
374 unsigned int mpu_2 : 1;
375 unsigned int mpu_3 : 1;
376 unsigned int mpu_4 : 1;
377 unsigned int mpu_5 : 1;
378 unsigned int mpu_6 : 1;
379 unsigned int mpu_7 : 1;
380 unsigned int mpu_8 : 1;
381 unsigned int mpu_9 : 1;
382 unsigned int mpu_10 : 1;
383 unsigned int mpu_11 : 1;
384 unsigned int mpu_12 : 1;
385 unsigned int mpu_13 : 1;
386 unsigned int mpu_14 : 1;
387 unsigned int mpu_15 : 1;
388 unsigned int spu0_0 : 1;
389 unsigned int spu0_1 : 1;
390 unsigned int spu0_2 : 1;
391 unsigned int spu0_3 : 1;
392 unsigned int spu0_4 : 1;
393 unsigned int spu0_5 : 1;
394 unsigned int spu0_6 : 1;
395 unsigned int spu0_7 : 1;
396 unsigned int spu1_8 : 1;
397 unsigned int spu1_9 : 1;
398 unsigned int spu1_10 : 1;
399 unsigned int spu1_11 : 1;
400 unsigned int spu1_12 : 1;
401 unsigned int spu1_13 : 1;
402 unsigned int spu1_14 : 1;
403 unsigned int spu1_15 : 1;
404} reg_iop_sw_cpu_r_masked_intr0;
405#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr0 96
406
407/* Register rw_intr1_mask, scope iop_sw_cpu, type rw */
408typedef struct {
409 unsigned int mpu_16 : 1;
410 unsigned int mpu_17 : 1;
411 unsigned int mpu_18 : 1;
412 unsigned int mpu_19 : 1;
413 unsigned int mpu_20 : 1;
414 unsigned int mpu_21 : 1;
415 unsigned int mpu_22 : 1;
416 unsigned int mpu_23 : 1;
417 unsigned int mpu_24 : 1;
418 unsigned int mpu_25 : 1;
419 unsigned int mpu_26 : 1;
420 unsigned int mpu_27 : 1;
421 unsigned int mpu_28 : 1;
422 unsigned int mpu_29 : 1;
423 unsigned int mpu_30 : 1;
424 unsigned int mpu_31 : 1;
425 unsigned int spu0_8 : 1;
426 unsigned int spu0_9 : 1;
427 unsigned int spu0_10 : 1;
428 unsigned int spu0_11 : 1;
429 unsigned int spu0_12 : 1;
430 unsigned int spu0_13 : 1;
431 unsigned int spu0_14 : 1;
432 unsigned int spu0_15 : 1;
433 unsigned int spu1_0 : 1;
434 unsigned int spu1_1 : 1;
435 unsigned int spu1_2 : 1;
436 unsigned int spu1_3 : 1;
437 unsigned int spu1_4 : 1;
438 unsigned int spu1_5 : 1;
439 unsigned int spu1_6 : 1;
440 unsigned int spu1_7 : 1;
441} reg_iop_sw_cpu_rw_intr1_mask;
442#define REG_RD_ADDR_iop_sw_cpu_rw_intr1_mask 100
443#define REG_WR_ADDR_iop_sw_cpu_rw_intr1_mask 100
444
445/* Register rw_ack_intr1, scope iop_sw_cpu, type rw */
446typedef struct {
447 unsigned int mpu_16 : 1;
448 unsigned int mpu_17 : 1;
449 unsigned int mpu_18 : 1;
450 unsigned int mpu_19 : 1;
451 unsigned int mpu_20 : 1;
452 unsigned int mpu_21 : 1;
453 unsigned int mpu_22 : 1;
454 unsigned int mpu_23 : 1;
455 unsigned int mpu_24 : 1;
456 unsigned int mpu_25 : 1;
457 unsigned int mpu_26 : 1;
458 unsigned int mpu_27 : 1;
459 unsigned int mpu_28 : 1;
460 unsigned int mpu_29 : 1;
461 unsigned int mpu_30 : 1;
462 unsigned int mpu_31 : 1;
463 unsigned int spu0_8 : 1;
464 unsigned int spu0_9 : 1;
465 unsigned int spu0_10 : 1;
466 unsigned int spu0_11 : 1;
467 unsigned int spu0_12 : 1;
468 unsigned int spu0_13 : 1;
469 unsigned int spu0_14 : 1;
470 unsigned int spu0_15 : 1;
471 unsigned int spu1_0 : 1;
472 unsigned int spu1_1 : 1;
473 unsigned int spu1_2 : 1;
474 unsigned int spu1_3 : 1;
475 unsigned int spu1_4 : 1;
476 unsigned int spu1_5 : 1;
477 unsigned int spu1_6 : 1;
478 unsigned int spu1_7 : 1;
479} reg_iop_sw_cpu_rw_ack_intr1;
480#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr1 104
481#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr1 104
482
483/* Register r_intr1, scope iop_sw_cpu, type r */
484typedef struct {
485 unsigned int mpu_16 : 1;
486 unsigned int mpu_17 : 1;
487 unsigned int mpu_18 : 1;
488 unsigned int mpu_19 : 1;
489 unsigned int mpu_20 : 1;
490 unsigned int mpu_21 : 1;
491 unsigned int mpu_22 : 1;
492 unsigned int mpu_23 : 1;
493 unsigned int mpu_24 : 1;
494 unsigned int mpu_25 : 1;
495 unsigned int mpu_26 : 1;
496 unsigned int mpu_27 : 1;
497 unsigned int mpu_28 : 1;
498 unsigned int mpu_29 : 1;
499 unsigned int mpu_30 : 1;
500 unsigned int mpu_31 : 1;
501 unsigned int spu0_8 : 1;
502 unsigned int spu0_9 : 1;
503 unsigned int spu0_10 : 1;
504 unsigned int spu0_11 : 1;
505 unsigned int spu0_12 : 1;
506 unsigned int spu0_13 : 1;
507 unsigned int spu0_14 : 1;
508 unsigned int spu0_15 : 1;
509 unsigned int spu1_0 : 1;
510 unsigned int spu1_1 : 1;
511 unsigned int spu1_2 : 1;
512 unsigned int spu1_3 : 1;
513 unsigned int spu1_4 : 1;
514 unsigned int spu1_5 : 1;
515 unsigned int spu1_6 : 1;
516 unsigned int spu1_7 : 1;
517} reg_iop_sw_cpu_r_intr1;
518#define REG_RD_ADDR_iop_sw_cpu_r_intr1 108
519
520/* Register r_masked_intr1, scope iop_sw_cpu, type r */
521typedef struct {
522 unsigned int mpu_16 : 1;
523 unsigned int mpu_17 : 1;
524 unsigned int mpu_18 : 1;
525 unsigned int mpu_19 : 1;
526 unsigned int mpu_20 : 1;
527 unsigned int mpu_21 : 1;
528 unsigned int mpu_22 : 1;
529 unsigned int mpu_23 : 1;
530 unsigned int mpu_24 : 1;
531 unsigned int mpu_25 : 1;
532 unsigned int mpu_26 : 1;
533 unsigned int mpu_27 : 1;
534 unsigned int mpu_28 : 1;
535 unsigned int mpu_29 : 1;
536 unsigned int mpu_30 : 1;
537 unsigned int mpu_31 : 1;
538 unsigned int spu0_8 : 1;
539 unsigned int spu0_9 : 1;
540 unsigned int spu0_10 : 1;
541 unsigned int spu0_11 : 1;
542 unsigned int spu0_12 : 1;
543 unsigned int spu0_13 : 1;
544 unsigned int spu0_14 : 1;
545 unsigned int spu0_15 : 1;
546 unsigned int spu1_0 : 1;
547 unsigned int spu1_1 : 1;
548 unsigned int spu1_2 : 1;
549 unsigned int spu1_3 : 1;
550 unsigned int spu1_4 : 1;
551 unsigned int spu1_5 : 1;
552 unsigned int spu1_6 : 1;
553 unsigned int spu1_7 : 1;
554} reg_iop_sw_cpu_r_masked_intr1;
555#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr1 112
556
557/* Register rw_intr2_mask, scope iop_sw_cpu, type rw */
558typedef struct {
559 unsigned int mpu_0 : 1;
560 unsigned int mpu_1 : 1;
561 unsigned int mpu_2 : 1;
562 unsigned int mpu_3 : 1;
563 unsigned int mpu_4 : 1;
564 unsigned int mpu_5 : 1;
565 unsigned int mpu_6 : 1;
566 unsigned int mpu_7 : 1;
567 unsigned int spu0_0 : 1;
568 unsigned int spu0_1 : 1;
569 unsigned int spu0_2 : 1;
570 unsigned int spu0_3 : 1;
571 unsigned int spu0_4 : 1;
572 unsigned int spu0_5 : 1;
573 unsigned int spu0_6 : 1;
574 unsigned int spu0_7 : 1;
575 unsigned int dmc_in0 : 1;
576 unsigned int dmc_out0 : 1;
577 unsigned int fifo_in0 : 1;
578 unsigned int fifo_out0 : 1;
579 unsigned int fifo_in0_extra : 1;
580 unsigned int fifo_out0_extra : 1;
581 unsigned int trigger_grp0 : 1;
582 unsigned int trigger_grp1 : 1;
583 unsigned int trigger_grp2 : 1;
584 unsigned int trigger_grp3 : 1;
585 unsigned int trigger_grp4 : 1;
586 unsigned int trigger_grp5 : 1;
587 unsigned int trigger_grp6 : 1;
588 unsigned int trigger_grp7 : 1;
589 unsigned int timer_grp0 : 1;
590 unsigned int timer_grp1 : 1;
591} reg_iop_sw_cpu_rw_intr2_mask;
592#define REG_RD_ADDR_iop_sw_cpu_rw_intr2_mask 116
593#define REG_WR_ADDR_iop_sw_cpu_rw_intr2_mask 116
594
595/* Register rw_ack_intr2, scope iop_sw_cpu, type rw */
596typedef struct {
597 unsigned int mpu_0 : 1;
598 unsigned int mpu_1 : 1;
599 unsigned int mpu_2 : 1;
600 unsigned int mpu_3 : 1;
601 unsigned int mpu_4 : 1;
602 unsigned int mpu_5 : 1;
603 unsigned int mpu_6 : 1;
604 unsigned int mpu_7 : 1;
605 unsigned int spu0_0 : 1;
606 unsigned int spu0_1 : 1;
607 unsigned int spu0_2 : 1;
608 unsigned int spu0_3 : 1;
609 unsigned int spu0_4 : 1;
610 unsigned int spu0_5 : 1;
611 unsigned int spu0_6 : 1;
612 unsigned int spu0_7 : 1;
613 unsigned int dummy1 : 16;
614} reg_iop_sw_cpu_rw_ack_intr2;
615#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr2 120
616#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr2 120
617
618/* Register r_intr2, scope iop_sw_cpu, type r */
619typedef struct {
620 unsigned int mpu_0 : 1;
621 unsigned int mpu_1 : 1;
622 unsigned int mpu_2 : 1;
623 unsigned int mpu_3 : 1;
624 unsigned int mpu_4 : 1;
625 unsigned int mpu_5 : 1;
626 unsigned int mpu_6 : 1;
627 unsigned int mpu_7 : 1;
628 unsigned int spu0_0 : 1;
629 unsigned int spu0_1 : 1;
630 unsigned int spu0_2 : 1;
631 unsigned int spu0_3 : 1;
632 unsigned int spu0_4 : 1;
633 unsigned int spu0_5 : 1;
634 unsigned int spu0_6 : 1;
635 unsigned int spu0_7 : 1;
636 unsigned int dmc_in0 : 1;
637 unsigned int dmc_out0 : 1;
638 unsigned int fifo_in0 : 1;
639 unsigned int fifo_out0 : 1;
640 unsigned int fifo_in0_extra : 1;
641 unsigned int fifo_out0_extra : 1;
642 unsigned int trigger_grp0 : 1;
643 unsigned int trigger_grp1 : 1;
644 unsigned int trigger_grp2 : 1;
645 unsigned int trigger_grp3 : 1;
646 unsigned int trigger_grp4 : 1;
647 unsigned int trigger_grp5 : 1;
648 unsigned int trigger_grp6 : 1;
649 unsigned int trigger_grp7 : 1;
650 unsigned int timer_grp0 : 1;
651 unsigned int timer_grp1 : 1;
652} reg_iop_sw_cpu_r_intr2;
653#define REG_RD_ADDR_iop_sw_cpu_r_intr2 124
654
655/* Register r_masked_intr2, scope iop_sw_cpu, type r */
656typedef struct {
657 unsigned int mpu_0 : 1;
658 unsigned int mpu_1 : 1;
659 unsigned int mpu_2 : 1;
660 unsigned int mpu_3 : 1;
661 unsigned int mpu_4 : 1;
662 unsigned int mpu_5 : 1;
663 unsigned int mpu_6 : 1;
664 unsigned int mpu_7 : 1;
665 unsigned int spu0_0 : 1;
666 unsigned int spu0_1 : 1;
667 unsigned int spu0_2 : 1;
668 unsigned int spu0_3 : 1;
669 unsigned int spu0_4 : 1;
670 unsigned int spu0_5 : 1;
671 unsigned int spu0_6 : 1;
672 unsigned int spu0_7 : 1;
673 unsigned int dmc_in0 : 1;
674 unsigned int dmc_out0 : 1;
675 unsigned int fifo_in0 : 1;
676 unsigned int fifo_out0 : 1;
677 unsigned int fifo_in0_extra : 1;
678 unsigned int fifo_out0_extra : 1;
679 unsigned int trigger_grp0 : 1;
680 unsigned int trigger_grp1 : 1;
681 unsigned int trigger_grp2 : 1;
682 unsigned int trigger_grp3 : 1;
683 unsigned int trigger_grp4 : 1;
684 unsigned int trigger_grp5 : 1;
685 unsigned int trigger_grp6 : 1;
686 unsigned int trigger_grp7 : 1;
687 unsigned int timer_grp0 : 1;
688 unsigned int timer_grp1 : 1;
689} reg_iop_sw_cpu_r_masked_intr2;
690#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr2 128
691
692/* Register rw_intr3_mask, scope iop_sw_cpu, type rw */
693typedef struct {
694 unsigned int mpu_16 : 1;
695 unsigned int mpu_17 : 1;
696 unsigned int mpu_18 : 1;
697 unsigned int mpu_19 : 1;
698 unsigned int mpu_20 : 1;
699 unsigned int mpu_21 : 1;
700 unsigned int mpu_22 : 1;
701 unsigned int mpu_23 : 1;
702 unsigned int spu1_0 : 1;
703 unsigned int spu1_1 : 1;
704 unsigned int spu1_2 : 1;
705 unsigned int spu1_3 : 1;
706 unsigned int spu1_4 : 1;
707 unsigned int spu1_5 : 1;
708 unsigned int spu1_6 : 1;
709 unsigned int spu1_7 : 1;
710 unsigned int dmc_in1 : 1;
711 unsigned int dmc_out1 : 1;
712 unsigned int fifo_in1 : 1;
713 unsigned int fifo_out1 : 1;
714 unsigned int fifo_in1_extra : 1;
715 unsigned int fifo_out1_extra : 1;
716 unsigned int trigger_grp0 : 1;
717 unsigned int trigger_grp1 : 1;
718 unsigned int trigger_grp2 : 1;
719 unsigned int trigger_grp3 : 1;
720 unsigned int trigger_grp4 : 1;
721 unsigned int trigger_grp5 : 1;
722 unsigned int trigger_grp6 : 1;
723 unsigned int trigger_grp7 : 1;
724 unsigned int timer_grp2 : 1;
725 unsigned int timer_grp3 : 1;
726} reg_iop_sw_cpu_rw_intr3_mask;
727#define REG_RD_ADDR_iop_sw_cpu_rw_intr3_mask 132
728#define REG_WR_ADDR_iop_sw_cpu_rw_intr3_mask 132
729
730/* Register rw_ack_intr3, scope iop_sw_cpu, type rw */
731typedef struct {
732 unsigned int mpu_16 : 1;
733 unsigned int mpu_17 : 1;
734 unsigned int mpu_18 : 1;
735 unsigned int mpu_19 : 1;
736 unsigned int mpu_20 : 1;
737 unsigned int mpu_21 : 1;
738 unsigned int mpu_22 : 1;
739 unsigned int mpu_23 : 1;
740 unsigned int spu1_0 : 1;
741 unsigned int spu1_1 : 1;
742 unsigned int spu1_2 : 1;
743 unsigned int spu1_3 : 1;
744 unsigned int spu1_4 : 1;
745 unsigned int spu1_5 : 1;
746 unsigned int spu1_6 : 1;
747 unsigned int spu1_7 : 1;
748 unsigned int dummy1 : 16;
749} reg_iop_sw_cpu_rw_ack_intr3;
750#define REG_RD_ADDR_iop_sw_cpu_rw_ack_intr3 136
751#define REG_WR_ADDR_iop_sw_cpu_rw_ack_intr3 136
752
753/* Register r_intr3, scope iop_sw_cpu, type r */
754typedef struct {
755 unsigned int mpu_16 : 1;
756 unsigned int mpu_17 : 1;
757 unsigned int mpu_18 : 1;
758 unsigned int mpu_19 : 1;
759 unsigned int mpu_20 : 1;
760 unsigned int mpu_21 : 1;
761 unsigned int mpu_22 : 1;
762 unsigned int mpu_23 : 1;
763 unsigned int spu1_0 : 1;
764 unsigned int spu1_1 : 1;
765 unsigned int spu1_2 : 1;
766 unsigned int spu1_3 : 1;
767 unsigned int spu1_4 : 1;
768 unsigned int spu1_5 : 1;
769 unsigned int spu1_6 : 1;
770 unsigned int spu1_7 : 1;
771 unsigned int dmc_in1 : 1;
772 unsigned int dmc_out1 : 1;
773 unsigned int fifo_in1 : 1;
774 unsigned int fifo_out1 : 1;
775 unsigned int fifo_in1_extra : 1;
776 unsigned int fifo_out1_extra : 1;
777 unsigned int trigger_grp0 : 1;
778 unsigned int trigger_grp1 : 1;
779 unsigned int trigger_grp2 : 1;
780 unsigned int trigger_grp3 : 1;
781 unsigned int trigger_grp4 : 1;
782 unsigned int trigger_grp5 : 1;
783 unsigned int trigger_grp6 : 1;
784 unsigned int trigger_grp7 : 1;
785 unsigned int timer_grp2 : 1;
786 unsigned int timer_grp3 : 1;
787} reg_iop_sw_cpu_r_intr3;
788#define REG_RD_ADDR_iop_sw_cpu_r_intr3 140
789
790/* Register r_masked_intr3, scope iop_sw_cpu, type r */
791typedef struct {
792 unsigned int mpu_16 : 1;
793 unsigned int mpu_17 : 1;
794 unsigned int mpu_18 : 1;
795 unsigned int mpu_19 : 1;
796 unsigned int mpu_20 : 1;
797 unsigned int mpu_21 : 1;
798 unsigned int mpu_22 : 1;
799 unsigned int mpu_23 : 1;
800 unsigned int spu1_0 : 1;
801 unsigned int spu1_1 : 1;
802 unsigned int spu1_2 : 1;
803 unsigned int spu1_3 : 1;
804 unsigned int spu1_4 : 1;
805 unsigned int spu1_5 : 1;
806 unsigned int spu1_6 : 1;
807 unsigned int spu1_7 : 1;
808 unsigned int dmc_in1 : 1;
809 unsigned int dmc_out1 : 1;
810 unsigned int fifo_in1 : 1;
811 unsigned int fifo_out1 : 1;
812 unsigned int fifo_in1_extra : 1;
813 unsigned int fifo_out1_extra : 1;
814 unsigned int trigger_grp0 : 1;
815 unsigned int trigger_grp1 : 1;
816 unsigned int trigger_grp2 : 1;
817 unsigned int trigger_grp3 : 1;
818 unsigned int trigger_grp4 : 1;
819 unsigned int trigger_grp5 : 1;
820 unsigned int trigger_grp6 : 1;
821 unsigned int trigger_grp7 : 1;
822 unsigned int timer_grp2 : 1;
823 unsigned int timer_grp3 : 1;
824} reg_iop_sw_cpu_r_masked_intr3;
825#define REG_RD_ADDR_iop_sw_cpu_r_masked_intr3 144
826
827
828/* Constants */
829enum {
830 regk_iop_sw_cpu_copy = 0x00000000,
831 regk_iop_sw_cpu_no = 0x00000000,
832 regk_iop_sw_cpu_rd = 0x00000002,
833 regk_iop_sw_cpu_reg_copy = 0x00000001,
834 regk_iop_sw_cpu_rw_bus0_clr_mask_default = 0x00000000,
835 regk_iop_sw_cpu_rw_bus0_oe_clr_mask_default = 0x00000000,
836 regk_iop_sw_cpu_rw_bus0_oe_set_mask_default = 0x00000000,
837 regk_iop_sw_cpu_rw_bus0_set_mask_default = 0x00000000,
838 regk_iop_sw_cpu_rw_bus1_clr_mask_default = 0x00000000,
839 regk_iop_sw_cpu_rw_bus1_oe_clr_mask_default = 0x00000000,
840 regk_iop_sw_cpu_rw_bus1_oe_set_mask_default = 0x00000000,
841 regk_iop_sw_cpu_rw_bus1_set_mask_default = 0x00000000,
842 regk_iop_sw_cpu_rw_gio_clr_mask_default = 0x00000000,
843 regk_iop_sw_cpu_rw_gio_oe_clr_mask_default = 0x00000000,
844 regk_iop_sw_cpu_rw_gio_oe_set_mask_default = 0x00000000,
845 regk_iop_sw_cpu_rw_gio_set_mask_default = 0x00000000,
846 regk_iop_sw_cpu_rw_intr0_mask_default = 0x00000000,
847 regk_iop_sw_cpu_rw_intr1_mask_default = 0x00000000,
848 regk_iop_sw_cpu_rw_intr2_mask_default = 0x00000000,
849 regk_iop_sw_cpu_rw_intr3_mask_default = 0x00000000,
850 regk_iop_sw_cpu_wr = 0x00000003,
851 regk_iop_sw_cpu_yes = 0x00000001
852};
853#endif /* __iop_sw_cpu_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sw_mpu_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_mpu_defs.h
new file mode 100644
index 000000000000..da718f2a8cad
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_mpu_defs.h
@@ -0,0 +1,893 @@
1#ifndef __iop_sw_mpu_defs_h
2#define __iop_sw_mpu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_mpu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sw_mpu_defs.h ../../inst/io_proc/rtl/guinness/iop_sw_mpu.r
11 * id: $Id: iop_sw_mpu_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sw_mpu */
86
87/* Register rw_sw_cfg_owner, scope iop_sw_mpu, type rw */
88typedef struct {
89 unsigned int cfg : 2;
90 unsigned int dummy1 : 30;
91} reg_iop_sw_mpu_rw_sw_cfg_owner;
92#define REG_RD_ADDR_iop_sw_mpu_rw_sw_cfg_owner 0
93#define REG_WR_ADDR_iop_sw_mpu_rw_sw_cfg_owner 0
94
95/* Register rw_mc_ctrl, scope iop_sw_mpu, type rw */
96typedef struct {
97 unsigned int keep_owner : 1;
98 unsigned int cmd : 2;
99 unsigned int size : 3;
100 unsigned int wr_spu0_mem : 1;
101 unsigned int wr_spu1_mem : 1;
102 unsigned int dummy1 : 24;
103} reg_iop_sw_mpu_rw_mc_ctrl;
104#define REG_RD_ADDR_iop_sw_mpu_rw_mc_ctrl 4
105#define REG_WR_ADDR_iop_sw_mpu_rw_mc_ctrl 4
106
107/* Register rw_mc_data, scope iop_sw_mpu, type rw */
108typedef struct {
109 unsigned int val : 32;
110} reg_iop_sw_mpu_rw_mc_data;
111#define REG_RD_ADDR_iop_sw_mpu_rw_mc_data 8
112#define REG_WR_ADDR_iop_sw_mpu_rw_mc_data 8
113
114/* Register rw_mc_addr, scope iop_sw_mpu, type rw */
115typedef unsigned int reg_iop_sw_mpu_rw_mc_addr;
116#define REG_RD_ADDR_iop_sw_mpu_rw_mc_addr 12
117#define REG_WR_ADDR_iop_sw_mpu_rw_mc_addr 12
118
119/* Register rs_mc_data, scope iop_sw_mpu, type rs */
120typedef unsigned int reg_iop_sw_mpu_rs_mc_data;
121#define REG_RD_ADDR_iop_sw_mpu_rs_mc_data 16
122
123/* Register r_mc_data, scope iop_sw_mpu, type r */
124typedef unsigned int reg_iop_sw_mpu_r_mc_data;
125#define REG_RD_ADDR_iop_sw_mpu_r_mc_data 20
126
127/* Register r_mc_stat, scope iop_sw_mpu, type r */
128typedef struct {
129 unsigned int busy_cpu : 1;
130 unsigned int busy_mpu : 1;
131 unsigned int busy_spu0 : 1;
132 unsigned int busy_spu1 : 1;
133 unsigned int owned_by_cpu : 1;
134 unsigned int owned_by_mpu : 1;
135 unsigned int owned_by_spu0 : 1;
136 unsigned int owned_by_spu1 : 1;
137 unsigned int dummy1 : 24;
138} reg_iop_sw_mpu_r_mc_stat;
139#define REG_RD_ADDR_iop_sw_mpu_r_mc_stat 24
140
141/* Register rw_bus0_clr_mask, scope iop_sw_mpu, type rw */
142typedef struct {
143 unsigned int byte0 : 8;
144 unsigned int byte1 : 8;
145 unsigned int byte2 : 8;
146 unsigned int byte3 : 8;
147} reg_iop_sw_mpu_rw_bus0_clr_mask;
148#define REG_RD_ADDR_iop_sw_mpu_rw_bus0_clr_mask 28
149#define REG_WR_ADDR_iop_sw_mpu_rw_bus0_clr_mask 28
150
151/* Register rw_bus0_set_mask, scope iop_sw_mpu, type rw */
152typedef struct {
153 unsigned int byte0 : 8;
154 unsigned int byte1 : 8;
155 unsigned int byte2 : 8;
156 unsigned int byte3 : 8;
157} reg_iop_sw_mpu_rw_bus0_set_mask;
158#define REG_RD_ADDR_iop_sw_mpu_rw_bus0_set_mask 32
159#define REG_WR_ADDR_iop_sw_mpu_rw_bus0_set_mask 32
160
161/* Register rw_bus0_oe_clr_mask, scope iop_sw_mpu, type rw */
162typedef struct {
163 unsigned int byte0 : 1;
164 unsigned int byte1 : 1;
165 unsigned int byte2 : 1;
166 unsigned int byte3 : 1;
167 unsigned int dummy1 : 28;
168} reg_iop_sw_mpu_rw_bus0_oe_clr_mask;
169#define REG_RD_ADDR_iop_sw_mpu_rw_bus0_oe_clr_mask 36
170#define REG_WR_ADDR_iop_sw_mpu_rw_bus0_oe_clr_mask 36
171
172/* Register rw_bus0_oe_set_mask, scope iop_sw_mpu, type rw */
173typedef struct {
174 unsigned int byte0 : 1;
175 unsigned int byte1 : 1;
176 unsigned int byte2 : 1;
177 unsigned int byte3 : 1;
178 unsigned int dummy1 : 28;
179} reg_iop_sw_mpu_rw_bus0_oe_set_mask;
180#define REG_RD_ADDR_iop_sw_mpu_rw_bus0_oe_set_mask 40
181#define REG_WR_ADDR_iop_sw_mpu_rw_bus0_oe_set_mask 40
182
183/* Register r_bus0_in, scope iop_sw_mpu, type r */
184typedef unsigned int reg_iop_sw_mpu_r_bus0_in;
185#define REG_RD_ADDR_iop_sw_mpu_r_bus0_in 44
186
187/* Register rw_bus1_clr_mask, scope iop_sw_mpu, type rw */
188typedef struct {
189 unsigned int byte0 : 8;
190 unsigned int byte1 : 8;
191 unsigned int byte2 : 8;
192 unsigned int byte3 : 8;
193} reg_iop_sw_mpu_rw_bus1_clr_mask;
194#define REG_RD_ADDR_iop_sw_mpu_rw_bus1_clr_mask 48
195#define REG_WR_ADDR_iop_sw_mpu_rw_bus1_clr_mask 48
196
197/* Register rw_bus1_set_mask, scope iop_sw_mpu, type rw */
198typedef struct {
199 unsigned int byte0 : 8;
200 unsigned int byte1 : 8;
201 unsigned int byte2 : 8;
202 unsigned int byte3 : 8;
203} reg_iop_sw_mpu_rw_bus1_set_mask;
204#define REG_RD_ADDR_iop_sw_mpu_rw_bus1_set_mask 52
205#define REG_WR_ADDR_iop_sw_mpu_rw_bus1_set_mask 52
206
207/* Register rw_bus1_oe_clr_mask, scope iop_sw_mpu, type rw */
208typedef struct {
209 unsigned int byte0 : 1;
210 unsigned int byte1 : 1;
211 unsigned int byte2 : 1;
212 unsigned int byte3 : 1;
213 unsigned int dummy1 : 28;
214} reg_iop_sw_mpu_rw_bus1_oe_clr_mask;
215#define REG_RD_ADDR_iop_sw_mpu_rw_bus1_oe_clr_mask 56
216#define REG_WR_ADDR_iop_sw_mpu_rw_bus1_oe_clr_mask 56
217
218/* Register rw_bus1_oe_set_mask, scope iop_sw_mpu, type rw */
219typedef struct {
220 unsigned int byte0 : 1;
221 unsigned int byte1 : 1;
222 unsigned int byte2 : 1;
223 unsigned int byte3 : 1;
224 unsigned int dummy1 : 28;
225} reg_iop_sw_mpu_rw_bus1_oe_set_mask;
226#define REG_RD_ADDR_iop_sw_mpu_rw_bus1_oe_set_mask 60
227#define REG_WR_ADDR_iop_sw_mpu_rw_bus1_oe_set_mask 60
228
229/* Register r_bus1_in, scope iop_sw_mpu, type r */
230typedef unsigned int reg_iop_sw_mpu_r_bus1_in;
231#define REG_RD_ADDR_iop_sw_mpu_r_bus1_in 64
232
233/* Register rw_gio_clr_mask, scope iop_sw_mpu, type rw */
234typedef struct {
235 unsigned int val : 32;
236} reg_iop_sw_mpu_rw_gio_clr_mask;
237#define REG_RD_ADDR_iop_sw_mpu_rw_gio_clr_mask 68
238#define REG_WR_ADDR_iop_sw_mpu_rw_gio_clr_mask 68
239
240/* Register rw_gio_set_mask, scope iop_sw_mpu, type rw */
241typedef struct {
242 unsigned int val : 32;
243} reg_iop_sw_mpu_rw_gio_set_mask;
244#define REG_RD_ADDR_iop_sw_mpu_rw_gio_set_mask 72
245#define REG_WR_ADDR_iop_sw_mpu_rw_gio_set_mask 72
246
247/* Register rw_gio_oe_clr_mask, scope iop_sw_mpu, type rw */
248typedef struct {
249 unsigned int val : 32;
250} reg_iop_sw_mpu_rw_gio_oe_clr_mask;
251#define REG_RD_ADDR_iop_sw_mpu_rw_gio_oe_clr_mask 76
252#define REG_WR_ADDR_iop_sw_mpu_rw_gio_oe_clr_mask 76
253
254/* Register rw_gio_oe_set_mask, scope iop_sw_mpu, type rw */
255typedef struct {
256 unsigned int val : 32;
257} reg_iop_sw_mpu_rw_gio_oe_set_mask;
258#define REG_RD_ADDR_iop_sw_mpu_rw_gio_oe_set_mask 80
259#define REG_WR_ADDR_iop_sw_mpu_rw_gio_oe_set_mask 80
260
261/* Register r_gio_in, scope iop_sw_mpu, type r */
262typedef unsigned int reg_iop_sw_mpu_r_gio_in;
263#define REG_RD_ADDR_iop_sw_mpu_r_gio_in 84
264
265/* Register rw_cpu_intr, scope iop_sw_mpu, type rw */
266typedef struct {
267 unsigned int intr0 : 1;
268 unsigned int intr1 : 1;
269 unsigned int intr2 : 1;
270 unsigned int intr3 : 1;
271 unsigned int intr4 : 1;
272 unsigned int intr5 : 1;
273 unsigned int intr6 : 1;
274 unsigned int intr7 : 1;
275 unsigned int intr8 : 1;
276 unsigned int intr9 : 1;
277 unsigned int intr10 : 1;
278 unsigned int intr11 : 1;
279 unsigned int intr12 : 1;
280 unsigned int intr13 : 1;
281 unsigned int intr14 : 1;
282 unsigned int intr15 : 1;
283 unsigned int intr16 : 1;
284 unsigned int intr17 : 1;
285 unsigned int intr18 : 1;
286 unsigned int intr19 : 1;
287 unsigned int intr20 : 1;
288 unsigned int intr21 : 1;
289 unsigned int intr22 : 1;
290 unsigned int intr23 : 1;
291 unsigned int intr24 : 1;
292 unsigned int intr25 : 1;
293 unsigned int intr26 : 1;
294 unsigned int intr27 : 1;
295 unsigned int intr28 : 1;
296 unsigned int intr29 : 1;
297 unsigned int intr30 : 1;
298 unsigned int intr31 : 1;
299} reg_iop_sw_mpu_rw_cpu_intr;
300#define REG_RD_ADDR_iop_sw_mpu_rw_cpu_intr 88
301#define REG_WR_ADDR_iop_sw_mpu_rw_cpu_intr 88
302
303/* Register r_cpu_intr, scope iop_sw_mpu, type r */
304typedef struct {
305 unsigned int intr0 : 1;
306 unsigned int intr1 : 1;
307 unsigned int intr2 : 1;
308 unsigned int intr3 : 1;
309 unsigned int intr4 : 1;
310 unsigned int intr5 : 1;
311 unsigned int intr6 : 1;
312 unsigned int intr7 : 1;
313 unsigned int intr8 : 1;
314 unsigned int intr9 : 1;
315 unsigned int intr10 : 1;
316 unsigned int intr11 : 1;
317 unsigned int intr12 : 1;
318 unsigned int intr13 : 1;
319 unsigned int intr14 : 1;
320 unsigned int intr15 : 1;
321 unsigned int intr16 : 1;
322 unsigned int intr17 : 1;
323 unsigned int intr18 : 1;
324 unsigned int intr19 : 1;
325 unsigned int intr20 : 1;
326 unsigned int intr21 : 1;
327 unsigned int intr22 : 1;
328 unsigned int intr23 : 1;
329 unsigned int intr24 : 1;
330 unsigned int intr25 : 1;
331 unsigned int intr26 : 1;
332 unsigned int intr27 : 1;
333 unsigned int intr28 : 1;
334 unsigned int intr29 : 1;
335 unsigned int intr30 : 1;
336 unsigned int intr31 : 1;
337} reg_iop_sw_mpu_r_cpu_intr;
338#define REG_RD_ADDR_iop_sw_mpu_r_cpu_intr 92
339
340/* Register rw_intr_grp0_mask, scope iop_sw_mpu, type rw */
341typedef struct {
342 unsigned int spu0_intr0 : 1;
343 unsigned int spu1_intr0 : 1;
344 unsigned int trigger_grp0 : 1;
345 unsigned int trigger_grp4 : 1;
346 unsigned int timer_grp0 : 1;
347 unsigned int fifo_out0 : 1;
348 unsigned int fifo_out0_extra : 1;
349 unsigned int dmc_out0 : 1;
350 unsigned int spu0_intr1 : 1;
351 unsigned int spu1_intr1 : 1;
352 unsigned int trigger_grp1 : 1;
353 unsigned int trigger_grp5 : 1;
354 unsigned int timer_grp1 : 1;
355 unsigned int fifo_in0 : 1;
356 unsigned int fifo_in0_extra : 1;
357 unsigned int dmc_in0 : 1;
358 unsigned int spu0_intr2 : 1;
359 unsigned int spu1_intr2 : 1;
360 unsigned int trigger_grp2 : 1;
361 unsigned int trigger_grp6 : 1;
362 unsigned int timer_grp2 : 1;
363 unsigned int fifo_out1 : 1;
364 unsigned int fifo_out1_extra : 1;
365 unsigned int dmc_out1 : 1;
366 unsigned int spu0_intr3 : 1;
367 unsigned int spu1_intr3 : 1;
368 unsigned int trigger_grp3 : 1;
369 unsigned int trigger_grp7 : 1;
370 unsigned int timer_grp3 : 1;
371 unsigned int fifo_in1 : 1;
372 unsigned int fifo_in1_extra : 1;
373 unsigned int dmc_in1 : 1;
374} reg_iop_sw_mpu_rw_intr_grp0_mask;
375#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp0_mask 96
376#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp0_mask 96
377
378/* Register rw_ack_intr_grp0, scope iop_sw_mpu, type rw */
379typedef struct {
380 unsigned int spu0_intr0 : 1;
381 unsigned int spu1_intr0 : 1;
382 unsigned int dummy1 : 6;
383 unsigned int spu0_intr1 : 1;
384 unsigned int spu1_intr1 : 1;
385 unsigned int dummy2 : 6;
386 unsigned int spu0_intr2 : 1;
387 unsigned int spu1_intr2 : 1;
388 unsigned int dummy3 : 6;
389 unsigned int spu0_intr3 : 1;
390 unsigned int spu1_intr3 : 1;
391 unsigned int dummy4 : 6;
392} reg_iop_sw_mpu_rw_ack_intr_grp0;
393#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp0 100
394#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp0 100
395
396/* Register r_intr_grp0, scope iop_sw_mpu, type r */
397typedef struct {
398 unsigned int spu0_intr0 : 1;
399 unsigned int spu1_intr0 : 1;
400 unsigned int trigger_grp0 : 1;
401 unsigned int trigger_grp4 : 1;
402 unsigned int timer_grp0 : 1;
403 unsigned int fifo_out0 : 1;
404 unsigned int fifo_out0_extra : 1;
405 unsigned int dmc_out0 : 1;
406 unsigned int spu0_intr1 : 1;
407 unsigned int spu1_intr1 : 1;
408 unsigned int trigger_grp1 : 1;
409 unsigned int trigger_grp5 : 1;
410 unsigned int timer_grp1 : 1;
411 unsigned int fifo_in0 : 1;
412 unsigned int fifo_in0_extra : 1;
413 unsigned int dmc_in0 : 1;
414 unsigned int spu0_intr2 : 1;
415 unsigned int spu1_intr2 : 1;
416 unsigned int trigger_grp2 : 1;
417 unsigned int trigger_grp6 : 1;
418 unsigned int timer_grp2 : 1;
419 unsigned int fifo_out1 : 1;
420 unsigned int fifo_out1_extra : 1;
421 unsigned int dmc_out1 : 1;
422 unsigned int spu0_intr3 : 1;
423 unsigned int spu1_intr3 : 1;
424 unsigned int trigger_grp3 : 1;
425 unsigned int trigger_grp7 : 1;
426 unsigned int timer_grp3 : 1;
427 unsigned int fifo_in1 : 1;
428 unsigned int fifo_in1_extra : 1;
429 unsigned int dmc_in1 : 1;
430} reg_iop_sw_mpu_r_intr_grp0;
431#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp0 104
432
433/* Register r_masked_intr_grp0, scope iop_sw_mpu, type r */
434typedef struct {
435 unsigned int spu0_intr0 : 1;
436 unsigned int spu1_intr0 : 1;
437 unsigned int trigger_grp0 : 1;
438 unsigned int trigger_grp4 : 1;
439 unsigned int timer_grp0 : 1;
440 unsigned int fifo_out0 : 1;
441 unsigned int fifo_out0_extra : 1;
442 unsigned int dmc_out0 : 1;
443 unsigned int spu0_intr1 : 1;
444 unsigned int spu1_intr1 : 1;
445 unsigned int trigger_grp1 : 1;
446 unsigned int trigger_grp5 : 1;
447 unsigned int timer_grp1 : 1;
448 unsigned int fifo_in0 : 1;
449 unsigned int fifo_in0_extra : 1;
450 unsigned int dmc_in0 : 1;
451 unsigned int spu0_intr2 : 1;
452 unsigned int spu1_intr2 : 1;
453 unsigned int trigger_grp2 : 1;
454 unsigned int trigger_grp6 : 1;
455 unsigned int timer_grp2 : 1;
456 unsigned int fifo_out1 : 1;
457 unsigned int fifo_out1_extra : 1;
458 unsigned int dmc_out1 : 1;
459 unsigned int spu0_intr3 : 1;
460 unsigned int spu1_intr3 : 1;
461 unsigned int trigger_grp3 : 1;
462 unsigned int trigger_grp7 : 1;
463 unsigned int timer_grp3 : 1;
464 unsigned int fifo_in1 : 1;
465 unsigned int fifo_in1_extra : 1;
466 unsigned int dmc_in1 : 1;
467} reg_iop_sw_mpu_r_masked_intr_grp0;
468#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp0 108
469
470/* Register rw_intr_grp1_mask, scope iop_sw_mpu, type rw */
471typedef struct {
472 unsigned int spu0_intr4 : 1;
473 unsigned int spu1_intr4 : 1;
474 unsigned int trigger_grp0 : 1;
475 unsigned int trigger_grp5 : 1;
476 unsigned int timer_grp0 : 1;
477 unsigned int fifo_in0 : 1;
478 unsigned int fifo_in0_extra : 1;
479 unsigned int dmc_out0 : 1;
480 unsigned int spu0_intr5 : 1;
481 unsigned int spu1_intr5 : 1;
482 unsigned int trigger_grp1 : 1;
483 unsigned int trigger_grp6 : 1;
484 unsigned int timer_grp1 : 1;
485 unsigned int fifo_out1 : 1;
486 unsigned int fifo_out0_extra : 1;
487 unsigned int dmc_in0 : 1;
488 unsigned int spu0_intr6 : 1;
489 unsigned int spu1_intr6 : 1;
490 unsigned int trigger_grp2 : 1;
491 unsigned int trigger_grp7 : 1;
492 unsigned int timer_grp2 : 1;
493 unsigned int fifo_in1 : 1;
494 unsigned int fifo_in1_extra : 1;
495 unsigned int dmc_out1 : 1;
496 unsigned int spu0_intr7 : 1;
497 unsigned int spu1_intr7 : 1;
498 unsigned int trigger_grp3 : 1;
499 unsigned int trigger_grp4 : 1;
500 unsigned int timer_grp3 : 1;
501 unsigned int fifo_out0 : 1;
502 unsigned int fifo_out1_extra : 1;
503 unsigned int dmc_in1 : 1;
504} reg_iop_sw_mpu_rw_intr_grp1_mask;
505#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp1_mask 112
506#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp1_mask 112
507
508/* Register rw_ack_intr_grp1, scope iop_sw_mpu, type rw */
509typedef struct {
510 unsigned int spu0_intr4 : 1;
511 unsigned int spu1_intr4 : 1;
512 unsigned int dummy1 : 6;
513 unsigned int spu0_intr5 : 1;
514 unsigned int spu1_intr5 : 1;
515 unsigned int dummy2 : 6;
516 unsigned int spu0_intr6 : 1;
517 unsigned int spu1_intr6 : 1;
518 unsigned int dummy3 : 6;
519 unsigned int spu0_intr7 : 1;
520 unsigned int spu1_intr7 : 1;
521 unsigned int dummy4 : 6;
522} reg_iop_sw_mpu_rw_ack_intr_grp1;
523#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp1 116
524#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp1 116
525
526/* Register r_intr_grp1, scope iop_sw_mpu, type r */
527typedef struct {
528 unsigned int spu0_intr4 : 1;
529 unsigned int spu1_intr4 : 1;
530 unsigned int trigger_grp0 : 1;
531 unsigned int trigger_grp5 : 1;
532 unsigned int timer_grp0 : 1;
533 unsigned int fifo_in0 : 1;
534 unsigned int fifo_in0_extra : 1;
535 unsigned int dmc_out0 : 1;
536 unsigned int spu0_intr5 : 1;
537 unsigned int spu1_intr5 : 1;
538 unsigned int trigger_grp1 : 1;
539 unsigned int trigger_grp6 : 1;
540 unsigned int timer_grp1 : 1;
541 unsigned int fifo_out1 : 1;
542 unsigned int fifo_out0_extra : 1;
543 unsigned int dmc_in0 : 1;
544 unsigned int spu0_intr6 : 1;
545 unsigned int spu1_intr6 : 1;
546 unsigned int trigger_grp2 : 1;
547 unsigned int trigger_grp7 : 1;
548 unsigned int timer_grp2 : 1;
549 unsigned int fifo_in1 : 1;
550 unsigned int fifo_in1_extra : 1;
551 unsigned int dmc_out1 : 1;
552 unsigned int spu0_intr7 : 1;
553 unsigned int spu1_intr7 : 1;
554 unsigned int trigger_grp3 : 1;
555 unsigned int trigger_grp4 : 1;
556 unsigned int timer_grp3 : 1;
557 unsigned int fifo_out0 : 1;
558 unsigned int fifo_out1_extra : 1;
559 unsigned int dmc_in1 : 1;
560} reg_iop_sw_mpu_r_intr_grp1;
561#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp1 120
562
563/* Register r_masked_intr_grp1, scope iop_sw_mpu, type r */
564typedef struct {
565 unsigned int spu0_intr4 : 1;
566 unsigned int spu1_intr4 : 1;
567 unsigned int trigger_grp0 : 1;
568 unsigned int trigger_grp5 : 1;
569 unsigned int timer_grp0 : 1;
570 unsigned int fifo_in0 : 1;
571 unsigned int fifo_in0_extra : 1;
572 unsigned int dmc_out0 : 1;
573 unsigned int spu0_intr5 : 1;
574 unsigned int spu1_intr5 : 1;
575 unsigned int trigger_grp1 : 1;
576 unsigned int trigger_grp6 : 1;
577 unsigned int timer_grp1 : 1;
578 unsigned int fifo_out1 : 1;
579 unsigned int fifo_out0_extra : 1;
580 unsigned int dmc_in0 : 1;
581 unsigned int spu0_intr6 : 1;
582 unsigned int spu1_intr6 : 1;
583 unsigned int trigger_grp2 : 1;
584 unsigned int trigger_grp7 : 1;
585 unsigned int timer_grp2 : 1;
586 unsigned int fifo_in1 : 1;
587 unsigned int fifo_in1_extra : 1;
588 unsigned int dmc_out1 : 1;
589 unsigned int spu0_intr7 : 1;
590 unsigned int spu1_intr7 : 1;
591 unsigned int trigger_grp3 : 1;
592 unsigned int trigger_grp4 : 1;
593 unsigned int timer_grp3 : 1;
594 unsigned int fifo_out0 : 1;
595 unsigned int fifo_out1_extra : 1;
596 unsigned int dmc_in1 : 1;
597} reg_iop_sw_mpu_r_masked_intr_grp1;
598#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp1 124
599
600/* Register rw_intr_grp2_mask, scope iop_sw_mpu, type rw */
601typedef struct {
602 unsigned int spu0_intr8 : 1;
603 unsigned int spu1_intr8 : 1;
604 unsigned int trigger_grp0 : 1;
605 unsigned int trigger_grp6 : 1;
606 unsigned int timer_grp0 : 1;
607 unsigned int fifo_out1 : 1;
608 unsigned int fifo_out1_extra : 1;
609 unsigned int dmc_out0 : 1;
610 unsigned int spu0_intr9 : 1;
611 unsigned int spu1_intr9 : 1;
612 unsigned int trigger_grp1 : 1;
613 unsigned int trigger_grp7 : 1;
614 unsigned int timer_grp1 : 1;
615 unsigned int fifo_in1 : 1;
616 unsigned int fifo_in1_extra : 1;
617 unsigned int dmc_in0 : 1;
618 unsigned int spu0_intr10 : 1;
619 unsigned int spu1_intr10 : 1;
620 unsigned int trigger_grp2 : 1;
621 unsigned int trigger_grp4 : 1;
622 unsigned int timer_grp2 : 1;
623 unsigned int fifo_out0 : 1;
624 unsigned int fifo_out0_extra : 1;
625 unsigned int dmc_out1 : 1;
626 unsigned int spu0_intr11 : 1;
627 unsigned int spu1_intr11 : 1;
628 unsigned int trigger_grp3 : 1;
629 unsigned int trigger_grp5 : 1;
630 unsigned int timer_grp3 : 1;
631 unsigned int fifo_in0 : 1;
632 unsigned int fifo_in0_extra : 1;
633 unsigned int dmc_in1 : 1;
634} reg_iop_sw_mpu_rw_intr_grp2_mask;
635#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp2_mask 128
636#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp2_mask 128
637
638/* Register rw_ack_intr_grp2, scope iop_sw_mpu, type rw */
639typedef struct {
640 unsigned int spu0_intr8 : 1;
641 unsigned int spu1_intr8 : 1;
642 unsigned int dummy1 : 6;
643 unsigned int spu0_intr9 : 1;
644 unsigned int spu1_intr9 : 1;
645 unsigned int dummy2 : 6;
646 unsigned int spu0_intr10 : 1;
647 unsigned int spu1_intr10 : 1;
648 unsigned int dummy3 : 6;
649 unsigned int spu0_intr11 : 1;
650 unsigned int spu1_intr11 : 1;
651 unsigned int dummy4 : 6;
652} reg_iop_sw_mpu_rw_ack_intr_grp2;
653#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp2 132
654#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp2 132
655
656/* Register r_intr_grp2, scope iop_sw_mpu, type r */
657typedef struct {
658 unsigned int spu0_intr8 : 1;
659 unsigned int spu1_intr8 : 1;
660 unsigned int trigger_grp0 : 1;
661 unsigned int trigger_grp6 : 1;
662 unsigned int timer_grp0 : 1;
663 unsigned int fifo_out1 : 1;
664 unsigned int fifo_out1_extra : 1;
665 unsigned int dmc_out0 : 1;
666 unsigned int spu0_intr9 : 1;
667 unsigned int spu1_intr9 : 1;
668 unsigned int trigger_grp1 : 1;
669 unsigned int trigger_grp7 : 1;
670 unsigned int timer_grp1 : 1;
671 unsigned int fifo_in1 : 1;
672 unsigned int fifo_in1_extra : 1;
673 unsigned int dmc_in0 : 1;
674 unsigned int spu0_intr10 : 1;
675 unsigned int spu1_intr10 : 1;
676 unsigned int trigger_grp2 : 1;
677 unsigned int trigger_grp4 : 1;
678 unsigned int timer_grp2 : 1;
679 unsigned int fifo_out0 : 1;
680 unsigned int fifo_out0_extra : 1;
681 unsigned int dmc_out1 : 1;
682 unsigned int spu0_intr11 : 1;
683 unsigned int spu1_intr11 : 1;
684 unsigned int trigger_grp3 : 1;
685 unsigned int trigger_grp5 : 1;
686 unsigned int timer_grp3 : 1;
687 unsigned int fifo_in0 : 1;
688 unsigned int fifo_in0_extra : 1;
689 unsigned int dmc_in1 : 1;
690} reg_iop_sw_mpu_r_intr_grp2;
691#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp2 136
692
693/* Register r_masked_intr_grp2, scope iop_sw_mpu, type r */
694typedef struct {
695 unsigned int spu0_intr8 : 1;
696 unsigned int spu1_intr8 : 1;
697 unsigned int trigger_grp0 : 1;
698 unsigned int trigger_grp6 : 1;
699 unsigned int timer_grp0 : 1;
700 unsigned int fifo_out1 : 1;
701 unsigned int fifo_out1_extra : 1;
702 unsigned int dmc_out0 : 1;
703 unsigned int spu0_intr9 : 1;
704 unsigned int spu1_intr9 : 1;
705 unsigned int trigger_grp1 : 1;
706 unsigned int trigger_grp7 : 1;
707 unsigned int timer_grp1 : 1;
708 unsigned int fifo_in1 : 1;
709 unsigned int fifo_in1_extra : 1;
710 unsigned int dmc_in0 : 1;
711 unsigned int spu0_intr10 : 1;
712 unsigned int spu1_intr10 : 1;
713 unsigned int trigger_grp2 : 1;
714 unsigned int trigger_grp4 : 1;
715 unsigned int timer_grp2 : 1;
716 unsigned int fifo_out0 : 1;
717 unsigned int fifo_out0_extra : 1;
718 unsigned int dmc_out1 : 1;
719 unsigned int spu0_intr11 : 1;
720 unsigned int spu1_intr11 : 1;
721 unsigned int trigger_grp3 : 1;
722 unsigned int trigger_grp5 : 1;
723 unsigned int timer_grp3 : 1;
724 unsigned int fifo_in0 : 1;
725 unsigned int fifo_in0_extra : 1;
726 unsigned int dmc_in1 : 1;
727} reg_iop_sw_mpu_r_masked_intr_grp2;
728#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp2 140
729
730/* Register rw_intr_grp3_mask, scope iop_sw_mpu, type rw */
731typedef struct {
732 unsigned int spu0_intr12 : 1;
733 unsigned int spu1_intr12 : 1;
734 unsigned int trigger_grp0 : 1;
735 unsigned int trigger_grp7 : 1;
736 unsigned int timer_grp0 : 1;
737 unsigned int fifo_in1 : 1;
738 unsigned int fifo_in1_extra : 1;
739 unsigned int dmc_out0 : 1;
740 unsigned int spu0_intr13 : 1;
741 unsigned int spu1_intr13 : 1;
742 unsigned int trigger_grp1 : 1;
743 unsigned int trigger_grp4 : 1;
744 unsigned int timer_grp1 : 1;
745 unsigned int fifo_out0 : 1;
746 unsigned int fifo_out0_extra : 1;
747 unsigned int dmc_in0 : 1;
748 unsigned int spu0_intr14 : 1;
749 unsigned int spu1_intr14 : 1;
750 unsigned int trigger_grp2 : 1;
751 unsigned int trigger_grp5 : 1;
752 unsigned int timer_grp2 : 1;
753 unsigned int fifo_in0 : 1;
754 unsigned int fifo_in0_extra : 1;
755 unsigned int dmc_out1 : 1;
756 unsigned int spu0_intr15 : 1;
757 unsigned int spu1_intr15 : 1;
758 unsigned int trigger_grp3 : 1;
759 unsigned int trigger_grp6 : 1;
760 unsigned int timer_grp3 : 1;
761 unsigned int fifo_out1 : 1;
762 unsigned int fifo_out1_extra : 1;
763 unsigned int dmc_in1 : 1;
764} reg_iop_sw_mpu_rw_intr_grp3_mask;
765#define REG_RD_ADDR_iop_sw_mpu_rw_intr_grp3_mask 144
766#define REG_WR_ADDR_iop_sw_mpu_rw_intr_grp3_mask 144
767
768/* Register rw_ack_intr_grp3, scope iop_sw_mpu, type rw */
769typedef struct {
770 unsigned int spu0_intr12 : 1;
771 unsigned int spu1_intr12 : 1;
772 unsigned int dummy1 : 6;
773 unsigned int spu0_intr13 : 1;
774 unsigned int spu1_intr13 : 1;
775 unsigned int dummy2 : 6;
776 unsigned int spu0_intr14 : 1;
777 unsigned int spu1_intr14 : 1;
778 unsigned int dummy3 : 6;
779 unsigned int spu0_intr15 : 1;
780 unsigned int spu1_intr15 : 1;
781 unsigned int dummy4 : 6;
782} reg_iop_sw_mpu_rw_ack_intr_grp3;
783#define REG_RD_ADDR_iop_sw_mpu_rw_ack_intr_grp3 148
784#define REG_WR_ADDR_iop_sw_mpu_rw_ack_intr_grp3 148
785
786/* Register r_intr_grp3, scope iop_sw_mpu, type r */
787typedef struct {
788 unsigned int spu0_intr12 : 1;
789 unsigned int spu1_intr12 : 1;
790 unsigned int trigger_grp0 : 1;
791 unsigned int trigger_grp7 : 1;
792 unsigned int timer_grp0 : 1;
793 unsigned int fifo_in1 : 1;
794 unsigned int fifo_in1_extra : 1;
795 unsigned int dmc_out0 : 1;
796 unsigned int spu0_intr13 : 1;
797 unsigned int spu1_intr13 : 1;
798 unsigned int trigger_grp1 : 1;
799 unsigned int trigger_grp4 : 1;
800 unsigned int timer_grp1 : 1;
801 unsigned int fifo_out0 : 1;
802 unsigned int fifo_out0_extra : 1;
803 unsigned int dmc_in0 : 1;
804 unsigned int spu0_intr14 : 1;
805 unsigned int spu1_intr14 : 1;
806 unsigned int trigger_grp2 : 1;
807 unsigned int trigger_grp5 : 1;
808 unsigned int timer_grp2 : 1;
809 unsigned int fifo_in0 : 1;
810 unsigned int fifo_in0_extra : 1;
811 unsigned int dmc_out1 : 1;
812 unsigned int spu0_intr15 : 1;
813 unsigned int spu1_intr15 : 1;
814 unsigned int trigger_grp3 : 1;
815 unsigned int trigger_grp6 : 1;
816 unsigned int timer_grp3 : 1;
817 unsigned int fifo_out1 : 1;
818 unsigned int fifo_out1_extra : 1;
819 unsigned int dmc_in1 : 1;
820} reg_iop_sw_mpu_r_intr_grp3;
821#define REG_RD_ADDR_iop_sw_mpu_r_intr_grp3 152
822
823/* Register r_masked_intr_grp3, scope iop_sw_mpu, type r */
824typedef struct {
825 unsigned int spu0_intr12 : 1;
826 unsigned int spu1_intr12 : 1;
827 unsigned int trigger_grp0 : 1;
828 unsigned int trigger_grp7 : 1;
829 unsigned int timer_grp0 : 1;
830 unsigned int fifo_in1 : 1;
831 unsigned int fifo_in1_extra : 1;
832 unsigned int dmc_out0 : 1;
833 unsigned int spu0_intr13 : 1;
834 unsigned int spu1_intr13 : 1;
835 unsigned int trigger_grp1 : 1;
836 unsigned int trigger_grp4 : 1;
837 unsigned int timer_grp1 : 1;
838 unsigned int fifo_out0 : 1;
839 unsigned int fifo_out0_extra : 1;
840 unsigned int dmc_in0 : 1;
841 unsigned int spu0_intr14 : 1;
842 unsigned int spu1_intr14 : 1;
843 unsigned int trigger_grp2 : 1;
844 unsigned int trigger_grp5 : 1;
845 unsigned int timer_grp2 : 1;
846 unsigned int fifo_in0 : 1;
847 unsigned int fifo_in0_extra : 1;
848 unsigned int dmc_out1 : 1;
849 unsigned int spu0_intr15 : 1;
850 unsigned int spu1_intr15 : 1;
851 unsigned int trigger_grp3 : 1;
852 unsigned int trigger_grp6 : 1;
853 unsigned int timer_grp3 : 1;
854 unsigned int fifo_out1 : 1;
855 unsigned int fifo_out1_extra : 1;
856 unsigned int dmc_in1 : 1;
857} reg_iop_sw_mpu_r_masked_intr_grp3;
858#define REG_RD_ADDR_iop_sw_mpu_r_masked_intr_grp3 156
859
860
861/* Constants */
862enum {
863 regk_iop_sw_mpu_copy = 0x00000000,
864 regk_iop_sw_mpu_cpu = 0x00000000,
865 regk_iop_sw_mpu_mpu = 0x00000001,
866 regk_iop_sw_mpu_no = 0x00000000,
867 regk_iop_sw_mpu_nop = 0x00000000,
868 regk_iop_sw_mpu_rd = 0x00000002,
869 regk_iop_sw_mpu_reg_copy = 0x00000001,
870 regk_iop_sw_mpu_rw_bus0_clr_mask_default = 0x00000000,
871 regk_iop_sw_mpu_rw_bus0_oe_clr_mask_default = 0x00000000,
872 regk_iop_sw_mpu_rw_bus0_oe_set_mask_default = 0x00000000,
873 regk_iop_sw_mpu_rw_bus0_set_mask_default = 0x00000000,
874 regk_iop_sw_mpu_rw_bus1_clr_mask_default = 0x00000000,
875 regk_iop_sw_mpu_rw_bus1_oe_clr_mask_default = 0x00000000,
876 regk_iop_sw_mpu_rw_bus1_oe_set_mask_default = 0x00000000,
877 regk_iop_sw_mpu_rw_bus1_set_mask_default = 0x00000000,
878 regk_iop_sw_mpu_rw_gio_clr_mask_default = 0x00000000,
879 regk_iop_sw_mpu_rw_gio_oe_clr_mask_default = 0x00000000,
880 regk_iop_sw_mpu_rw_gio_oe_set_mask_default = 0x00000000,
881 regk_iop_sw_mpu_rw_gio_set_mask_default = 0x00000000,
882 regk_iop_sw_mpu_rw_intr_grp0_mask_default = 0x00000000,
883 regk_iop_sw_mpu_rw_intr_grp1_mask_default = 0x00000000,
884 regk_iop_sw_mpu_rw_intr_grp2_mask_default = 0x00000000,
885 regk_iop_sw_mpu_rw_intr_grp3_mask_default = 0x00000000,
886 regk_iop_sw_mpu_rw_sw_cfg_owner_default = 0x00000000,
887 regk_iop_sw_mpu_set = 0x00000001,
888 regk_iop_sw_mpu_spu0 = 0x00000002,
889 regk_iop_sw_mpu_spu1 = 0x00000003,
890 regk_iop_sw_mpu_wr = 0x00000003,
891 regk_iop_sw_mpu_yes = 0x00000001
892};
893#endif /* __iop_sw_mpu_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_sw_spu_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_spu_defs.h
new file mode 100644
index 000000000000..b59dde4bd0d1
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_sw_spu_defs.h
@@ -0,0 +1,552 @@
1#ifndef __iop_sw_spu_defs_h
2#define __iop_sw_spu_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_sw_spu.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:10:19 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_sw_spu_defs.h ../../inst/io_proc/rtl/guinness/iop_sw_spu.r
11 * id: $Id: iop_sw_spu_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_sw_spu */
86
87/* Register rw_mc_ctrl, scope iop_sw_spu, type rw */
88typedef struct {
89 unsigned int keep_owner : 1;
90 unsigned int cmd : 2;
91 unsigned int size : 3;
92 unsigned int wr_spu0_mem : 1;
93 unsigned int wr_spu1_mem : 1;
94 unsigned int dummy1 : 24;
95} reg_iop_sw_spu_rw_mc_ctrl;
96#define REG_RD_ADDR_iop_sw_spu_rw_mc_ctrl 0
97#define REG_WR_ADDR_iop_sw_spu_rw_mc_ctrl 0
98
99/* Register rw_mc_data, scope iop_sw_spu, type rw */
100typedef struct {
101 unsigned int val : 32;
102} reg_iop_sw_spu_rw_mc_data;
103#define REG_RD_ADDR_iop_sw_spu_rw_mc_data 4
104#define REG_WR_ADDR_iop_sw_spu_rw_mc_data 4
105
106/* Register rw_mc_addr, scope iop_sw_spu, type rw */
107typedef unsigned int reg_iop_sw_spu_rw_mc_addr;
108#define REG_RD_ADDR_iop_sw_spu_rw_mc_addr 8
109#define REG_WR_ADDR_iop_sw_spu_rw_mc_addr 8
110
111/* Register rs_mc_data, scope iop_sw_spu, type rs */
112typedef unsigned int reg_iop_sw_spu_rs_mc_data;
113#define REG_RD_ADDR_iop_sw_spu_rs_mc_data 12
114
115/* Register r_mc_data, scope iop_sw_spu, type r */
116typedef unsigned int reg_iop_sw_spu_r_mc_data;
117#define REG_RD_ADDR_iop_sw_spu_r_mc_data 16
118
119/* Register r_mc_stat, scope iop_sw_spu, type r */
120typedef struct {
121 unsigned int busy_cpu : 1;
122 unsigned int busy_mpu : 1;
123 unsigned int busy_spu0 : 1;
124 unsigned int busy_spu1 : 1;
125 unsigned int owned_by_cpu : 1;
126 unsigned int owned_by_mpu : 1;
127 unsigned int owned_by_spu0 : 1;
128 unsigned int owned_by_spu1 : 1;
129 unsigned int dummy1 : 24;
130} reg_iop_sw_spu_r_mc_stat;
131#define REG_RD_ADDR_iop_sw_spu_r_mc_stat 20
132
133/* Register rw_bus0_clr_mask, scope iop_sw_spu, type rw */
134typedef struct {
135 unsigned int byte0 : 8;
136 unsigned int byte1 : 8;
137 unsigned int byte2 : 8;
138 unsigned int byte3 : 8;
139} reg_iop_sw_spu_rw_bus0_clr_mask;
140#define REG_RD_ADDR_iop_sw_spu_rw_bus0_clr_mask 24
141#define REG_WR_ADDR_iop_sw_spu_rw_bus0_clr_mask 24
142
143/* Register rw_bus0_set_mask, scope iop_sw_spu, type rw */
144typedef struct {
145 unsigned int byte0 : 8;
146 unsigned int byte1 : 8;
147 unsigned int byte2 : 8;
148 unsigned int byte3 : 8;
149} reg_iop_sw_spu_rw_bus0_set_mask;
150#define REG_RD_ADDR_iop_sw_spu_rw_bus0_set_mask 28
151#define REG_WR_ADDR_iop_sw_spu_rw_bus0_set_mask 28
152
153/* Register rw_bus0_oe_clr_mask, scope iop_sw_spu, type rw */
154typedef struct {
155 unsigned int byte0 : 1;
156 unsigned int byte1 : 1;
157 unsigned int byte2 : 1;
158 unsigned int byte3 : 1;
159 unsigned int dummy1 : 28;
160} reg_iop_sw_spu_rw_bus0_oe_clr_mask;
161#define REG_RD_ADDR_iop_sw_spu_rw_bus0_oe_clr_mask 32
162#define REG_WR_ADDR_iop_sw_spu_rw_bus0_oe_clr_mask 32
163
164/* Register rw_bus0_oe_set_mask, scope iop_sw_spu, type rw */
165typedef struct {
166 unsigned int byte0 : 1;
167 unsigned int byte1 : 1;
168 unsigned int byte2 : 1;
169 unsigned int byte3 : 1;
170 unsigned int dummy1 : 28;
171} reg_iop_sw_spu_rw_bus0_oe_set_mask;
172#define REG_RD_ADDR_iop_sw_spu_rw_bus0_oe_set_mask 36
173#define REG_WR_ADDR_iop_sw_spu_rw_bus0_oe_set_mask 36
174
175/* Register r_bus0_in, scope iop_sw_spu, type r */
176typedef unsigned int reg_iop_sw_spu_r_bus0_in;
177#define REG_RD_ADDR_iop_sw_spu_r_bus0_in 40
178
179/* Register rw_bus1_clr_mask, scope iop_sw_spu, type rw */
180typedef struct {
181 unsigned int byte0 : 8;
182 unsigned int byte1 : 8;
183 unsigned int byte2 : 8;
184 unsigned int byte3 : 8;
185} reg_iop_sw_spu_rw_bus1_clr_mask;
186#define REG_RD_ADDR_iop_sw_spu_rw_bus1_clr_mask 44
187#define REG_WR_ADDR_iop_sw_spu_rw_bus1_clr_mask 44
188
189/* Register rw_bus1_set_mask, scope iop_sw_spu, type rw */
190typedef struct {
191 unsigned int byte0 : 8;
192 unsigned int byte1 : 8;
193 unsigned int byte2 : 8;
194 unsigned int byte3 : 8;
195} reg_iop_sw_spu_rw_bus1_set_mask;
196#define REG_RD_ADDR_iop_sw_spu_rw_bus1_set_mask 48
197#define REG_WR_ADDR_iop_sw_spu_rw_bus1_set_mask 48
198
199/* Register rw_bus1_oe_clr_mask, scope iop_sw_spu, type rw */
200typedef struct {
201 unsigned int byte0 : 1;
202 unsigned int byte1 : 1;
203 unsigned int byte2 : 1;
204 unsigned int byte3 : 1;
205 unsigned int dummy1 : 28;
206} reg_iop_sw_spu_rw_bus1_oe_clr_mask;
207#define REG_RD_ADDR_iop_sw_spu_rw_bus1_oe_clr_mask 52
208#define REG_WR_ADDR_iop_sw_spu_rw_bus1_oe_clr_mask 52
209
210/* Register rw_bus1_oe_set_mask, scope iop_sw_spu, type rw */
211typedef struct {
212 unsigned int byte0 : 1;
213 unsigned int byte1 : 1;
214 unsigned int byte2 : 1;
215 unsigned int byte3 : 1;
216 unsigned int dummy1 : 28;
217} reg_iop_sw_spu_rw_bus1_oe_set_mask;
218#define REG_RD_ADDR_iop_sw_spu_rw_bus1_oe_set_mask 56
219#define REG_WR_ADDR_iop_sw_spu_rw_bus1_oe_set_mask 56
220
221/* Register r_bus1_in, scope iop_sw_spu, type r */
222typedef unsigned int reg_iop_sw_spu_r_bus1_in;
223#define REG_RD_ADDR_iop_sw_spu_r_bus1_in 60
224
225/* Register rw_gio_clr_mask, scope iop_sw_spu, type rw */
226typedef struct {
227 unsigned int val : 32;
228} reg_iop_sw_spu_rw_gio_clr_mask;
229#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask 64
230#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask 64
231
232/* Register rw_gio_set_mask, scope iop_sw_spu, type rw */
233typedef struct {
234 unsigned int val : 32;
235} reg_iop_sw_spu_rw_gio_set_mask;
236#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask 68
237#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask 68
238
239/* Register rw_gio_oe_clr_mask, scope iop_sw_spu, type rw */
240typedef struct {
241 unsigned int val : 32;
242} reg_iop_sw_spu_rw_gio_oe_clr_mask;
243#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask 72
244#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask 72
245
246/* Register rw_gio_oe_set_mask, scope iop_sw_spu, type rw */
247typedef struct {
248 unsigned int val : 32;
249} reg_iop_sw_spu_rw_gio_oe_set_mask;
250#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask 76
251#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask 76
252
253/* Register r_gio_in, scope iop_sw_spu, type r */
254typedef unsigned int reg_iop_sw_spu_r_gio_in;
255#define REG_RD_ADDR_iop_sw_spu_r_gio_in 80
256
257/* Register rw_bus0_clr_mask_lo, scope iop_sw_spu, type rw */
258typedef struct {
259 unsigned int byte0 : 8;
260 unsigned int byte1 : 8;
261 unsigned int dummy1 : 16;
262} reg_iop_sw_spu_rw_bus0_clr_mask_lo;
263#define REG_RD_ADDR_iop_sw_spu_rw_bus0_clr_mask_lo 84
264#define REG_WR_ADDR_iop_sw_spu_rw_bus0_clr_mask_lo 84
265
266/* Register rw_bus0_clr_mask_hi, scope iop_sw_spu, type rw */
267typedef struct {
268 unsigned int byte2 : 8;
269 unsigned int byte3 : 8;
270 unsigned int dummy1 : 16;
271} reg_iop_sw_spu_rw_bus0_clr_mask_hi;
272#define REG_RD_ADDR_iop_sw_spu_rw_bus0_clr_mask_hi 88
273#define REG_WR_ADDR_iop_sw_spu_rw_bus0_clr_mask_hi 88
274
275/* Register rw_bus0_set_mask_lo, scope iop_sw_spu, type rw */
276typedef struct {
277 unsigned int byte0 : 8;
278 unsigned int byte1 : 8;
279 unsigned int dummy1 : 16;
280} reg_iop_sw_spu_rw_bus0_set_mask_lo;
281#define REG_RD_ADDR_iop_sw_spu_rw_bus0_set_mask_lo 92
282#define REG_WR_ADDR_iop_sw_spu_rw_bus0_set_mask_lo 92
283
284/* Register rw_bus0_set_mask_hi, scope iop_sw_spu, type rw */
285typedef struct {
286 unsigned int byte2 : 8;
287 unsigned int byte3 : 8;
288 unsigned int dummy1 : 16;
289} reg_iop_sw_spu_rw_bus0_set_mask_hi;
290#define REG_RD_ADDR_iop_sw_spu_rw_bus0_set_mask_hi 96
291#define REG_WR_ADDR_iop_sw_spu_rw_bus0_set_mask_hi 96
292
293/* Register rw_bus1_clr_mask_lo, scope iop_sw_spu, type rw */
294typedef struct {
295 unsigned int byte0 : 8;
296 unsigned int byte1 : 8;
297 unsigned int dummy1 : 16;
298} reg_iop_sw_spu_rw_bus1_clr_mask_lo;
299#define REG_RD_ADDR_iop_sw_spu_rw_bus1_clr_mask_lo 100
300#define REG_WR_ADDR_iop_sw_spu_rw_bus1_clr_mask_lo 100
301
302/* Register rw_bus1_clr_mask_hi, scope iop_sw_spu, type rw */
303typedef struct {
304 unsigned int byte2 : 8;
305 unsigned int byte3 : 8;
306 unsigned int dummy1 : 16;
307} reg_iop_sw_spu_rw_bus1_clr_mask_hi;
308#define REG_RD_ADDR_iop_sw_spu_rw_bus1_clr_mask_hi 104
309#define REG_WR_ADDR_iop_sw_spu_rw_bus1_clr_mask_hi 104
310
311/* Register rw_bus1_set_mask_lo, scope iop_sw_spu, type rw */
312typedef struct {
313 unsigned int byte0 : 8;
314 unsigned int byte1 : 8;
315 unsigned int dummy1 : 16;
316} reg_iop_sw_spu_rw_bus1_set_mask_lo;
317#define REG_RD_ADDR_iop_sw_spu_rw_bus1_set_mask_lo 108
318#define REG_WR_ADDR_iop_sw_spu_rw_bus1_set_mask_lo 108
319
320/* Register rw_bus1_set_mask_hi, scope iop_sw_spu, type rw */
321typedef struct {
322 unsigned int byte2 : 8;
323 unsigned int byte3 : 8;
324 unsigned int dummy1 : 16;
325} reg_iop_sw_spu_rw_bus1_set_mask_hi;
326#define REG_RD_ADDR_iop_sw_spu_rw_bus1_set_mask_hi 112
327#define REG_WR_ADDR_iop_sw_spu_rw_bus1_set_mask_hi 112
328
329/* Register rw_gio_clr_mask_lo, scope iop_sw_spu, type rw */
330typedef struct {
331 unsigned int val : 16;
332 unsigned int dummy1 : 16;
333} reg_iop_sw_spu_rw_gio_clr_mask_lo;
334#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask_lo 116
335#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask_lo 116
336
337/* Register rw_gio_clr_mask_hi, scope iop_sw_spu, type rw */
338typedef struct {
339 unsigned int val : 16;
340 unsigned int dummy1 : 16;
341} reg_iop_sw_spu_rw_gio_clr_mask_hi;
342#define REG_RD_ADDR_iop_sw_spu_rw_gio_clr_mask_hi 120
343#define REG_WR_ADDR_iop_sw_spu_rw_gio_clr_mask_hi 120
344
345/* Register rw_gio_set_mask_lo, scope iop_sw_spu, type rw */
346typedef struct {
347 unsigned int val : 16;
348 unsigned int dummy1 : 16;
349} reg_iop_sw_spu_rw_gio_set_mask_lo;
350#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask_lo 124
351#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask_lo 124
352
353/* Register rw_gio_set_mask_hi, scope iop_sw_spu, type rw */
354typedef struct {
355 unsigned int val : 16;
356 unsigned int dummy1 : 16;
357} reg_iop_sw_spu_rw_gio_set_mask_hi;
358#define REG_RD_ADDR_iop_sw_spu_rw_gio_set_mask_hi 128
359#define REG_WR_ADDR_iop_sw_spu_rw_gio_set_mask_hi 128
360
361/* Register rw_gio_oe_clr_mask_lo, scope iop_sw_spu, type rw */
362typedef struct {
363 unsigned int val : 16;
364 unsigned int dummy1 : 16;
365} reg_iop_sw_spu_rw_gio_oe_clr_mask_lo;
366#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_lo 132
367#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_lo 132
368
369/* Register rw_gio_oe_clr_mask_hi, scope iop_sw_spu, type rw */
370typedef struct {
371 unsigned int val : 16;
372 unsigned int dummy1 : 16;
373} reg_iop_sw_spu_rw_gio_oe_clr_mask_hi;
374#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_hi 136
375#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_clr_mask_hi 136
376
377/* Register rw_gio_oe_set_mask_lo, scope iop_sw_spu, type rw */
378typedef struct {
379 unsigned int val : 16;
380 unsigned int dummy1 : 16;
381} reg_iop_sw_spu_rw_gio_oe_set_mask_lo;
382#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask_lo 140
383#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask_lo 140
384
385/* Register rw_gio_oe_set_mask_hi, scope iop_sw_spu, type rw */
386typedef struct {
387 unsigned int val : 16;
388 unsigned int dummy1 : 16;
389} reg_iop_sw_spu_rw_gio_oe_set_mask_hi;
390#define REG_RD_ADDR_iop_sw_spu_rw_gio_oe_set_mask_hi 144
391#define REG_WR_ADDR_iop_sw_spu_rw_gio_oe_set_mask_hi 144
392
393/* Register rw_cpu_intr, scope iop_sw_spu, type rw */
394typedef struct {
395 unsigned int intr0 : 1;
396 unsigned int intr1 : 1;
397 unsigned int intr2 : 1;
398 unsigned int intr3 : 1;
399 unsigned int intr4 : 1;
400 unsigned int intr5 : 1;
401 unsigned int intr6 : 1;
402 unsigned int intr7 : 1;
403 unsigned int intr8 : 1;
404 unsigned int intr9 : 1;
405 unsigned int intr10 : 1;
406 unsigned int intr11 : 1;
407 unsigned int intr12 : 1;
408 unsigned int intr13 : 1;
409 unsigned int intr14 : 1;
410 unsigned int intr15 : 1;
411 unsigned int dummy1 : 16;
412} reg_iop_sw_spu_rw_cpu_intr;
413#define REG_RD_ADDR_iop_sw_spu_rw_cpu_intr 148
414#define REG_WR_ADDR_iop_sw_spu_rw_cpu_intr 148
415
416/* Register r_cpu_intr, scope iop_sw_spu, type r */
417typedef struct {
418 unsigned int intr0 : 1;
419 unsigned int intr1 : 1;
420 unsigned int intr2 : 1;
421 unsigned int intr3 : 1;
422 unsigned int intr4 : 1;
423 unsigned int intr5 : 1;
424 unsigned int intr6 : 1;
425 unsigned int intr7 : 1;
426 unsigned int intr8 : 1;
427 unsigned int intr9 : 1;
428 unsigned int intr10 : 1;
429 unsigned int intr11 : 1;
430 unsigned int intr12 : 1;
431 unsigned int intr13 : 1;
432 unsigned int intr14 : 1;
433 unsigned int intr15 : 1;
434 unsigned int dummy1 : 16;
435} reg_iop_sw_spu_r_cpu_intr;
436#define REG_RD_ADDR_iop_sw_spu_r_cpu_intr 152
437
438/* Register r_hw_intr, scope iop_sw_spu, type r */
439typedef struct {
440 unsigned int trigger_grp0 : 1;
441 unsigned int trigger_grp1 : 1;
442 unsigned int trigger_grp2 : 1;
443 unsigned int trigger_grp3 : 1;
444 unsigned int trigger_grp4 : 1;
445 unsigned int trigger_grp5 : 1;
446 unsigned int trigger_grp6 : 1;
447 unsigned int trigger_grp7 : 1;
448 unsigned int timer_grp0 : 1;
449 unsigned int timer_grp1 : 1;
450 unsigned int timer_grp2 : 1;
451 unsigned int timer_grp3 : 1;
452 unsigned int fifo_out0 : 1;
453 unsigned int fifo_out0_extra : 1;
454 unsigned int fifo_in0 : 1;
455 unsigned int fifo_in0_extra : 1;
456 unsigned int fifo_out1 : 1;
457 unsigned int fifo_out1_extra : 1;
458 unsigned int fifo_in1 : 1;
459 unsigned int fifo_in1_extra : 1;
460 unsigned int dmc_out0 : 1;
461 unsigned int dmc_in0 : 1;
462 unsigned int dmc_out1 : 1;
463 unsigned int dmc_in1 : 1;
464 unsigned int dummy1 : 8;
465} reg_iop_sw_spu_r_hw_intr;
466#define REG_RD_ADDR_iop_sw_spu_r_hw_intr 156
467
468/* Register rw_mpu_intr, scope iop_sw_spu, type rw */
469typedef struct {
470 unsigned int intr0 : 1;
471 unsigned int intr1 : 1;
472 unsigned int intr2 : 1;
473 unsigned int intr3 : 1;
474 unsigned int intr4 : 1;
475 unsigned int intr5 : 1;
476 unsigned int intr6 : 1;
477 unsigned int intr7 : 1;
478 unsigned int intr8 : 1;
479 unsigned int intr9 : 1;
480 unsigned int intr10 : 1;
481 unsigned int intr11 : 1;
482 unsigned int intr12 : 1;
483 unsigned int intr13 : 1;
484 unsigned int intr14 : 1;
485 unsigned int intr15 : 1;
486 unsigned int dummy1 : 16;
487} reg_iop_sw_spu_rw_mpu_intr;
488#define REG_RD_ADDR_iop_sw_spu_rw_mpu_intr 160
489#define REG_WR_ADDR_iop_sw_spu_rw_mpu_intr 160
490
491/* Register r_mpu_intr, scope iop_sw_spu, type r */
492typedef struct {
493 unsigned int intr0 : 1;
494 unsigned int intr1 : 1;
495 unsigned int intr2 : 1;
496 unsigned int intr3 : 1;
497 unsigned int intr4 : 1;
498 unsigned int intr5 : 1;
499 unsigned int intr6 : 1;
500 unsigned int intr7 : 1;
501 unsigned int intr8 : 1;
502 unsigned int intr9 : 1;
503 unsigned int intr10 : 1;
504 unsigned int intr11 : 1;
505 unsigned int intr12 : 1;
506 unsigned int intr13 : 1;
507 unsigned int intr14 : 1;
508 unsigned int intr15 : 1;
509 unsigned int other_spu_intr0 : 1;
510 unsigned int other_spu_intr1 : 1;
511 unsigned int other_spu_intr2 : 1;
512 unsigned int other_spu_intr3 : 1;
513 unsigned int other_spu_intr4 : 1;
514 unsigned int other_spu_intr5 : 1;
515 unsigned int other_spu_intr6 : 1;
516 unsigned int other_spu_intr7 : 1;
517 unsigned int other_spu_intr8 : 1;
518 unsigned int other_spu_intr9 : 1;
519 unsigned int other_spu_intr10 : 1;
520 unsigned int other_spu_intr11 : 1;
521 unsigned int other_spu_intr12 : 1;
522 unsigned int other_spu_intr13 : 1;
523 unsigned int other_spu_intr14 : 1;
524 unsigned int other_spu_intr15 : 1;
525} reg_iop_sw_spu_r_mpu_intr;
526#define REG_RD_ADDR_iop_sw_spu_r_mpu_intr 164
527
528
529/* Constants */
530enum {
531 regk_iop_sw_spu_copy = 0x00000000,
532 regk_iop_sw_spu_no = 0x00000000,
533 regk_iop_sw_spu_nop = 0x00000000,
534 regk_iop_sw_spu_rd = 0x00000002,
535 regk_iop_sw_spu_reg_copy = 0x00000001,
536 regk_iop_sw_spu_rw_bus0_clr_mask_default = 0x00000000,
537 regk_iop_sw_spu_rw_bus0_oe_clr_mask_default = 0x00000000,
538 regk_iop_sw_spu_rw_bus0_oe_set_mask_default = 0x00000000,
539 regk_iop_sw_spu_rw_bus0_set_mask_default = 0x00000000,
540 regk_iop_sw_spu_rw_bus1_clr_mask_default = 0x00000000,
541 regk_iop_sw_spu_rw_bus1_oe_clr_mask_default = 0x00000000,
542 regk_iop_sw_spu_rw_bus1_oe_set_mask_default = 0x00000000,
543 regk_iop_sw_spu_rw_bus1_set_mask_default = 0x00000000,
544 regk_iop_sw_spu_rw_gio_clr_mask_default = 0x00000000,
545 regk_iop_sw_spu_rw_gio_oe_clr_mask_default = 0x00000000,
546 regk_iop_sw_spu_rw_gio_oe_set_mask_default = 0x00000000,
547 regk_iop_sw_spu_rw_gio_set_mask_default = 0x00000000,
548 regk_iop_sw_spu_set = 0x00000001,
549 regk_iop_sw_spu_wr = 0x00000003,
550 regk_iop_sw_spu_yes = 0x00000001
551};
552#endif /* __iop_sw_spu_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_timer_grp_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_timer_grp_defs.h
new file mode 100644
index 000000000000..c994114f3b51
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_timer_grp_defs.h
@@ -0,0 +1,249 @@
1#ifndef __iop_timer_grp_defs_h
2#define __iop_timer_grp_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_timer_grp.r
7 * id: iop_timer_grp.r,v 1.29 2005/02/16 09:13:27 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_timer_grp_defs.h ../../inst/io_proc/rtl/iop_timer_grp.r
11 * id: $Id: iop_timer_grp_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_timer_grp */
86
87/* Register rw_cfg, scope iop_timer_grp, type rw */
88typedef struct {
89 unsigned int clk_src : 1;
90 unsigned int trig : 2;
91 unsigned int clk_gen_div : 8;
92 unsigned int clk_div : 8;
93 unsigned int dummy1 : 13;
94} reg_iop_timer_grp_rw_cfg;
95#define REG_RD_ADDR_iop_timer_grp_rw_cfg 0
96#define REG_WR_ADDR_iop_timer_grp_rw_cfg 0
97
98/* Register rw_half_period, scope iop_timer_grp, type rw */
99typedef struct {
100 unsigned int quota_lo : 15;
101 unsigned int quota_hi : 15;
102 unsigned int quota_hi_sel : 1;
103 unsigned int dummy1 : 1;
104} reg_iop_timer_grp_rw_half_period;
105#define REG_RD_ADDR_iop_timer_grp_rw_half_period 4
106#define REG_WR_ADDR_iop_timer_grp_rw_half_period 4
107
108/* Register rw_half_period_len, scope iop_timer_grp, type rw */
109typedef unsigned int reg_iop_timer_grp_rw_half_period_len;
110#define REG_RD_ADDR_iop_timer_grp_rw_half_period_len 8
111#define REG_WR_ADDR_iop_timer_grp_rw_half_period_len 8
112
113#define STRIDE_iop_timer_grp_rw_tmr_cfg 4
114/* Register rw_tmr_cfg, scope iop_timer_grp, type rw */
115typedef struct {
116 unsigned int clk_src : 3;
117 unsigned int strb : 2;
118 unsigned int run_mode : 2;
119 unsigned int out_mode : 1;
120 unsigned int active_on_tmr : 2;
121 unsigned int inv : 1;
122 unsigned int en_by_tmr : 2;
123 unsigned int dis_by_tmr : 2;
124 unsigned int en_only_by_reg : 1;
125 unsigned int dis_only_by_reg : 1;
126 unsigned int rst_at_en_strb : 1;
127 unsigned int dummy1 : 14;
128} reg_iop_timer_grp_rw_tmr_cfg;
129#define REG_RD_ADDR_iop_timer_grp_rw_tmr_cfg 12
130#define REG_WR_ADDR_iop_timer_grp_rw_tmr_cfg 12
131
132#define STRIDE_iop_timer_grp_rw_tmr_len 4
133/* Register rw_tmr_len, scope iop_timer_grp, type rw */
134typedef struct {
135 unsigned int val : 16;
136 unsigned int dummy1 : 16;
137} reg_iop_timer_grp_rw_tmr_len;
138#define REG_RD_ADDR_iop_timer_grp_rw_tmr_len 44
139#define REG_WR_ADDR_iop_timer_grp_rw_tmr_len 44
140
141/* Register rw_cmd, scope iop_timer_grp, type rw */
142typedef struct {
143 unsigned int rst : 4;
144 unsigned int en : 4;
145 unsigned int dis : 4;
146 unsigned int strb : 4;
147 unsigned int dummy1 : 16;
148} reg_iop_timer_grp_rw_cmd;
149#define REG_RD_ADDR_iop_timer_grp_rw_cmd 60
150#define REG_WR_ADDR_iop_timer_grp_rw_cmd 60
151
152/* Register r_clk_gen_cnt, scope iop_timer_grp, type r */
153typedef unsigned int reg_iop_timer_grp_r_clk_gen_cnt;
154#define REG_RD_ADDR_iop_timer_grp_r_clk_gen_cnt 64
155
156#define STRIDE_iop_timer_grp_rs_tmr_cnt 8
157/* Register rs_tmr_cnt, scope iop_timer_grp, type rs */
158typedef struct {
159 unsigned int val : 16;
160 unsigned int dummy1 : 16;
161} reg_iop_timer_grp_rs_tmr_cnt;
162#define REG_RD_ADDR_iop_timer_grp_rs_tmr_cnt 68
163
164#define STRIDE_iop_timer_grp_r_tmr_cnt 8
165/* Register r_tmr_cnt, scope iop_timer_grp, type r */
166typedef struct {
167 unsigned int val : 16;
168 unsigned int dummy1 : 16;
169} reg_iop_timer_grp_r_tmr_cnt;
170#define REG_RD_ADDR_iop_timer_grp_r_tmr_cnt 72
171
172/* Register rw_intr_mask, scope iop_timer_grp, type rw */
173typedef struct {
174 unsigned int tmr0 : 1;
175 unsigned int tmr1 : 1;
176 unsigned int tmr2 : 1;
177 unsigned int tmr3 : 1;
178 unsigned int dummy1 : 28;
179} reg_iop_timer_grp_rw_intr_mask;
180#define REG_RD_ADDR_iop_timer_grp_rw_intr_mask 100
181#define REG_WR_ADDR_iop_timer_grp_rw_intr_mask 100
182
183/* Register rw_ack_intr, scope iop_timer_grp, type rw */
184typedef struct {
185 unsigned int tmr0 : 1;
186 unsigned int tmr1 : 1;
187 unsigned int tmr2 : 1;
188 unsigned int tmr3 : 1;
189 unsigned int dummy1 : 28;
190} reg_iop_timer_grp_rw_ack_intr;
191#define REG_RD_ADDR_iop_timer_grp_rw_ack_intr 104
192#define REG_WR_ADDR_iop_timer_grp_rw_ack_intr 104
193
194/* Register r_intr, scope iop_timer_grp, type r */
195typedef struct {
196 unsigned int tmr0 : 1;
197 unsigned int tmr1 : 1;
198 unsigned int tmr2 : 1;
199 unsigned int tmr3 : 1;
200 unsigned int dummy1 : 28;
201} reg_iop_timer_grp_r_intr;
202#define REG_RD_ADDR_iop_timer_grp_r_intr 108
203
204/* Register r_masked_intr, scope iop_timer_grp, type r */
205typedef struct {
206 unsigned int tmr0 : 1;
207 unsigned int tmr1 : 1;
208 unsigned int tmr2 : 1;
209 unsigned int tmr3 : 1;
210 unsigned int dummy1 : 28;
211} reg_iop_timer_grp_r_masked_intr;
212#define REG_RD_ADDR_iop_timer_grp_r_masked_intr 112
213
214
215/* Constants */
216enum {
217 regk_iop_timer_grp_clk200 = 0x00000000,
218 regk_iop_timer_grp_clk_gen = 0x00000002,
219 regk_iop_timer_grp_complete = 0x00000002,
220 regk_iop_timer_grp_div_clk200 = 0x00000001,
221 regk_iop_timer_grp_div_clk_gen = 0x00000003,
222 regk_iop_timer_grp_ext = 0x00000001,
223 regk_iop_timer_grp_hi = 0x00000000,
224 regk_iop_timer_grp_long_period = 0x00000001,
225 regk_iop_timer_grp_neg = 0x00000002,
226 regk_iop_timer_grp_no = 0x00000000,
227 regk_iop_timer_grp_once = 0x00000003,
228 regk_iop_timer_grp_pause = 0x00000001,
229 regk_iop_timer_grp_pos = 0x00000001,
230 regk_iop_timer_grp_pos_neg = 0x00000003,
231 regk_iop_timer_grp_pulse = 0x00000000,
232 regk_iop_timer_grp_r_tmr_cnt_size = 0x00000004,
233 regk_iop_timer_grp_rs_tmr_cnt_size = 0x00000004,
234 regk_iop_timer_grp_rw_cfg_default = 0x00000002,
235 regk_iop_timer_grp_rw_intr_mask_default = 0x00000000,
236 regk_iop_timer_grp_rw_tmr_cfg_default0 = 0x00018000,
237 regk_iop_timer_grp_rw_tmr_cfg_default1 = 0x0001a900,
238 regk_iop_timer_grp_rw_tmr_cfg_default2 = 0x0001d200,
239 regk_iop_timer_grp_rw_tmr_cfg_default3 = 0x0001fb00,
240 regk_iop_timer_grp_rw_tmr_cfg_size = 0x00000004,
241 regk_iop_timer_grp_rw_tmr_len_default = 0x00000000,
242 regk_iop_timer_grp_rw_tmr_len_size = 0x00000004,
243 regk_iop_timer_grp_short_period = 0x00000000,
244 regk_iop_timer_grp_stop = 0x00000000,
245 regk_iop_timer_grp_tmr = 0x00000004,
246 regk_iop_timer_grp_toggle = 0x00000001,
247 regk_iop_timer_grp_yes = 0x00000001
248};
249#endif /* __iop_timer_grp_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_trigger_grp_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_trigger_grp_defs.h
new file mode 100644
index 000000000000..36e44282399d
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_trigger_grp_defs.h
@@ -0,0 +1,170 @@
1#ifndef __iop_trigger_grp_defs_h
2#define __iop_trigger_grp_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/iop_trigger_grp.r
7 * id: iop_trigger_grp.r,v 0.20 2005/02/16 09:13:20 niklaspa Exp
8 * last modfied: Mon Apr 11 16:08:46 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_trigger_grp_defs.h ../../inst/io_proc/rtl/iop_trigger_grp.r
11 * id: $Id: iop_trigger_grp_defs.h,v 1.5 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_trigger_grp */
86
87#define STRIDE_iop_trigger_grp_rw_cfg 4
88/* Register rw_cfg, scope iop_trigger_grp, type rw */
89typedef struct {
90 unsigned int action : 2;
91 unsigned int once : 1;
92 unsigned int trig : 3;
93 unsigned int en_only_by_reg : 1;
94 unsigned int dis_only_by_reg : 1;
95 unsigned int dummy1 : 24;
96} reg_iop_trigger_grp_rw_cfg;
97#define REG_RD_ADDR_iop_trigger_grp_rw_cfg 0
98#define REG_WR_ADDR_iop_trigger_grp_rw_cfg 0
99
100/* Register rw_cmd, scope iop_trigger_grp, type rw */
101typedef struct {
102 unsigned int dis : 4;
103 unsigned int en : 4;
104 unsigned int dummy1 : 24;
105} reg_iop_trigger_grp_rw_cmd;
106#define REG_RD_ADDR_iop_trigger_grp_rw_cmd 16
107#define REG_WR_ADDR_iop_trigger_grp_rw_cmd 16
108
109/* Register rw_intr_mask, scope iop_trigger_grp, type rw */
110typedef struct {
111 unsigned int trig0 : 1;
112 unsigned int trig1 : 1;
113 unsigned int trig2 : 1;
114 unsigned int trig3 : 1;
115 unsigned int dummy1 : 28;
116} reg_iop_trigger_grp_rw_intr_mask;
117#define REG_RD_ADDR_iop_trigger_grp_rw_intr_mask 20
118#define REG_WR_ADDR_iop_trigger_grp_rw_intr_mask 20
119
120/* Register rw_ack_intr, scope iop_trigger_grp, type rw */
121typedef struct {
122 unsigned int trig0 : 1;
123 unsigned int trig1 : 1;
124 unsigned int trig2 : 1;
125 unsigned int trig3 : 1;
126 unsigned int dummy1 : 28;
127} reg_iop_trigger_grp_rw_ack_intr;
128#define REG_RD_ADDR_iop_trigger_grp_rw_ack_intr 24
129#define REG_WR_ADDR_iop_trigger_grp_rw_ack_intr 24
130
131/* Register r_intr, scope iop_trigger_grp, type r */
132typedef struct {
133 unsigned int trig0 : 1;
134 unsigned int trig1 : 1;
135 unsigned int trig2 : 1;
136 unsigned int trig3 : 1;
137 unsigned int dummy1 : 28;
138} reg_iop_trigger_grp_r_intr;
139#define REG_RD_ADDR_iop_trigger_grp_r_intr 28
140
141/* Register r_masked_intr, scope iop_trigger_grp, type r */
142typedef struct {
143 unsigned int trig0 : 1;
144 unsigned int trig1 : 1;
145 unsigned int trig2 : 1;
146 unsigned int trig3 : 1;
147 unsigned int dummy1 : 28;
148} reg_iop_trigger_grp_r_masked_intr;
149#define REG_RD_ADDR_iop_trigger_grp_r_masked_intr 32
150
151
152/* Constants */
153enum {
154 regk_iop_trigger_grp_fall = 0x00000002,
155 regk_iop_trigger_grp_fall_lo = 0x00000006,
156 regk_iop_trigger_grp_no = 0x00000000,
157 regk_iop_trigger_grp_off = 0x00000000,
158 regk_iop_trigger_grp_pulse = 0x00000000,
159 regk_iop_trigger_grp_rise = 0x00000001,
160 regk_iop_trigger_grp_rise_fall = 0x00000003,
161 regk_iop_trigger_grp_rise_fall_hi = 0x00000007,
162 regk_iop_trigger_grp_rise_fall_lo = 0x00000004,
163 regk_iop_trigger_grp_rise_hi = 0x00000005,
164 regk_iop_trigger_grp_rw_cfg_default = 0x000000c0,
165 regk_iop_trigger_grp_rw_cfg_size = 0x00000004,
166 regk_iop_trigger_grp_rw_intr_mask_default = 0x00000000,
167 regk_iop_trigger_grp_toggle = 0x00000003,
168 regk_iop_trigger_grp_yes = 0x00000001
169};
170#endif /* __iop_trigger_grp_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/iop/iop_version_defs.h b/include/asm-cris/arch-v32/hwregs/iop/iop_version_defs.h
new file mode 100644
index 000000000000..b8d6a910c71c
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/iop/iop_version_defs.h
@@ -0,0 +1,99 @@
1#ifndef __iop_version_defs_h
2#define __iop_version_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/io_proc/rtl/guinness/iop_version.r
7 * id: iop_version.r,v 1.3 2004/04/22 12:37:54 jonaso Exp
8 * last modfied: Mon Apr 11 16:08:44 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile iop_version_defs.h ../../inst/io_proc/rtl/guinness/iop_version.r
11 * id: $Id: iop_version_defs.h,v 1.4 2005/04/24 18:31:05 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope iop_version */
86
87/* Register r_version, scope iop_version, type r */
88typedef struct {
89 unsigned int nr : 8;
90 unsigned int dummy1 : 24;
91} reg_iop_version_r_version;
92#define REG_RD_ADDR_iop_version_r_version 0
93
94
95/* Constants */
96enum {
97 regk_iop_version_v1_0 = 0x00000001
98};
99#endif /* __iop_version_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/irq_nmi_defs.h b/include/asm-cris/arch-v32/hwregs/irq_nmi_defs.h
new file mode 100644
index 000000000000..7b167e3c0572
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/irq_nmi_defs.h
@@ -0,0 +1,104 @@
1#ifndef __irq_nmi_defs_h
2#define __irq_nmi_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../mod/irq_nmi.r
7 * id: <not found>
8 * last modfied: Thu Jan 22 09:22:43 2004
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile irq_nmi_defs.h ../../mod/irq_nmi.r
11 * id: $Id: irq_nmi_defs.h,v 1.1 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope irq_nmi */
86
87/* Register rw_cmd, scope irq_nmi, type rw */
88typedef struct {
89 unsigned int delay : 16;
90 unsigned int op : 2;
91 unsigned int dummy1 : 14;
92} reg_irq_nmi_rw_cmd;
93#define REG_RD_ADDR_irq_nmi_rw_cmd 0
94#define REG_WR_ADDR_irq_nmi_rw_cmd 0
95
96
97/* Constants */
98enum {
99 regk_irq_nmi_ack_irq = 0x00000002,
100 regk_irq_nmi_ack_nmi = 0x00000003,
101 regk_irq_nmi_irq = 0x00000000,
102 regk_irq_nmi_nmi = 0x00000001
103};
104#endif /* __irq_nmi_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/marb_bp_defs.h b/include/asm-cris/arch-v32/hwregs/marb_bp_defs.h
new file mode 100644
index 000000000000..a11fdd3cd907
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/marb_bp_defs.h
@@ -0,0 +1,205 @@
1#ifndef __marb_bp_defs_h
2#define __marb_bp_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/memarb/rtl/guinness/marb_top.r
7 * id: <not found>
8 * last modfied: Fri Nov 7 15:36:04 2003
9 *
10 * by /n/asic/projects/guinness/design/top/inst/rdesc/rdes2c ../../rtl/global.rmap ../../mod/modreg.rmap -base 0xb0000000 ../../inst/memarb/rtl/guinness/marb_top.r
11 * id: $Id: marb_bp_defs.h,v 1.2 2004/06/04 07:15:33 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74/* C-code for register scope marb_bp */
75
76/* Register rw_first_addr, scope marb_bp, type rw */
77typedef unsigned int reg_marb_bp_rw_first_addr;
78#define REG_RD_ADDR_marb_bp_rw_first_addr 0
79#define REG_WR_ADDR_marb_bp_rw_first_addr 0
80
81/* Register rw_last_addr, scope marb_bp, type rw */
82typedef unsigned int reg_marb_bp_rw_last_addr;
83#define REG_RD_ADDR_marb_bp_rw_last_addr 4
84#define REG_WR_ADDR_marb_bp_rw_last_addr 4
85
86/* Register rw_op, scope marb_bp, type rw */
87typedef struct {
88 unsigned int read : 1;
89 unsigned int write : 1;
90 unsigned int read_excl : 1;
91 unsigned int pri_write : 1;
92 unsigned int us_read : 1;
93 unsigned int us_write : 1;
94 unsigned int us_read_excl : 1;
95 unsigned int us_pri_write : 1;
96 unsigned int dummy1 : 24;
97} reg_marb_bp_rw_op;
98#define REG_RD_ADDR_marb_bp_rw_op 8
99#define REG_WR_ADDR_marb_bp_rw_op 8
100
101/* Register rw_clients, scope marb_bp, type rw */
102typedef struct {
103 unsigned int dma0 : 1;
104 unsigned int dma1 : 1;
105 unsigned int dma2 : 1;
106 unsigned int dma3 : 1;
107 unsigned int dma4 : 1;
108 unsigned int dma5 : 1;
109 unsigned int dma6 : 1;
110 unsigned int dma7 : 1;
111 unsigned int dma8 : 1;
112 unsigned int dma9 : 1;
113 unsigned int cpui : 1;
114 unsigned int cpud : 1;
115 unsigned int iop : 1;
116 unsigned int slave : 1;
117 unsigned int dummy1 : 18;
118} reg_marb_bp_rw_clients;
119#define REG_RD_ADDR_marb_bp_rw_clients 12
120#define REG_WR_ADDR_marb_bp_rw_clients 12
121
122/* Register rw_options, scope marb_bp, type rw */
123typedef struct {
124 unsigned int wrap : 1;
125 unsigned int dummy1 : 31;
126} reg_marb_bp_rw_options;
127#define REG_RD_ADDR_marb_bp_rw_options 16
128#define REG_WR_ADDR_marb_bp_rw_options 16
129
130/* Register r_break_addr, scope marb_bp, type r */
131typedef unsigned int reg_marb_bp_r_break_addr;
132#define REG_RD_ADDR_marb_bp_r_break_addr 20
133
134/* Register r_break_op, scope marb_bp, type r */
135typedef struct {
136 unsigned int read : 1;
137 unsigned int write : 1;
138 unsigned int read_excl : 1;
139 unsigned int pri_write : 1;
140 unsigned int us_read : 1;
141 unsigned int us_write : 1;
142 unsigned int us_read_excl : 1;
143 unsigned int us_pri_write : 1;
144 unsigned int dummy1 : 24;
145} reg_marb_bp_r_break_op;
146#define REG_RD_ADDR_marb_bp_r_break_op 24
147
148/* Register r_break_clients, scope marb_bp, type r */
149typedef struct {
150 unsigned int dma0 : 1;
151 unsigned int dma1 : 1;
152 unsigned int dma2 : 1;
153 unsigned int dma3 : 1;
154 unsigned int dma4 : 1;
155 unsigned int dma5 : 1;
156 unsigned int dma6 : 1;
157 unsigned int dma7 : 1;
158 unsigned int dma8 : 1;
159 unsigned int dma9 : 1;
160 unsigned int cpui : 1;
161 unsigned int cpud : 1;
162 unsigned int iop : 1;
163 unsigned int slave : 1;
164 unsigned int dummy1 : 18;
165} reg_marb_bp_r_break_clients;
166#define REG_RD_ADDR_marb_bp_r_break_clients 28
167
168/* Register r_break_first_client, scope marb_bp, type r */
169typedef struct {
170 unsigned int dma0 : 1;
171 unsigned int dma1 : 1;
172 unsigned int dma2 : 1;
173 unsigned int dma3 : 1;
174 unsigned int dma4 : 1;
175 unsigned int dma5 : 1;
176 unsigned int dma6 : 1;
177 unsigned int dma7 : 1;
178 unsigned int dma8 : 1;
179 unsigned int dma9 : 1;
180 unsigned int cpui : 1;
181 unsigned int cpud : 1;
182 unsigned int iop : 1;
183 unsigned int slave : 1;
184 unsigned int dummy1 : 18;
185} reg_marb_bp_r_break_first_client;
186#define REG_RD_ADDR_marb_bp_r_break_first_client 32
187
188/* Register r_break_size, scope marb_bp, type r */
189typedef unsigned int reg_marb_bp_r_break_size;
190#define REG_RD_ADDR_marb_bp_r_break_size 36
191
192/* Register rw_ack, scope marb_bp, type rw */
193typedef unsigned int reg_marb_bp_rw_ack;
194#define REG_RD_ADDR_marb_bp_rw_ack 40
195#define REG_WR_ADDR_marb_bp_rw_ack 40
196
197
198/* Constants */
199enum {
200 regk_marb_bp_no = 0x00000000,
201 regk_marb_bp_rw_op_default = 0x00000000,
202 regk_marb_bp_rw_options_default = 0x00000000,
203 regk_marb_bp_yes = 0x00000001
204};
205#endif /* __marb_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/marb_defs.h b/include/asm-cris/arch-v32/hwregs/marb_defs.h
new file mode 100644
index 000000000000..71e8af0bb3a4
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/marb_defs.h
@@ -0,0 +1,475 @@
1#ifndef __marb_defs_h
2#define __marb_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/memarb/rtl/guinness/marb_top.r
7 * id: <not found>
8 * last modfied: Mon Apr 11 16:12:16 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile marb_defs.h ../../inst/memarb/rtl/guinness/marb_top.r
11 * id: $Id: marb_defs.h,v 1.3 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope marb */
86
87#define STRIDE_marb_rw_int_slots 4
88/* Register rw_int_slots, scope marb, type rw */
89typedef struct {
90 unsigned int owner : 4;
91 unsigned int dummy1 : 28;
92} reg_marb_rw_int_slots;
93#define REG_RD_ADDR_marb_rw_int_slots 0
94#define REG_WR_ADDR_marb_rw_int_slots 0
95
96#define STRIDE_marb_rw_ext_slots 4
97/* Register rw_ext_slots, scope marb, type rw */
98typedef struct {
99 unsigned int owner : 4;
100 unsigned int dummy1 : 28;
101} reg_marb_rw_ext_slots;
102#define REG_RD_ADDR_marb_rw_ext_slots 256
103#define REG_WR_ADDR_marb_rw_ext_slots 256
104
105#define STRIDE_marb_rw_regs_slots 4
106/* Register rw_regs_slots, scope marb, type rw */
107typedef struct {
108 unsigned int owner : 4;
109 unsigned int dummy1 : 28;
110} reg_marb_rw_regs_slots;
111#define REG_RD_ADDR_marb_rw_regs_slots 512
112#define REG_WR_ADDR_marb_rw_regs_slots 512
113
114/* Register rw_intr_mask, scope marb, type rw */
115typedef struct {
116 unsigned int bp0 : 1;
117 unsigned int bp1 : 1;
118 unsigned int bp2 : 1;
119 unsigned int bp3 : 1;
120 unsigned int dummy1 : 28;
121} reg_marb_rw_intr_mask;
122#define REG_RD_ADDR_marb_rw_intr_mask 528
123#define REG_WR_ADDR_marb_rw_intr_mask 528
124
125/* Register rw_ack_intr, scope marb, type rw */
126typedef struct {
127 unsigned int bp0 : 1;
128 unsigned int bp1 : 1;
129 unsigned int bp2 : 1;
130 unsigned int bp3 : 1;
131 unsigned int dummy1 : 28;
132} reg_marb_rw_ack_intr;
133#define REG_RD_ADDR_marb_rw_ack_intr 532
134#define REG_WR_ADDR_marb_rw_ack_intr 532
135
136/* Register r_intr, scope marb, type r */
137typedef struct {
138 unsigned int bp0 : 1;
139 unsigned int bp1 : 1;
140 unsigned int bp2 : 1;
141 unsigned int bp3 : 1;
142 unsigned int dummy1 : 28;
143} reg_marb_r_intr;
144#define REG_RD_ADDR_marb_r_intr 536
145
146/* Register r_masked_intr, scope marb, type r */
147typedef struct {
148 unsigned int bp0 : 1;
149 unsigned int bp1 : 1;
150 unsigned int bp2 : 1;
151 unsigned int bp3 : 1;
152 unsigned int dummy1 : 28;
153} reg_marb_r_masked_intr;
154#define REG_RD_ADDR_marb_r_masked_intr 540
155
156/* Register rw_stop_mask, scope marb, type rw */
157typedef struct {
158 unsigned int dma0 : 1;
159 unsigned int dma1 : 1;
160 unsigned int dma2 : 1;
161 unsigned int dma3 : 1;
162 unsigned int dma4 : 1;
163 unsigned int dma5 : 1;
164 unsigned int dma6 : 1;
165 unsigned int dma7 : 1;
166 unsigned int dma8 : 1;
167 unsigned int dma9 : 1;
168 unsigned int cpui : 1;
169 unsigned int cpud : 1;
170 unsigned int iop : 1;
171 unsigned int slave : 1;
172 unsigned int dummy1 : 18;
173} reg_marb_rw_stop_mask;
174#define REG_RD_ADDR_marb_rw_stop_mask 544
175#define REG_WR_ADDR_marb_rw_stop_mask 544
176
177/* Register r_stopped, scope marb, type r */
178typedef struct {
179 unsigned int dma0 : 1;
180 unsigned int dma1 : 1;
181 unsigned int dma2 : 1;
182 unsigned int dma3 : 1;
183 unsigned int dma4 : 1;
184 unsigned int dma5 : 1;
185 unsigned int dma6 : 1;
186 unsigned int dma7 : 1;
187 unsigned int dma8 : 1;
188 unsigned int dma9 : 1;
189 unsigned int cpui : 1;
190 unsigned int cpud : 1;
191 unsigned int iop : 1;
192 unsigned int slave : 1;
193 unsigned int dummy1 : 18;
194} reg_marb_r_stopped;
195#define REG_RD_ADDR_marb_r_stopped 548
196
197/* Register rw_no_snoop, scope marb, type rw */
198typedef struct {
199 unsigned int dma0 : 1;
200 unsigned int dma1 : 1;
201 unsigned int dma2 : 1;
202 unsigned int dma3 : 1;
203 unsigned int dma4 : 1;
204 unsigned int dma5 : 1;
205 unsigned int dma6 : 1;
206 unsigned int dma7 : 1;
207 unsigned int dma8 : 1;
208 unsigned int dma9 : 1;
209 unsigned int cpui : 1;
210 unsigned int cpud : 1;
211 unsigned int iop : 1;
212 unsigned int slave : 1;
213 unsigned int dummy1 : 18;
214} reg_marb_rw_no_snoop;
215#define REG_RD_ADDR_marb_rw_no_snoop 832
216#define REG_WR_ADDR_marb_rw_no_snoop 832
217
218/* Register rw_no_snoop_rq, scope marb, type rw */
219typedef struct {
220 unsigned int dummy1 : 10;
221 unsigned int cpui : 1;
222 unsigned int cpud : 1;
223 unsigned int dummy2 : 20;
224} reg_marb_rw_no_snoop_rq;
225#define REG_RD_ADDR_marb_rw_no_snoop_rq 836
226#define REG_WR_ADDR_marb_rw_no_snoop_rq 836
227
228
229/* Constants */
230enum {
231 regk_marb_cpud = 0x0000000b,
232 regk_marb_cpui = 0x0000000a,
233 regk_marb_dma0 = 0x00000000,
234 regk_marb_dma1 = 0x00000001,
235 regk_marb_dma2 = 0x00000002,
236 regk_marb_dma3 = 0x00000003,
237 regk_marb_dma4 = 0x00000004,
238 regk_marb_dma5 = 0x00000005,
239 regk_marb_dma6 = 0x00000006,
240 regk_marb_dma7 = 0x00000007,
241 regk_marb_dma8 = 0x00000008,
242 regk_marb_dma9 = 0x00000009,
243 regk_marb_iop = 0x0000000c,
244 regk_marb_no = 0x00000000,
245 regk_marb_r_stopped_default = 0x00000000,
246 regk_marb_rw_ext_slots_default = 0x00000000,
247 regk_marb_rw_ext_slots_size = 0x00000040,
248 regk_marb_rw_int_slots_default = 0x00000000,
249 regk_marb_rw_int_slots_size = 0x00000040,
250 regk_marb_rw_intr_mask_default = 0x00000000,
251 regk_marb_rw_no_snoop_default = 0x00000000,
252 regk_marb_rw_no_snoop_rq_default = 0x00000000,
253 regk_marb_rw_regs_slots_default = 0x00000000,
254 regk_marb_rw_regs_slots_size = 0x00000004,
255 regk_marb_rw_stop_mask_default = 0x00000000,
256 regk_marb_slave = 0x0000000d,
257 regk_marb_yes = 0x00000001
258};
259#endif /* __marb_defs_h */
260#ifndef __marb_bp_defs_h
261#define __marb_bp_defs_h
262
263/*
264 * This file is autogenerated from
265 * file: ../../inst/memarb/rtl/guinness/marb_top.r
266 * id: <not found>
267 * last modfied: Mon Apr 11 16:12:16 2005
268 *
269 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile marb_defs.h ../../inst/memarb/rtl/guinness/marb_top.r
270 * id: $Id: marb_defs.h,v 1.3 2005/04/24 18:30:58 starvik Exp $
271 * Any changes here will be lost.
272 *
273 * -*- buffer-read-only: t -*-
274 */
275/* Main access macros */
276#ifndef REG_RD
277#define REG_RD( scope, inst, reg ) \
278 REG_READ( reg_##scope##_##reg, \
279 (inst) + REG_RD_ADDR_##scope##_##reg )
280#endif
281
282#ifndef REG_WR
283#define REG_WR( scope, inst, reg, val ) \
284 REG_WRITE( reg_##scope##_##reg, \
285 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
286#endif
287
288#ifndef REG_RD_VECT
289#define REG_RD_VECT( scope, inst, reg, index ) \
290 REG_READ( reg_##scope##_##reg, \
291 (inst) + REG_RD_ADDR_##scope##_##reg + \
292 (index) * STRIDE_##scope##_##reg )
293#endif
294
295#ifndef REG_WR_VECT
296#define REG_WR_VECT( scope, inst, reg, index, val ) \
297 REG_WRITE( reg_##scope##_##reg, \
298 (inst) + REG_WR_ADDR_##scope##_##reg + \
299 (index) * STRIDE_##scope##_##reg, (val) )
300#endif
301
302#ifndef REG_RD_INT
303#define REG_RD_INT( scope, inst, reg ) \
304 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
305#endif
306
307#ifndef REG_WR_INT
308#define REG_WR_INT( scope, inst, reg, val ) \
309 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
310#endif
311
312#ifndef REG_RD_INT_VECT
313#define REG_RD_INT_VECT( scope, inst, reg, index ) \
314 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
315 (index) * STRIDE_##scope##_##reg )
316#endif
317
318#ifndef REG_WR_INT_VECT
319#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
320 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
321 (index) * STRIDE_##scope##_##reg, (val) )
322#endif
323
324#ifndef REG_TYPE_CONV
325#define REG_TYPE_CONV( type, orgtype, val ) \
326 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
327#endif
328
329#ifndef reg_page_size
330#define reg_page_size 8192
331#endif
332
333#ifndef REG_ADDR
334#define REG_ADDR( scope, inst, reg ) \
335 ( (inst) + REG_RD_ADDR_##scope##_##reg )
336#endif
337
338#ifndef REG_ADDR_VECT
339#define REG_ADDR_VECT( scope, inst, reg, index ) \
340 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
341 (index) * STRIDE_##scope##_##reg )
342#endif
343
344/* C-code for register scope marb_bp */
345
346/* Register rw_first_addr, scope marb_bp, type rw */
347typedef unsigned int reg_marb_bp_rw_first_addr;
348#define REG_RD_ADDR_marb_bp_rw_first_addr 0
349#define REG_WR_ADDR_marb_bp_rw_first_addr 0
350
351/* Register rw_last_addr, scope marb_bp, type rw */
352typedef unsigned int reg_marb_bp_rw_last_addr;
353#define REG_RD_ADDR_marb_bp_rw_last_addr 4
354#define REG_WR_ADDR_marb_bp_rw_last_addr 4
355
356/* Register rw_op, scope marb_bp, type rw */
357typedef struct {
358 unsigned int rd : 1;
359 unsigned int wr : 1;
360 unsigned int rd_excl : 1;
361 unsigned int pri_wr : 1;
362 unsigned int us_rd : 1;
363 unsigned int us_wr : 1;
364 unsigned int us_rd_excl : 1;
365 unsigned int us_pri_wr : 1;
366 unsigned int dummy1 : 24;
367} reg_marb_bp_rw_op;
368#define REG_RD_ADDR_marb_bp_rw_op 8
369#define REG_WR_ADDR_marb_bp_rw_op 8
370
371/* Register rw_clients, scope marb_bp, type rw */
372typedef struct {
373 unsigned int dma0 : 1;
374 unsigned int dma1 : 1;
375 unsigned int dma2 : 1;
376 unsigned int dma3 : 1;
377 unsigned int dma4 : 1;
378 unsigned int dma5 : 1;
379 unsigned int dma6 : 1;
380 unsigned int dma7 : 1;
381 unsigned int dma8 : 1;
382 unsigned int dma9 : 1;
383 unsigned int cpui : 1;
384 unsigned int cpud : 1;
385 unsigned int iop : 1;
386 unsigned int slave : 1;
387 unsigned int dummy1 : 18;
388} reg_marb_bp_rw_clients;
389#define REG_RD_ADDR_marb_bp_rw_clients 12
390#define REG_WR_ADDR_marb_bp_rw_clients 12
391
392/* Register rw_options, scope marb_bp, type rw */
393typedef struct {
394 unsigned int wrap : 1;
395 unsigned int dummy1 : 31;
396} reg_marb_bp_rw_options;
397#define REG_RD_ADDR_marb_bp_rw_options 16
398#define REG_WR_ADDR_marb_bp_rw_options 16
399
400/* Register r_brk_addr, scope marb_bp, type r */
401typedef unsigned int reg_marb_bp_r_brk_addr;
402#define REG_RD_ADDR_marb_bp_r_brk_addr 20
403
404/* Register r_brk_op, scope marb_bp, type r */
405typedef struct {
406 unsigned int rd : 1;
407 unsigned int wr : 1;
408 unsigned int rd_excl : 1;
409 unsigned int pri_wr : 1;
410 unsigned int us_rd : 1;
411 unsigned int us_wr : 1;
412 unsigned int us_rd_excl : 1;
413 unsigned int us_pri_wr : 1;
414 unsigned int dummy1 : 24;
415} reg_marb_bp_r_brk_op;
416#define REG_RD_ADDR_marb_bp_r_brk_op 24
417
418/* Register r_brk_clients, scope marb_bp, type r */
419typedef struct {
420 unsigned int dma0 : 1;
421 unsigned int dma1 : 1;
422 unsigned int dma2 : 1;
423 unsigned int dma3 : 1;
424 unsigned int dma4 : 1;
425 unsigned int dma5 : 1;
426 unsigned int dma6 : 1;
427 unsigned int dma7 : 1;
428 unsigned int dma8 : 1;
429 unsigned int dma9 : 1;
430 unsigned int cpui : 1;
431 unsigned int cpud : 1;
432 unsigned int iop : 1;
433 unsigned int slave : 1;
434 unsigned int dummy1 : 18;
435} reg_marb_bp_r_brk_clients;
436#define REG_RD_ADDR_marb_bp_r_brk_clients 28
437
438/* Register r_brk_first_client, scope marb_bp, type r */
439typedef struct {
440 unsigned int dma0 : 1;
441 unsigned int dma1 : 1;
442 unsigned int dma2 : 1;
443 unsigned int dma3 : 1;
444 unsigned int dma4 : 1;
445 unsigned int dma5 : 1;
446 unsigned int dma6 : 1;
447 unsigned int dma7 : 1;
448 unsigned int dma8 : 1;
449 unsigned int dma9 : 1;
450 unsigned int cpui : 1;
451 unsigned int cpud : 1;
452 unsigned int iop : 1;
453 unsigned int slave : 1;
454 unsigned int dummy1 : 18;
455} reg_marb_bp_r_brk_first_client;
456#define REG_RD_ADDR_marb_bp_r_brk_first_client 32
457
458/* Register r_brk_size, scope marb_bp, type r */
459typedef unsigned int reg_marb_bp_r_brk_size;
460#define REG_RD_ADDR_marb_bp_r_brk_size 36
461
462/* Register rw_ack, scope marb_bp, type rw */
463typedef unsigned int reg_marb_bp_rw_ack;
464#define REG_RD_ADDR_marb_bp_rw_ack 40
465#define REG_WR_ADDR_marb_bp_rw_ack 40
466
467
468/* Constants */
469enum {
470 regk_marb_bp_no = 0x00000000,
471 regk_marb_bp_rw_op_default = 0x00000000,
472 regk_marb_bp_rw_options_default = 0x00000000,
473 regk_marb_bp_yes = 0x00000001
474};
475#endif /* __marb_bp_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/pinmux_defs.h b/include/asm-cris/arch-v32/hwregs/pinmux_defs.h
new file mode 100644
index 000000000000..9d91c2de1b07
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/pinmux_defs.h
@@ -0,0 +1,357 @@
1#ifndef __pinmux_defs_h
2#define __pinmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/pinmux/rtl/guinness/pinmux_regs.r
7 * id: pinmux_regs.r,v 1.40 2005/02/09 16:22:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:11 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile pinmux_defs.h ../../inst/pinmux/rtl/guinness/pinmux_regs.r
11 * id: $Id: pinmux_defs.h,v 1.3 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope pinmux */
86
87/* Register rw_pa, scope pinmux, type rw */
88typedef struct {
89 unsigned int pa0 : 1;
90 unsigned int pa1 : 1;
91 unsigned int pa2 : 1;
92 unsigned int pa3 : 1;
93 unsigned int pa4 : 1;
94 unsigned int pa5 : 1;
95 unsigned int pa6 : 1;
96 unsigned int pa7 : 1;
97 unsigned int csp2_n : 1;
98 unsigned int csp3_n : 1;
99 unsigned int csp5_n : 1;
100 unsigned int csp6_n : 1;
101 unsigned int hsh4 : 1;
102 unsigned int hsh5 : 1;
103 unsigned int hsh6 : 1;
104 unsigned int hsh7 : 1;
105 unsigned int dummy1 : 16;
106} reg_pinmux_rw_pa;
107#define REG_RD_ADDR_pinmux_rw_pa 0
108#define REG_WR_ADDR_pinmux_rw_pa 0
109
110/* Register rw_hwprot, scope pinmux, type rw */
111typedef struct {
112 unsigned int ser1 : 1;
113 unsigned int ser2 : 1;
114 unsigned int ser3 : 1;
115 unsigned int sser0 : 1;
116 unsigned int sser1 : 1;
117 unsigned int ata0 : 1;
118 unsigned int ata1 : 1;
119 unsigned int ata2 : 1;
120 unsigned int ata3 : 1;
121 unsigned int ata : 1;
122 unsigned int eth1 : 1;
123 unsigned int eth1_mgm : 1;
124 unsigned int timer : 1;
125 unsigned int p21 : 1;
126 unsigned int dummy1 : 18;
127} reg_pinmux_rw_hwprot;
128#define REG_RD_ADDR_pinmux_rw_hwprot 4
129#define REG_WR_ADDR_pinmux_rw_hwprot 4
130
131/* Register rw_pb_gio, scope pinmux, type rw */
132typedef struct {
133 unsigned int pb0 : 1;
134 unsigned int pb1 : 1;
135 unsigned int pb2 : 1;
136 unsigned int pb3 : 1;
137 unsigned int pb4 : 1;
138 unsigned int pb5 : 1;
139 unsigned int pb6 : 1;
140 unsigned int pb7 : 1;
141 unsigned int pb8 : 1;
142 unsigned int pb9 : 1;
143 unsigned int pb10 : 1;
144 unsigned int pb11 : 1;
145 unsigned int pb12 : 1;
146 unsigned int pb13 : 1;
147 unsigned int pb14 : 1;
148 unsigned int pb15 : 1;
149 unsigned int pb16 : 1;
150 unsigned int pb17 : 1;
151 unsigned int dummy1 : 14;
152} reg_pinmux_rw_pb_gio;
153#define REG_RD_ADDR_pinmux_rw_pb_gio 8
154#define REG_WR_ADDR_pinmux_rw_pb_gio 8
155
156/* Register rw_pb_iop, scope pinmux, type rw */
157typedef struct {
158 unsigned int pb0 : 1;
159 unsigned int pb1 : 1;
160 unsigned int pb2 : 1;
161 unsigned int pb3 : 1;
162 unsigned int pb4 : 1;
163 unsigned int pb5 : 1;
164 unsigned int pb6 : 1;
165 unsigned int pb7 : 1;
166 unsigned int pb8 : 1;
167 unsigned int pb9 : 1;
168 unsigned int pb10 : 1;
169 unsigned int pb11 : 1;
170 unsigned int pb12 : 1;
171 unsigned int pb13 : 1;
172 unsigned int pb14 : 1;
173 unsigned int pb15 : 1;
174 unsigned int pb16 : 1;
175 unsigned int pb17 : 1;
176 unsigned int dummy1 : 14;
177} reg_pinmux_rw_pb_iop;
178#define REG_RD_ADDR_pinmux_rw_pb_iop 12
179#define REG_WR_ADDR_pinmux_rw_pb_iop 12
180
181/* Register rw_pc_gio, scope pinmux, type rw */
182typedef struct {
183 unsigned int pc0 : 1;
184 unsigned int pc1 : 1;
185 unsigned int pc2 : 1;
186 unsigned int pc3 : 1;
187 unsigned int pc4 : 1;
188 unsigned int pc5 : 1;
189 unsigned int pc6 : 1;
190 unsigned int pc7 : 1;
191 unsigned int pc8 : 1;
192 unsigned int pc9 : 1;
193 unsigned int pc10 : 1;
194 unsigned int pc11 : 1;
195 unsigned int pc12 : 1;
196 unsigned int pc13 : 1;
197 unsigned int pc14 : 1;
198 unsigned int pc15 : 1;
199 unsigned int pc16 : 1;
200 unsigned int pc17 : 1;
201 unsigned int dummy1 : 14;
202} reg_pinmux_rw_pc_gio;
203#define REG_RD_ADDR_pinmux_rw_pc_gio 16
204#define REG_WR_ADDR_pinmux_rw_pc_gio 16
205
206/* Register rw_pc_iop, scope pinmux, type rw */
207typedef struct {
208 unsigned int pc0 : 1;
209 unsigned int pc1 : 1;
210 unsigned int pc2 : 1;
211 unsigned int pc3 : 1;
212 unsigned int pc4 : 1;
213 unsigned int pc5 : 1;
214 unsigned int pc6 : 1;
215 unsigned int pc7 : 1;
216 unsigned int pc8 : 1;
217 unsigned int pc9 : 1;
218 unsigned int pc10 : 1;
219 unsigned int pc11 : 1;
220 unsigned int pc12 : 1;
221 unsigned int pc13 : 1;
222 unsigned int pc14 : 1;
223 unsigned int pc15 : 1;
224 unsigned int pc16 : 1;
225 unsigned int pc17 : 1;
226 unsigned int dummy1 : 14;
227} reg_pinmux_rw_pc_iop;
228#define REG_RD_ADDR_pinmux_rw_pc_iop 20
229#define REG_WR_ADDR_pinmux_rw_pc_iop 20
230
231/* Register rw_pd_gio, scope pinmux, type rw */
232typedef struct {
233 unsigned int pd0 : 1;
234 unsigned int pd1 : 1;
235 unsigned int pd2 : 1;
236 unsigned int pd3 : 1;
237 unsigned int pd4 : 1;
238 unsigned int pd5 : 1;
239 unsigned int pd6 : 1;
240 unsigned int pd7 : 1;
241 unsigned int pd8 : 1;
242 unsigned int pd9 : 1;
243 unsigned int pd10 : 1;
244 unsigned int pd11 : 1;
245 unsigned int pd12 : 1;
246 unsigned int pd13 : 1;
247 unsigned int pd14 : 1;
248 unsigned int pd15 : 1;
249 unsigned int pd16 : 1;
250 unsigned int pd17 : 1;
251 unsigned int dummy1 : 14;
252} reg_pinmux_rw_pd_gio;
253#define REG_RD_ADDR_pinmux_rw_pd_gio 24
254#define REG_WR_ADDR_pinmux_rw_pd_gio 24
255
256/* Register rw_pd_iop, scope pinmux, type rw */
257typedef struct {
258 unsigned int pd0 : 1;
259 unsigned int pd1 : 1;
260 unsigned int pd2 : 1;
261 unsigned int pd3 : 1;
262 unsigned int pd4 : 1;
263 unsigned int pd5 : 1;
264 unsigned int pd6 : 1;
265 unsigned int pd7 : 1;
266 unsigned int pd8 : 1;
267 unsigned int pd9 : 1;
268 unsigned int pd10 : 1;
269 unsigned int pd11 : 1;
270 unsigned int pd12 : 1;
271 unsigned int pd13 : 1;
272 unsigned int pd14 : 1;
273 unsigned int pd15 : 1;
274 unsigned int pd16 : 1;
275 unsigned int pd17 : 1;
276 unsigned int dummy1 : 14;
277} reg_pinmux_rw_pd_iop;
278#define REG_RD_ADDR_pinmux_rw_pd_iop 28
279#define REG_WR_ADDR_pinmux_rw_pd_iop 28
280
281/* Register rw_pe_gio, scope pinmux, type rw */
282typedef struct {
283 unsigned int pe0 : 1;
284 unsigned int pe1 : 1;
285 unsigned int pe2 : 1;
286 unsigned int pe3 : 1;
287 unsigned int pe4 : 1;
288 unsigned int pe5 : 1;
289 unsigned int pe6 : 1;
290 unsigned int pe7 : 1;
291 unsigned int pe8 : 1;
292 unsigned int pe9 : 1;
293 unsigned int pe10 : 1;
294 unsigned int pe11 : 1;
295 unsigned int pe12 : 1;
296 unsigned int pe13 : 1;
297 unsigned int pe14 : 1;
298 unsigned int pe15 : 1;
299 unsigned int pe16 : 1;
300 unsigned int pe17 : 1;
301 unsigned int dummy1 : 14;
302} reg_pinmux_rw_pe_gio;
303#define REG_RD_ADDR_pinmux_rw_pe_gio 32
304#define REG_WR_ADDR_pinmux_rw_pe_gio 32
305
306/* Register rw_pe_iop, scope pinmux, type rw */
307typedef struct {
308 unsigned int pe0 : 1;
309 unsigned int pe1 : 1;
310 unsigned int pe2 : 1;
311 unsigned int pe3 : 1;
312 unsigned int pe4 : 1;
313 unsigned int pe5 : 1;
314 unsigned int pe6 : 1;
315 unsigned int pe7 : 1;
316 unsigned int pe8 : 1;
317 unsigned int pe9 : 1;
318 unsigned int pe10 : 1;
319 unsigned int pe11 : 1;
320 unsigned int pe12 : 1;
321 unsigned int pe13 : 1;
322 unsigned int pe14 : 1;
323 unsigned int pe15 : 1;
324 unsigned int pe16 : 1;
325 unsigned int pe17 : 1;
326 unsigned int dummy1 : 14;
327} reg_pinmux_rw_pe_iop;
328#define REG_RD_ADDR_pinmux_rw_pe_iop 36
329#define REG_WR_ADDR_pinmux_rw_pe_iop 36
330
331/* Register rw_usb_phy, scope pinmux, type rw */
332typedef struct {
333 unsigned int en_usb0 : 1;
334 unsigned int en_usb1 : 1;
335 unsigned int dummy1 : 30;
336} reg_pinmux_rw_usb_phy;
337#define REG_RD_ADDR_pinmux_rw_usb_phy 40
338#define REG_WR_ADDR_pinmux_rw_usb_phy 40
339
340
341/* Constants */
342enum {
343 regk_pinmux_no = 0x00000000,
344 regk_pinmux_rw_hwprot_default = 0x00000000,
345 regk_pinmux_rw_pa_default = 0x00000000,
346 regk_pinmux_rw_pb_gio_default = 0x00000000,
347 regk_pinmux_rw_pb_iop_default = 0x00000000,
348 regk_pinmux_rw_pc_gio_default = 0x00000000,
349 regk_pinmux_rw_pc_iop_default = 0x00000000,
350 regk_pinmux_rw_pd_gio_default = 0x00000000,
351 regk_pinmux_rw_pd_iop_default = 0x00000000,
352 regk_pinmux_rw_pe_gio_default = 0x00000000,
353 regk_pinmux_rw_pe_iop_default = 0x00000000,
354 regk_pinmux_rw_usb_phy_default = 0x00000000,
355 regk_pinmux_yes = 0x00000001
356};
357#endif /* __pinmux_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/reg_map.h b/include/asm-cris/arch-v32/hwregs/reg_map.h
new file mode 100644
index 000000000000..e31502838ec6
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/reg_map.h
@@ -0,0 +1,103 @@
1#ifndef __reg_map_h
2#define __reg_map_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../mod/fakereg.rmap
7 * id: fakereg.rmap,v 1.3 2004/02/11 19:53:22 ronny Exp
8 * last modified: Wed Feb 11 20:53:25 2004
9 * file: ../../rtl/global.rmap
10 * id: global.rmap,v 1.3 2003/08/18 15:08:23 mikaeln Exp
11 * last modified: Mon Aug 18 17:08:23 2003
12 * file: ../../mod/modreg.rmap
13 * id: modreg.rmap,v 1.31 2004/02/20 15:40:04 stefans Exp
14 * last modified: Fri Feb 20 16:40:04 2004
15 *
16 * by /n/asic/design/tools/rdesc/src/rdes2c -map -base 0xb0000000 ../../rtl/global.rmap ../../mod/modreg.rmap ../../inst/io_proc/rtl/guinness/iop_top.r ../../inst/memarb/rtl/guinness/marb_top.r ../../mod/fakereg.rmap
17 * id: $Id: reg_map.h,v 1.7 2005/04/24 18:30:58 starvik Exp $
18 * Any changes here will be lost.
19 *
20 * -*- buffer-read-only: t -*-
21 */
22typedef enum {
23 regi_ata = 0xb0032000,
24 regi_bif_core = 0xb0014000,
25 regi_bif_dma = 0xb0016000,
26 regi_bif_slave = 0xb0018000,
27 regi_config = 0xb003c000,
28 regi_dma0 = 0xb0000000,
29 regi_dma1 = 0xb0002000,
30 regi_dma2 = 0xb0004000,
31 regi_dma3 = 0xb0006000,
32 regi_dma4 = 0xb0008000,
33 regi_dma5 = 0xb000a000,
34 regi_dma6 = 0xb000c000,
35 regi_dma7 = 0xb000e000,
36 regi_dma8 = 0xb0010000,
37 regi_dma9 = 0xb0012000,
38 regi_eth0 = 0xb0034000,
39 regi_eth1 = 0xb0036000,
40 regi_gio = 0xb001a000,
41 regi_iop = 0xb0020000,
42 regi_iop_version = 0xb0020000,
43 regi_iop_fifo_in0_extra = 0xb0020040,
44 regi_iop_fifo_in1_extra = 0xb0020080,
45 regi_iop_fifo_out0_extra = 0xb00200c0,
46 regi_iop_fifo_out1_extra = 0xb0020100,
47 regi_iop_trigger_grp0 = 0xb0020140,
48 regi_iop_trigger_grp1 = 0xb0020180,
49 regi_iop_trigger_grp2 = 0xb00201c0,
50 regi_iop_trigger_grp3 = 0xb0020200,
51 regi_iop_trigger_grp4 = 0xb0020240,
52 regi_iop_trigger_grp5 = 0xb0020280,
53 regi_iop_trigger_grp6 = 0xb00202c0,
54 regi_iop_trigger_grp7 = 0xb0020300,
55 regi_iop_crc_par0 = 0xb0020380,
56 regi_iop_crc_par1 = 0xb0020400,
57 regi_iop_dmc_in0 = 0xb0020480,
58 regi_iop_dmc_in1 = 0xb0020500,
59 regi_iop_dmc_out0 = 0xb0020580,
60 regi_iop_dmc_out1 = 0xb0020600,
61 regi_iop_fifo_in0 = 0xb0020680,
62 regi_iop_fifo_in1 = 0xb0020700,
63 regi_iop_fifo_out0 = 0xb0020780,
64 regi_iop_fifo_out1 = 0xb0020800,
65 regi_iop_scrc_in0 = 0xb0020880,
66 regi_iop_scrc_in1 = 0xb0020900,
67 regi_iop_scrc_out0 = 0xb0020980,
68 regi_iop_scrc_out1 = 0xb0020a00,
69 regi_iop_timer_grp0 = 0xb0020a80,
70 regi_iop_timer_grp1 = 0xb0020b00,
71 regi_iop_timer_grp2 = 0xb0020b80,
72 regi_iop_timer_grp3 = 0xb0020c00,
73 regi_iop_sap_in = 0xb0020d00,
74 regi_iop_sap_out = 0xb0020e00,
75 regi_iop_spu0 = 0xb0020f00,
76 regi_iop_spu1 = 0xb0021000,
77 regi_iop_sw_cfg = 0xb0021100,
78 regi_iop_sw_cpu = 0xb0021200,
79 regi_iop_sw_mpu = 0xb0021300,
80 regi_iop_sw_spu0 = 0xb0021400,
81 regi_iop_sw_spu1 = 0xb0021500,
82 regi_iop_mpu = 0xb0021600,
83 regi_irq = 0xb001c000,
84 regi_irq2 = 0xb005c000,
85 regi_marb = 0xb003e000,
86 regi_marb_bp0 = 0xb003e240,
87 regi_marb_bp1 = 0xb003e280,
88 regi_marb_bp2 = 0xb003e2c0,
89 regi_marb_bp3 = 0xb003e300,
90 regi_pinmux = 0xb0038000,
91 regi_ser0 = 0xb0026000,
92 regi_ser1 = 0xb0028000,
93 regi_ser2 = 0xb002a000,
94 regi_ser3 = 0xb002c000,
95 regi_sser0 = 0xb0022000,
96 regi_sser1 = 0xb0024000,
97 regi_strcop = 0xb0030000,
98 regi_strmux = 0xb003a000,
99 regi_timer = 0xb001e000,
100 regi_timer2 = 0xb005e000,
101 regi_trace = 0xb0040000,
102} reg_scope_instances;
103#endif /* __reg_map_h */
diff --git a/include/asm-cris/arch-v32/hwregs/reg_rdwr.h b/include/asm-cris/arch-v32/hwregs/reg_rdwr.h
new file mode 100644
index 000000000000..44e60233c68f
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/reg_rdwr.h
@@ -0,0 +1,15 @@
1/* $Id: reg_rdwr.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
2 *
3 * Read/write register macros used by *_defs.h
4 */
5
6#ifndef reg_rdwr_h
7#define reg_rdwr_h
8
9
10#define REG_READ(type, addr) *((volatile type *) (addr))
11
12#define REG_WRITE(type, addr, val) \
13 do { *((volatile type *) (addr)) = (val); } while(0)
14
15#endif
diff --git a/include/asm-cris/arch-v32/hwregs/rt_trace_defs.h b/include/asm-cris/arch-v32/hwregs/rt_trace_defs.h
new file mode 100644
index 000000000000..d9f0e924fb23
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/rt_trace_defs.h
@@ -0,0 +1,173 @@
1#ifndef __rt_trace_defs_h
2#define __rt_trace_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/rt_trace/rtl/rt_regs.r
7 * id: rt_regs.r,v 1.18 2005/02/08 15:45:00 stefans Exp
8 * last modfied: Mon Apr 11 16:09:14 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile rt_trace_defs.h ../../inst/rt_trace/rtl/rt_regs.r
11 * id: $Id: rt_trace_defs.h,v 1.1 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope rt_trace */
86
87/* Register rw_cfg, scope rt_trace, type rw */
88typedef struct {
89 unsigned int en : 1;
90 unsigned int mode : 1;
91 unsigned int owner : 1;
92 unsigned int wp : 1;
93 unsigned int stall : 1;
94 unsigned int dummy1 : 3;
95 unsigned int wp_start : 7;
96 unsigned int dummy2 : 1;
97 unsigned int wp_stop : 7;
98 unsigned int dummy3 : 9;
99} reg_rt_trace_rw_cfg;
100#define REG_RD_ADDR_rt_trace_rw_cfg 0
101#define REG_WR_ADDR_rt_trace_rw_cfg 0
102
103/* Register rw_tap_ctrl, scope rt_trace, type rw */
104typedef struct {
105 unsigned int ack_data : 1;
106 unsigned int ack_guru : 1;
107 unsigned int dummy1 : 30;
108} reg_rt_trace_rw_tap_ctrl;
109#define REG_RD_ADDR_rt_trace_rw_tap_ctrl 4
110#define REG_WR_ADDR_rt_trace_rw_tap_ctrl 4
111
112/* Register r_tap_stat, scope rt_trace, type r */
113typedef struct {
114 unsigned int dav : 1;
115 unsigned int empty : 1;
116 unsigned int dummy1 : 30;
117} reg_rt_trace_r_tap_stat;
118#define REG_RD_ADDR_rt_trace_r_tap_stat 8
119
120/* Register rw_tap_data, scope rt_trace, type rw */
121typedef unsigned int reg_rt_trace_rw_tap_data;
122#define REG_RD_ADDR_rt_trace_rw_tap_data 12
123#define REG_WR_ADDR_rt_trace_rw_tap_data 12
124
125/* Register rw_tap_hdata, scope rt_trace, type rw */
126typedef struct {
127 unsigned int op : 4;
128 unsigned int sub_op : 4;
129 unsigned int dummy1 : 24;
130} reg_rt_trace_rw_tap_hdata;
131#define REG_RD_ADDR_rt_trace_rw_tap_hdata 16
132#define REG_WR_ADDR_rt_trace_rw_tap_hdata 16
133
134/* Register r_redir, scope rt_trace, type r */
135typedef unsigned int reg_rt_trace_r_redir;
136#define REG_RD_ADDR_rt_trace_r_redir 20
137
138
139/* Constants */
140enum {
141 regk_rt_trace_brk = 0x0000000c,
142 regk_rt_trace_dbg = 0x00000003,
143 regk_rt_trace_dbgdi = 0x00000004,
144 regk_rt_trace_dbgdo = 0x00000005,
145 regk_rt_trace_gmode = 0x00000000,
146 regk_rt_trace_no = 0x00000000,
147 regk_rt_trace_nop = 0x00000000,
148 regk_rt_trace_normal = 0x00000000,
149 regk_rt_trace_rdmem = 0x00000007,
150 regk_rt_trace_rdmemb = 0x00000009,
151 regk_rt_trace_rdpreg = 0x00000002,
152 regk_rt_trace_rdreg = 0x00000001,
153 regk_rt_trace_rdsreg = 0x00000003,
154 regk_rt_trace_redir = 0x00000006,
155 regk_rt_trace_ret = 0x0000000b,
156 regk_rt_trace_rw_cfg_default = 0x00000000,
157 regk_rt_trace_trcfg = 0x00000001,
158 regk_rt_trace_wp = 0x00000001,
159 regk_rt_trace_wp0 = 0x00000001,
160 regk_rt_trace_wp1 = 0x00000002,
161 regk_rt_trace_wp2 = 0x00000004,
162 regk_rt_trace_wp3 = 0x00000008,
163 regk_rt_trace_wp4 = 0x00000010,
164 regk_rt_trace_wp5 = 0x00000020,
165 regk_rt_trace_wp6 = 0x00000040,
166 regk_rt_trace_wrmem = 0x00000008,
167 regk_rt_trace_wrmemb = 0x0000000a,
168 regk_rt_trace_wrpreg = 0x00000005,
169 regk_rt_trace_wrreg = 0x00000004,
170 regk_rt_trace_wrsreg = 0x00000006,
171 regk_rt_trace_yes = 0x00000001
172};
173#endif /* __rt_trace_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/ser_defs.h b/include/asm-cris/arch-v32/hwregs/ser_defs.h
new file mode 100644
index 000000000000..01c2fab97d43
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/ser_defs.h
@@ -0,0 +1,308 @@
1#ifndef __ser_defs_h
2#define __ser_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/ser/rtl/ser_regs.r
7 * id: ser_regs.r,v 1.23 2005/02/08 13:58:35 perz Exp
8 * last modfied: Mon Apr 11 16:09:21 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile ser_defs.h ../../inst/ser/rtl/ser_regs.r
11 * id: $Id: ser_defs.h,v 1.10 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope ser */
86
87/* Register rw_tr_ctrl, scope ser, type rw */
88typedef struct {
89 unsigned int base_freq : 3;
90 unsigned int en : 1;
91 unsigned int par : 2;
92 unsigned int par_en : 1;
93 unsigned int data_bits : 1;
94 unsigned int stop_bits : 1;
95 unsigned int stop : 1;
96 unsigned int rts_delay : 3;
97 unsigned int rts_setup : 1;
98 unsigned int auto_rts : 1;
99 unsigned int txd : 1;
100 unsigned int auto_cts : 1;
101 unsigned int dummy1 : 15;
102} reg_ser_rw_tr_ctrl;
103#define REG_RD_ADDR_ser_rw_tr_ctrl 0
104#define REG_WR_ADDR_ser_rw_tr_ctrl 0
105
106/* Register rw_tr_dma_en, scope ser, type rw */
107typedef struct {
108 unsigned int en : 1;
109 unsigned int dummy1 : 31;
110} reg_ser_rw_tr_dma_en;
111#define REG_RD_ADDR_ser_rw_tr_dma_en 4
112#define REG_WR_ADDR_ser_rw_tr_dma_en 4
113
114/* Register rw_rec_ctrl, scope ser, type rw */
115typedef struct {
116 unsigned int base_freq : 3;
117 unsigned int en : 1;
118 unsigned int par : 2;
119 unsigned int par_en : 1;
120 unsigned int data_bits : 1;
121 unsigned int dma_mode : 1;
122 unsigned int dma_err : 1;
123 unsigned int sampling : 1;
124 unsigned int timeout : 3;
125 unsigned int auto_eop : 1;
126 unsigned int half_duplex : 1;
127 unsigned int rts_n : 1;
128 unsigned int loopback : 1;
129 unsigned int dummy1 : 14;
130} reg_ser_rw_rec_ctrl;
131#define REG_RD_ADDR_ser_rw_rec_ctrl 8
132#define REG_WR_ADDR_ser_rw_rec_ctrl 8
133
134/* Register rw_tr_baud_div, scope ser, type rw */
135typedef struct {
136 unsigned int div : 16;
137 unsigned int dummy1 : 16;
138} reg_ser_rw_tr_baud_div;
139#define REG_RD_ADDR_ser_rw_tr_baud_div 12
140#define REG_WR_ADDR_ser_rw_tr_baud_div 12
141
142/* Register rw_rec_baud_div, scope ser, type rw */
143typedef struct {
144 unsigned int div : 16;
145 unsigned int dummy1 : 16;
146} reg_ser_rw_rec_baud_div;
147#define REG_RD_ADDR_ser_rw_rec_baud_div 16
148#define REG_WR_ADDR_ser_rw_rec_baud_div 16
149
150/* Register rw_xoff, scope ser, type rw */
151typedef struct {
152 unsigned int chr : 8;
153 unsigned int automatic : 1;
154 unsigned int dummy1 : 23;
155} reg_ser_rw_xoff;
156#define REG_RD_ADDR_ser_rw_xoff 20
157#define REG_WR_ADDR_ser_rw_xoff 20
158
159/* Register rw_xoff_clr, scope ser, type rw */
160typedef struct {
161 unsigned int clr : 1;
162 unsigned int dummy1 : 31;
163} reg_ser_rw_xoff_clr;
164#define REG_RD_ADDR_ser_rw_xoff_clr 24
165#define REG_WR_ADDR_ser_rw_xoff_clr 24
166
167/* Register rw_dout, scope ser, type rw */
168typedef struct {
169 unsigned int data : 8;
170 unsigned int dummy1 : 24;
171} reg_ser_rw_dout;
172#define REG_RD_ADDR_ser_rw_dout 28
173#define REG_WR_ADDR_ser_rw_dout 28
174
175/* Register rs_stat_din, scope ser, type rs */
176typedef struct {
177 unsigned int data : 8;
178 unsigned int dummy1 : 8;
179 unsigned int dav : 1;
180 unsigned int framing_err : 1;
181 unsigned int par_err : 1;
182 unsigned int orun : 1;
183 unsigned int rec_err : 1;
184 unsigned int rxd : 1;
185 unsigned int tr_idle : 1;
186 unsigned int tr_empty : 1;
187 unsigned int tr_rdy : 1;
188 unsigned int cts_n : 1;
189 unsigned int xoff_detect : 1;
190 unsigned int rts_n : 1;
191 unsigned int txd : 1;
192 unsigned int dummy2 : 3;
193} reg_ser_rs_stat_din;
194#define REG_RD_ADDR_ser_rs_stat_din 32
195
196/* Register r_stat_din, scope ser, type r */
197typedef struct {
198 unsigned int data : 8;
199 unsigned int dummy1 : 8;
200 unsigned int dav : 1;
201 unsigned int framing_err : 1;
202 unsigned int par_err : 1;
203 unsigned int orun : 1;
204 unsigned int rec_err : 1;
205 unsigned int rxd : 1;
206 unsigned int tr_idle : 1;
207 unsigned int tr_empty : 1;
208 unsigned int tr_rdy : 1;
209 unsigned int cts_n : 1;
210 unsigned int xoff_detect : 1;
211 unsigned int rts_n : 1;
212 unsigned int txd : 1;
213 unsigned int dummy2 : 3;
214} reg_ser_r_stat_din;
215#define REG_RD_ADDR_ser_r_stat_din 36
216
217/* Register rw_rec_eop, scope ser, type rw */
218typedef struct {
219 unsigned int set : 1;
220 unsigned int dummy1 : 31;
221} reg_ser_rw_rec_eop;
222#define REG_RD_ADDR_ser_rw_rec_eop 40
223#define REG_WR_ADDR_ser_rw_rec_eop 40
224
225/* Register rw_intr_mask, scope ser, type rw */
226typedef struct {
227 unsigned int tr_rdy : 1;
228 unsigned int tr_empty : 1;
229 unsigned int tr_idle : 1;
230 unsigned int dav : 1;
231 unsigned int dummy1 : 28;
232} reg_ser_rw_intr_mask;
233#define REG_RD_ADDR_ser_rw_intr_mask 44
234#define REG_WR_ADDR_ser_rw_intr_mask 44
235
236/* Register rw_ack_intr, scope ser, type rw */
237typedef struct {
238 unsigned int tr_rdy : 1;
239 unsigned int tr_empty : 1;
240 unsigned int tr_idle : 1;
241 unsigned int dav : 1;
242 unsigned int dummy1 : 28;
243} reg_ser_rw_ack_intr;
244#define REG_RD_ADDR_ser_rw_ack_intr 48
245#define REG_WR_ADDR_ser_rw_ack_intr 48
246
247/* Register r_intr, scope ser, type r */
248typedef struct {
249 unsigned int tr_rdy : 1;
250 unsigned int tr_empty : 1;
251 unsigned int tr_idle : 1;
252 unsigned int dav : 1;
253 unsigned int dummy1 : 28;
254} reg_ser_r_intr;
255#define REG_RD_ADDR_ser_r_intr 52
256
257/* Register r_masked_intr, scope ser, type r */
258typedef struct {
259 unsigned int tr_rdy : 1;
260 unsigned int tr_empty : 1;
261 unsigned int tr_idle : 1;
262 unsigned int dav : 1;
263 unsigned int dummy1 : 28;
264} reg_ser_r_masked_intr;
265#define REG_RD_ADDR_ser_r_masked_intr 56
266
267
268/* Constants */
269enum {
270 regk_ser_active = 0x00000000,
271 regk_ser_bits1 = 0x00000000,
272 regk_ser_bits2 = 0x00000001,
273 regk_ser_bits7 = 0x00000001,
274 regk_ser_bits8 = 0x00000000,
275 regk_ser_del0_5 = 0x00000000,
276 regk_ser_del1 = 0x00000001,
277 regk_ser_del1_5 = 0x00000002,
278 regk_ser_del2 = 0x00000003,
279 regk_ser_del2_5 = 0x00000004,
280 regk_ser_del3 = 0x00000005,
281 regk_ser_del3_5 = 0x00000006,
282 regk_ser_del4 = 0x00000007,
283 regk_ser_even = 0x00000000,
284 regk_ser_ext = 0x00000001,
285 regk_ser_f100 = 0x00000007,
286 regk_ser_f29_493 = 0x00000004,
287 regk_ser_f32 = 0x00000005,
288 regk_ser_f32_768 = 0x00000006,
289 regk_ser_ignore = 0x00000001,
290 regk_ser_inactive = 0x00000001,
291 regk_ser_majority = 0x00000001,
292 regk_ser_mark = 0x00000002,
293 regk_ser_middle = 0x00000000,
294 regk_ser_no = 0x00000000,
295 regk_ser_odd = 0x00000001,
296 regk_ser_off = 0x00000000,
297 regk_ser_rw_intr_mask_default = 0x00000000,
298 regk_ser_rw_rec_baud_div_default = 0x00000000,
299 regk_ser_rw_rec_ctrl_default = 0x00010000,
300 regk_ser_rw_tr_baud_div_default = 0x00000000,
301 regk_ser_rw_tr_ctrl_default = 0x00008000,
302 regk_ser_rw_tr_dma_en_default = 0x00000000,
303 regk_ser_rw_xoff_default = 0x00000000,
304 regk_ser_space = 0x00000003,
305 regk_ser_stop = 0x00000000,
306 regk_ser_yes = 0x00000001
307};
308#endif /* __ser_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/sser_defs.h b/include/asm-cris/arch-v32/hwregs/sser_defs.h
new file mode 100644
index 000000000000..8d1dab218b91
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/sser_defs.h
@@ -0,0 +1,331 @@
1#ifndef __sser_defs_h
2#define __sser_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/syncser/rtl/sser_regs.r
7 * id: sser_regs.r,v 1.24 2005/02/11 14:27:36 gunnard Exp
8 * last modfied: Mon Apr 11 16:09:48 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile sser_defs.h ../../inst/syncser/rtl/sser_regs.r
11 * id: $Id: sser_defs.h,v 1.3 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope sser */
86
87/* Register rw_cfg, scope sser, type rw */
88typedef struct {
89 unsigned int clk_div : 16;
90 unsigned int base_freq : 3;
91 unsigned int gate_clk : 1;
92 unsigned int clkgate_ctrl : 1;
93 unsigned int clkgate_in : 1;
94 unsigned int clk_dir : 1;
95 unsigned int clk_od_mode : 1;
96 unsigned int out_clk_pol : 1;
97 unsigned int out_clk_src : 2;
98 unsigned int clk_in_sel : 1;
99 unsigned int hold_pol : 1;
100 unsigned int prepare : 1;
101 unsigned int en : 1;
102 unsigned int dummy1 : 1;
103} reg_sser_rw_cfg;
104#define REG_RD_ADDR_sser_rw_cfg 0
105#define REG_WR_ADDR_sser_rw_cfg 0
106
107/* Register rw_frm_cfg, scope sser, type rw */
108typedef struct {
109 unsigned int wordrate : 10;
110 unsigned int rec_delay : 3;
111 unsigned int tr_delay : 3;
112 unsigned int early_wend : 1;
113 unsigned int level : 2;
114 unsigned int type : 1;
115 unsigned int clk_pol : 1;
116 unsigned int fr_in_rxclk : 1;
117 unsigned int clk_src : 1;
118 unsigned int out_off : 1;
119 unsigned int out_on : 1;
120 unsigned int frame_pin_dir : 1;
121 unsigned int frame_pin_use : 2;
122 unsigned int status_pin_dir : 1;
123 unsigned int status_pin_use : 2;
124 unsigned int dummy1 : 1;
125} reg_sser_rw_frm_cfg;
126#define REG_RD_ADDR_sser_rw_frm_cfg 4
127#define REG_WR_ADDR_sser_rw_frm_cfg 4
128
129/* Register rw_tr_cfg, scope sser, type rw */
130typedef struct {
131 unsigned int tr_en : 1;
132 unsigned int stop : 1;
133 unsigned int urun_stop : 1;
134 unsigned int eop_stop : 1;
135 unsigned int sample_size : 6;
136 unsigned int sh_dir : 1;
137 unsigned int clk_pol : 1;
138 unsigned int clk_src : 1;
139 unsigned int use_dma : 1;
140 unsigned int mode : 2;
141 unsigned int frm_src : 1;
142 unsigned int use60958 : 1;
143 unsigned int iec60958_ckdiv : 2;
144 unsigned int rate_ctrl : 1;
145 unsigned int use_md : 1;
146 unsigned int dual_i2s : 1;
147 unsigned int data_pin_use : 2;
148 unsigned int od_mode : 1;
149 unsigned int bulk_wspace : 2;
150 unsigned int dummy1 : 4;
151} reg_sser_rw_tr_cfg;
152#define REG_RD_ADDR_sser_rw_tr_cfg 8
153#define REG_WR_ADDR_sser_rw_tr_cfg 8
154
155/* Register rw_rec_cfg, scope sser, type rw */
156typedef struct {
157 unsigned int rec_en : 1;
158 unsigned int force_eop : 1;
159 unsigned int stop : 1;
160 unsigned int orun_stop : 1;
161 unsigned int eop_stop : 1;
162 unsigned int sample_size : 6;
163 unsigned int sh_dir : 1;
164 unsigned int clk_pol : 1;
165 unsigned int clk_src : 1;
166 unsigned int use_dma : 1;
167 unsigned int mode : 2;
168 unsigned int frm_src : 2;
169 unsigned int use60958 : 1;
170 unsigned int iec60958_ui_len : 5;
171 unsigned int slave2_en : 1;
172 unsigned int slave3_en : 1;
173 unsigned int fifo_thr : 2;
174 unsigned int dummy1 : 3;
175} reg_sser_rw_rec_cfg;
176#define REG_RD_ADDR_sser_rw_rec_cfg 12
177#define REG_WR_ADDR_sser_rw_rec_cfg 12
178
179/* Register rw_tr_data, scope sser, type rw */
180typedef struct {
181 unsigned int data : 16;
182 unsigned int md : 1;
183 unsigned int dummy1 : 15;
184} reg_sser_rw_tr_data;
185#define REG_RD_ADDR_sser_rw_tr_data 16
186#define REG_WR_ADDR_sser_rw_tr_data 16
187
188/* Register r_rec_data, scope sser, type r */
189typedef struct {
190 unsigned int data : 16;
191 unsigned int md : 1;
192 unsigned int ext_clk : 1;
193 unsigned int status_in : 1;
194 unsigned int frame_in : 1;
195 unsigned int din : 1;
196 unsigned int data_in : 1;
197 unsigned int clk_in : 1;
198 unsigned int dummy1 : 9;
199} reg_sser_r_rec_data;
200#define REG_RD_ADDR_sser_r_rec_data 20
201
202/* Register rw_extra, scope sser, type rw */
203typedef struct {
204 unsigned int clkoff_cycles : 20;
205 unsigned int clkoff_en : 1;
206 unsigned int clkon_en : 1;
207 unsigned int dout_delay : 5;
208 unsigned int dummy1 : 5;
209} reg_sser_rw_extra;
210#define REG_RD_ADDR_sser_rw_extra 24
211#define REG_WR_ADDR_sser_rw_extra 24
212
213/* Register rw_intr_mask, scope sser, type rw */
214typedef struct {
215 unsigned int trdy : 1;
216 unsigned int rdav : 1;
217 unsigned int tidle : 1;
218 unsigned int rstop : 1;
219 unsigned int urun : 1;
220 unsigned int orun : 1;
221 unsigned int md_rec : 1;
222 unsigned int md_sent : 1;
223 unsigned int r958err : 1;
224 unsigned int dummy1 : 23;
225} reg_sser_rw_intr_mask;
226#define REG_RD_ADDR_sser_rw_intr_mask 28
227#define REG_WR_ADDR_sser_rw_intr_mask 28
228
229/* Register rw_ack_intr, scope sser, type rw */
230typedef struct {
231 unsigned int trdy : 1;
232 unsigned int rdav : 1;
233 unsigned int tidle : 1;
234 unsigned int rstop : 1;
235 unsigned int urun : 1;
236 unsigned int orun : 1;
237 unsigned int md_rec : 1;
238 unsigned int md_sent : 1;
239 unsigned int r958err : 1;
240 unsigned int dummy1 : 23;
241} reg_sser_rw_ack_intr;
242#define REG_RD_ADDR_sser_rw_ack_intr 32
243#define REG_WR_ADDR_sser_rw_ack_intr 32
244
245/* Register r_intr, scope sser, type r */
246typedef struct {
247 unsigned int trdy : 1;
248 unsigned int rdav : 1;
249 unsigned int tidle : 1;
250 unsigned int rstop : 1;
251 unsigned int urun : 1;
252 unsigned int orun : 1;
253 unsigned int md_rec : 1;
254 unsigned int md_sent : 1;
255 unsigned int r958err : 1;
256 unsigned int dummy1 : 23;
257} reg_sser_r_intr;
258#define REG_RD_ADDR_sser_r_intr 36
259
260/* Register r_masked_intr, scope sser, type r */
261typedef struct {
262 unsigned int trdy : 1;
263 unsigned int rdav : 1;
264 unsigned int tidle : 1;
265 unsigned int rstop : 1;
266 unsigned int urun : 1;
267 unsigned int orun : 1;
268 unsigned int md_rec : 1;
269 unsigned int md_sent : 1;
270 unsigned int r958err : 1;
271 unsigned int dummy1 : 23;
272} reg_sser_r_masked_intr;
273#define REG_RD_ADDR_sser_r_masked_intr 40
274
275
276/* Constants */
277enum {
278 regk_sser_both = 0x00000002,
279 regk_sser_bulk = 0x00000001,
280 regk_sser_clk100 = 0x00000000,
281 regk_sser_clk_in = 0x00000000,
282 regk_sser_const0 = 0x00000003,
283 regk_sser_dout = 0x00000002,
284 regk_sser_edge = 0x00000000,
285 regk_sser_ext = 0x00000001,
286 regk_sser_ext_clk = 0x00000001,
287 regk_sser_f100 = 0x00000000,
288 regk_sser_f29_493 = 0x00000004,
289 regk_sser_f32 = 0x00000005,
290 regk_sser_f32_768 = 0x00000006,
291 regk_sser_frm = 0x00000003,
292 regk_sser_gio0 = 0x00000000,
293 regk_sser_gio1 = 0x00000001,
294 regk_sser_hispeed = 0x00000001,
295 regk_sser_hold = 0x00000002,
296 regk_sser_in = 0x00000000,
297 regk_sser_inf = 0x00000003,
298 regk_sser_intern = 0x00000000,
299 regk_sser_intern_clk = 0x00000001,
300 regk_sser_intern_tb = 0x00000000,
301 regk_sser_iso = 0x00000000,
302 regk_sser_level = 0x00000001,
303 regk_sser_lospeed = 0x00000000,
304 regk_sser_lsbfirst = 0x00000000,
305 regk_sser_msbfirst = 0x00000001,
306 regk_sser_neg = 0x00000001,
307 regk_sser_neg_lo = 0x00000000,
308 regk_sser_no = 0x00000000,
309 regk_sser_no_clk = 0x00000007,
310 regk_sser_nojitter = 0x00000002,
311 regk_sser_out = 0x00000001,
312 regk_sser_pos = 0x00000000,
313 regk_sser_pos_hi = 0x00000001,
314 regk_sser_rec = 0x00000000,
315 regk_sser_rw_cfg_default = 0x00000000,
316 regk_sser_rw_extra_default = 0x00000000,
317 regk_sser_rw_frm_cfg_default = 0x00000000,
318 regk_sser_rw_intr_mask_default = 0x00000000,
319 regk_sser_rw_rec_cfg_default = 0x00000000,
320 regk_sser_rw_tr_cfg_default = 0x01800000,
321 regk_sser_rw_tr_data_default = 0x00000000,
322 regk_sser_thr16 = 0x00000001,
323 regk_sser_thr32 = 0x00000002,
324 regk_sser_thr8 = 0x00000000,
325 regk_sser_tr = 0x00000001,
326 regk_sser_ts_out = 0x00000003,
327 regk_sser_tx_bulk = 0x00000002,
328 regk_sser_wiresave = 0x00000002,
329 regk_sser_yes = 0x00000001
330};
331#endif /* __sser_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/strcop.h b/include/asm-cris/arch-v32/hwregs/strcop.h
new file mode 100644
index 000000000000..35131ba466f3
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/strcop.h
@@ -0,0 +1,57 @@
1// $Id: strcop.h,v 1.3 2003/10/22 13:27:12 henriken Exp $
2
3// Streamcop meta-data configuration structs
4
5struct strcop_meta_out {
6 unsigned char csumsel : 3;
7 unsigned char ciphsel : 3;
8 unsigned char ciphconf : 2;
9 unsigned char hashsel : 3;
10 unsigned char hashconf : 1;
11 unsigned char hashmode : 1;
12 unsigned char decrypt : 1;
13 unsigned char dlkey : 1;
14 unsigned char cbcmode : 1;
15};
16
17struct strcop_meta_in {
18 unsigned char dmasel : 3;
19 unsigned char sync : 1;
20 unsigned char res1 : 5;
21 unsigned char res2;
22};
23
24// Source definitions
25
26enum {
27 src_none = 0,
28 src_dma = 1,
29 src_des = 2,
30 src_sha1 = 3,
31 src_csum = 4,
32 src_aes = 5,
33 src_md5 = 6,
34 src_res = 7
35};
36
37// Cipher definitions
38
39enum {
40 ciph_des = 0,
41 ciph_3des = 1,
42 ciph_aes = 2
43};
44
45// Hash definitions
46
47enum {
48 hash_sha1 = 0,
49 hash_md5 = 1
50};
51
52enum {
53 hash_noiv = 0,
54 hash_iv = 1
55};
56
57
diff --git a/include/asm-cris/arch-v32/hwregs/strcop_defs.h b/include/asm-cris/arch-v32/hwregs/strcop_defs.h
new file mode 100644
index 000000000000..bd145a49b2c4
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/strcop_defs.h
@@ -0,0 +1,109 @@
1#ifndef __strcop_defs_h
2#define __strcop_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/strcop/rtl/strcop_regs.r
7 * id: strcop_regs.r,v 1.5 2003/10/15 12:09:45 kriskn Exp
8 * last modfied: Mon Apr 11 16:09:38 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile strcop_defs.h ../../inst/strcop/rtl/strcop_regs.r
11 * id: $Id: strcop_defs.h,v 1.7 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope strcop */
86
87/* Register rw_cfg, scope strcop, type rw */
88typedef struct {
89 unsigned int td3 : 1;
90 unsigned int td2 : 1;
91 unsigned int td1 : 1;
92 unsigned int ipend : 1;
93 unsigned int ignore_sync : 1;
94 unsigned int en : 1;
95 unsigned int dummy1 : 26;
96} reg_strcop_rw_cfg;
97#define REG_RD_ADDR_strcop_rw_cfg 0
98#define REG_WR_ADDR_strcop_rw_cfg 0
99
100
101/* Constants */
102enum {
103 regk_strcop_big = 0x00000001,
104 regk_strcop_d = 0x00000001,
105 regk_strcop_e = 0x00000000,
106 regk_strcop_little = 0x00000000,
107 regk_strcop_rw_cfg_default = 0x00000002
108};
109#endif /* __strcop_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/strmux_defs.h b/include/asm-cris/arch-v32/hwregs/strmux_defs.h
new file mode 100644
index 000000000000..67474855c499
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/strmux_defs.h
@@ -0,0 +1,127 @@
1#ifndef __strmux_defs_h
2#define __strmux_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/strmux/rtl/guinness/strmux_regs.r
7 * id: strmux_regs.r,v 1.10 2005/02/10 10:10:46 perz Exp
8 * last modfied: Mon Apr 11 16:09:43 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile strmux_defs.h ../../inst/strmux/rtl/guinness/strmux_regs.r
11 * id: $Id: strmux_defs.h,v 1.5 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope strmux */
86
87/* Register rw_cfg, scope strmux, type rw */
88typedef struct {
89 unsigned int dma0 : 3;
90 unsigned int dma1 : 3;
91 unsigned int dma2 : 3;
92 unsigned int dma3 : 3;
93 unsigned int dma4 : 3;
94 unsigned int dma5 : 3;
95 unsigned int dma6 : 3;
96 unsigned int dma7 : 3;
97 unsigned int dma8 : 3;
98 unsigned int dma9 : 3;
99 unsigned int dummy1 : 2;
100} reg_strmux_rw_cfg;
101#define REG_RD_ADDR_strmux_rw_cfg 0
102#define REG_WR_ADDR_strmux_rw_cfg 0
103
104
105/* Constants */
106enum {
107 regk_strmux_ata = 0x00000003,
108 regk_strmux_eth0 = 0x00000001,
109 regk_strmux_eth1 = 0x00000004,
110 regk_strmux_ext0 = 0x00000001,
111 regk_strmux_ext1 = 0x00000001,
112 regk_strmux_ext2 = 0x00000001,
113 regk_strmux_ext3 = 0x00000001,
114 regk_strmux_iop0 = 0x00000002,
115 regk_strmux_iop1 = 0x00000001,
116 regk_strmux_off = 0x00000000,
117 regk_strmux_p21 = 0x00000004,
118 regk_strmux_rw_cfg_default = 0x00000000,
119 regk_strmux_ser0 = 0x00000002,
120 regk_strmux_ser1 = 0x00000002,
121 regk_strmux_ser2 = 0x00000004,
122 regk_strmux_ser3 = 0x00000003,
123 regk_strmux_sser0 = 0x00000003,
124 regk_strmux_sser1 = 0x00000003,
125 regk_strmux_strcop = 0x00000002
126};
127#endif /* __strmux_defs_h */
diff --git a/include/asm-cris/arch-v32/hwregs/supp_reg.h b/include/asm-cris/arch-v32/hwregs/supp_reg.h
new file mode 100644
index 000000000000..ffe49625ae36
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/supp_reg.h
@@ -0,0 +1,78 @@
1#ifndef __SUPP_REG_H__
2#define __SUPP_REG_H__
3
4/* Macros for reading and writing support/special registers. */
5
6#ifndef STRINGIFYFY
7#define STRINGIFYFY(i) #i
8#endif
9
10#ifndef STRINGIFY
11#define STRINGIFY(i) STRINGIFYFY(i)
12#endif
13
14#define SPEC_REG_BZ "BZ"
15#define SPEC_REG_VR "VR"
16#define SPEC_REG_PID "PID"
17#define SPEC_REG_SRS "SRS"
18#define SPEC_REG_WZ "WZ"
19#define SPEC_REG_EXS "EXS"
20#define SPEC_REG_EDA "EDA"
21#define SPEC_REG_MOF "MOF"
22#define SPEC_REG_DZ "DZ"
23#define SPEC_REG_EBP "EBP"
24#define SPEC_REG_ERP "ERP"
25#define SPEC_REG_SRP "SRP"
26#define SPEC_REG_NRP "NRP"
27#define SPEC_REG_CCS "CCS"
28#define SPEC_REG_USP "USP"
29#define SPEC_REG_SPC "SPC"
30
31#define RW_MM_CFG 0
32#define RW_MM_KBASE_LO 1
33#define RW_MM_KBASE_HI 2
34#define RW_MM_CAUSE 3
35#define RW_MM_TLB_SEL 4
36#define RW_MM_TLB_LO 5
37#define RW_MM_TLB_HI 6
38#define RW_MM_TLB_PGD 7
39
40#define BANK_GC 0
41#define BANK_IM 1
42#define BANK_DM 2
43#define BANK_BP 3
44
45#define RW_GC_CFG 0
46#define RW_GC_CCS 1
47#define RW_GC_SRS 2
48#define RW_GC_NRP 3
49#define RW_GC_EXS 4
50#define RW_GC_R0 8
51#define RW_GC_R1 9
52
53#define SPEC_REG_WR(r,v) \
54__asm__ __volatile__ ("move %0, $" r : : "r" (v));
55
56#define SPEC_REG_RD(r,v) \
57__asm__ __volatile__ ("move $" r ",%0" : "=r" (v));
58
59#define NOP() \
60 __asm__ __volatile__ ("nop");
61
62#define SUPP_BANK_SEL(b) \
63 SPEC_REG_WR(SPEC_REG_SRS,b); \
64 NOP(); \
65 NOP(); \
66 NOP();
67
68#define SUPP_REG_WR(r,v) \
69__asm__ __volatile__ ("move %0, $S" STRINGIFYFY(r) "\n\t" \
70 "nop\n\t" \
71 "nop\n\t" \
72 "nop\n\t" \
73 : : "r" (v));
74
75#define SUPP_REG_RD(r,v) \
76__asm__ __volatile__ ("move $S" STRINGIFYFY(r) ",%0" : "=r" (v));
77
78#endif /* __SUPP_REG_H__ */
diff --git a/include/asm-cris/arch-v32/hwregs/timer_defs.h b/include/asm-cris/arch-v32/hwregs/timer_defs.h
new file mode 100644
index 000000000000..20c8c89ec076
--- /dev/null
+++ b/include/asm-cris/arch-v32/hwregs/timer_defs.h
@@ -0,0 +1,266 @@
1#ifndef __timer_defs_h
2#define __timer_defs_h
3
4/*
5 * This file is autogenerated from
6 * file: ../../inst/timer/rtl/timer_regs.r
7 * id: timer_regs.r,v 1.7 2003/03/11 11:16:59 perz Exp
8 * last modfied: Mon Apr 11 16:09:53 2005
9 *
10 * by /n/asic/design/tools/rdesc/src/rdes2c --outfile timer_defs.h ../../inst/timer/rtl/timer_regs.r
11 * id: $Id: timer_defs.h,v 1.6 2005/04/24 18:30:58 starvik Exp $
12 * Any changes here will be lost.
13 *
14 * -*- buffer-read-only: t -*-
15 */
16/* Main access macros */
17#ifndef REG_RD
18#define REG_RD( scope, inst, reg ) \
19 REG_READ( reg_##scope##_##reg, \
20 (inst) + REG_RD_ADDR_##scope##_##reg )
21#endif
22
23#ifndef REG_WR
24#define REG_WR( scope, inst, reg, val ) \
25 REG_WRITE( reg_##scope##_##reg, \
26 (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
27#endif
28
29#ifndef REG_RD_VECT
30#define REG_RD_VECT( scope, inst, reg, index ) \
31 REG_READ( reg_##scope##_##reg, \
32 (inst) + REG_RD_ADDR_##scope##_##reg + \
33 (index) * STRIDE_##scope##_##reg )
34#endif
35
36#ifndef REG_WR_VECT
37#define REG_WR_VECT( scope, inst, reg, index, val ) \
38 REG_WRITE( reg_##scope##_##reg, \
39 (inst) + REG_WR_ADDR_##scope##_##reg + \
40 (index) * STRIDE_##scope##_##reg, (val) )
41#endif
42
43#ifndef REG_RD_INT
44#define REG_RD_INT( scope, inst, reg ) \
45 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
46#endif
47
48#ifndef REG_WR_INT
49#define REG_WR_INT( scope, inst, reg, val ) \
50 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
51#endif
52
53#ifndef REG_RD_INT_VECT
54#define REG_RD_INT_VECT( scope, inst, reg, index ) \
55 REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
56 (index) * STRIDE_##scope##_##reg )
57#endif
58
59#ifndef REG_WR_INT_VECT
60#define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
61 REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
62 (index) * STRIDE_##scope##_##reg, (val) )
63#endif
64
65#ifndef REG_TYPE_CONV
66#define REG_TYPE_CONV( type, orgtype, val ) \
67 ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
68#endif
69
70#ifndef reg_page_size
71#define reg_page_size 8192
72#endif
73
74#ifndef REG_ADDR
75#define REG_ADDR( scope, inst, reg ) \
76 ( (inst) + REG_RD_ADDR_##scope##_##reg )
77#endif
78
79#ifndef REG_ADDR_VECT
80#define REG_ADDR_VECT( scope, inst, reg, index ) \
81 ( (inst) + REG_RD_ADDR_##scope##_##reg + \
82 (index) * STRIDE_##scope##_##reg )
83#endif
84
85/* C-code for register scope timer */
86
87/* Register rw_tmr0_div, scope timer, type rw */
88typedef unsigned int reg_timer_rw_tmr0_div;
89#define REG_RD_ADDR_timer_rw_tmr0_div 0
90#define REG_WR_ADDR_timer_rw_tmr0_div 0
91
92/* Register r_tmr0_data, scope timer, type r */
93typedef unsigned int reg_timer_r_tmr0_data;
94#define REG_RD_ADDR_timer_r_tmr0_data 4
95
96/* Register rw_tmr0_ctrl, scope timer, type rw */
97typedef struct {
98 unsigned int op : 2;
99 unsigned int freq : 3;
100 unsigned int dummy1 : 27;
101} reg_timer_rw_tmr0_ctrl;
102#define REG_RD_ADDR_timer_rw_tmr0_ctrl 8
103#define REG_WR_ADDR_timer_rw_tmr0_ctrl 8
104
105/* Register rw_tmr1_div, scope timer, type rw */
106typedef unsigned int reg_timer_rw_tmr1_div;
107#define REG_RD_ADDR_timer_rw_tmr1_div 16
108#define REG_WR_ADDR_timer_rw_tmr1_div 16
109
110/* Register r_tmr1_data, scope timer, type r */
111typedef unsigned int reg_timer_r_tmr1_data;
112#define REG_RD_ADDR_timer_r_tmr1_data 20
113
114/* Register rw_tmr1_ctrl, scope timer, type rw */
115typedef struct {
116 unsigned int op : 2;
117 unsigned int freq : 3;
118 unsigned int dummy1 : 27;
119} reg_timer_rw_tmr1_ctrl;
120#define REG_RD_ADDR_timer_rw_tmr1_ctrl 24
121#define REG_WR_ADDR_timer_rw_tmr1_ctrl 24
122
123/* Register rs_cnt_data, scope timer, type rs */
124typedef struct {
125 unsigned int tmr : 24;
126 unsigned int cnt : 8;
127} reg_timer_rs_cnt_data;
128#define REG_RD_ADDR_timer_rs_cnt_data 32
129
130/* Register r_cnt_data, scope timer, type r */
131typedef struct {
132 unsigned int tmr : 24;
133 unsigned int cnt : 8;
134} reg_timer_r_cnt_data;
135#define REG_RD_ADDR_timer_r_cnt_data 36
136
137/* Register rw_cnt_cfg, scope timer, type rw */
138typedef struct {
139 unsigned int clk : 2;
140 unsigned int dummy1 : 30;
141} reg_timer_rw_cnt_cfg;
142#define REG_RD_ADDR_timer_rw_cnt_cfg 40
143#define REG_WR_ADDR_timer_rw_cnt_cfg 40
144
145/* Register rw_trig, scope timer, type rw */
146typedef unsigned int reg_timer_rw_trig;
147#define REG_RD_ADDR_timer_rw_trig 48
148#define REG_WR_ADDR_timer_rw_trig 48
149
150/* Register rw_trig_cfg, scope timer, type rw */
151typedef struct {
152 unsigned int tmr : 2;
153 unsigned int dummy1 : 30;
154} reg_timer_rw_trig_cfg;
155#define REG_RD_ADDR_timer_rw_trig_cfg 52
156#define REG_WR_ADDR_timer_rw_trig_cfg 52
157
158/* Register r_time, scope timer, type r */
159typedef unsigned int reg_timer_r_time;
160#define REG_RD_ADDR_timer_r_time 56
161
162/* Register rw_out, scope timer, type rw */
163typedef struct {
164 unsigned int tmr : 2;
165 unsigned int dummy1 : 30;
166} reg_timer_rw_out;
167#define REG_RD_ADDR_timer_rw_out 60
168#define REG_WR_ADDR_timer_rw_out 60
169
170/* Register rw_wd_ctrl, scope timer, type rw */
171typedef struct {
172 unsigned int cnt : 8;
173 unsigned int cmd : 1;
174 unsigned int key : 7;
175 unsigned int dummy1 : 16;
176} reg_timer_rw_wd_ctrl;
177#define REG_RD_ADDR_timer_rw_wd_ctrl 64
178#define REG_WR_ADDR_timer_rw_wd_ctrl 64
179
180/* Register r_wd_stat, scope timer, type r */
181typedef struct {
182 unsigned int cnt : 8;
183 unsigned int cmd : 1;
184 unsigned int dummy1 : 23;
185} reg_timer_r_wd_stat;
186#define REG_RD_ADDR_timer_r_wd_stat 68
187
188/* Register rw_intr_mask, scope timer, type rw */
189typedef struct {
190 unsigned int tmr0 : 1;
191 unsigned int tmr1 : 1;
192 unsigned int cnt : 1;
193 unsigned int trig : 1;
194 unsigned int dummy1 : 28;
195} reg_timer_rw_intr_mask;
196#define REG_RD_ADDR_timer_rw_intr_mask 72
197#define REG_WR_ADDR_timer_rw_intr_mask 72
198
199/* Register rw_ack_intr, scope timer, type rw */
200typedef struct {
201 unsigned int tmr0 : 1;
202 unsigned int tmr1 : 1;
203 unsigned int cnt : 1;
204 unsigned int trig : 1;
205 unsigned int dummy1 : 28;
206} reg_timer_rw_ack_intr;
207#define REG_RD_ADDR_timer_rw_ack_intr 76
208#define REG_WR_ADDR_timer_rw_ack_intr 76
209
210/* Register r_intr, scope timer, type r */
211typedef struct {
212 unsigned int tmr0 : 1;
213 unsigned int tmr1 : 1;
214 unsigned int cnt : 1;
215 unsigned int trig : 1;
216 unsigned int dummy1 : 28;
217} reg_timer_r_intr;
218#define REG_RD_ADDR_timer_r_intr 80
219
220/* Register r_masked_intr, scope timer, type r */
221typedef struct {
222 unsigned int tmr0 : 1;
223 unsigned int tmr1 : 1;
224 unsigned int cnt : 1;
225 unsigned int trig : 1;
226 unsigned int dummy1 : 28;
227} reg_timer_r_masked_intr;
228#define REG_RD_ADDR_timer_r_masked_intr 84
229
230/* Register rw_test, scope timer, type rw */
231typedef struct {
232 unsigned int dis : 1;
233 unsigned int en : 1;
234 unsigned int dummy1 : 30;
235} reg_timer_rw_test;
236#define REG_RD_ADDR_timer_rw_test 88
237#define REG_WR_ADDR_timer_rw_test 88
238
239
240/* Constants */
241enum {
242 regk_timer_ext = 0x00000001,
243 regk_timer_f100 = 0x00000007,
244 regk_timer_f29_493 = 0x00000004,
245 regk_timer_f32 = 0x00000005,
246 regk_timer_f32_768 = 0x00000006,
247 regk_timer_hold = 0x00000001,
248 regk_timer_ld = 0x00000000,
249 regk_timer_no = 0x00000000,
250 regk_timer_off = 0x00000000,
251 regk_timer_run = 0x00000002,
252 regk_timer_rw_cnt_cfg_default = 0x00000000,
253 regk_timer_rw_intr_mask_default = 0x00000000,
254 regk_timer_rw_out_default = 0x00000000,
255 regk_timer_rw_test_default = 0x00000000,
256 regk_timer_rw_tmr0_ctrl_default = 0x00000000,
257 regk_timer_rw_tmr1_ctrl_default = 0x00000000,
258 regk_timer_rw_trig_cfg_default = 0x00000000,
259 regk_timer_start = 0x00000001,
260 regk_timer_stop = 0x00000000,
261 regk_timer_time = 0x00000001,
262 regk_timer_tmr0 = 0x00000002,
263 regk_timer_tmr1 = 0x00000003,
264 regk_timer_yes = 0x00000001
265};
266#endif /* __timer_defs_h */
diff --git a/include/asm-cris/arch-v32/ide.h b/include/asm-cris/arch-v32/ide.h
new file mode 100644
index 000000000000..24f5604f566a
--- /dev/null
+++ b/include/asm-cris/arch-v32/ide.h
@@ -0,0 +1,61 @@
1/*
2 * linux/include/asm-cris/ide.h
3 *
4 * Copyright (C) 2000-2004 Axis Communications AB
5 *
6 * Authors: Bjorn Wesen, Mikael Starvik
7 *
8 */
9
10/*
11 * This file contains the ETRAX FS specific IDE code.
12 */
13
14#ifndef __ASMCRIS_IDE_H
15#define __ASMCRIS_IDE_H
16
17#ifdef __KERNEL__
18
19#include <asm/arch/hwregs/intr_vect.h>
20#include <asm/arch/hwregs/ata_defs.h>
21#include <asm/io.h>
22#include <asm-generic/ide_iops.h>
23
24
25/* ETRAX FS can support 4 IDE busses on the same pins (serialized) */
26
27#define MAX_HWIFS 4
28
29extern __inline__ int ide_default_irq(unsigned long base)
30{
31 /* all IDE busses share the same IRQ,
32 * this has the side-effect that ide-probe.c will cluster our 4 interfaces
33 * together in a hwgroup, and will serialize accesses. this is good, because
34 * we can't access more than one interface at the same time on ETRAX100.
35 */
36 return ATA_INTR_VECT;
37}
38
39extern __inline__ unsigned long ide_default_io_base(int index)
40{
41 reg_ata_rw_ctrl2 ctrl2 = {.sel = index};
42 /* we have no real I/O base address per interface, since all go through the
43 * same register. but in a bitfield in that register, we have the i/f number.
44 * so we can use the io_base to remember that bitfield.
45 */
46 ctrl2.sel = index;
47
48 return REG_TYPE_CONV(unsigned long, reg_ata_rw_ctrl2, ctrl2);
49}
50
51/* some configuration options we don't need */
52
53#undef SUPPORT_VLB_SYNC
54#define SUPPORT_VLB_SYNC 0
55
56#define IDE_ARCH_ACK_INTR
57#define ide_ack_intr(hwif) (hwif)->hw.ack_intr(hwif)
58
59#endif /* __KERNEL__ */
60
61#endif /* __ASMCRIS_IDE_H */
diff --git a/include/asm-cris/arch-v32/intmem.h b/include/asm-cris/arch-v32/intmem.h
new file mode 100644
index 000000000000..c0ada33bf90f
--- /dev/null
+++ b/include/asm-cris/arch-v32/intmem.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_CRIS_INTMEM_H
2#define _ASM_CRIS_INTMEM_H
3
4void* crisv32_intmem_alloc(unsigned size, unsigned align);
5void crisv32_intmem_free(void* addr);
6void* crisv32_intmem_phys_to_virt(unsigned long addr);
7unsigned long crisv32_intmem_virt_to_phys(void *addr);
8
9#endif /* _ASM_CRIS_ARCH_INTMEM_H */
diff --git a/include/asm-cris/arch-v32/io.h b/include/asm-cris/arch-v32/io.h
new file mode 100644
index 000000000000..4c80263ec634
--- /dev/null
+++ b/include/asm-cris/arch-v32/io.h
@@ -0,0 +1,98 @@
1#ifndef _ASM_ARCH_CRIS_IO_H
2#define _ASM_ARCH_CRIS_IO_H
3
4#include <asm/arch/hwregs/reg_map.h>
5#include <asm/arch/hwregs/reg_rdwr.h>
6#include <asm/arch/hwregs/gio_defs.h>
7#include <linux/config.h>
8
9enum crisv32_io_dir
10{
11 crisv32_io_dir_in = 0,
12 crisv32_io_dir_out = 1
13};
14
15struct crisv32_ioport
16{
17 unsigned long* oe;
18 unsigned long* data;
19 unsigned long* data_in;
20 unsigned int pin_count;
21};
22
23struct crisv32_iopin
24{
25 struct crisv32_ioport* port;
26 int bit;
27};
28
29extern struct crisv32_ioport crisv32_ioports[];
30
31extern struct crisv32_iopin crisv32_led1_green;
32extern struct crisv32_iopin crisv32_led1_red;
33extern struct crisv32_iopin crisv32_led2_green;
34extern struct crisv32_iopin crisv32_led2_red;
35extern struct crisv32_iopin crisv32_led3_green;
36extern struct crisv32_iopin crisv32_led3_red;
37
38extern inline void crisv32_io_set(struct crisv32_iopin* iopin,
39 int val)
40{
41 if (val)
42 *iopin->port->data |= iopin->bit;
43 else
44 *iopin->port->data &= ~iopin->bit;
45}
46
47extern inline void crisv32_io_set_dir(struct crisv32_iopin* iopin,
48 enum crisv32_io_dir dir)
49{
50 if (dir == crisv32_io_dir_in)
51 *iopin->port->oe &= ~iopin->bit;
52 else
53 *iopin->port->oe |= iopin->bit;
54}
55
56extern inline int crisv32_io_rd(struct crisv32_iopin* iopin)
57{
58 return ((*iopin->port->data_in & iopin->bit) ? 1 : 0);
59}
60
61int crisv32_io_get(struct crisv32_iopin* iopin,
62 unsigned int port, unsigned int pin);
63int crisv32_io_get_name(struct crisv32_iopin* iopin,
64 char* name);
65
66#define LED_OFF 0x00
67#define LED_GREEN 0x01
68#define LED_RED 0x02
69#define LED_ORANGE (LED_GREEN | LED_RED)
70
71#define LED_NETWORK_SET(x) \
72 do { \
73 LED_NETWORK_SET_G((x) & LED_GREEN); \
74 LED_NETWORK_SET_R((x) & LED_RED); \
75 } while (0)
76#define LED_ACTIVE_SET(x) \
77 do { \
78 LED_ACTIVE_SET_G((x) & LED_GREEN); \
79 LED_ACTIVE_SET_R((x) & LED_RED); \
80 } while (0)
81
82#define LED_NETWORK_SET_G(x) \
83 crisv32_io_set(&crisv32_led1_green, !(x));
84#define LED_NETWORK_SET_R(x) \
85 crisv32_io_set(&crisv32_led1_red, !(x));
86#define LED_ACTIVE_SET_G(x) \
87 crisv32_io_set(&crisv32_led2_green, !(x));
88#define LED_ACTIVE_SET_R(x) \
89 crisv32_io_set(&crisv32_led2_red, !(x));
90#define LED_DISK_WRITE(x) \
91 do{\
92 crisv32_io_set(&crisv32_led3_green, !(x)); \
93 crisv32_io_set(&crisv32_led3_red, !(x)); \
94 }while(0)
95#define LED_DISK_READ(x) \
96 crisv32_io_set(&crisv32_led3_green, !(x));
97
98#endif
diff --git a/include/asm-cris/arch-v32/irq.h b/include/asm-cris/arch-v32/irq.h
new file mode 100644
index 000000000000..d35aa8174c2f
--- /dev/null
+++ b/include/asm-cris/arch-v32/irq.h
@@ -0,0 +1,120 @@
1#ifndef _ASM_ARCH_IRQ_H
2#define _ASM_ARCH_IRQ_H
3
4#include <linux/config.h>
5#include "hwregs/intr_vect.h"
6
7/* Number of non-cpu interrupts. */
8#define NR_IRQS 0x50 /* Exceptions + IRQs */
9#define NR_REAL_IRQS 0x20 /* IRQs */
10#define FIRST_IRQ 0x31 /* Exception number for first IRQ */
11
12#ifndef __ASSEMBLY__
13/* Global IRQ vector. */
14typedef void (*irqvectptr)(void);
15
16struct etrax_interrupt_vector {
17 irqvectptr v[256];
18};
19
20extern struct etrax_interrupt_vector *etrax_irv; /* head.S */
21
22void mask_irq(int irq);
23void unmask_irq(int irq);
24
25void set_exception_vector(int n, irqvectptr addr);
26
27/* Save registers so that they match pt_regs. */
28#define SAVE_ALL \
29 "subq 12,$sp\n\t" \
30 "move $erp,[$sp]\n\t" \
31 "subq 4,$sp\n\t" \
32 "move $srp,[$sp]\n\t" \
33 "subq 4,$sp\n\t" \
34 "move $ccs,[$sp]\n\t" \
35 "subq 4,$sp\n\t" \
36 "move $spc,[$sp]\n\t" \
37 "subq 4,$sp\n\t" \
38 "move $mof,[$sp]\n\t" \
39 "subq 4,$sp\n\t" \
40 "move $srs,[$sp]\n\t" \
41 "subq 4,$sp\n\t" \
42 "move.d $acr,[$sp]\n\t" \
43 "subq 14*4,$sp\n\t" \
44 "movem $r13,[$sp]\n\t" \
45 "subq 4,$sp\n\t" \
46 "move.d $r10,[$sp]\n"
47
48#define STR2(x) #x
49#define STR(x) STR2(x)
50
51#define IRQ_NAME2(nr) nr##_interrupt(void)
52#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
53
54/*
55 * The reason for setting the S-bit when debugging the kernel is that we want
56 * hardware breakpoints to remain active while we are in an exception handler.
57 * Note that we cannot simply copy S1, since we may come here from user-space,
58 * or any context where the S-bit wasn't set.
59 */
60#ifdef CONFIG_ETRAX_KGDB
61#define KGDB_FIXUP \
62 "move $ccs, $r10\n\t" \
63 "or.d (1<<9), $r10\n\t" \
64 "move $r10, $ccs\n\t"
65#else
66#define KGDB_FIXUP ""
67#endif
68
69/*
70 * Make sure the causing IRQ is blocked, then call do_IRQ. After that, unblock
71 * and jump to ret_from_intr which is found in entry.S.
72 *
73 * The reason for blocking the IRQ is to allow an sti() before the handler,
74 * which will acknowledge the interrupt, is run. The actual blocking is made
75 * by crisv32_do_IRQ.
76 */
77#define BUILD_IRQ(nr, mask) \
78void IRQ_NAME(nr); \
79__asm__ ( \
80 ".text\n\t" \
81 "IRQ" #nr "_interrupt:\n\t" \
82 SAVE_ALL \
83 KGDB_FIXUP \
84 "move.d "#nr",$r10\n\t" \
85 "move.d $sp,$r12\n\t" \
86 "jsr crisv32_do_IRQ\n\t" \
87 "moveq 1, $r11\n\t" \
88 "jump ret_from_intr\n\t" \
89 "nop\n\t");
90/*
91 * This is subtle. The timer interrupt is crucial and it should not be disabled
92 * for too long. However, if it had been a normal interrupt as per BUILD_IRQ, it
93 * would have been BLOCK'ed, and then softirq's are run before we return here to
94 * UNBLOCK. If the softirq's take too much time to run, the timer irq won't run
95 * and the watchdog will kill us.
96 *
97 * Furthermore, if a lot of other irq's occur before we return here, the
98 * multiple_irq handler is run and it prioritizes the timer interrupt. However
99 * if we had BLOCK'edit here, we would not get the multiple_irq at all.
100 *
101 * The non-blocking here is based on the knowledge that the timer interrupt is
102 * registred as a fast interrupt (SA_INTERRUPT) so that we _know_ there will not
103 * be an sti() before the timer irq handler is run to acknowledge the interrupt.
104 */
105#define BUILD_TIMER_IRQ(nr, mask) \
106void IRQ_NAME(nr); \
107__asm__ ( \
108 ".text\n\t" \
109 "IRQ" #nr "_interrupt:\n\t" \
110 SAVE_ALL \
111 KGDB_FIXUP \
112 "move.d "#nr",$r10\n\t" \
113 "move.d $sp,$r12\n\t" \
114 "jsr crisv32_do_IRQ\n\t" \
115 "moveq 0,$r11\n\t" \
116 "jump ret_from_intr\n\t" \
117 "nop\n\t");
118
119#endif /* __ASSEMBLY__ */
120#endif /* _ASM_ARCH_IRQ_H */
diff --git a/include/asm-cris/arch-v32/juliette.h b/include/asm-cris/arch-v32/juliette.h
new file mode 100644
index 000000000000..f1f81725e57b
--- /dev/null
+++ b/include/asm-cris/arch-v32/juliette.h
@@ -0,0 +1,326 @@
1#ifndef _ASM_JULIETTE_H
2#define _ASM_JULIETTE_H
3
4/* juliette _IOC_TYPE, bits 8 to 15 in ioctl cmd */
5
6#define JULIOCTYPE 42
7
8/* supported ioctl _IOC_NR's */
9
10#define JULSTARTDMA 0x1 /* start a picture asynchronously */
11
12/* set parameters */
13
14#define SETDEFAULT 0x2 /* CCD/VIDEO/SS1M */
15#define SETPARAMETERS 0x3 /* CCD/VIDEO */
16#define SETSIZE 0x4 /* CCD/VIDEO/SS1M */
17#define SETCOMPRESSION 0x5 /* CCD/VIDEO/SS1M */
18#define SETCOLORLEVEL 0x6 /* CCD/VIDEO */
19#define SETBRIGHTNESS 0x7 /* CCD */
20#define SETROTATION 0x8 /* CCD */
21#define SETTEXT 0x9 /* CCD/VIDEO/SS1M */
22#define SETCLOCK 0xa /* CCD/VIDEO/SS1M */
23#define SETDATE 0xb /* CCD/VIDEO/SS1M */
24#define SETTIMEFORMAT 0xc /* CCD/VIDEO/SS1M */
25#define SETDATEFORMAT 0xd /* VIDEO */
26#define SETTEXTALIGNMENT 0xe /* VIDEO */
27#define SETFPS 0xf /* CCD/VIDEO/SS1M */
28#define SETVGA 0xff /* VIDEO */
29#define SETCOMMENT 0xfe /* CCD/VIDEO */
30
31/* get parameters */
32
33#define GETDRIVERTYPE 0x10 /* CCD/VIDEO/SS1M */
34#define GETNBROFCAMERAS 0x11 /* CCD/VIDEO/SS1M */
35#define GETPARAMETERS 0x12 /* CCD/VIDEO/SS1M */
36#define GETBUFFERSIZE 0x13 /* CCD/VIDEO/SS1M */
37#define GETVIDEOTYPE 0x14 /* VIDEO/SS1M */
38#define GETVIDEOSIGNAL 0x15 /* VIDEO */
39#define GETMODULATION 0x16 /* VIDEO */
40#define GETDCYVALUES 0xa0 /* CCD /SS1M */
41#define GETDCYWIDTH 0xa1 /* CCD /SS1M */
42#define GETDCYHEIGHT 0xa2 /* CCD /SS1M */
43#define GETSIZE 0xa3 /* CCD/VIDEO */
44#define GETCOMPRESSION 0xa4 /* CCD/VIDEO */
45
46/* detect and get parameters */
47
48#define DETECTMODULATION 0x17 /* VIDEO */
49#define DETECTVIDEOTYPE 0x18 /* VIDEO */
50#define DETECTVIDEOSIGNAL 0x19 /* VIDEO */
51
52/* configure default parameters */
53
54#define CONFIGUREDEFAULT 0x20 /* CCD/VIDEO/SS1M */
55#define DEFSIZE 0x21 /* CCD/VIDEO/SS1M */
56#define DEFCOMPRESSION 0x22 /* CCD/VIDEO/SS1M */
57#define DEFCOLORLEVEL 0x23 /* CCD/VIDEO */
58#define DEFBRIGHTNESS 0x24 /* CCD */
59#define DEFROTATION 0x25 /* CCD */
60#define DEFWHITEBALANCE 0x26 /* CCD */
61#define DEFEXPOSURE 0x27 /* CCD */
62#define DEFAUTOEXPWINDOW 0x28 /* CCD */
63#define DEFTEXT 0x29 /* CCD/VIDEO/SS1M */
64#define DEFCLOCK 0x2a /* CCD/VIDEO/SS1M */
65#define DEFDATE 0x2b /* CCD/VIDEO/SS1M */
66#define DEFTIMEFORMAT 0x2c /* CCD/VIDEO/SS1M */
67#define DEFDATEFORMAT 0x2d /* VIDEO */
68#define DEFTEXTALIGNMENT 0x2e /* VIDEO */
69#define DEFFPS 0x2f /* CCD/VIDEO/SS1M */
70#define DEFTEXTSTRING 0x30 /* CCD/VIDEO/SS1M */
71#define DEFHEADERINFO 0x31 /* CCD/VIDEO/SS1M */
72#define DEFWEXAR 0x32 /* CCD */
73#define DEFLINEDELAY 0x33 /* CCD */
74#define DEFDISABLEDVIDEO 0x34 /* VIDEO */
75#define DEFVIDEOTYPE 0x35 /* VIDEO */
76#define DEFMODULATION 0x36 /* VIDEO */
77#define DEFXOFFSET 0x37 /* VIDEO */
78#define DEFYOFFSET 0x38 /* VIDEO */
79#define DEFYCMODE 0x39 /* VIDEO */
80#define DEFVCRMODE 0x3a /* VIDEO */
81#define DEFSTOREDCYVALUES 0x3b /* CCD/VIDEO/SS1M */
82#define DEFWCDS 0x3c /* CCD */
83#define DEFVGA 0x3d /* VIDEO */
84#define DEFCOMMENT 0x3e /* CCD/VIDEO */
85#define DEFCOMMENTSIZE 0x3f /* CCD/VIDEO */
86#define DEFCOMMENTTEXT 0x50 /* CCD/VIDEO */
87#define DEFSTOREDCYTEXT 0x51 /* VIDEO */
88
89
90#define JULABORTDMA 0x70 /* Abort current DMA transfer */
91
92/* juliette general i/o port */
93
94#define JIO_READBITS 0x40 /* read and return current port bits */
95#define JIO_SETBITS 0x41 /* set bits marked by 1 in the argument */
96#define JIO_CLRBITS 0x42 /* clr bits marked by 1 in the argument */
97#define JIO_READDIR 0x43 /* read direction, 0=input 1=output */
98#define JIO_SETINPUT 0x44 /* set direction, 0=unchanged 1=input
99 returns current dir */
100#define JIO_SETOUTPUT 0x45 /* set direction, 0=unchanged 1=output
101 returns current dir */
102
103/**** YumYum internal adresses ****/
104
105/* Juliette buffer addresses */
106
107#define BUFFER1_VIDEO 0x1100
108#define BUFFER2_VIDEO 0x2800
109#define ACDC_BUFF_VIDEO 0x0aaa
110#define BUFFER1 0x1700
111#define BUFFER2 0x2b01
112#define ACDC_BUFFER 0x1200
113#define BUFFER1_SS1M 0x1100
114#define BUFFER2_SS1M 0x2800
115#define ACDC_BUFF_SS1M 0x0900
116
117/* Juliette parameter memory addresses */
118
119#define PA_BUFFER_CNT 0x3f09 /* CCD/VIDEO */
120#define PA_CCD_BUFFER 0x3f10 /* CCD */
121#define PA_VIDEO_BUFFER 0x3f10 /* VIDEO */
122#define PA_DCT_BUFFER 0x3f11 /* CCD/VIDEO */
123#define PA_TEMP 0x3f12 /* CCD/VIDEO */
124#define PA_VIDEOLINE_RD 0x3f13 /* VIDEO */
125#define PA_VIDEOLINE_WR 0x3f14 /* VIDEO */
126#define PA_VI_HDELAY0 0x3f15 /* VIDEO */
127#define PA_VI_VDELAY0 0x3f16 /* VIDEO */
128#define PA_VI_HDELAY1 0x3f17 /* VIDEO */
129#define PA_VI_VDELAY1 0x3f18 /* VIDEO */
130#define PA_VI_HDELAY2 0x3f19 /* VIDEO */
131#define PA_VI_VDELAY2 0x3f1a /* VIDEO */
132#define PA_VI_HDELAY3 0x3f1b /* VIDEO */
133#define PA_VI_VDELAY3 0x3f1c /* VIDEO */
134#define PA_VI_CTRL 0x3f20 /* VIDEO */
135#define PA_JPEG_CTRL 0x3f22 /* CCD/VIDEO */
136#define PA_BUFFER_SIZE 0x3f24 /* CCD/VIDEO */
137#define PA_PAL_NTSC 0x3f25 /* VIDEO */
138#define PA_MACROBLOCKS 0x3f26 /* CCD/VIDEO */
139#define PA_COLOR 0x3f27 /* VIDEO */
140#define PA_MEMCH1CNT2 0x3f28 /* CCD/VIDEO */
141#define PA_MEMCH1CNT3 0x3f29 /* VIDEO */
142#define PA_MEMCH1STR2 0x3f2a /* CCD/VIDEO */
143#define PA_MEMCH1STR3 0x3f2b /* VIDEO */
144#define PA_BUFFERS 0x3f2c /* CCD/VIDEO */
145#define PA_PROGRAM 0x3f2d /* CCD/VIDEO */
146#define PA_ROTATION 0x3f2e /* CCD */
147#define PA_PC 0x3f30 /* CCD/VIDEO */
148#define PA_PC2 0x3f31 /* VIDEO */
149#define PA_ODD_LINE 0x3f32 /* VIDEO */
150#define PA_EXP_DELAY 0x3f34 /* CCD */
151#define PA_MACROBLOCK_CNT 0x3f35 /* CCD/VIDEO */
152#define PA_DRAM_PTR1_L 0x3f36 /* CCD/VIDEO */
153#define PA_CLPOB_CNT 0x3f37 /* CCD */
154#define PA_DRAM_PTR1_H 0x3f38 /* CCD/VIDEO */
155#define PA_DRAM_PTR2_L 0x3f3a /* VIDEO */
156#define PA_DRAM_PTR2_H 0x3f3c /* VIDEO */
157#define PA_CCD_LINE_CNT 0x3f3f /* CCD */
158#define PA_VIDEO_LINE_CNT 0x3f3f /* VIDEO */
159#define PA_TEXT 0x3f41 /* CCD/VIDEO */
160#define PA_CAMERA_CHANGED 0x3f42 /* VIDEO */
161#define PA_TEXTALIGNMENT 0x3f43 /* VIDEO */
162#define PA_DISABLED 0x3f44 /* VIDEO */
163#define PA_MACROBLOCKTEXT 0x3f45 /* VIDEO */
164#define PA_VGA 0x3f46 /* VIDEO */
165#define PA_ZERO 0x3ffe /* VIDEO */
166#define PA_NULL 0x3fff /* CCD/VIDEO */
167
168typedef enum {
169 jpeg = 0,
170 dummy = 1
171} request_type;
172
173typedef enum {
174 hugesize = 0,
175 fullsize = 1,
176 halfsize = 2,
177 fieldsize = 3
178} size_type;
179
180typedef enum {
181 min = 0,
182 low = 1,
183 medium = 2,
184 high = 3,
185 very_high = 4,
186 very_low = 5,
187 q1 = 6,
188 q2 = 7,
189 q3 = 8,
190 q4 = 9,
191 q5 = 10,
192 q6 = 11
193} compr_type;
194
195typedef enum {
196 deg_0 = 0,
197 deg_180 = 1,
198 deg_90 = 2,
199 deg_270 = 3
200} rotation_type;
201
202typedef enum {
203 auto_white = 0,
204 hold = 1,
205 fixed_outdoor = 2,
206 fixed_indoor = 3,
207 fixed_fluor = 4
208} white_balance_type;
209
210typedef enum {
211 auto_exp = 0,
212 fixed_exp = 1
213} exposure_type;
214
215typedef enum {
216 no_window = 0,
217 center = 1,
218 top = 2,
219 lower = 3,
220 left = 4,
221 right = 5,
222 spot = 6,
223 cw = 7
224} exp_window_type;
225
226typedef enum {
227 h_24 = 0,
228 h_12 = 1,
229 h_24P = 2
230} hour_type;
231
232typedef enum {
233 standard = 0,
234 YYYY_MM_DD = 1,
235 Www_Mmm_DD_YYYY = 2,
236 Www_DD_MM_YYYY = 3
237} date_type;
238
239typedef enum {
240 left_align = 0,
241 center_align = 1,
242 right_align = 2
243} alignment_type;
244
245typedef enum {
246 off = 0,
247 on = 1,
248 no = 0,
249 yes = 1
250} enable_type;
251
252typedef enum {
253 disabled = 0,
254 enabled = 1,
255 extended = 2
256} comment_type;
257
258typedef enum {
259 pal = 0,
260 ntsc = 1
261} video_type;
262
263typedef enum {
264 pal_bghi_ntsc_m = 0,
265 ntsc_4_43_50hz_pal_4_43_60hz = 1,
266 pal_n_ntsc_4_43_60hz = 2,
267 ntsc_n_pal_m = 3,
268 secam_pal_4_43_60hz = 4
269} modulation_type;
270
271typedef enum {
272 cam0 = 0,
273 cam1 = 1,
274 cam2 = 2,
275 cam3 = 3,
276 quad = 32
277} camera_type;
278
279typedef enum {
280 video_driver = 0,
281 ccd_driver = 1
282} driver_type;
283
284struct jul_param {
285 request_type req_type;
286 size_type size;
287 compr_type compression;
288 rotation_type rotation;
289 int color_level;
290 int brightness;
291 white_balance_type white_balance;
292 exposure_type exposure;
293 exp_window_type auto_exp_window;
294 hour_type time_format;
295 date_type date_format;
296 alignment_type text_alignment;
297 enable_type text;
298 enable_type clock;
299 enable_type date;
300 enable_type fps;
301 enable_type vga;
302 enable_type comment;
303};
304
305struct video_param {
306 enable_type disabled;
307 modulation_type modulation;
308 video_type video;
309 enable_type signal;
310 enable_type vcr;
311 int xoffset;
312 int yoffset;
313};
314
315/* The juliette_request structure is used during the JULSTARTDMA asynchronous
316 * picture-taking ioctl call as an argument to specify a buffer which will get
317 * the final picture.
318 */
319
320struct juliette_request {
321 char *buf; /* Pointer to the buffer to hold picture data */
322 unsigned int buflen; /* Length of the above buffer */
323 unsigned int size; /* Resulting length, 0 if the picture is not ready */
324};
325
326#endif
diff --git a/include/asm-cris/arch-v32/memmap.h b/include/asm-cris/arch-v32/memmap.h
new file mode 100644
index 000000000000..d29df5644d3e
--- /dev/null
+++ b/include/asm-cris/arch-v32/memmap.h
@@ -0,0 +1,24 @@
1#ifndef _ASM_ARCH_MEMMAP_H
2#define _ASM_ARCH_MEMMAP_H
3
4#define MEM_CSE0_START (0x00000000)
5#define MEM_CSE0_SIZE (0x04000000)
6#define MEM_CSE1_START (0x04000000)
7#define MEM_CSE1_SIZE (0x04000000)
8#define MEM_CSR0_START (0x08000000)
9#define MEM_CSR1_START (0x0c000000)
10#define MEM_CSP0_START (0x10000000)
11#define MEM_CSP1_START (0x14000000)
12#define MEM_CSP2_START (0x18000000)
13#define MEM_CSP3_START (0x1c000000)
14#define MEM_CSP4_START (0x20000000)
15#define MEM_CSP5_START (0x24000000)
16#define MEM_CSP6_START (0x28000000)
17#define MEM_CSP7_START (0x2c000000)
18#define MEM_INTMEM_START (0x38000000)
19#define MEM_INTMEM_SIZE (0x00020000)
20#define MEM_DRAM_START (0x40000000)
21
22#define MEM_NON_CACHEABLE (0x80000000)
23
24#endif
diff --git a/include/asm-cris/arch-v32/mmu.h b/include/asm-cris/arch-v32/mmu.h
new file mode 100644
index 000000000000..6bcdc3fdf7dc
--- /dev/null
+++ b/include/asm-cris/arch-v32/mmu.h
@@ -0,0 +1,111 @@
1#ifndef _ASM_CRIS_ARCH_MMU_H
2#define _ASM_CRIS_ARCH_MMU_H
3
4/* MMU context type. */
5typedef struct
6{
7 unsigned int page_id;
8} mm_context_t;
9
10/* Kernel memory segments. */
11#define KSEG_F 0xf0000000UL
12#define KSEG_E 0xe0000000UL
13#define KSEG_D 0xd0000000UL
14#define KSEG_C 0xc0000000UL
15#define KSEG_B 0xb0000000UL
16#define KSEG_A 0xa0000000UL
17#define KSEG_9 0x90000000UL
18#define KSEG_8 0x80000000UL
19#define KSEG_7 0x70000000UL
20#define KSEG_6 0x60000000UL
21#define KSEG_5 0x50000000UL
22#define KSEG_4 0x40000000UL
23#define KSEG_3 0x30000000UL
24#define KSEG_2 0x20000000UL
25#define KSEG_1 0x10000000UL
26#define KSEG_0 0x00000000UL
27
28/*
29 * CRISv32 PTE bits:
30 *
31 * Bit: 31-13 12-5 4 3 2 1 0
32 * +-----+------+--------+-------+--------+-------+---------+
33 * | pfn | zero | global | valid | kernel | write | execute |
34 * +-----+------+--------+-------+--------+-------+---------+
35 */
36
37/*
38 * Defines for accessing the bits. Also define some synonyms for use with
39 * the software-based defined bits below.
40 */
41#define _PAGE_EXECUTE (1 << 0) /* Execution bit. */
42#define _PAGE_WE (1 << 1) /* Write bit. */
43#define _PAGE_SILENT_WRITE (1 << 1) /* Same as above. */
44#define _PAGE_KERNEL (1 << 2) /* Kernel mode page. */
45#define _PAGE_VALID (1 << 3) /* Page is valid. */
46#define _PAGE_SILENT_READ (1 << 3) /* Same as above. */
47#define _PAGE_GLOBAL (1 << 4) /* Global page. */
48
49/*
50 * The hardware doesn't care about these bits, but the kernel uses them in
51 * software.
52 */
53#define _PAGE_PRESENT (1 << 5) /* Page is present in memory. */
54#define _PAGE_FILE (1 << 6) /* 1=pagecache, 0=swap (when !present) */
55#define _PAGE_ACCESSED (1 << 6) /* Simulated in software using valid bit. */
56#define _PAGE_MODIFIED (1 << 7) /* Simulated in software using we bit. */
57#define _PAGE_READ (1 << 8) /* Read enabled. */
58#define _PAGE_WRITE (1 << 9) /* Write enabled. */
59
60/* Define some higher level generic page attributes. */
61#define __READABLE (_PAGE_READ | _PAGE_SILENT_READ | _PAGE_ACCESSED)
62#define __WRITEABLE (_PAGE_WRITE | _PAGE_SILENT_WRITE | _PAGE_MODIFIED)
63
64#define _PAGE_TABLE (_PAGE_PRESENT | __READABLE | __WRITEABLE)
65#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_MODIFIED)
66
67#define PAGE_NONE __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
68#define PAGE_SHARED __pgprot(_PAGE_PRESENT | __READABLE | _PAGE_WRITE | \
69 _PAGE_ACCESSED)
70#define PAGE_SHARED_EXEC __pgprot(_PAGE_PRESENT | __READABLE | _PAGE_WRITE | \
71 _PAGE_ACCESSED | _PAGE_EXECUTE)
72
73#define PAGE_READONLY __pgprot(_PAGE_PRESENT | __READABLE)
74#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | __READABLE | _PAGE_EXECUTE | _PAGE_ACCESSED)
75
76#define PAGE_COPY __pgprot(_PAGE_PRESENT | __READABLE)
77#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | __READABLE | _PAGE_EXECUTE)
78#define PAGE_KERNEL __pgprot(_PAGE_GLOBAL | _PAGE_KERNEL | \
79 _PAGE_PRESENT | __READABLE | __WRITEABLE)
80#define PAGE_KERNEL_EXEC __pgprot(_PAGE_GLOBAL | _PAGE_KERNEL | _PAGE_EXECUTE | \
81 _PAGE_PRESENT | __READABLE | __WRITEABLE)
82#define PAGE_SIGNAL_TRAMPOLINE __pgprot(_PAGE_GLOBAL | _PAGE_EXECUTE | \
83 _PAGE_PRESENT | __READABLE)
84
85#define _KERNPG_TABLE (_PAGE_TABLE | _PAGE_KERNEL)
86
87/* CRISv32 can do page protection for execute.
88 * Write permissions imply read permissions.
89 * Note that the numbers are in Execute-Write-Read order!
90 */
91#define __P000 PAGE_NONE
92#define __P001 PAGE_READONLY
93#define __P010 PAGE_COPY
94#define __P011 PAGE_COPY
95#define __P100 PAGE_READONLY_EXEC
96#define __P101 PAGE_READONLY_EXEC
97#define __P110 PAGE_COPY_EXEC
98#define __P111 PAGE_COPY_EXEC
99
100#define __S000 PAGE_NONE
101#define __S001 PAGE_READONLY
102#define __S010 PAGE_SHARED
103#define __S011 PAGE_SHARED
104#define __S100 PAGE_READONLY_EXEC
105#define __S101 PAGE_READONLY_EXEC
106#define __S110 PAGE_SHARED_EXEC
107#define __S111 PAGE_SHARED_EXEC
108
109#define PTE_FILE_MAX_BITS 25
110
111#endif /* _ASM_CRIS_ARCH_MMU_H */
diff --git a/include/asm-cris/arch-v32/offset.h b/include/asm-cris/arch-v32/offset.h
new file mode 100644
index 000000000000..597419b033f9
--- /dev/null
+++ b/include/asm-cris/arch-v32/offset.h
@@ -0,0 +1,35 @@
1#ifndef __ASM_OFFSETS_H__
2#define __ASM_OFFSETS_H__
3/*
4 * DO NOT MODIFY.
5 *
6 * This file was generated by arch/cris/Makefile
7 *
8 */
9
10#define PT_orig_r10 0 /* offsetof(struct pt_regs, orig_r10) */
11#define PT_r13 56 /* offsetof(struct pt_regs, r13) */
12#define PT_r12 52 /* offsetof(struct pt_regs, r12) */
13#define PT_r11 48 /* offsetof(struct pt_regs, r11) */
14#define PT_r10 44 /* offsetof(struct pt_regs, r10) */
15#define PT_r9 40 /* offsetof(struct pt_regs, r9) */
16#define PT_acr 60 /* offsetof(struct pt_regs, acr) */
17#define PT_srs 64 /* offsetof(struct pt_regs, srs) */
18#define PT_mof 68 /* offsetof(struct pt_regs, mof) */
19#define PT_ccs 76 /* offsetof(struct pt_regs, ccs) */
20#define PT_srp 80 /* offsetof(struct pt_regs, srp) */
21
22#define TI_task 0 /* offsetof(struct thread_info, task) */
23#define TI_flags 8 /* offsetof(struct thread_info, flags) */
24#define TI_preempt_count 16 /* offsetof(struct thread_info, preempt_count) */
25
26#define THREAD_ksp 0 /* offsetof(struct thread_struct, ksp) */
27#define THREAD_usp 4 /* offsetof(struct thread_struct, usp) */
28#define THREAD_ccs 8 /* offsetof(struct thread_struct, ccs) */
29
30#define TASK_pid 149 /* offsetof(struct task_struct, pid) */
31
32#define LCLONE_VM 256 /* CLONE_VM */
33#define LCLONE_UNTRACED 8388608 /* CLONE_UNTRACED */
34
35#endif
diff --git a/include/asm-cris/arch-v32/page.h b/include/asm-cris/arch-v32/page.h
new file mode 100644
index 000000000000..77827bc17cca
--- /dev/null
+++ b/include/asm-cris/arch-v32/page.h
@@ -0,0 +1,28 @@
1#ifndef _ASM_CRIS_ARCH_PAGE_H
2#define _ASM_CRIS_ARCH_PAGE_H
3
4#include <linux/config.h>
5
6#ifdef __KERNEL__
7
8#define PAGE_OFFSET KSEG_C /* kseg_c is mapped to physical ram. */
9
10/*
11 * Macros to convert between physical and virtual addresses. By stripiing a
12 * selected bit it's possible to convert between KSEG_x and 0x40000000 where the
13 * DRAM really resides. DRAM is virtually at 0xc.
14 */
15#ifndef CONFIG_ETRAXFS_SIM
16#define __pa(x) ((unsigned long)(x) & 0x7fffffff)
17#define __va(x) ((void *)((unsigned long)(x) | 0x80000000))
18#else
19#define __pa(x) ((unsigned long)(x) & 0x3fffffff)
20#define __va(x) ((void *)((unsigned long)(x) | 0xc0000000))
21#endif
22
23#define VM_STACK_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
24 VM_MAYREAD | VM_MAYWRITE)
25
26#endif /* __KERNEL__ */
27
28#endif /* _ASM_CRIS_ARCH_PAGE_H */
diff --git a/include/asm-cris/arch-v32/pgtable.h b/include/asm-cris/arch-v32/pgtable.h
new file mode 100644
index 000000000000..08cb7ff7e4e7
--- /dev/null
+++ b/include/asm-cris/arch-v32/pgtable.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_CRIS_ARCH_PGTABLE_H
2#define _ASM_CRIS_ARCH_PGTABLE_H
3
4/* Define the kernels virtual memory area. */
5#define VMALLOC_START KSEG_D
6#define VMALLOC_END KSEG_E
7#define VMALLOC_VMADDR(x) ((unsigned long)(x))
8
9#endif /* _ASM_CRIS_ARCH_PGTABLE_H */
diff --git a/include/asm-cris/arch-v32/pinmux.h b/include/asm-cris/arch-v32/pinmux.h
new file mode 100644
index 000000000000..a66dc9970919
--- /dev/null
+++ b/include/asm-cris/arch-v32/pinmux.h
@@ -0,0 +1,39 @@
1#ifndef _ASM_CRIS_ARCH_PINMUX_H
2#define _ASM_CRIS_ARCH_PINMUX_H
3
4#define PORT_B 0
5#define PORT_C 1
6#define PORT_D 2
7#define PORT_E 3
8
9enum pin_mode
10{
11 pinmux_none = 0,
12 pinmux_fixed,
13 pinmux_gpio,
14 pinmux_iop
15};
16
17enum fixed_function
18{
19 pinmux_ser1,
20 pinmux_ser2,
21 pinmux_ser3,
22 pinmux_sser0,
23 pinmux_sser1,
24 pinmux_ata0,
25 pinmux_ata1,
26 pinmux_ata2,
27 pinmux_ata3,
28 pinmux_ata,
29 pinmux_eth1,
30 pinmux_timer
31};
32
33int crisv32_pinmux_init(void);
34int crisv32_pinmux_alloc(int port, int first_pin, int last_pin, enum pin_mode);
35int crisv32_pinmux_alloc_fixed(enum fixed_function function);
36int crisv32_pinmux_dealloc(int port, int first_pin, int last_pin);
37void crisv32_pinmux_dump(void);
38
39#endif
diff --git a/include/asm-cris/arch-v32/processor.h b/include/asm-cris/arch-v32/processor.h
new file mode 100644
index 000000000000..8c939bf27987
--- /dev/null
+++ b/include/asm-cris/arch-v32/processor.h
@@ -0,0 +1,60 @@
1#ifndef _ASM_CRIS_ARCH_PROCESSOR_H
2#define _ASM_CRIS_ARCH_PROCESSOR_H
3
4#include <linux/config.h>
5
6/* Return current instruction pointer. */
7#define current_text_addr() \
8 ({void *pc; __asm__ __volatile__ ("lapcq .,%0" : "=rm" (pc)); pc;})
9
10/*
11 * Since CRIS doesn't do hardware task-switching this hasn't really anything to
12 * do with the proccessor itself, it's just here for legacy reasons. This is
13 * used when task-switching using _resume defined in entry.S. The offsets here
14 * are hardcoded into _resume, so if this struct is changed, entry.S needs to be
15 * changed as well.
16 */
17struct thread_struct {
18 unsigned long ksp; /* Kernel stack pointer. */
19 unsigned long usp; /* User stack pointer. */
20 unsigned long ccs; /* Saved flags register. */
21};
22
23/*
24 * User-space process size. This is hardcoded into a few places, so don't
25 * changed it unless everything's clear!
26 */
27#ifndef CONFIG_ETRAXFS_SIM
28#define TASK_SIZE (0xB0000000UL)
29#else
30#define TASK_SIZE (0xA0000000UL)
31#endif
32
33/* CCS I=1, enable interrupts. */
34#define INIT_THREAD { 0, 0, (1 << I_CCS_BITNR) }
35
36#define KSTK_EIP(tsk) \
37({ \
38 unsigned long eip = 0; \
39 unsigned long regs = (unsigned long)user_regs(tsk); \
40 if (regs > PAGE_SIZE && virt_addr_valid(regs)) \
41 eip = ((struct pt_regs *)regs)->erp; \
42 eip; \
43})
44
45/*
46 * Give the thread a program location, set user-mode and switch user
47 * stackpointer.
48 */
49#define start_thread(regs, ip, usp) \
50do { \
51 set_fs(USER_DS); \
52 regs->erp = ip; \
53 regs->ccs |= 1 << (U_CCS_BITNR + CCS_SHIFT); \
54 wrusp(usp); \
55} while(0)
56
57/* Nothing special to do for v32 when handling a kernel bus fault fixup. */
58#define arch_fixup(regs) {};
59
60#endif /* _ASM_CRIS_ARCH_PROCESSOR_H */
diff --git a/include/asm-cris/arch-v32/ptrace.h b/include/asm-cris/arch-v32/ptrace.h
new file mode 100644
index 000000000000..516cc7062d94
--- /dev/null
+++ b/include/asm-cris/arch-v32/ptrace.h
@@ -0,0 +1,114 @@
1#ifndef _CRIS_ARCH_PTRACE_H
2#define _CRIS_ARCH_PTRACE_H
3
4/* Register numbers in the ptrace system call interface */
5
6#define PT_ORIG_R10 0
7#define PT_R0 1
8#define PT_R1 2
9#define PT_R2 3
10#define PT_R3 4
11#define PT_R4 5
12#define PT_R5 6
13#define PT_R6 7
14#define PT_R7 8
15#define PT_R8 9
16#define PT_R9 10
17#define PT_R10 11
18#define PT_R11 12
19#define PT_R12 13
20#define PT_R13 14
21#define PT_ACR 15
22#define PT_SRS 16
23#define PT_MOF 17
24#define PT_SPC 18
25#define PT_CCS 19
26#define PT_SRP 20
27#define PT_ERP 21 /* This is actually the debugged process' PC */
28#define PT_EXS 22
29#define PT_EDA 23
30#define PT_USP 24 /* special case - USP is not in the pt_regs */
31#define PT_PPC 25 /* special case - pseudo PC */
32#define PT_BP 26 /* Base number for BP registers. */
33#define PT_BP_CTRL 26 /* BP control register. */
34#define PT_MAX 40
35
36/* Condition code bit numbers. */
37#define C_CCS_BITNR 0
38#define V_CCS_BITNR 1
39#define Z_CCS_BITNR 2
40#define N_CCS_BITNR 3
41#define X_CCS_BITNR 4
42#define I_CCS_BITNR 5
43#define U_CCS_BITNR 6
44#define P_CCS_BITNR 7
45#define R_CCS_BITNR 8
46#define S_CCS_BITNR 9
47#define M_CCS_BITNR 30
48#define Q_CCS_BITNR 31
49#define CCS_SHIFT 10 /* Shift count for each level in CCS */
50
51/* pt_regs not only specifices the format in the user-struct during
52 * ptrace but is also the frame format used in the kernel prologue/epilogues
53 * themselves
54 */
55
56struct pt_regs {
57 unsigned long orig_r10;
58 /* pushed by movem r13, [sp] in SAVE_ALL. */
59 unsigned long r0;
60 unsigned long r1;
61 unsigned long r2;
62 unsigned long r3;
63 unsigned long r4;
64 unsigned long r5;
65 unsigned long r6;
66 unsigned long r7;
67 unsigned long r8;
68 unsigned long r9;
69 unsigned long r10;
70 unsigned long r11;
71 unsigned long r12;
72 unsigned long r13;
73 unsigned long acr;
74 unsigned long srs;
75 unsigned long mof;
76 unsigned long spc;
77 unsigned long ccs;
78 unsigned long srp;
79 unsigned long erp; /* This is actually the debugged process' PC */
80 /* For debugging purposes; saved only when needed. */
81 unsigned long exs;
82 unsigned long eda;
83};
84
85/* switch_stack is the extra stuff pushed onto the stack in _resume (entry.S)
86 * when doing a context-switch. it is used (apart from in resume) when a new
87 * thread is made and we need to make _resume (which is starting it for the
88 * first time) realise what is going on.
89 *
90 * Actually, the use is very close to the thread struct (TSS) in that both the
91 * switch_stack and the TSS are used to keep thread stuff when switching in
92 * _resume.
93 */
94
95struct switch_stack {
96 unsigned long r0;
97 unsigned long r1;
98 unsigned long r2;
99 unsigned long r3;
100 unsigned long r4;
101 unsigned long r5;
102 unsigned long r6;
103 unsigned long r7;
104 unsigned long r8;
105 unsigned long r9;
106 unsigned long return_ip; /* ip that _resume will return to */
107};
108
109#define user_mode(regs) (((regs)->ccs & (1 << (U_CCS_BITNR + CCS_SHIFT))) != 0)
110#define instruction_pointer(regs) ((regs)->erp)
111extern void show_regs(struct pt_regs *);
112#define profile_pc(regs) instruction_pointer(regs)
113
114#endif
diff --git a/include/asm-cris/arch-v32/spinlock.h b/include/asm-cris/arch-v32/spinlock.h
new file mode 100644
index 000000000000..52df72a62232
--- /dev/null
+++ b/include/asm-cris/arch-v32/spinlock.h
@@ -0,0 +1,163 @@
1#ifndef __ASM_ARCH_SPINLOCK_H
2#define __ASM_ARCH_SPINLOCK_H
3
4#include <asm/system.h>
5
6#define RW_LOCK_BIAS 0x01000000
7#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 }
8#define spin_lock_init(x) do { *(x) = SPIN_LOCK_UNLOCKED; } while(0)
9
10#define spin_is_locked(x) (*(volatile signed char *)(&(x)->lock) <= 0)
11#define spin_unlock_wait(x) do { barrier(); } while(spin_is_locked(x))
12
13extern void cris_spin_unlock(void *l, int val);
14extern void cris_spin_lock(void *l);
15extern int cris_spin_trylock(void* l);
16
17static inline void _raw_spin_unlock(spinlock_t *lock)
18{
19 __asm__ volatile ("move.d %1,%0" \
20 : "=m" (lock->lock) \
21 : "r" (1) \
22 : "memory");
23}
24
25static inline int _raw_spin_trylock(spinlock_t *lock)
26{
27 return cris_spin_trylock((void*)&lock->lock);
28}
29
30static inline void _raw_spin_lock(spinlock_t *lock)
31{
32 cris_spin_lock((void*)&lock->lock);
33}
34
35static inline void _raw_spin_lock_flags (spinlock_t *lock, unsigned long flags)
36{
37 _raw_spin_lock(lock);
38}
39
40/*
41 * Read-write spinlocks, allowing multiple readers
42 * but only one writer.
43 *
44 * NOTE! it is quite common to have readers in interrupts
45 * but no interrupt writers. For those circumstances we
46 * can "mix" irq-safe locks - any writer needs to get a
47 * irq-safe write-lock, but readers can get non-irqsafe
48 * read-locks.
49 */
50typedef struct {
51 spinlock_t lock;
52 volatile int counter;
53#ifdef CONFIG_PREEMPT
54 unsigned int break_lock;
55#endif
56} rwlock_t;
57
58#define RW_LOCK_UNLOCKED (rwlock_t) { {1}, 0 }
59
60#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while (0)
61
62/**
63 * read_can_lock - would read_trylock() succeed?
64 * @lock: the rwlock in question.
65 */
66#define read_can_lock(x) ((int)(x)->counter >= 0)
67
68/**
69 * write_can_lock - would write_trylock() succeed?
70 * @lock: the rwlock in question.
71 */
72#define write_can_lock(x) ((x)->counter == 0)
73
74#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
75
76/* read_lock, read_unlock are pretty straightforward. Of course it somehow
77 * sucks we end up saving/restoring flags twice for read_lock_irqsave aso. */
78
79static __inline__ void _raw_read_lock(rwlock_t *rw)
80{
81 unsigned long flags;
82 local_irq_save(flags);
83 _raw_spin_lock(&rw->lock);
84
85 rw->counter++;
86
87 _raw_spin_unlock(&rw->lock);
88 local_irq_restore(flags);
89}
90
91static __inline__ void _raw_read_unlock(rwlock_t *rw)
92{
93 unsigned long flags;
94 local_irq_save(flags);
95 _raw_spin_lock(&rw->lock);
96
97 rw->counter--;
98
99 _raw_spin_unlock(&rw->lock);
100 local_irq_restore(flags);
101}
102
103/* write_lock is less trivial. We optimistically grab the lock and check
104 * if we surprised any readers. If so we release the lock and wait till
105 * they're all gone before trying again
106 *
107 * Also note that we don't use the _irqsave / _irqrestore suffixes here.
108 * If we're called with interrupts enabled and we've got readers (or other
109 * writers) in interrupt handlers someone fucked up and we'd dead-lock
110 * sooner or later anyway. prumpf */
111
112static __inline__ void _raw_write_lock(rwlock_t *rw)
113{
114retry:
115 _raw_spin_lock(&rw->lock);
116
117 if(rw->counter != 0) {
118 /* this basically never happens */
119 _raw_spin_unlock(&rw->lock);
120
121 while(rw->counter != 0);
122
123 goto retry;
124 }
125
126 /* got it. now leave without unlocking */
127 rw->counter = -1; /* remember we are locked */
128}
129
130/* write_unlock is absolutely trivial - we don't have to wait for anything */
131
132static __inline__ void _raw_write_unlock(rwlock_t *rw)
133{
134 rw->counter = 0;
135 _raw_spin_unlock(&rw->lock);
136}
137
138static __inline__ int _raw_write_trylock(rwlock_t *rw)
139{
140 _raw_spin_lock(&rw->lock);
141 if (rw->counter != 0) {
142 /* this basically never happens */
143 _raw_spin_unlock(&rw->lock);
144
145 return 0;
146 }
147
148 /* got it. now leave without unlocking */
149 rw->counter = -1; /* remember we are locked */
150 return 1;
151}
152
153static __inline__ int is_read_locked(rwlock_t *rw)
154{
155 return rw->counter > 0;
156}
157
158static __inline__ int is_write_locked(rwlock_t *rw)
159{
160 return rw->counter < 0;
161}
162
163#endif /* __ASM_ARCH_SPINLOCK_H */
diff --git a/include/asm-cris/arch-v32/system.h b/include/asm-cris/arch-v32/system.h
new file mode 100644
index 000000000000..b9afbb95e0bb
--- /dev/null
+++ b/include/asm-cris/arch-v32/system.h
@@ -0,0 +1,79 @@
1#ifndef _ASM_CRIS_ARCH_SYSTEM_H
2#define _ASM_CRIS_ARCH_SYSTEM_H
3
4#include <linux/config.h>
5
6/* Read the CPU version register. */
7extern inline unsigned long rdvr(void)
8{
9 unsigned char vr;
10
11 __asm__ __volatile__ ("move $vr, %0" : "=rm" (vr));
12 return vr;
13}
14
15#define cris_machine_name "crisv32"
16
17/* Read the user-mode stack pointer. */
18extern inline unsigned long rdusp(void)
19{
20 unsigned long usp;
21
22 __asm__ __volatile__ ("move $usp, %0" : "=rm" (usp));
23 return usp;
24}
25
26/* Read the current stack pointer. */
27extern inline unsigned long rdsp(void)
28{
29 unsigned long sp;
30
31 __asm__ __volatile__ ("move.d $sp, %0" : "=rm" (sp));
32 return sp;
33}
34
35/* Write the user-mode stack pointer. */
36#define wrusp(usp) __asm__ __volatile__ ("move %0, $usp" : : "rm" (usp))
37
38#define nop() __asm__ __volatile__ ("nop");
39
40#define xchg(ptr,x) \
41 ((__typeof__(*(ptr)))__xchg((unsigned long) (x),(ptr),sizeof(*(ptr))))
42
43#define tas(ptr) (xchg((ptr),1))
44
45struct __xchg_dummy { unsigned long a[100]; };
46#define __xg(x) ((struct __xchg_dummy *)(x))
47
48/* Used for interrupt control. */
49#define local_save_flags(x) \
50 __asm__ __volatile__ ("move $ccs, %0" : "=rm" (x) : : "memory");
51
52#define local_irq_restore(x) \
53 __asm__ __volatile__ ("move %0, $ccs" : : "rm" (x) : "memory");
54
55#define local_irq_disable() __asm__ __volatile__ ("di" : : : "memory");
56#define local_irq_enable() __asm__ __volatile__ ("ei" : : : "memory");
57
58#define irqs_disabled() \
59({ \
60 unsigned long flags; \
61 \
62 local_save_flags(flags);\
63 !(flags & (1 << I_CCS_BITNR)); \
64})
65
66/* Used for spinlocks, etc. */
67#define local_irq_save(x) \
68 __asm__ __volatile__ ("move $ccs, %0\n\tdi" : "=rm" (x) : : "memory");
69
70#ifdef CONFIG_SMP
71typedef struct {
72 volatile unsigned int lock __attribute__ ((aligned(4)));
73#ifdef CONFIG_PREEMPT
74 unsigned int break_lock;
75#endif
76} spinlock_t;
77#endif
78
79#endif /* _ASM_CRIS_ARCH_SYSTEM_H */
diff --git a/include/asm-cris/arch-v32/thread_info.h b/include/asm-cris/arch-v32/thread_info.h
new file mode 100644
index 000000000000..a7a182307da0
--- /dev/null
+++ b/include/asm-cris/arch-v32/thread_info.h
@@ -0,0 +1,13 @@
1#ifndef _ASM_CRIS_ARCH_THREAD_INFO_H
2#define _ASM_CRIS_ARCH_THREAD_INFO_H
3
4/* Return a thread_info struct. */
5extern inline struct thread_info *current_thread_info(void)
6{
7 struct thread_info *ti;
8
9 __asm__ __volatile__ ("and.d $sp, %0" : "=r" (ti) : "0" (~8191UL));
10 return ti;
11}
12
13#endif /* _ASM_CRIS_ARCH_THREAD_INFO_H */
diff --git a/include/asm-cris/arch-v32/timex.h b/include/asm-cris/arch-v32/timex.h
new file mode 100644
index 000000000000..4d0fd23b21e9
--- /dev/null
+++ b/include/asm-cris/arch-v32/timex.h
@@ -0,0 +1,31 @@
1#ifndef _ASM_CRIS_ARCH_TIMEX_H
2#define _ASM_CRIS_ARCH_TIMEX_H
3
4#include <asm/arch/hwregs/reg_map.h>
5#include <asm/arch/hwregs/reg_rdwr.h>
6#include <asm/arch/hwregs/timer_defs.h>
7
8/*
9 * The clock runs at 100MHz, we divide it by 1000000. If you change anything
10 * here you must check time.c as well.
11 */
12
13#define CLOCK_TICK_RATE 100000000 /* Underlying frequency of the HZ timer */
14
15/* The timer0 values gives 10 ns resolution but interrupts at HZ. */
16#define TIMER0_FREQ (CLOCK_TICK_RATE)
17#define TIMER0_DIV (TIMER0_FREQ/(HZ))
18
19/* Convert the value in step of 10 ns to 1us without overflow: */
20#define GET_JIFFIES_USEC() \
21 ( (TIMER0_DIV - REG_RD(timer, regi_timer, r_tmr0_data)) /100 )
22
23extern unsigned long get_ns_in_jiffie(void);
24
25extern inline unsigned long get_us_in_jiffie_highres(void)
26{
27 return get_ns_in_jiffie() / 1000;
28}
29
30#endif
31
diff --git a/include/asm-cris/arch-v32/tlb.h b/include/asm-cris/arch-v32/tlb.h
new file mode 100644
index 000000000000..4effb1253660
--- /dev/null
+++ b/include/asm-cris/arch-v32/tlb.h
@@ -0,0 +1,14 @@
1#ifndef _CRIS_ARCH_TLB_H
2#define _CRIS_ARCH_TLB_H
3
4/*
5 * The TLB is a 64-entry cache. Each entry has a 8-bit page_id that is used
6 * to store the "process" it belongs to (=> fast mm context switch). The
7 * last page_id is never used so we can make TLB entries that never matches.
8 */
9#define NUM_TLB_ENTRIES 64
10#define NUM_PAGEID 256
11#define INVALID_PAGEID 255
12#define NO_CONTEXT -1
13
14#endif /* _CRIS_ARCH_TLB_H */
diff --git a/include/asm-cris/arch-v32/uaccess.h b/include/asm-cris/arch-v32/uaccess.h
new file mode 100644
index 000000000000..055a0bdbe835
--- /dev/null
+++ b/include/asm-cris/arch-v32/uaccess.h
@@ -0,0 +1,748 @@
1/*
2 * Authors: Hans-Peter Nilsson (hp@axis.com)
3 *
4 */
5#ifndef _CRIS_ARCH_UACCESS_H
6#define _CRIS_ARCH_UACCESS_H
7
8/*
9 * We don't tell gcc that we are accessing memory, but this is OK
10 * because we do not write to any memory gcc knows about, so there
11 * are no aliasing issues.
12 *
13 * Note that PC at a fault is the address *at* the faulting
14 * instruction for CRISv32.
15 */
16#define __put_user_asm(x, addr, err, op) \
17 __asm__ __volatile__( \
18 "2: "op" %1,[%2]\n" \
19 "4:\n" \
20 " .section .fixup,\"ax\"\n" \
21 "3: move.d %3,%0\n" \
22 " jump 4b\n" \
23 " nop\n" \
24 " .previous\n" \
25 " .section __ex_table,\"a\"\n" \
26 " .dword 2b,3b\n" \
27 " .previous\n" \
28 : "=r" (err) \
29 : "r" (x), "r" (addr), "g" (-EFAULT), "0" (err))
30
31#define __put_user_asm_64(x, addr, err) do { \
32 int dummy_for_put_user_asm_64_; \
33 __asm__ __volatile__( \
34 "2: move.d %M2,[%1+]\n" \
35 "4: move.d %H2,[%1]\n" \
36 "5:\n" \
37 " .section .fixup,\"ax\"\n" \
38 "3: move.d %4,%0\n" \
39 " jump 5b\n" \
40 " .previous\n" \
41 " .section __ex_table,\"a\"\n" \
42 " .dword 2b,3b\n" \
43 " .dword 4b,3b\n" \
44 " .previous\n" \
45 : "=r" (err), "=b" (dummy_for_put_user_asm_64_) \
46 : "r" (x), "1" (addr), "g" (-EFAULT), \
47 "0" (err)); \
48 } while (0)
49
50/* See comment before __put_user_asm. */
51
52#define __get_user_asm(x, addr, err, op) \
53 __asm__ __volatile__( \
54 "2: "op" [%2],%1\n" \
55 "4:\n" \
56 " .section .fixup,\"ax\"\n" \
57 "3: move.d %3,%0\n" \
58 " jump 4b\n" \
59 " moveq 0,%1\n" \
60 " .previous\n" \
61 " .section __ex_table,\"a\"\n" \
62 " .dword 2b,3b\n" \
63 " .previous\n" \
64 : "=r" (err), "=r" (x) \
65 : "r" (addr), "g" (-EFAULT), "0" (err))
66
67#define __get_user_asm_64(x, addr, err) do { \
68 int dummy_for_get_user_asm_64_; \
69 __asm__ __volatile__( \
70 "2: move.d [%2+],%M1\n" \
71 "4: move.d [%2],%H1\n" \
72 "5:\n" \
73 " .section .fixup,\"ax\"\n" \
74 "3: move.d %4,%0\n" \
75 " jump 5b\n" \
76 " moveq 0,%1\n" \
77 " .previous\n" \
78 " .section __ex_table,\"a\"\n" \
79 " .dword 2b,3b\n" \
80 " .dword 4b,3b\n" \
81 " .previous\n" \
82 : "=r" (err), "=r" (x), \
83 "=b" (dummy_for_get_user_asm_64_) \
84 : "2" (addr), "g" (-EFAULT), "0" (err));\
85 } while (0)
86
87/*
88 * Copy a null terminated string from userspace.
89 *
90 * Must return:
91 * -EFAULT for an exception
92 * count if we hit the buffer limit
93 * bytes copied if we hit a null byte
94 * (without the null byte)
95 */
96extern inline long
97__do_strncpy_from_user(char *dst, const char *src, long count)
98{
99 long res;
100
101 if (count == 0)
102 return 0;
103
104 /*
105 * Currently, in 2.4.0-test9, most ports use a simple byte-copy loop.
106 * So do we.
107 *
108 * This code is deduced from:
109 *
110 * char tmp2;
111 * long tmp1, tmp3;
112 * tmp1 = count;
113 * while ((*dst++ = (tmp2 = *src++)) != 0
114 * && --tmp1)
115 * ;
116 *
117 * res = count - tmp1;
118 *
119 * with tweaks.
120 */
121
122 __asm__ __volatile__ (
123 " move.d %3,%0\n"
124 "5: move.b [%2+],$acr\n"
125 "1: beq 2f\n"
126 " move.b $acr,[%1+]\n"
127
128 " subq 1,%0\n"
129 "2: bne 1b\n"
130 " move.b [%2+],$acr\n"
131
132 " sub.d %3,%0\n"
133 " neg.d %0,%0\n"
134 "3:\n"
135 " .section .fixup,\"ax\"\n"
136 "4: move.d %7,%0\n"
137 " jump 3b\n"
138 " nop\n"
139
140 /* The address for a fault at the first move is trivial.
141 The address for a fault at the second move is that of
142 the preceding branch insn, since the move insn is in
143 its delay-slot. That address is also a branch
144 target. Just so you don't get confused... */
145 " .previous\n"
146 " .section __ex_table,\"a\"\n"
147 " .dword 5b,4b\n"
148 " .dword 2b,4b\n"
149 " .previous"
150 : "=r" (res), "=b" (dst), "=b" (src), "=r" (count)
151 : "3" (count), "1" (dst), "2" (src), "g" (-EFAULT)
152 : "acr");
153
154 return res;
155}
156
157/* A few copy asms to build up the more complex ones from.
158
159 Note again, a post-increment is performed regardless of whether a bus
160 fault occurred in that instruction, and PC for a faulted insn is the
161 address for the insn, or for the preceding branch when in a delay-slot. */
162
163#define __asm_copy_user_cont(to, from, ret, COPY, FIXUP, TENTRY) \
164 __asm__ __volatile__ ( \
165 COPY \
166 "1:\n" \
167 " .section .fixup,\"ax\"\n" \
168 FIXUP \
169 " .previous\n" \
170 " .section __ex_table,\"a\"\n" \
171 TENTRY \
172 " .previous\n" \
173 : "=b" (to), "=b" (from), "=r" (ret) \
174 : "0" (to), "1" (from), "2" (ret) \
175 : "acr", "memory")
176
177#define __asm_copy_from_user_1(to, from, ret) \
178 __asm_copy_user_cont(to, from, ret, \
179 "2: move.b [%1+],$acr\n" \
180 " move.b $acr,[%0+]\n", \
181 "3: addq 1,%2\n" \
182 " jump 1b\n" \
183 " clear.b [%0+]\n", \
184 " .dword 2b,3b\n")
185
186#define __asm_copy_from_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
187 __asm_copy_user_cont(to, from, ret, \
188 COPY \
189 "2: move.w [%1+],$acr\n" \
190 " move.w $acr,[%0+]\n", \
191 FIXUP \
192 "3: addq 2,%2\n" \
193 " jump 1b\n" \
194 " clear.w [%0+]\n", \
195 TENTRY \
196 " .dword 2b,3b\n")
197
198#define __asm_copy_from_user_2(to, from, ret) \
199 __asm_copy_from_user_2x_cont(to, from, ret, "", "", "")
200
201#define __asm_copy_from_user_3(to, from, ret) \
202 __asm_copy_from_user_2x_cont(to, from, ret, \
203 "4: move.b [%1+],$acr\n" \
204 " move.b $acr,[%0+]\n", \
205 "5: addq 1,%2\n" \
206 " clear.b [%0+]\n", \
207 " .dword 4b,5b\n")
208
209#define __asm_copy_from_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
210 __asm_copy_user_cont(to, from, ret, \
211 COPY \
212 "2: move.d [%1+],$acr\n" \
213 " move.d $acr,[%0+]\n", \
214 FIXUP \
215 "3: addq 4,%2\n" \
216 " jump 1b\n" \
217 " clear.d [%0+]\n", \
218 TENTRY \
219 " .dword 2b,3b\n")
220
221#define __asm_copy_from_user_4(to, from, ret) \
222 __asm_copy_from_user_4x_cont(to, from, ret, "", "", "")
223
224#define __asm_copy_from_user_5(to, from, ret) \
225 __asm_copy_from_user_4x_cont(to, from, ret, \
226 "4: move.b [%1+],$acr\n" \
227 " move.b $acr,[%0+]\n", \
228 "5: addq 1,%2\n" \
229 " clear.b [%0+]\n", \
230 " .dword 4b,5b\n")
231
232#define __asm_copy_from_user_6x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
233 __asm_copy_from_user_4x_cont(to, from, ret, \
234 COPY \
235 "4: move.w [%1+],$acr\n" \
236 " move.w $acr,[%0+]\n", \
237 FIXUP \
238 "5: addq 2,%2\n" \
239 " clear.w [%0+]\n", \
240 TENTRY \
241 " .dword 4b,5b\n")
242
243#define __asm_copy_from_user_6(to, from, ret) \
244 __asm_copy_from_user_6x_cont(to, from, ret, "", "", "")
245
246#define __asm_copy_from_user_7(to, from, ret) \
247 __asm_copy_from_user_6x_cont(to, from, ret, \
248 "6: move.b [%1+],$acr\n" \
249 " move.b $acr,[%0+]\n", \
250 "7: addq 1,%2\n" \
251 " clear.b [%0+]\n", \
252 " .dword 6b,7b\n")
253
254#define __asm_copy_from_user_8x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
255 __asm_copy_from_user_4x_cont(to, from, ret, \
256 COPY \
257 "4: move.d [%1+],$acr\n" \
258 " move.d $acr,[%0+]\n", \
259 FIXUP \
260 "5: addq 4,%2\n" \
261 " clear.d [%0+]\n", \
262 TENTRY \
263 " .dword 4b,5b\n")
264
265#define __asm_copy_from_user_8(to, from, ret) \
266 __asm_copy_from_user_8x_cont(to, from, ret, "", "", "")
267
268#define __asm_copy_from_user_9(to, from, ret) \
269 __asm_copy_from_user_8x_cont(to, from, ret, \
270 "6: move.b [%1+],$acr\n" \
271 " move.b $acr,[%0+]\n", \
272 "7: addq 1,%2\n" \
273 " clear.b [%0+]\n", \
274 " .dword 6b,7b\n")
275
276#define __asm_copy_from_user_10x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
277 __asm_copy_from_user_8x_cont(to, from, ret, \
278 COPY \
279 "6: move.w [%1+],$acr\n" \
280 " move.w $acr,[%0+]\n", \
281 FIXUP \
282 "7: addq 2,%2\n" \
283 " clear.w [%0+]\n", \
284 TENTRY \
285 " .dword 6b,7b\n")
286
287#define __asm_copy_from_user_10(to, from, ret) \
288 __asm_copy_from_user_10x_cont(to, from, ret, "", "", "")
289
290#define __asm_copy_from_user_11(to, from, ret) \
291 __asm_copy_from_user_10x_cont(to, from, ret, \
292 "8: move.b [%1+],$acr\n" \
293 " move.b $acr,[%0+]\n", \
294 "9: addq 1,%2\n" \
295 " clear.b [%0+]\n", \
296 " .dword 8b,9b\n")
297
298#define __asm_copy_from_user_12x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
299 __asm_copy_from_user_8x_cont(to, from, ret, \
300 COPY \
301 "6: move.d [%1+],$acr\n" \
302 " move.d $acr,[%0+]\n", \
303 FIXUP \
304 "7: addq 4,%2\n" \
305 " clear.d [%0+]\n", \
306 TENTRY \
307 " .dword 6b,7b\n")
308
309#define __asm_copy_from_user_12(to, from, ret) \
310 __asm_copy_from_user_12x_cont(to, from, ret, "", "", "")
311
312#define __asm_copy_from_user_13(to, from, ret) \
313 __asm_copy_from_user_12x_cont(to, from, ret, \
314 "8: move.b [%1+],$acr\n" \
315 " move.b $acr,[%0+]\n", \
316 "9: addq 1,%2\n" \
317 " clear.b [%0+]\n", \
318 " .dword 8b,9b\n")
319
320#define __asm_copy_from_user_14x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
321 __asm_copy_from_user_12x_cont(to, from, ret, \
322 COPY \
323 "8: move.w [%1+],$acr\n" \
324 " move.w $acr,[%0+]\n", \
325 FIXUP \
326 "9: addq 2,%2\n" \
327 " clear.w [%0+]\n", \
328 TENTRY \
329 " .dword 8b,9b\n")
330
331#define __asm_copy_from_user_14(to, from, ret) \
332 __asm_copy_from_user_14x_cont(to, from, ret, "", "", "")
333
334#define __asm_copy_from_user_15(to, from, ret) \
335 __asm_copy_from_user_14x_cont(to, from, ret, \
336 "10: move.b [%1+],$acr\n" \
337 " move.b $acr,[%0+]\n", \
338 "11: addq 1,%2\n" \
339 " clear.b [%0+]\n", \
340 " .dword 10b,11b\n")
341
342#define __asm_copy_from_user_16x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
343 __asm_copy_from_user_12x_cont(to, from, ret, \
344 COPY \
345 "8: move.d [%1+],$acr\n" \
346 " move.d $acr,[%0+]\n", \
347 FIXUP \
348 "9: addq 4,%2\n" \
349 " clear.d [%0+]\n", \
350 TENTRY \
351 " .dword 8b,9b\n")
352
353#define __asm_copy_from_user_16(to, from, ret) \
354 __asm_copy_from_user_16x_cont(to, from, ret, "", "", "")
355
356#define __asm_copy_from_user_20x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
357 __asm_copy_from_user_16x_cont(to, from, ret, \
358 COPY \
359 "10: move.d [%1+],$acr\n" \
360 " move.d $acr,[%0+]\n", \
361 FIXUP \
362 "11: addq 4,%2\n" \
363 " clear.d [%0+]\n", \
364 TENTRY \
365 " .dword 10b,11b\n")
366
367#define __asm_copy_from_user_20(to, from, ret) \
368 __asm_copy_from_user_20x_cont(to, from, ret, "", "", "")
369
370#define __asm_copy_from_user_24x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
371 __asm_copy_from_user_20x_cont(to, from, ret, \
372 COPY \
373 "12: move.d [%1+],$acr\n" \
374 " move.d $acr,[%0+]\n", \
375 FIXUP \
376 "13: addq 4,%2\n" \
377 " clear.d [%0+]\n", \
378 TENTRY \
379 " .dword 12b,13b\n")
380
381#define __asm_copy_from_user_24(to, from, ret) \
382 __asm_copy_from_user_24x_cont(to, from, ret, "", "", "")
383
384/* And now, the to-user ones. */
385
386#define __asm_copy_to_user_1(to, from, ret) \
387 __asm_copy_user_cont(to, from, ret, \
388 " move.b [%1+],$acr\n" \
389 "2: move.b $acr,[%0+]\n", \
390 "3: jump 1b\n" \
391 " addq 1,%2\n", \
392 " .dword 2b,3b\n")
393
394#define __asm_copy_to_user_2x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
395 __asm_copy_user_cont(to, from, ret, \
396 COPY \
397 " move.w [%1+],$acr\n" \
398 "2: move.w $acr,[%0+]\n", \
399 FIXUP \
400 "3: jump 1b\n" \
401 " addq 2,%2\n", \
402 TENTRY \
403 " .dword 2b,3b\n")
404
405#define __asm_copy_to_user_2(to, from, ret) \
406 __asm_copy_to_user_2x_cont(to, from, ret, "", "", "")
407
408#define __asm_copy_to_user_3(to, from, ret) \
409 __asm_copy_to_user_2x_cont(to, from, ret, \
410 " move.b [%1+],$acr\n" \
411 "4: move.b $acr,[%0+]\n", \
412 "5: addq 1,%2\n", \
413 " .dword 4b,5b\n")
414
415#define __asm_copy_to_user_4x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
416 __asm_copy_user_cont(to, from, ret, \
417 COPY \
418 " move.d [%1+],$acr\n" \
419 "2: move.d $acr,[%0+]\n", \
420 FIXUP \
421 "3: jump 1b\n" \
422 " addq 4,%2\n", \
423 TENTRY \
424 " .dword 2b,3b\n")
425
426#define __asm_copy_to_user_4(to, from, ret) \
427 __asm_copy_to_user_4x_cont(to, from, ret, "", "", "")
428
429#define __asm_copy_to_user_5(to, from, ret) \
430 __asm_copy_to_user_4x_cont(to, from, ret, \
431 " move.b [%1+],$acr\n" \
432 "4: move.b $acr,[%0+]\n", \
433 "5: addq 1,%2\n", \
434 " .dword 4b,5b\n")
435
436#define __asm_copy_to_user_6x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
437 __asm_copy_to_user_4x_cont(to, from, ret, \
438 COPY \
439 " move.w [%1+],$acr\n" \
440 "4: move.w $acr,[%0+]\n", \
441 FIXUP \
442 "5: addq 2,%2\n", \
443 TENTRY \
444 " .dword 4b,5b\n")
445
446#define __asm_copy_to_user_6(to, from, ret) \
447 __asm_copy_to_user_6x_cont(to, from, ret, "", "", "")
448
449#define __asm_copy_to_user_7(to, from, ret) \
450 __asm_copy_to_user_6x_cont(to, from, ret, \
451 " move.b [%1+],$acr\n" \
452 "6: move.b $acr,[%0+]\n", \
453 "7: addq 1,%2\n", \
454 " .dword 6b,7b\n")
455
456#define __asm_copy_to_user_8x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
457 __asm_copy_to_user_4x_cont(to, from, ret, \
458 COPY \
459 " move.d [%1+],$acr\n" \
460 "4: move.d $acr,[%0+]\n", \
461 FIXUP \
462 "5: addq 4,%2\n", \
463 TENTRY \
464 " .dword 4b,5b\n")
465
466#define __asm_copy_to_user_8(to, from, ret) \
467 __asm_copy_to_user_8x_cont(to, from, ret, "", "", "")
468
469#define __asm_copy_to_user_9(to, from, ret) \
470 __asm_copy_to_user_8x_cont(to, from, ret, \
471 " move.b [%1+],$acr\n" \
472 "6: move.b $acr,[%0+]\n", \
473 "7: addq 1,%2\n", \
474 " .dword 6b,7b\n")
475
476#define __asm_copy_to_user_10x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
477 __asm_copy_to_user_8x_cont(to, from, ret, \
478 COPY \
479 " move.w [%1+],$acr\n" \
480 "6: move.w $acr,[%0+]\n", \
481 FIXUP \
482 "7: addq 2,%2\n", \
483 TENTRY \
484 " .dword 6b,7b\n")
485
486#define __asm_copy_to_user_10(to, from, ret) \
487 __asm_copy_to_user_10x_cont(to, from, ret, "", "", "")
488
489#define __asm_copy_to_user_11(to, from, ret) \
490 __asm_copy_to_user_10x_cont(to, from, ret, \
491 " move.b [%1+],$acr\n" \
492 "8: move.b $acr,[%0+]\n", \
493 "9: addq 1,%2\n", \
494 " .dword 8b,9b\n")
495
496#define __asm_copy_to_user_12x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
497 __asm_copy_to_user_8x_cont(to, from, ret, \
498 COPY \
499 " move.d [%1+],$acr\n" \
500 "6: move.d $acr,[%0+]\n", \
501 FIXUP \
502 "7: addq 4,%2\n", \
503 TENTRY \
504 " .dword 6b,7b\n")
505
506#define __asm_copy_to_user_12(to, from, ret) \
507 __asm_copy_to_user_12x_cont(to, from, ret, "", "", "")
508
509#define __asm_copy_to_user_13(to, from, ret) \
510 __asm_copy_to_user_12x_cont(to, from, ret, \
511 " move.b [%1+],$acr\n" \
512 "8: move.b $acr,[%0+]\n", \
513 "9: addq 1,%2\n", \
514 " .dword 8b,9b\n")
515
516#define __asm_copy_to_user_14x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
517 __asm_copy_to_user_12x_cont(to, from, ret, \
518 COPY \
519 " move.w [%1+],$acr\n" \
520 "8: move.w $acr,[%0+]\n", \
521 FIXUP \
522 "9: addq 2,%2\n", \
523 TENTRY \
524 " .dword 8b,9b\n")
525
526#define __asm_copy_to_user_14(to, from, ret) \
527 __asm_copy_to_user_14x_cont(to, from, ret, "", "", "")
528
529#define __asm_copy_to_user_15(to, from, ret) \
530 __asm_copy_to_user_14x_cont(to, from, ret, \
531 " move.b [%1+],$acr\n" \
532 "10: move.b $acr,[%0+]\n", \
533 "11: addq 1,%2\n", \
534 " .dword 10b,11b\n")
535
536#define __asm_copy_to_user_16x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
537 __asm_copy_to_user_12x_cont(to, from, ret, \
538 COPY \
539 " move.d [%1+],$acr\n" \
540 "8: move.d $acr,[%0+]\n", \
541 FIXUP \
542 "9: addq 4,%2\n", \
543 TENTRY \
544 " .dword 8b,9b\n")
545
546#define __asm_copy_to_user_16(to, from, ret) \
547 __asm_copy_to_user_16x_cont(to, from, ret, "", "", "")
548
549#define __asm_copy_to_user_20x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
550 __asm_copy_to_user_16x_cont(to, from, ret, \
551 COPY \
552 " move.d [%1+],$acr\n" \
553 "10: move.d $acr,[%0+]\n", \
554 FIXUP \
555 "11: addq 4,%2\n", \
556 TENTRY \
557 " .dword 10b,11b\n")
558
559#define __asm_copy_to_user_20(to, from, ret) \
560 __asm_copy_to_user_20x_cont(to, from, ret, "", "", "")
561
562#define __asm_copy_to_user_24x_cont(to, from, ret, COPY, FIXUP, TENTRY) \
563 __asm_copy_to_user_20x_cont(to, from, ret, \
564 COPY \
565 " move.d [%1+],$acr\n" \
566 "12: move.d $acr,[%0+]\n", \
567 FIXUP \
568 "13: addq 4,%2\n", \
569 TENTRY \
570 " .dword 12b,13b\n")
571
572#define __asm_copy_to_user_24(to, from, ret) \
573 __asm_copy_to_user_24x_cont(to, from, ret, "", "", "")
574
575/* Define a few clearing asms with exception handlers. */
576
577/* This frame-asm is like the __asm_copy_user_cont one, but has one less
578 input. */
579
580#define __asm_clear(to, ret, CLEAR, FIXUP, TENTRY) \
581 __asm__ __volatile__ ( \
582 CLEAR \
583 "1:\n" \
584 " .section .fixup,\"ax\"\n" \
585 FIXUP \
586 " .previous\n" \
587 " .section __ex_table,\"a\"\n" \
588 TENTRY \
589 " .previous" \
590 : "=b" (to), "=r" (ret) \
591 : "0" (to), "1" (ret) \
592 : "memory")
593
594#define __asm_clear_1(to, ret) \
595 __asm_clear(to, ret, \
596 "2: clear.b [%0+]\n", \
597 "3: jump 1b\n" \
598 " addq 1,%1\n", \
599 " .dword 2b,3b\n")
600
601#define __asm_clear_2(to, ret) \
602 __asm_clear(to, ret, \
603 "2: clear.w [%0+]\n", \
604 "3: jump 1b\n" \
605 " addq 2,%1\n", \
606 " .dword 2b,3b\n")
607
608#define __asm_clear_3(to, ret) \
609 __asm_clear(to, ret, \
610 "2: clear.w [%0+]\n" \
611 "3: clear.b [%0+]\n", \
612 "4: addq 2,%1\n" \
613 "5: jump 1b\n" \
614 " addq 1,%1\n", \
615 " .dword 2b,4b\n" \
616 " .dword 3b,5b\n")
617
618#define __asm_clear_4x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
619 __asm_clear(to, ret, \
620 CLEAR \
621 "2: clear.d [%0+]\n", \
622 FIXUP \
623 "3: jump 1b\n" \
624 " addq 4,%1\n", \
625 TENTRY \
626 " .dword 2b,3b\n")
627
628#define __asm_clear_4(to, ret) \
629 __asm_clear_4x_cont(to, ret, "", "", "")
630
631#define __asm_clear_8x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
632 __asm_clear_4x_cont(to, ret, \
633 CLEAR \
634 "4: clear.d [%0+]\n", \
635 FIXUP \
636 "5: addq 4,%1\n", \
637 TENTRY \
638 " .dword 4b,5b\n")
639
640#define __asm_clear_8(to, ret) \
641 __asm_clear_8x_cont(to, ret, "", "", "")
642
643#define __asm_clear_12x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
644 __asm_clear_8x_cont(to, ret, \
645 CLEAR \
646 "6: clear.d [%0+]\n", \
647 FIXUP \
648 "7: addq 4,%1\n", \
649 TENTRY \
650 " .dword 6b,7b\n")
651
652#define __asm_clear_12(to, ret) \
653 __asm_clear_12x_cont(to, ret, "", "", "")
654
655#define __asm_clear_16x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
656 __asm_clear_12x_cont(to, ret, \
657 CLEAR \
658 "8: clear.d [%0+]\n", \
659 FIXUP \
660 "9: addq 4,%1\n", \
661 TENTRY \
662 " .dword 8b,9b\n")
663
664#define __asm_clear_16(to, ret) \
665 __asm_clear_16x_cont(to, ret, "", "", "")
666
667#define __asm_clear_20x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
668 __asm_clear_16x_cont(to, ret, \
669 CLEAR \
670 "10: clear.d [%0+]\n", \
671 FIXUP \
672 "11: addq 4,%1\n", \
673 TENTRY \
674 " .dword 10b,11b\n")
675
676#define __asm_clear_20(to, ret) \
677 __asm_clear_20x_cont(to, ret, "", "", "")
678
679#define __asm_clear_24x_cont(to, ret, CLEAR, FIXUP, TENTRY) \
680 __asm_clear_20x_cont(to, ret, \
681 CLEAR \
682 "12: clear.d [%0+]\n", \
683 FIXUP \
684 "13: addq 4,%1\n", \
685 TENTRY \
686 " .dword 12b,13b\n")
687
688#define __asm_clear_24(to, ret) \
689 __asm_clear_24x_cont(to, ret, "", "", "")
690
691/*
692 * Return the size of a string (including the ending 0)
693 *
694 * Return length of string in userspace including terminating 0
695 * or 0 for error. Return a value greater than N if too long.
696 */
697
698extern inline long
699strnlen_user(const char *s, long n)
700{
701 long res, tmp1;
702
703 if (!access_ok(VERIFY_READ, s, 0))
704 return 0;
705
706 /*
707 * This code is deduced from:
708 *
709 * tmp1 = n;
710 * while (tmp1-- > 0 && *s++)
711 * ;
712 *
713 * res = n - tmp1;
714 *
715 * (with tweaks).
716 */
717
718 __asm__ __volatile__ (
719 " move.d %1,$acr\n"
720 " cmpq 0,$acr\n"
721 "0:\n"
722 " ble 1f\n"
723 " subq 1,$acr\n"
724
725 "4: test.b [%0+]\n"
726 " bne 0b\n"
727 " cmpq 0,$acr\n"
728 "1:\n"
729 " move.d %1,%0\n"
730 " sub.d $acr,%0\n"
731 "2:\n"
732 " .section .fixup,\"ax\"\n"
733
734 "3: jump 2b\n"
735 " clear.d %0\n"
736
737 " .previous\n"
738 " .section __ex_table,\"a\"\n"
739 " .dword 4b,3b\n"
740 " .previous\n"
741 : "=r" (res), "=r" (tmp1)
742 : "0" (s), "1" (n)
743 : "acr");
744
745 return res;
746}
747
748#endif
diff --git a/include/asm-cris/arch-v32/unistd.h b/include/asm-cris/arch-v32/unistd.h
new file mode 100644
index 000000000000..5d369d4439d9
--- /dev/null
+++ b/include/asm-cris/arch-v32/unistd.h
@@ -0,0 +1,148 @@
1#ifndef _ASM_CRIS_ARCH_UNISTD_H_
2#define _ASM_CRIS_ARCH_UNISTD_H_
3
4/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
5/*
6 * Don't remove the .ifnc tests; they are an insurance against
7 * any hard-to-spot gcc register allocation bugs.
8 */
9#define _syscall0(type,name) \
10type name(void) \
11{ \
12 register long __a __asm__ ("r10"); \
13 register long __n_ __asm__ ("r9") = (__NR_##name); \
14 __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
15 ".err\n\t" \
16 ".endif\n\t" \
17 "break 13" \
18 : "=r" (__a) \
19 : "r" (__n_)); \
20 if (__a >= 0) \
21 return (type) __a; \
22 errno = -__a; \
23 return (type) -1; \
24}
25
26#define _syscall1(type,name,type1,arg1) \
27type name(type1 arg1) \
28{ \
29 register long __a __asm__ ("r10") = (long) arg1; \
30 register long __n_ __asm__ ("r9") = (__NR_##name); \
31 __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
32 ".err\n\t" \
33 ".endif\n\t" \
34 "break 13" \
35 : "=r" (__a) \
36 : "r" (__n_), "0" (__a)); \
37 if (__a >= 0) \
38 return (type) __a; \
39 errno = -__a; \
40 return (type) -1; \
41}
42
43#define _syscall2(type,name,type1,arg1,type2,arg2) \
44type name(type1 arg1,type2 arg2) \
45{ \
46 register long __a __asm__ ("r10") = (long) arg1; \
47 register long __b __asm__ ("r11") = (long) arg2; \
48 register long __n_ __asm__ ("r9") = (__NR_##name); \
49 __asm__ __volatile__ (".ifnc %0%1%3,$r10$r9$r11\n\t" \
50 ".err\n\t" \
51 ".endif\n\t" \
52 "break 13" \
53 : "=r" (__a) \
54 : "r" (__n_), "0" (__a), "r" (__b)); \
55 if (__a >= 0) \
56 return (type) __a; \
57 errno = -__a; \
58 return (type) -1; \
59}
60
61#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
62type name(type1 arg1,type2 arg2,type3 arg3) \
63{ \
64 register long __a __asm__ ("r10") = (long) arg1; \
65 register long __b __asm__ ("r11") = (long) arg2; \
66 register long __c __asm__ ("r12") = (long) arg3; \
67 register long __n_ __asm__ ("r9") = (__NR_##name); \
68 __asm__ __volatile__ (".ifnc %0%1%3%4,$r10$r9$r11$r12\n\t" \
69 ".err\n\t" \
70 ".endif\n\t" \
71 "break 13" \
72 : "=r" (__a) \
73 : "r" (__n_), "0" (__a), "r" (__b), "r" (__c)); \
74 if (__a >= 0) \
75 return (type) __a; \
76 errno = -__a; \
77 return (type) -1; \
78}
79
80#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
81type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
82{ \
83 register long __a __asm__ ("r10") = (long) arg1; \
84 register long __b __asm__ ("r11") = (long) arg2; \
85 register long __c __asm__ ("r12") = (long) arg3; \
86 register long __d __asm__ ("r13") = (long) arg4; \
87 register long __n_ __asm__ ("r9") = (__NR_##name); \
88 __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
89 ".err\n\t" \
90 ".endif\n\t" \
91 "break 13" \
92 : "=r" (__a) \
93 : "r" (__n_), "0" (__a), "r" (__b), \
94 "r" (__c), "r" (__d)); \
95 if (__a >= 0) \
96 return (type) __a; \
97 errno = -__a; \
98 return (type) -1; \
99}
100
101#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
102 type5,arg5) \
103type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
104{ \
105 register long __a __asm__ ("r10") = (long) arg1; \
106 register long __b __asm__ ("r11") = (long) arg2; \
107 register long __c __asm__ ("r12") = (long) arg3; \
108 register long __d __asm__ ("r13") = (long) arg4; \
109 register long __e __asm__ ("mof") = (long) arg5; \
110 register long __n_ __asm__ ("r9") = (__NR_##name); \
111 __asm__ __volatile__ (".ifnc %0%1%3%4%5%6,$r10$r9$r11$r12$r13$mof\n\t" \
112 ".err\n\t" \
113 ".endif\n\t" \
114 "break 13" \
115 : "=r" (__a) \
116 : "r" (__n_), "0" (__a), "r" (__b), \
117 "r" (__c), "r" (__d), "h" (__e)); \
118 if (__a >= 0) \
119 return (type) __a; \
120 errno = -__a; \
121 return (type) -1; \
122}
123
124#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
125 type5,arg5,type6,arg6) \
126type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
127{ \
128 register long __a __asm__ ("r10") = (long) arg1; \
129 register long __b __asm__ ("r11") = (long) arg2; \
130 register long __c __asm__ ("r12") = (long) arg3; \
131 register long __d __asm__ ("r13") = (long) arg4; \
132 register long __e __asm__ ("mof") = (long) arg5; \
133 register long __f __asm__ ("srp") = (long) arg6; \
134 register long __n_ __asm__ ("r9") = (__NR_##name); \
135 __asm__ __volatile__ (".ifnc %0%1%3%4%5%6%7,$r10$r9$r11$r12$r13$mof$srp\n\t" \
136 ".err\n\t" \
137 ".endif\n\t" \
138 "break 13" \
139 : "=r" (__a) \
140 : "r" (__n_), "0" (__a), "r" (__b), \
141 "r" (__c), "r" (__d), "h" (__e), "x" (__f)); \
142 if (__a >= 0) \
143 return (type) __a; \
144 errno = -__a; \
145 return (type) -1; \
146}
147
148#endif
diff --git a/include/asm-cris/arch-v32/user.h b/include/asm-cris/arch-v32/user.h
new file mode 100644
index 000000000000..03fa1f3c3c00
--- /dev/null
+++ b/include/asm-cris/arch-v32/user.h
@@ -0,0 +1,41 @@
1#ifndef _ASM_CRIS_ARCH_USER_H
2#define _ASM_CRIS_ARCH_USER_H
3
4/* User-mode register used for core dumps. */
5
6struct user_regs_struct {
7 unsigned long r0; /* General registers. */
8 unsigned long r1;
9 unsigned long r2;
10 unsigned long r3;
11 unsigned long r4;
12 unsigned long r5;
13 unsigned long r6;
14 unsigned long r7;
15 unsigned long r8;
16 unsigned long r9;
17 unsigned long r10;
18 unsigned long r11;
19 unsigned long r12;
20 unsigned long r13;
21 unsigned long sp; /* R14, Stack pointer. */
22 unsigned long acr; /* R15, Address calculation register. */
23 unsigned long bz; /* P0, Constant zero (8-bits). */
24 unsigned long vr; /* P1, Version register (8-bits). */
25 unsigned long pid; /* P2, Process ID (8-bits). */
26 unsigned long srs; /* P3, Support register select (8-bits). */
27 unsigned long wz; /* P4, Constant zero (16-bits). */
28 unsigned long exs; /* P5, Exception status. */
29 unsigned long eda; /* P6, Exception data address. */
30 unsigned long mof; /* P7, Multiply overflow regiter. */
31 unsigned long dz; /* P8, Constant zero (32-bits). */
32 unsigned long ebp; /* P9, Exception base pointer. */
33 unsigned long erp; /* P10, Exception return pointer. */
34 unsigned long srp; /* P11, Subroutine return pointer. */
35 unsigned long nrp; /* P12, NMI return pointer. */
36 unsigned long ccs; /* P13, Condition code stack. */
37 unsigned long usp; /* P14, User mode stack pointer. */
38 unsigned long spc; /* P15, Single step PC. */
39};
40
41#endif /* _ASM_CRIS_ARCH_USER_H */
diff --git a/include/asm-cris/atomic.h b/include/asm-cris/atomic.h
index b3dfea5a71e4..70605b09e8b7 100644
--- a/include/asm-cris/atomic.h
+++ b/include/asm-cris/atomic.h
@@ -4,21 +4,14 @@
4#define __ASM_CRIS_ATOMIC__ 4#define __ASM_CRIS_ATOMIC__
5 5
6#include <asm/system.h> 6#include <asm/system.h>
7#include <asm/arch/atomic.h>
7 8
8/* 9/*
9 * Atomic operations that C can't guarantee us. Useful for 10 * Atomic operations that C can't guarantee us. Useful for
10 * resource counting etc.. 11 * resource counting etc..
11 */ 12 */
12 13
13/* 14typedef struct { volatile int counter; } atomic_t;
14 * Make sure gcc doesn't try to be clever and move things around
15 * on us. We need to use _exactly_ the address the user gave us,
16 * not some alias that contains the same information.
17 */
18
19#define __atomic_fool_gcc(x) (*(struct { int a[100]; } *)x)
20
21typedef struct { int counter; } atomic_t;
22 15
23#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
24 17
@@ -30,29 +23,26 @@ typedef struct { int counter; } atomic_t;
30extern __inline__ void atomic_add(int i, volatile atomic_t *v) 23extern __inline__ void atomic_add(int i, volatile atomic_t *v)
31{ 24{
32 unsigned long flags; 25 unsigned long flags;
33 local_save_flags(flags); 26 cris_atomic_save(v, flags);
34 local_irq_disable();
35 v->counter += i; 27 v->counter += i;
36 local_irq_restore(flags); 28 cris_atomic_restore(v, flags);
37} 29}
38 30
39extern __inline__ void atomic_sub(int i, volatile atomic_t *v) 31extern __inline__ void atomic_sub(int i, volatile atomic_t *v)
40{ 32{
41 unsigned long flags; 33 unsigned long flags;
42 local_save_flags(flags); 34 cris_atomic_save(v, flags);
43 local_irq_disable();
44 v->counter -= i; 35 v->counter -= i;
45 local_irq_restore(flags); 36 cris_atomic_restore(v, flags);
46} 37}
47 38
48extern __inline__ int atomic_add_return(int i, volatile atomic_t *v) 39extern __inline__ int atomic_add_return(int i, volatile atomic_t *v)
49{ 40{
50 unsigned long flags; 41 unsigned long flags;
51 int retval; 42 int retval;
52 local_save_flags(flags); 43 cris_atomic_save(v, flags);
53 local_irq_disable();
54 retval = (v->counter += i); 44 retval = (v->counter += i);
55 local_irq_restore(flags); 45 cris_atomic_restore(v, flags);
56 return retval; 46 return retval;
57} 47}
58 48
@@ -62,10 +52,9 @@ extern __inline__ int atomic_sub_return(int i, volatile atomic_t *v)
62{ 52{
63 unsigned long flags; 53 unsigned long flags;
64 int retval; 54 int retval;
65 local_save_flags(flags); 55 cris_atomic_save(v, flags);
66 local_irq_disable();
67 retval = (v->counter -= i); 56 retval = (v->counter -= i);
68 local_irq_restore(flags); 57 cris_atomic_restore(v, flags);
69 return retval; 58 return retval;
70} 59}
71 60
@@ -73,39 +62,35 @@ extern __inline__ int atomic_sub_and_test(int i, volatile atomic_t *v)
73{ 62{
74 int retval; 63 int retval;
75 unsigned long flags; 64 unsigned long flags;
76 local_save_flags(flags); 65 cris_atomic_save(v, flags);
77 local_irq_disable();
78 retval = (v->counter -= i) == 0; 66 retval = (v->counter -= i) == 0;
79 local_irq_restore(flags); 67 cris_atomic_restore(v, flags);
80 return retval; 68 return retval;
81} 69}
82 70
83extern __inline__ void atomic_inc(volatile atomic_t *v) 71extern __inline__ void atomic_inc(volatile atomic_t *v)
84{ 72{
85 unsigned long flags; 73 unsigned long flags;
86 local_save_flags(flags); 74 cris_atomic_save(v, flags);
87 local_irq_disable();
88 (v->counter)++; 75 (v->counter)++;
89 local_irq_restore(flags); 76 cris_atomic_restore(v, flags);
90} 77}
91 78
92extern __inline__ void atomic_dec(volatile atomic_t *v) 79extern __inline__ void atomic_dec(volatile atomic_t *v)
93{ 80{
94 unsigned long flags; 81 unsigned long flags;
95 local_save_flags(flags); 82 cris_atomic_save(v, flags);
96 local_irq_disable();
97 (v->counter)--; 83 (v->counter)--;
98 local_irq_restore(flags); 84 cris_atomic_restore(v, flags);
99} 85}
100 86
101extern __inline__ int atomic_inc_return(volatile atomic_t *v) 87extern __inline__ int atomic_inc_return(volatile atomic_t *v)
102{ 88{
103 unsigned long flags; 89 unsigned long flags;
104 int retval; 90 int retval;
105 local_save_flags(flags); 91 cris_atomic_save(v, flags);
106 local_irq_disable();
107 retval = (v->counter)++; 92 retval = (v->counter)++;
108 local_irq_restore(flags); 93 cris_atomic_restore(v, flags);
109 return retval; 94 return retval;
110} 95}
111 96
@@ -113,20 +98,18 @@ extern __inline__ int atomic_dec_return(volatile atomic_t *v)
113{ 98{
114 unsigned long flags; 99 unsigned long flags;
115 int retval; 100 int retval;
116 local_save_flags(flags); 101 cris_atomic_save(v, flags);
117 local_irq_disable();
118 retval = (v->counter)--; 102 retval = (v->counter)--;
119 local_irq_restore(flags); 103 cris_atomic_restore(v, flags);
120 return retval; 104 return retval;
121} 105}
122extern __inline__ int atomic_dec_and_test(volatile atomic_t *v) 106extern __inline__ int atomic_dec_and_test(volatile atomic_t *v)
123{ 107{
124 int retval; 108 int retval;
125 unsigned long flags; 109 unsigned long flags;
126 local_save_flags(flags); 110 cris_atomic_save(v, flags);
127 local_irq_disable();
128 retval = --(v->counter) == 0; 111 retval = --(v->counter) == 0;
129 local_irq_restore(flags); 112 cris_atomic_restore(v, flags);
130 return retval; 113 return retval;
131} 114}
132 115
@@ -134,10 +117,9 @@ extern __inline__ int atomic_inc_and_test(volatile atomic_t *v)
134{ 117{
135 int retval; 118 int retval;
136 unsigned long flags; 119 unsigned long flags;
137 local_save_flags(flags); 120 cris_atomic_save(v, flags);
138 local_irq_disable();
139 retval = ++(v->counter) == 0; 121 retval = ++(v->counter) == 0;
140 local_irq_restore(flags); 122 cris_atomic_restore(v, flags);
141 return retval; 123 return retval;
142} 124}
143 125
diff --git a/include/asm-cris/axisflashmap.h b/include/asm-cris/axisflashmap.h
index 600bb8715d89..7a8d3114e682 100644
--- a/include/asm-cris/axisflashmap.h
+++ b/include/asm-cris/axisflashmap.h
@@ -40,4 +40,7 @@ struct partitiontable_entry {
40#define PARTITION_TYPE_KERNEL 0x0002 40#define PARTITION_TYPE_KERNEL 0x0002
41#define PARTITION_TYPE_JFFS 0x0003 41#define PARTITION_TYPE_JFFS 0x0003
42 42
43/* The master mtd for the entire flash. */
44extern struct mtd_info* axisflash_mtd;
45
43#endif 46#endif
diff --git a/include/asm-cris/bitops.h b/include/asm-cris/bitops.h
index d7861115d731..e3da57f97964 100644
--- a/include/asm-cris/bitops.h
+++ b/include/asm-cris/bitops.h
@@ -16,6 +16,7 @@
16 16
17#include <asm/arch/bitops.h> 17#include <asm/arch/bitops.h>
18#include <asm/system.h> 18#include <asm/system.h>
19#include <asm/atomic.h>
19#include <linux/compiler.h> 20#include <linux/compiler.h>
20 21
21/* 22/*
@@ -88,7 +89,7 @@ struct __dummy { unsigned long a[100]; };
88 * It also implies a memory barrier. 89 * It also implies a memory barrier.
89 */ 90 */
90 91
91extern inline int test_and_set_bit(int nr, void *addr) 92extern inline int test_and_set_bit(int nr, volatile unsigned long *addr)
92{ 93{
93 unsigned int mask, retval; 94 unsigned int mask, retval;
94 unsigned long flags; 95 unsigned long flags;
@@ -96,15 +97,15 @@ extern inline int test_and_set_bit(int nr, void *addr)
96 97
97 adr += nr >> 5; 98 adr += nr >> 5;
98 mask = 1 << (nr & 0x1f); 99 mask = 1 << (nr & 0x1f);
99 local_save_flags(flags); 100 cris_atomic_save(addr, flags);
100 local_irq_disable();
101 retval = (mask & *adr) != 0; 101 retval = (mask & *adr) != 0;
102 *adr |= mask; 102 *adr |= mask;
103 cris_atomic_restore(addr, flags);
103 local_irq_restore(flags); 104 local_irq_restore(flags);
104 return retval; 105 return retval;
105} 106}
106 107
107extern inline int __test_and_set_bit(int nr, void *addr) 108extern inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
108{ 109{
109 unsigned int mask, retval; 110 unsigned int mask, retval;
110 unsigned int *adr = (unsigned int *)addr; 111 unsigned int *adr = (unsigned int *)addr;
@@ -131,7 +132,7 @@ extern inline int __test_and_set_bit(int nr, void *addr)
131 * It also implies a memory barrier. 132 * It also implies a memory barrier.
132 */ 133 */
133 134
134extern inline int test_and_clear_bit(int nr, void *addr) 135extern inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
135{ 136{
136 unsigned int mask, retval; 137 unsigned int mask, retval;
137 unsigned long flags; 138 unsigned long flags;
@@ -139,11 +140,10 @@ extern inline int test_and_clear_bit(int nr, void *addr)
139 140
140 adr += nr >> 5; 141 adr += nr >> 5;
141 mask = 1 << (nr & 0x1f); 142 mask = 1 << (nr & 0x1f);
142 local_save_flags(flags); 143 cris_atomic_save(addr, flags);
143 local_irq_disable();
144 retval = (mask & *adr) != 0; 144 retval = (mask & *adr) != 0;
145 *adr &= ~mask; 145 *adr &= ~mask;
146 local_irq_restore(flags); 146 cris_atomic_restore(addr, flags);
147 return retval; 147 return retval;
148} 148}
149 149
@@ -157,7 +157,7 @@ extern inline int test_and_clear_bit(int nr, void *addr)
157 * but actually fail. You must protect multiple accesses with a lock. 157 * but actually fail. You must protect multiple accesses with a lock.
158 */ 158 */
159 159
160extern inline int __test_and_clear_bit(int nr, void *addr) 160extern inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
161{ 161{
162 unsigned int mask, retval; 162 unsigned int mask, retval;
163 unsigned int *adr = (unsigned int *)addr; 163 unsigned int *adr = (unsigned int *)addr;
@@ -177,24 +177,23 @@ extern inline int __test_and_clear_bit(int nr, void *addr)
177 * It also implies a memory barrier. 177 * It also implies a memory barrier.
178 */ 178 */
179 179
180extern inline int test_and_change_bit(int nr, void *addr) 180extern inline int test_and_change_bit(int nr, volatile unsigned long *addr)
181{ 181{
182 unsigned int mask, retval; 182 unsigned int mask, retval;
183 unsigned long flags; 183 unsigned long flags;
184 unsigned int *adr = (unsigned int *)addr; 184 unsigned int *adr = (unsigned int *)addr;
185 adr += nr >> 5; 185 adr += nr >> 5;
186 mask = 1 << (nr & 0x1f); 186 mask = 1 << (nr & 0x1f);
187 local_save_flags(flags); 187 cris_atomic_save(addr, flags);
188 local_irq_disable();
189 retval = (mask & *adr) != 0; 188 retval = (mask & *adr) != 0;
190 *adr ^= mask; 189 *adr ^= mask;
191 local_irq_restore(flags); 190 cris_atomic_restore(addr, flags);
192 return retval; 191 return retval;
193} 192}
194 193
195/* WARNING: non atomic and it can be reordered! */ 194/* WARNING: non atomic and it can be reordered! */
196 195
197extern inline int __test_and_change_bit(int nr, void *addr) 196extern inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
198{ 197{
199 unsigned int mask, retval; 198 unsigned int mask, retval;
200 unsigned int *adr = (unsigned int *)addr; 199 unsigned int *adr = (unsigned int *)addr;
@@ -215,7 +214,7 @@ extern inline int __test_and_change_bit(int nr, void *addr)
215 * This routine doesn't need to be atomic. 214 * This routine doesn't need to be atomic.
216 */ 215 */
217 216
218extern inline int test_bit(int nr, const void *addr) 217extern inline int test_bit(int nr, const volatile unsigned long *addr)
219{ 218{
220 unsigned int mask; 219 unsigned int mask;
221 unsigned int *adr = (unsigned int *)addr; 220 unsigned int *adr = (unsigned int *)addr;
@@ -259,7 +258,7 @@ extern inline int test_bit(int nr, const void *addr)
259 * @offset: The bitnumber to start searching at 258 * @offset: The bitnumber to start searching at
260 * @size: The maximum size to search 259 * @size: The maximum size to search
261 */ 260 */
262extern inline int find_next_zero_bit (void * addr, int size, int offset) 261extern inline int find_next_zero_bit (const unsigned long * addr, int size, int offset)
263{ 262{
264 unsigned long *p = ((unsigned long *) addr) + (offset >> 5); 263 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
265 unsigned long result = offset & ~31UL; 264 unsigned long result = offset & ~31UL;
@@ -301,7 +300,7 @@ extern inline int find_next_zero_bit (void * addr, int size, int offset)
301 * @offset: The bitnumber to start searching at 300 * @offset: The bitnumber to start searching at
302 * @size: The maximum size to search 301 * @size: The maximum size to search
303 */ 302 */
304static __inline__ int find_next_bit(void *addr, int size, int offset) 303static __inline__ int find_next_bit(const unsigned long *addr, int size, int offset)
305{ 304{
306 unsigned long *p = ((unsigned long *) addr) + (offset >> 5); 305 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
307 unsigned long result = offset & ~31UL; 306 unsigned long result = offset & ~31UL;
@@ -367,7 +366,7 @@ found_middle:
367#define minix_test_bit(nr,addr) test_bit(nr,addr) 366#define minix_test_bit(nr,addr) test_bit(nr,addr)
368#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size) 367#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
369 368
370extern inline int sched_find_first_bit(unsigned long *b) 369extern inline int sched_find_first_bit(const unsigned long *b)
371{ 370{
372 if (unlikely(b[0])) 371 if (unlikely(b[0]))
373 return __ffs(b[0]); 372 return __ffs(b[0]);
diff --git a/include/asm-cris/dma-mapping.h b/include/asm-cris/dma-mapping.h
index 0d770f60127a..0b5c3fdaefe1 100644
--- a/include/asm-cris/dma-mapping.h
+++ b/include/asm-cris/dma-mapping.h
@@ -1,125 +1,179 @@
1/* DMA mapping. Nothing tricky here, just virt_to_phys */
2
1#ifndef _ASM_CRIS_DMA_MAPPING_H 3#ifndef _ASM_CRIS_DMA_MAPPING_H
2#define _ASM_CRIS_DMA_MAPPING_H 4#define _ASM_CRIS_DMA_MAPPING_H
3 5
4#include "scatterlist.h" 6#include <linux/mm.h>
7#include <linux/kernel.h>
5 8
6static inline int 9#include <asm/cache.h>
7dma_supported(struct device *dev, u64 mask) 10#include <asm/io.h>
8{ 11#include <asm/scatterlist.h>
9 BUG();
10 return 0;
11}
12 12
13static inline int 13#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
14dma_set_mask(struct device *dev, u64 dma_mask) 14#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
15{ 15
16 BUG(); 16#ifdef CONFIG_PCI
17 return 1; 17void *dma_alloc_coherent(struct device *dev, size_t size,
18} 18 dma_addr_t *dma_handle, int flag);
19 19
20void dma_free_coherent(struct device *dev, size_t size,
21 void *vaddr, dma_addr_t dma_handle);
22#else
20static inline void * 23static inline void *
21dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, 24dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle,
22 int flag) 25 int flag)
23{ 26{
24 BUG(); 27 BUG();
25 return NULL; 28 return NULL;
26} 29}
27 30
28static inline void 31static inline void
29dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, 32dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
30 dma_addr_t dma_handle) 33 dma_addr_t dma_handle)
31{ 34{
32 BUG(); 35 BUG();
33} 36}
34 37#endif
35static inline dma_addr_t 38static inline dma_addr_t
36dma_map_single(struct device *dev, void *cpu_addr, size_t size, 39dma_map_single(struct device *dev, void *ptr, size_t size,
37 enum dma_data_direction direction) 40 enum dma_data_direction direction)
38{ 41{
39 BUG(); 42 BUG_ON(direction == DMA_NONE);
40 return 0; 43 return virt_to_phys(ptr);
41} 44}
42 45
43static inline void 46static inline void
44dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, 47dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
45 enum dma_data_direction direction) 48 enum dma_data_direction direction)
46{ 49{
47 BUG(); 50 BUG_ON(direction == DMA_NONE);
51}
52
53static inline int
54dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
55 enum dma_data_direction direction)
56{
57 printk("Map sg\n");
58 return nents;
48} 59}
49 60
50static inline dma_addr_t 61static inline dma_addr_t
51dma_map_page(struct device *dev, struct page *page, 62dma_map_page(struct device *dev, struct page *page, unsigned long offset,
52 unsigned long offset, size_t size, 63 size_t size, enum dma_data_direction direction)
53 enum dma_data_direction direction)
54{ 64{
55 BUG(); 65 BUG_ON(direction == DMA_NONE);
56 return 0; 66 return page_to_phys(page) + offset;
57} 67}
58 68
59static inline void 69static inline void
60dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, 70dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
61 enum dma_data_direction direction) 71 enum dma_data_direction direction)
62{ 72{
63 BUG(); 73 BUG_ON(direction == DMA_NONE);
64} 74}
65 75
66static inline int
67dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
68 enum dma_data_direction direction)
69{
70 BUG();
71 return 1;
72}
73 76
74static inline void 77static inline void
75dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, 78dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
76 enum dma_data_direction direction) 79 enum dma_data_direction direction)
77{ 80{
78 BUG(); 81 BUG_ON(direction == DMA_NONE);
79} 82}
80 83
81static inline void 84static inline void
82dma_sync_single(struct device *dev, dma_addr_t dma_handle, size_t size, 85dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
83 enum dma_data_direction direction) 86 enum dma_data_direction direction)
84{ 87{
85 BUG();
86} 88}
87 89
88static inline void 90static inline void
89dma_sync_sg(struct device *dev, struct scatterlist *sg, int nelems, 91dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
90 enum dma_data_direction direction) 92 enum dma_data_direction direction)
91{ 93{
92 BUG();
93} 94}
94 95
95/* Now for the API extensions over the pci_ one */ 96static inline void
97dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
98 unsigned long offset, size_t size,
99 enum dma_data_direction direction)
100{
101}
96 102
97#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 103static inline void
98#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 104dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
99#define dma_is_consistent(d) (1) 105 unsigned long offset, size_t size,
106 enum dma_data_direction direction)
107{
108}
100 109
101static inline int 110static inline void
102dma_get_cache_alignment(void) 111dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
112 enum dma_data_direction direction)
103{ 113{
104 /* no easy way to get cache size on all processors, so return
105 * the maximum possible, to be safe */
106 return (1 << L1_CACHE_SHIFT_MAX);
107} 114}
108 115
109static inline void 116static inline void
110dma_sync_single_range(struct device *dev, dma_addr_t dma_handle, 117dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
111 unsigned long offset, size_t size, 118 enum dma_data_direction direction)
112 enum dma_data_direction direction)
113{ 119{
114 BUG();
115} 120}
116 121
122static inline int
123dma_mapping_error(dma_addr_t dma_addr)
124{
125 return 0;
126}
127
128static inline int
129dma_supported(struct device *dev, u64 mask)
130{
131 /*
132 * we fall back to GFP_DMA when the mask isn't all 1s,
133 * so we can't guarantee allocations that must be
134 * within a tighter range than GFP_DMA..
135 */
136 if(mask < 0x00ffffff)
137 return 0;
138
139 return 1;
140}
141
142static inline int
143dma_set_mask(struct device *dev, u64 mask)
144{
145 if(!dev->dma_mask || !dma_supported(dev, mask))
146 return -EIO;
147
148 *dev->dma_mask = mask;
149
150 return 0;
151}
152
153static inline int
154dma_get_cache_alignment(void)
155{
156 return (1 << L1_CACHE_SHIFT_MAX);
157}
158
159#define dma_is_consistent(d) (1)
160
117static inline void 161static inline void
118dma_cache_sync(void *vaddr, size_t size, 162dma_cache_sync(void *vaddr, size_t size,
119 enum dma_data_direction direction) 163 enum dma_data_direction direction)
120{ 164{
121 BUG();
122} 165}
123 166
124#endif 167#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
168extern int
169dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr,
170 dma_addr_t device_addr, size_t size, int flags);
171
172extern void
173dma_release_declared_memory(struct device *dev);
125 174
175extern void *
176dma_mark_declared_memory_occupied(struct device *dev,
177 dma_addr_t device_addr, size_t size);
178
179#endif
diff --git a/include/asm-cris/dma.h b/include/asm-cris/dma.h
index c229fac35cdc..6f188dc56138 100644
--- a/include/asm-cris/dma.h
+++ b/include/asm-cris/dma.h
@@ -10,4 +10,12 @@
10 10
11#define MAX_DMA_ADDRESS PAGE_OFFSET 11#define MAX_DMA_ADDRESS PAGE_OFFSET
12 12
13/* From PCI */
14
15#ifdef CONFIG_PCI
16extern int isa_dma_bridge_buggy;
17#else
18#define isa_dma_bridge_buggy (0)
19#endif
20
13#endif /* _ASM_DMA_H */ 21#endif /* _ASM_DMA_H */
diff --git a/include/asm-cris/elf.h b/include/asm-cris/elf.h
index d37fd5c4a567..87a60bd8e667 100644
--- a/include/asm-cris/elf.h
+++ b/include/asm-cris/elf.h
@@ -8,6 +8,27 @@
8#include <asm/arch/elf.h> 8#include <asm/arch/elf.h>
9#include <asm/user.h> 9#include <asm/user.h>
10 10
11#define R_CRIS_NONE 0
12#define R_CRIS_8 1
13#define R_CRIS_16 2
14#define R_CRIS_32 3
15#define R_CRIS_8_PCREL 4
16#define R_CRIS_16_PCREL 5
17#define R_CRIS_32_PCREL 6
18#define R_CRIS_GNU_VTINHERIT 7
19#define R_CRIS_GNU_VTENTRY 8
20#define R_CRIS_COPY 9
21#define R_CRIS_GLOB_DAT 10
22#define R_CRIS_JUMP_SLOT 11
23#define R_CRIS_RELATIVE 12
24#define R_CRIS_16_GOT 13
25#define R_CRIS_32_GOT 14
26#define R_CRIS_16_GOTPLT 15
27#define R_CRIS_32_GOTPLT 16
28#define R_CRIS_32_GOTREL 17
29#define R_CRIS_32_PLT_GOTREL 18
30#define R_CRIS_32_PLT_PCREL 19
31
11typedef unsigned long elf_greg_t; 32typedef unsigned long elf_greg_t;
12 33
13/* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is 34/* Note that NGREG is defined to ELF_NGREG in include/linux/elfcore.h, and is
@@ -19,17 +40,29 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
19typedef unsigned long elf_fpregset_t; 40typedef unsigned long elf_fpregset_t;
20 41
21/* 42/*
22 * This is used to ensure we don't load something for the wrong architecture.
23 */
24#define elf_check_arch(x) ( (x)->e_machine == EM_CRIS )
25
26/*
27 * These are used to set parameters in the core dumps. 43 * These are used to set parameters in the core dumps.
28 */ 44 */
29#define ELF_CLASS ELFCLASS32 45#define ELF_CLASS ELFCLASS32
30#define ELF_DATA ELFDATA2LSB; 46#define ELF_DATA ELFDATA2LSB
31#define ELF_ARCH EM_CRIS 47#define ELF_ARCH EM_CRIS
32 48
49/* The master for these definitions is {binutils}/include/elf/cris.h: */
50/* User symbols in this file have a leading underscore. */
51#define EF_CRIS_UNDERSCORE 0x00000001
52
53/* This is a mask for different incompatible machine variants. */
54#define EF_CRIS_VARIANT_MASK 0x0000000e
55
56/* Variant 0; may contain v0..10 object. */
57#define EF_CRIS_VARIANT_ANY_V0_V10 0x00000000
58
59/* Variant 1; contains v32 object. */
60#define EF_CRIS_VARIANT_V32 0x00000002
61
62/* Variant 2; contains object compatible with v32 and v10. */
63#define EF_CRIS_VARIANT_COMMON_V10_V32 0x00000004
64/* End of excerpt from {binutils}/include/elf/cris.h. */
65
33#define USE_ELF_CORE_DUMP 66#define USE_ELF_CORE_DUMP
34 67
35#define ELF_EXEC_PAGESIZE 8192 68#define ELF_EXEC_PAGESIZE 8192
diff --git a/include/asm-cris/emergency-restart.h b/include/asm-cris/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-cris/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-cris/etraxgpio.h b/include/asm-cris/etraxgpio.h
index cf04af9635cc..80ee10f70d43 100644
--- a/include/asm-cris/etraxgpio.h
+++ b/include/asm-cris/etraxgpio.h
@@ -13,7 +13,7 @@
13 are enabled. 13 are enabled.
14 * 14 *
15 * 15 *
16 * For ETRAX 200 (ARCH_V32): 16 * For ETRAX FS (ARCH_V32):
17 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction 17 * /dev/gpioa minor 0, 8 bit GPIO, each bit can change direction
18 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction 18 * /dev/gpiob minor 1, 18 bit GPIO, each bit can change direction
19 * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction 19 * /dev/gpioc minor 2, 18 bit GPIO, each bit can change direction
@@ -39,10 +39,10 @@
39#define ETRAXGPIO_IOCTYPE 43 39#define ETRAXGPIO_IOCTYPE 43
40#define GPIO_MINOR_A 0 40#define GPIO_MINOR_A 0
41#define GPIO_MINOR_B 1 41#define GPIO_MINOR_B 1
42#define GPIO_MINOR_C 2 42#define GPIO_MINOR_LEDS 2
43#define GPIO_MINOR_D 3 43#define GPIO_MINOR_C 3
44#define GPIO_MINOR_E 4 44#define GPIO_MINOR_D 4
45#define GPIO_MINOR_LEDS 5 45#define GPIO_MINOR_E 5
46#define GPIO_MINOR_LAST 5 46#define GPIO_MINOR_LAST 5
47#endif 47#endif
48 48
diff --git a/include/asm-cris/hardirq.h b/include/asm-cris/hardirq.h
index f4d136228ee1..1c13dd3faac3 100644
--- a/include/asm-cris/hardirq.h
+++ b/include/asm-cris/hardirq.h
@@ -1,18 +1,17 @@
1#ifndef __ASM_HARDIRQ_H 1#ifndef __ASM_HARDIRQ_H
2#define __ASM_HARDIRQ_H 2#define __ASM_HARDIRQ_H
3 3
4/* only non-SMP supported */
5
6#include <linux/threads.h> 4#include <linux/threads.h>
7#include <linux/cache.h> 5#include <linux/cache.h>
8 6
9/* entry.S is sensitive to the offsets of these fields */
10typedef struct { 7typedef struct {
11 unsigned int __softirq_pending; 8 unsigned int __softirq_pending;
12} ____cacheline_aligned irq_cpustat_t; 9} ____cacheline_aligned irq_cpustat_t;
13 10
14#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ 11#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
15 12
13void ack_bad_irq(unsigned int irq);
14
16#define HARDIRQ_BITS 8 15#define HARDIRQ_BITS 8
17 16
18/* 17/*
diff --git a/include/asm-cris/hw_irq.h b/include/asm-cris/hw_irq.h
new file mode 100644
index 000000000000..341536a234e9
--- /dev/null
+++ b/include/asm-cris/hw_irq.h
@@ -0,0 +1,7 @@
1#ifndef _ASM_HW_IRQ_H
2#define _ASM_HW_IRQ_H
3
4static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i) {}
5
6#endif
7
diff --git a/include/asm-cris/ide.h b/include/asm-cris/ide.h
new file mode 100644
index 000000000000..a894f66665f8
--- /dev/null
+++ b/include/asm-cris/ide.h
@@ -0,0 +1 @@
#include <asm/arch/ide.h>
diff --git a/include/asm-cris/io.h b/include/asm-cris/io.h
index 1d2b51701e8d..16e791b3c721 100644
--- a/include/asm-cris/io.h
+++ b/include/asm-cris/io.h
@@ -3,6 +3,21 @@
3 3
4#include <asm/page.h> /* for __va, __pa */ 4#include <asm/page.h> /* for __va, __pa */
5#include <asm/arch/io.h> 5#include <asm/arch/io.h>
6#include <linux/kernel.h>
7
8struct cris_io_operations
9{
10 u32 (*read_mem)(void *addr, int size);
11 void (*write_mem)(u32 val, int size, void *addr);
12 u32 (*read_io)(u32 port, void *addr, int size, int count);
13 void (*write_io)(u32 port, void *addr, int size, int count);
14};
15
16#ifdef CONFIG_PCI
17extern struct cris_io_operations *cris_iops;
18#else
19#define cris_iops ((struct cris_io_operations*)NULL)
20#endif
6 21
7/* 22/*
8 * Change virtual addresses to physical addresses and vv. 23 * Change virtual addresses to physical addresses and vv.
@@ -18,14 +33,17 @@ extern inline void * phys_to_virt(unsigned long address)
18 return __va(address); 33 return __va(address);
19} 34}
20 35
21extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags); 36extern void __iomem * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
37extern void __iomem * __ioremap_prot(unsigned long phys_addr, unsigned long size, pgprot_t prot);
22 38
23extern inline void * ioremap (unsigned long offset, unsigned long size) 39extern inline void __iomem * ioremap (unsigned long offset, unsigned long size)
24{ 40{
25 return __ioremap(offset, size, 0); 41 return __ioremap(offset, size, 0);
26} 42}
27 43
28extern void iounmap(void *addr); 44extern void iounmap(volatile void * __iomem addr);
45
46extern void __iomem * ioremap_nocache(unsigned long offset, unsigned long size);
29 47
30/* 48/*
31 * IO bus memory addresses are also 1:1 with the physical address 49 * IO bus memory addresses are also 1:1 with the physical address
@@ -39,9 +57,32 @@ extern void iounmap(void *addr);
39 * differently. On the CRIS architecture, we just read/write the 57 * differently. On the CRIS architecture, we just read/write the
40 * memory location directly. 58 * memory location directly.
41 */ 59 */
42#define readb(addr) (*(volatile unsigned char *) (addr)) 60#ifdef CONFIG_PCI
43#define readw(addr) (*(volatile unsigned short *) (addr)) 61#define PCI_SPACE(x) ((((unsigned)(x)) & 0x10000000) == 0x10000000)
44#define readl(addr) (*(volatile unsigned int *) (addr)) 62#else
63#define PCI_SPACE(x) 0
64#endif
65static inline unsigned char readb(const volatile void __iomem *addr)
66{
67 if (PCI_SPACE(addr) && cris_iops)
68 return cris_iops->read_mem((void*)addr, 1);
69 else
70 return *(volatile unsigned char __force *) addr;
71}
72static inline unsigned short readw(const volatile void __iomem *addr)
73{
74 if (PCI_SPACE(addr) && cris_iops)
75 return cris_iops->read_mem((void*)addr, 2);
76 else
77 return *(volatile unsigned short __force *) addr;
78}
79static inline unsigned int readl(const volatile void __iomem *addr)
80{
81 if (PCI_SPACE(addr) && cris_iops)
82 return cris_iops->read_mem((void*)addr, 4);
83 else
84 return *(volatile unsigned int __force *) addr;
85}
45#define readb_relaxed(addr) readb(addr) 86#define readb_relaxed(addr) readb(addr)
46#define readw_relaxed(addr) readw(addr) 87#define readw_relaxed(addr) readw(addr)
47#define readl_relaxed(addr) readl(addr) 88#define readl_relaxed(addr) readl(addr)
@@ -49,9 +90,27 @@ extern void iounmap(void *addr);
49#define __raw_readw readw 90#define __raw_readw readw
50#define __raw_readl readl 91#define __raw_readl readl
51 92
52#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) 93static inline void writeb(unsigned char b, volatile void __iomem *addr)
53#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) 94{
54#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b)) 95 if (PCI_SPACE(addr) && cris_iops)
96 cris_iops->write_mem(b, 1, (void*)addr);
97 else
98 *(volatile unsigned char __force *) addr = b;
99}
100static inline void writew(unsigned short b, volatile void __iomem *addr)
101{
102 if (PCI_SPACE(addr) && cris_iops)
103 cris_iops->write_mem(b, 2, (void*)addr);
104 else
105 *(volatile unsigned short __force *) addr = b;
106}
107static inline void writel(unsigned int b, volatile void __iomem *addr)
108{
109 if (PCI_SPACE(addr) && cris_iops)
110 cris_iops->write_mem(b, 4, (void*)addr);
111 else
112 *(volatile unsigned int __force *) addr = b;
113}
55#define __raw_writeb writeb 114#define __raw_writeb writeb
56#define __raw_writew writew 115#define __raw_writew writew
57#define __raw_writel writel 116#define __raw_writel writel
@@ -66,25 +125,25 @@ extern void iounmap(void *addr);
66 * Again, CRIS does not require mem IO specific function. 125 * Again, CRIS does not require mem IO specific function.
67 */ 126 */
68 127
69#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d)) 128#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void __force *)(b),(c),(d))
70 129
71/* The following is junk needed for the arch-independent code but which 130/* The following is junk needed for the arch-independent code but which
72 * we never use in the CRIS port 131 * we never use in the CRIS port
73 */ 132 */
74 133
75#define IO_SPACE_LIMIT 0xffff 134#define IO_SPACE_LIMIT 0xffff
76#define inb(x) (0) 135#define inb(port) (cris_iops ? cris_iops->read_io(port,NULL,1,1) : 0)
77#define inw(x) (0) 136#define inw(port) (cris_iops ? cris_iops->read_io(port,NULL,2,1) : 0)
78#define inl(x) (0) 137#define inl(port) (cris_iops ? cris_iops->read_io(port,NULL,4,1) : 0)
79#define outb(x,y) 138#define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
80#define outw(x,y) 139#define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
81#define outl(x,y) 140#define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
82#define insb(x,y,z) 141#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1)
83#define insw(x,y,z) 142#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1)
84#define insl(x,y,z) 143#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1)
85#define outsb(x,y,z) 144#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count)
86#define outsw(x,y,z) 145#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count)
87#define outsl(x,y,z) 146#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count)
88 147
89/* 148/*
90 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 149 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
diff --git a/include/asm-cris/irq.h b/include/asm-cris/irq.h
index 87f342517bb1..8e787fdaedd4 100644
--- a/include/asm-cris/irq.h
+++ b/include/asm-cris/irq.h
@@ -8,16 +8,6 @@ extern __inline__ int irq_canonicalize(int irq)
8 return irq; 8 return irq;
9} 9}
10 10
11extern void disable_irq(unsigned int);
12extern void enable_irq(unsigned int);
13
14#define disable_irq_nosync disable_irq
15#define enable_irq_nosync enable_irq
16
17struct irqaction;
18struct pt_regs;
19int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
20
21#endif /* _ASM_IRQ_H */ 11#endif /* _ASM_IRQ_H */
22 12
23 13
diff --git a/include/asm-cris/kmap_types.h b/include/asm-cris/kmap_types.h
index eec0974c2417..492988cb9077 100644
--- a/include/asm-cris/kmap_types.h
+++ b/include/asm-cris/kmap_types.h
@@ -17,8 +17,8 @@ enum km_type {
17 KM_PTE1, 17 KM_PTE1,
18 KM_IRQ0, 18 KM_IRQ0,
19 KM_IRQ1, 19 KM_IRQ1,
20 KM_CRYPTO_USER, 20 KM_SOFTIRQ0,
21 KM_CRYPTO_SOFTIRQ, 21 KM_SOFTIRQ1,
22 KM_TYPE_NR 22 KM_TYPE_NR
23}; 23};
24 24
diff --git a/include/asm-cris/mmu_context.h b/include/asm-cris/mmu_context.h
index f9308c5bbd99..e6e659dc757b 100644
--- a/include/asm-cris/mmu_context.h
+++ b/include/asm-cris/mmu_context.h
@@ -15,7 +15,7 @@ extern void switch_mm(struct mm_struct *prev, struct mm_struct *next,
15 * registers like cr3 on the i386 15 * registers like cr3 on the i386
16 */ 16 */
17 17
18extern volatile pgd_t *current_pgd; /* defined in arch/cris/mm/fault.c */ 18extern volatile DEFINE_PER_CPU(pgd_t *,current_pgd); /* defined in arch/cris/mm/fault.c */
19 19
20static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) 20static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
21{ 21{
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h
index c767da1ef8f5..bbf17bd39385 100644
--- a/include/asm-cris/page.h
+++ b/include/asm-cris/page.h
@@ -29,18 +29,15 @@
29 */ 29 */
30#ifndef __ASSEMBLY__ 30#ifndef __ASSEMBLY__
31typedef struct { unsigned long pte; } pte_t; 31typedef struct { unsigned long pte; } pte_t;
32typedef struct { unsigned long pmd; } pmd_t;
33typedef struct { unsigned long pgd; } pgd_t; 32typedef struct { unsigned long pgd; } pgd_t;
34typedef struct { unsigned long pgprot; } pgprot_t; 33typedef struct { unsigned long pgprot; } pgprot_t;
35#endif 34#endif
36 35
37#define pte_val(x) ((x).pte) 36#define pte_val(x) ((x).pte)
38#define pmd_val(x) ((x).pmd)
39#define pgd_val(x) ((x).pgd) 37#define pgd_val(x) ((x).pgd)
40#define pgprot_val(x) ((x).pgprot) 38#define pgprot_val(x) ((x).pgprot)
41 39
42#define __pte(x) ((pte_t) { (x) } ) 40#define __pte(x) ((pte_t) { (x) } )
43#define __pmd(x) ((pmd_t) { (x) } )
44#define __pgd(x) ((pgd_t) { (x) } ) 41#define __pgd(x) ((pgd_t) { (x) } )
45#define __pgprot(x) ((pgprot_t) { (x) } ) 42#define __pgprot(x) ((pgprot_t) { (x) } )
46 43
@@ -73,10 +70,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
73 70
74#ifndef __ASSEMBLY__ 71#ifndef __ASSEMBLY__
75 72
76#define BUG() do { \
77 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
78} while (0)
79
80/* Pure 2^n version of get_order */ 73/* Pure 2^n version of get_order */
81static inline int get_order(unsigned long size) 74static inline int get_order(unsigned long size)
82{ 75{
diff --git a/include/asm-cris/pci.h b/include/asm-cris/pci.h
index c61041531889..2064bc1de074 100644
--- a/include/asm-cris/pci.h
+++ b/include/asm-cris/pci.h
@@ -1,13 +1,105 @@
1#ifndef __ASM_CRIS_PCI_H 1#ifndef __ASM_CRIS_PCI_H
2#define __ASM_CRIS_PCI_H 2#define __ASM_CRIS_PCI_H
3 3
4#include <linux/config.h>
5
6#ifdef __KERNEL__
7#include <linux/mm.h> /* for struct page */
8
9/* Can be used to override the logic in pci_scan_bus for skipping
10 already-configured bus numbers - to be used for buggy BIOSes
11 or architectures with incomplete PCI setup by the loader */
12
13#define pcibios_assign_all_busses(void) 1
14
15extern unsigned long pci_mem_start;
16#define PCIBIOS_MIN_IO 0x1000
17#define PCIBIOS_MIN_MEM 0x10000000
18
19#define PCIBIOS_MIN_CARDBUS_IO 0x4000
20
21void pcibios_config_init(void);
22struct pci_bus * pcibios_scan_root(int bus);
23int pcibios_assign_resources(void);
24
25void pcibios_set_master(struct pci_dev *dev);
26void pcibios_penalize_isa_irq(int irq);
27struct irq_routing_table *pcibios_get_irq_routing_table(void);
28int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
29
30/* Dynamic DMA mapping stuff.
31 * i386 has everything mapped statically.
32 */
33
34#include <linux/types.h>
35#include <linux/slab.h>
4#include <asm/scatterlist.h> 36#include <asm/scatterlist.h>
5#include <asm-generic/pci-dma-compat.h> 37#include <linux/string.h>
38#include <asm/io.h>
6 39
7/* ETRAX chips don't have a PCI bus. This file is just here because some stupid .c code 40struct pci_dev;
8 * includes it even if CONFIG_PCI is not set. 41
42/* The PCI address space does equal the physical memory
43 * address space. The networking and block device layers use
44 * this boolean for bounce buffer decisions.
9 */ 45 */
10#define PCI_DMA_BUS_IS_PHYS (1) 46#define PCI_DMA_BUS_IS_PHYS (1)
11 47
12#endif /* __ASM_CRIS_PCI_H */ 48/* pci_unmap_{page,single} is a nop so... */
49#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
50#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
51#define pci_unmap_addr(PTR, ADDR_NAME) (0)
52#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
53#define pci_unmap_len(PTR, LEN_NAME) (0)
54#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
55
56/* This is always fine. */
57#define pci_dac_dma_supported(pci_dev, mask) (1)
13 58
59static inline dma64_addr_t
60pci_dac_page_to_dma(struct pci_dev *pdev, struct page *page, unsigned long offset, int direction)
61{
62 return ((dma64_addr_t) page_to_phys(page) +
63 (dma64_addr_t) offset);
64}
65
66static inline struct page *
67pci_dac_dma_to_page(struct pci_dev *pdev, dma64_addr_t dma_addr)
68{
69 return pfn_to_page(dma_addr >> PAGE_SHIFT);
70}
71
72static inline unsigned long
73pci_dac_dma_to_offset(struct pci_dev *pdev, dma64_addr_t dma_addr)
74{
75 return (dma_addr & ~PAGE_MASK);
76}
77
78static inline void
79pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
80{
81}
82
83static inline void
84pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr, size_t len, int direction)
85{
86}
87
88#define HAVE_PCI_MMAP
89extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
90 enum pci_mmap_state mmap_state, int write_combine);
91
92
93static inline void pcibios_add_platform_entries(struct pci_dev *dev)
94{
95}
96
97#endif /* __KERNEL__ */
98
99/* implement the pci_ DMA API in terms of the generic device dma_ one */
100#include <asm-generic/pci-dma-compat.h>
101
102/* generic pci stuff */
103#include <asm-generic/pci.h>
104
105#endif /* __ASM_CRIS_PCI_H */
diff --git a/include/asm-cris/pgalloc.h b/include/asm-cris/pgalloc.h
index b202e62ed6e0..a131776edf41 100644
--- a/include/asm-cris/pgalloc.h
+++ b/include/asm-cris/pgalloc.h
@@ -47,16 +47,6 @@ extern inline void pte_free(struct page *pte)
47 47
48#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte)) 48#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
49 49
50/*
51 * We don't have any real pmd's, and this code never triggers because
52 * the pgd will always be present..
53 */
54
55#define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); })
56#define pmd_free(x) do { } while (0)
57#define __pmd_free_tlb(tlb,x) do { } while (0)
58#define pgd_populate(mm, pmd, pte) BUG()
59
60#define check_pgt_cache() do { } while (0) 50#define check_pgt_cache() do { } while (0)
61 51
62#endif 52#endif
diff --git a/include/asm-cris/pgtable.h b/include/asm-cris/pgtable.h
index f7042944b073..a9143bed99db 100644
--- a/include/asm-cris/pgtable.h
+++ b/include/asm-cris/pgtable.h
@@ -5,7 +5,8 @@
5#ifndef _CRIS_PGTABLE_H 5#ifndef _CRIS_PGTABLE_H
6#define _CRIS_PGTABLE_H 6#define _CRIS_PGTABLE_H
7 7
8#include <asm-generic/4level-fixup.h> 8#include <asm/page.h>
9#include <asm-generic/pgtable-nopmd.h>
9 10
10#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
11#include <linux/config.h> 12#include <linux/config.h>
@@ -41,22 +42,14 @@ extern void paging_init(void);
41 * but the define is needed for a generic inline function.) 42 * but the define is needed for a generic inline function.)
42 */ 43 */
43#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval) 44#define set_pmd(pmdptr, pmdval) (*(pmdptr) = pmdval)
44#define set_pgd(pgdptr, pgdval) (*(pgdptr) = pgdval) 45#define set_pgu(pudptr, pudval) (*(pudptr) = pudval)
45 46
46/* PMD_SHIFT determines the size of the area a second-level page table can 47/* PGDIR_SHIFT determines the size of the area a second-level page table can
47 * map. It is equal to the page size times the number of PTE's that fit in 48 * map. It is equal to the page size times the number of PTE's that fit in
48 * a PMD page. A PTE is 4-bytes in CRIS. Hence the following number. 49 * a PMD page. A PTE is 4-bytes in CRIS. Hence the following number.
49 */ 50 */
50 51
51#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-2)) 52#define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-2))
52#define PMD_SIZE (1UL << PMD_SHIFT)
53#define PMD_MASK (~(PMD_SIZE-1))
54
55/* PGDIR_SHIFT determines what a third-level page table entry can map.
56 * Since we fold into a two-level structure, this is the same as PMD_SHIFT.
57 */
58
59#define PGDIR_SHIFT PMD_SHIFT
60#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 53#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
61#define PGDIR_MASK (~(PGDIR_SIZE-1)) 54#define PGDIR_MASK (~(PGDIR_SIZE-1))
62 55
@@ -67,7 +60,6 @@ extern void paging_init(void);
67 * divide it by 4 (shift by 2). 60 * divide it by 4 (shift by 2).
68 */ 61 */
69#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-2)) 62#define PTRS_PER_PTE (1UL << (PAGE_SHIFT-2))
70#define PTRS_PER_PMD 1
71#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-2)) 63#define PTRS_PER_PGD (1UL << (PAGE_SHIFT-2))
72 64
73/* calculate how many PGD entries a user-level program can use 65/* calculate how many PGD entries a user-level program can use
@@ -105,7 +97,7 @@ extern unsigned long empty_zero_page;
105#define pte_present(x) (pte_val(x) & _PAGE_PRESENT) 97#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
106#define pte_clear(mm,addr,xp) do { pte_val(*(xp)) = 0; } while (0) 98#define pte_clear(mm,addr,xp) do { pte_val(*(xp)) = 0; } while (0)
107 99
108#define pmd_none(x) (!pmd_val(x)) 100#define pmd_none(x) (!pmd_val(x))
109/* by removing the _PAGE_KERNEL bit from the comparision, the same pmd_bad 101/* by removing the _PAGE_KERNEL bit from the comparision, the same pmd_bad
110 * works for both _PAGE_TABLE and _KERNPG_TABLE pmd entries. 102 * works for both _PAGE_TABLE and _KERNPG_TABLE pmd entries.
111 */ 103 */
@@ -116,16 +108,6 @@ extern unsigned long empty_zero_page;
116#ifndef __ASSEMBLY__ 108#ifndef __ASSEMBLY__
117 109
118/* 110/*
119 * The "pgd_xxx()" functions here are trivial for a folded two-level
120 * setup: the pgd is never bad, and a pmd always exists (as it's folded
121 * into the pgd entry)
122 */
123extern inline int pgd_none(pgd_t pgd) { return 0; }
124extern inline int pgd_bad(pgd_t pgd) { return 0; }
125extern inline int pgd_present(pgd_t pgd) { return 1; }
126extern inline void pgd_clear(pgd_t * pgdp) { }
127
128/*
129 * The following only work if pte_present() is true. 111 * The following only work if pte_present() is true.
130 * Undefined behaviour if not.. 112 * Undefined behaviour if not..
131 */ 113 */
@@ -275,7 +257,7 @@ extern inline void pmd_set(pmd_t * pmdp, pte_t * ptep)
275#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK)) 257#define pmd_page_kernel(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
276 258
277/* to find an entry in a page-table-directory. */ 259/* to find an entry in a page-table-directory. */
278#define pgd_index(address) ((address >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) 260#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
279 261
280/* to find an entry in a page-table-directory */ 262/* to find an entry in a page-table-directory */
281extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) 263extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
@@ -286,12 +268,6 @@ extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
286/* to find an entry in a kernel page-table-directory */ 268/* to find an entry in a kernel page-table-directory */
287#define pgd_offset_k(address) pgd_offset(&init_mm, address) 269#define pgd_offset_k(address) pgd_offset(&init_mm, address)
288 270
289/* Find an entry in the second-level page table.. */
290extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
291{
292 return (pmd_t *) dir;
293}
294
295/* Find an entry in the third-level page table.. */ 271/* Find an entry in the third-level page table.. */
296#define __pte_offset(address) \ 272#define __pte_offset(address) \
297 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) 273 (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
@@ -308,8 +284,6 @@ extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
308 284
309#define pte_ERROR(e) \ 285#define pte_ERROR(e) \
310 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), pte_val(e)) 286 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), pte_val(e))
311#define pmd_ERROR(e) \
312 printk("%s:%d: bad pmd %p(%08lx).\n", __FILE__, __LINE__, &(e), pmd_val(e))
313#define pgd_ERROR(e) \ 287#define pgd_ERROR(e) \
314 printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), pgd_val(e)) 288 printk("%s:%d: bad pgd %p(%08lx).\n", __FILE__, __LINE__, &(e), pgd_val(e))
315 289
@@ -348,5 +322,7 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma,
348#define pte_to_pgoff(x) (pte_val(x) >> 6) 322#define pte_to_pgoff(x) (pte_val(x) >> 6)
349#define pgoff_to_pte(x) __pte(((x) << 6) | _PAGE_FILE) 323#define pgoff_to_pte(x) __pte(((x) << 6) | _PAGE_FILE)
350 324
325typedef pte_t *pte_addr_t;
326
351#endif /* __ASSEMBLY__ */ 327#endif /* __ASSEMBLY__ */
352#endif /* _CRIS_PGTABLE_H */ 328#endif /* _CRIS_PGTABLE_H */
diff --git a/include/asm-cris/processor.h b/include/asm-cris/processor.h
index 623bdf06d911..0dc218117bd8 100644
--- a/include/asm-cris/processor.h
+++ b/include/asm-cris/processor.h
@@ -55,15 +55,6 @@ unsigned long get_wchan(struct task_struct *p);
55 55
56#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 56#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
57 57
58/*
59 * Free current thread data structures etc..
60 */
61
62extern inline void exit_thread(void)
63{
64 /* Nothing needs to be done. */
65}
66
67extern unsigned long thread_saved_pc(struct task_struct *tsk); 58extern unsigned long thread_saved_pc(struct task_struct *tsk);
68 59
69/* Free all resources held by a thread. */ 60/* Free all resources held by a thread. */
diff --git a/include/asm-cris/ptrace.h b/include/asm-cris/ptrace.h
index 7a8c2880e487..1ec69a7ea836 100644
--- a/include/asm-cris/ptrace.h
+++ b/include/asm-cris/ptrace.h
@@ -9,4 +9,6 @@
9#define PTRACE_SETREGS 13 9#define PTRACE_SETREGS 13
10#endif 10#endif
11 11
12#define profile_pc(regs) instruction_pointer(regs)
13
12#endif /* _CRIS_PTRACE_H */ 14#endif /* _CRIS_PTRACE_H */
diff --git a/include/asm-cris/semaphore.h b/include/asm-cris/semaphore.h
index 605aa7eaaaf8..8ed7636ab311 100644
--- a/include/asm-cris/semaphore.h
+++ b/include/asm-cris/semaphore.h
@@ -72,10 +72,9 @@ extern inline void down(struct semaphore * sem)
72 might_sleep(); 72 might_sleep();
73 73
74 /* atomically decrement the semaphores count, and if its negative, we wait */ 74 /* atomically decrement the semaphores count, and if its negative, we wait */
75 local_save_flags(flags); 75 cris_atomic_save(sem, flags);
76 local_irq_disable();
77 failed = --(sem->count.counter) < 0; 76 failed = --(sem->count.counter) < 0;
78 local_irq_restore(flags); 77 cris_atomic_restore(sem, flags);
79 if(failed) { 78 if(failed) {
80 __down(sem); 79 __down(sem);
81 } 80 }
@@ -95,10 +94,9 @@ extern inline int down_interruptible(struct semaphore * sem)
95 might_sleep(); 94 might_sleep();
96 95
97 /* atomically decrement the semaphores count, and if its negative, we wait */ 96 /* atomically decrement the semaphores count, and if its negative, we wait */
98 local_save_flags(flags); 97 cris_atomic_save(sem, flags);
99 local_irq_disable();
100 failed = --(sem->count.counter) < 0; 98 failed = --(sem->count.counter) < 0;
101 local_irq_restore(flags); 99 cris_atomic_restore(sem, flags);
102 if(failed) 100 if(failed)
103 failed = __down_interruptible(sem); 101 failed = __down_interruptible(sem);
104 return(failed); 102 return(failed);
@@ -109,13 +107,13 @@ extern inline int down_trylock(struct semaphore * sem)
109 unsigned long flags; 107 unsigned long flags;
110 int failed; 108 int failed;
111 109
112 local_save_flags(flags); 110 cris_atomic_save(sem, flags);
113 local_irq_disable();
114 failed = --(sem->count.counter) < 0; 111 failed = --(sem->count.counter) < 0;
115 local_irq_restore(flags); 112 cris_atomic_restore(sem, flags);
116 if(failed) 113 if(failed)
117 failed = __down_trylock(sem); 114 failed = __down_trylock(sem);
118 return(failed); 115 return(failed);
116
119} 117}
120 118
121/* 119/*
@@ -130,10 +128,9 @@ extern inline void up(struct semaphore * sem)
130 int wakeup; 128 int wakeup;
131 129
132 /* atomically increment the semaphores count, and if it was negative, we wake people */ 130 /* atomically increment the semaphores count, and if it was negative, we wake people */
133 local_save_flags(flags); 131 cris_atomic_save(sem, flags);
134 local_irq_disable();
135 wakeup = ++(sem->count.counter) <= 0; 132 wakeup = ++(sem->count.counter) <= 0;
136 local_irq_restore(flags); 133 cris_atomic_restore(sem, flags);
137 if(wakeup) { 134 if(wakeup) {
138 __up(sem); 135 __up(sem);
139 } 136 }
diff --git a/include/asm-cris/smp.h b/include/asm-cris/smp.h
index c2f4feaa041d..dca5ef1d8c97 100644
--- a/include/asm-cris/smp.h
+++ b/include/asm-cris/smp.h
@@ -1,4 +1,11 @@
1#ifndef __ASM_SMP_H 1#ifndef __ASM_SMP_H
2#define __ASM_SMP_H 2#define __ASM_SMP_H
3 3
4#include <linux/cpumask.h>
5
6extern cpumask_t phys_cpu_present_map;
7#define cpu_possible_map phys_cpu_present_map
8
9#define __smp_processor_id() (current_thread_info()->cpu)
10
4#endif 11#endif
diff --git a/include/asm-cris/spinlock.h b/include/asm-cris/spinlock.h
new file mode 100644
index 000000000000..2e8ba8afc7af
--- /dev/null
+++ b/include/asm-cris/spinlock.h
@@ -0,0 +1 @@
#include <asm/arch/spinlock.h>
diff --git a/include/asm-cris/sync_serial.h b/include/asm-cris/sync_serial.h
new file mode 100644
index 000000000000..f930b6e00663
--- /dev/null
+++ b/include/asm-cris/sync_serial.h
@@ -0,0 +1,106 @@
1/*
2 * ioctl defines for synchronous serial port driver
3 *
4 * Copyright (c) 2001-2003 Axis Communications AB
5 *
6 * Author: Mikael Starvik
7 *
8 */
9
10#ifndef SYNC_SERIAL_H
11#define SYNC_SERIAL_H
12
13#include <linux/ioctl.h>
14
15#define SSP_SPEED _IOR('S', 0, unsigned int)
16#define SSP_MODE _IOR('S', 1, unsigned int)
17#define SSP_FRAME_SYNC _IOR('S', 2, unsigned int)
18#define SSP_IPOLARITY _IOR('S', 3, unsigned int)
19#define SSP_OPOLARITY _IOR('S', 4, unsigned int)
20#define SSP_SPI _IOR('S', 5, unsigned int)
21#define SSP_INBUFCHUNK _IOR('S', 6, unsigned int)
22
23/* Values for SSP_SPEED */
24#define SSP150 0
25#define SSP300 1
26#define SSP600 2
27#define SSP1200 3
28#define SSP2400 4
29#define SSP4800 5
30#define SSP9600 6
31#define SSP19200 7
32#define SSP28800 8
33#define SSP57600 9
34#define SSP115200 10
35#define SSP230400 11
36#define SSP460800 12
37#define SSP921600 13
38#define SSP3125000 14
39#define CODEC 15
40
41#define FREQ_4MHz 0
42#define FREQ_2MHz 1
43#define FREQ_1MHz 2
44#define FREQ_512kHz 3
45#define FREQ_256kHz 4
46#define FREQ_128kHz 5
47#define FREQ_64kHz 6
48#define FREQ_32kHz 7
49
50/* Used by application to set CODEC divider, word rate and frame rate */
51#define CODEC_VAL(freq, clk_per_sync, sync_per_frame) (CODEC | (freq << 8) | (clk_per_sync << 16) | (sync_per_frame << 28))
52
53/* Used by driver to extract speed */
54#define GET_SPEED(x) (x & 0xff)
55#define GET_FREQ(x) ((x & 0xff00) >> 8)
56#define GET_WORD_RATE(x) (((x & 0x0fff0000) >> 16) - 1)
57#define GET_FRAME_RATE(x) (((x & 0xf0000000) >> 28) - 1)
58
59/* Values for SSP_MODE */
60#define MASTER_OUTPUT 0
61#define SLAVE_OUTPUT 1
62#define MASTER_INPUT 2
63#define SLAVE_INPUT 3
64#define MASTER_BIDIR 4
65#define SLAVE_BIDIR 5
66
67/* Values for SSP_FRAME_SYNC */
68#define NORMAL_SYNC 1
69#define EARLY_SYNC 2
70
71#define BIT_SYNC 4
72#define WORD_SYNC 8
73#define EXTENDED_SYNC 0x10
74
75#define SYNC_OFF 0x20
76#define SYNC_ON 0x40
77#define WORD_SIZE_8 0x80
78#define WORD_SIZE_12 0x100
79#define WORD_SIZE_16 0x200
80#define WORD_SIZE_24 0x400
81#define WORD_SIZE_32 0x800
82#define BIT_ORDER_LSB 0x1000
83#define BIT_ORDER_MSB 0x2000
84#define FLOW_CONTROL_ENABLE 0x4000
85#define FLOW_CONTROL_DISABLE 0x8000
86#define CLOCK_GATED 0x10000
87#define CLOCK_NOT_GATED 0x20000
88
89/* Values for SSP_IPOLARITY and SSP_OPOLARITY */
90#define CLOCK_NORMAL 1
91#define CLOCK_INVERT 2
92#define CLOCK_INEGEDGE CLOCK_NORMAL
93#define CLOCK_IPOSEDGE CLOCK_INVERT
94#define FRAME_NORMAL 4
95#define FRAME_INVERT 8
96#define STATUS_NORMAL 0x10
97#define STATUS_INVERT 0x20
98
99/* Values for SSP_SPI */
100#define SPI_MASTER 0
101#define SPI_SLAVE 1
102
103/* Values for SSP_INBUFCHUNK */
104/* plain integer with the size of DMA chunks */
105
106#endif
diff --git a/include/asm-cris/termbits.h b/include/asm-cris/termbits.h
index 16d9a491fdb3..be0836d2f282 100644
--- a/include/asm-cris/termbits.h
+++ b/include/asm-cris/termbits.h
@@ -152,7 +152,7 @@ struct termios {
152#define B921600 0010005 152#define B921600 0010005
153#define B1843200 0010006 153#define B1843200 0010006
154#define B6250000 0010007 154#define B6250000 0010007
155/* etrax 200 supports this as well */ 155/* ETRAX FS supports this as well */
156#define B12500000 0010010 156#define B12500000 0010010
157#define CIBAUD 002003600000 /* input baud rate (used in v32) */ 157#define CIBAUD 002003600000 /* input baud rate (used in v32) */
158/* The values for CIBAUD bits are the same as the values for CBAUD and CBAUDEX 158/* The values for CIBAUD bits are the same as the values for CBAUD and CBAUDEX
diff --git a/include/asm-cris/thread_info.h b/include/asm-cris/thread_info.h
index 53193feb0826..cef0140fc104 100644
--- a/include/asm-cris/thread_info.h
+++ b/include/asm-cris/thread_info.h
@@ -31,7 +31,7 @@ struct thread_info {
31 struct exec_domain *exec_domain; /* execution domain */ 31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */ 32 unsigned long flags; /* low level flags */
33 __u32 cpu; /* current CPU */ 33 __u32 cpu; /* current CPU */
34 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 34 int preempt_count; /* 0 => preemptable, <0 => BUG */
35 35
36 mm_segment_t addr_limit; /* thread address space: 36 mm_segment_t addr_limit; /* thread address space:
37 0-0xBFFFFFFF for user-thead 37 0-0xBFFFFFFF for user-thead
@@ -43,7 +43,7 @@ struct thread_info {
43 43
44#endif 44#endif
45 45
46#define PREEMPT_ACTIVE 0x4000000 46#define PREEMPT_ACTIVE 0x10000000
47 47
48/* 48/*
49 * macros/functions for gaining access to the thread information structure 49 * macros/functions for gaining access to the thread information structure
diff --git a/include/asm-cris/timex.h b/include/asm-cris/timex.h
index 375c41af47de..3fb069a37717 100644
--- a/include/asm-cris/timex.h
+++ b/include/asm-cris/timex.h
@@ -14,7 +14,7 @@
14 * used so it does not matter. 14 * used so it does not matter.
15 */ 15 */
16 16
17typedef unsigned int cycles_t; 17typedef unsigned long long cycles_t;
18 18
19extern inline cycles_t get_cycles(void) 19extern inline cycles_t get_cycles(void)
20{ 20{
diff --git a/include/asm-cris/tlbflush.h b/include/asm-cris/tlbflush.h
index 1781fe1a32f6..6ed7d9ae90db 100644
--- a/include/asm-cris/tlbflush.h
+++ b/include/asm-cris/tlbflush.h
@@ -18,13 +18,26 @@
18 * 18 *
19 */ 19 */
20 20
21extern void __flush_tlb_all(void);
22extern void __flush_tlb_mm(struct mm_struct *mm);
23extern void __flush_tlb_page(struct vm_area_struct *vma,
24 unsigned long addr);
25
26#ifdef CONFIG_SMP
21extern void flush_tlb_all(void); 27extern void flush_tlb_all(void);
22extern void flush_tlb_mm(struct mm_struct *mm); 28extern void flush_tlb_mm(struct mm_struct *mm);
23extern void flush_tlb_page(struct vm_area_struct *vma, 29extern void flush_tlb_page(struct vm_area_struct *vma,
24 unsigned long addr); 30 unsigned long addr);
25extern void flush_tlb_range(struct vm_area_struct *vma, 31#else
26 unsigned long start, 32#define flush_tlb_all __flush_tlb_all
27 unsigned long end); 33#define flush_tlb_mm __flush_tlb_mm
34#define flush_tlb_page __flush_tlb_page
35#endif
36
37static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long start, unsigned long end)
38{
39 flush_tlb_mm(vma->vm_mm);
40}
28 41
29extern inline void flush_tlb_pgtables(struct mm_struct *mm, 42extern inline void flush_tlb_pgtables(struct mm_struct *mm,
30 unsigned long start, unsigned long end) 43 unsigned long start, unsigned long end)
diff --git a/include/asm-cris/types.h b/include/asm-cris/types.h
index 41a0d450ba1d..8fa6d6c7afce 100644
--- a/include/asm-cris/types.h
+++ b/include/asm-cris/types.h
@@ -52,7 +52,7 @@ typedef unsigned long long u64;
52typedef u32 dma_addr_t; 52typedef u32 dma_addr_t;
53typedef u32 dma64_addr_t; 53typedef u32 dma64_addr_t;
54 54
55typedef unsigned int kmem_bufctl_t; 55typedef unsigned short kmem_bufctl_t;
56 56
57#endif /* __ASSEMBLY__ */ 57#endif /* __ASSEMBLY__ */
58 58
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index e80bf276b101..28232ad2ff34 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -288,8 +288,15 @@
288#define __NR_mq_timedreceive (__NR_mq_open+3) 288#define __NR_mq_timedreceive (__NR_mq_open+3)
289#define __NR_mq_notify (__NR_mq_open+4) 289#define __NR_mq_notify (__NR_mq_open+4)
290#define __NR_mq_getsetattr (__NR_mq_open+5) 290#define __NR_mq_getsetattr (__NR_mq_open+5)
291 291#define __NR_sys_kexec_load 283
292#define NR_syscalls 283 292#define __NR_waitid 284
293/* #define __NR_sys_setaltroot 285 */
294#define __NR_add_key 286
295#define __NR_request_key 287
296#define __NR_keyctl 288
297
298#define NR_syscalls 289
299
293 300
294 301
295#ifdef __KERNEL__ 302#ifdef __KERNEL__
diff --git a/include/asm-frv/emergency-restart.h b/include/asm-frv/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-frv/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-frv/pci.h b/include/asm-frv/pci.h
index a6a469231f62..b4efe5e3591a 100644
--- a/include/asm-frv/pci.h
+++ b/include/asm-frv/pci.h
@@ -57,6 +57,16 @@ extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
57 */ 57 */
58#define PCI_DMA_BUS_IS_PHYS (1) 58#define PCI_DMA_BUS_IS_PHYS (1)
59 59
60#ifdef CONFIG_PCI
61static inline void pci_dma_burst_advice(struct pci_dev *pdev,
62 enum pci_dma_burst_strategy *strat,
63 unsigned long *strategy_parameter)
64{
65 *strat = PCI_DMA_BURST_INFINITY;
66 *strategy_parameter = ~0UL;
67}
68#endif
69
60/* 70/*
61 * These are pretty much arbitary with the CoMEM implementation. 71 * These are pretty much arbitary with the CoMEM implementation.
62 * We have the whole address space to ourselves. 72 * We have the whole address space to ourselves.
diff --git a/include/asm-frv/thread_info.h b/include/asm-frv/thread_info.h
index b80a97f50af6..c8cba7836f0d 100644
--- a/include/asm-frv/thread_info.h
+++ b/include/asm-frv/thread_info.h
@@ -33,7 +33,7 @@ struct thread_info {
33 unsigned long flags; /* low level flags */ 33 unsigned long flags; /* low level flags */
34 unsigned long status; /* thread-synchronous flags */ 34 unsigned long status; /* thread-synchronous flags */
35 __u32 cpu; /* current CPU */ 35 __u32 cpu; /* current CPU */
36 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 36 int preempt_count; /* 0 => preemptable, <0 => BUG */
37 37
38 mm_segment_t addr_limit; /* thread address space: 38 mm_segment_t addr_limit; /* thread address space:
39 0-0xBFFFFFFF for user-thead 39 0-0xBFFFFFFF for user-thead
diff --git a/include/asm-generic/emergency-restart.h b/include/asm-generic/emergency-restart.h
new file mode 100644
index 000000000000..0d68a1eae985
--- /dev/null
+++ b/include/asm-generic/emergency-restart.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H
2#define _ASM_GENERIC_EMERGENCY_RESTART_H
3
4static inline void machine_emergency_restart(void)
5{
6 machine_restart(NULL);
7}
8
9#endif /* _ASM_GENERIC_EMERGENCY_RESTART_H */
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index 9d4cc47bde39..ee1d8b5d8168 100644
--- a/include/asm-generic/pci.h
+++ b/include/asm-generic/pci.h
@@ -22,6 +22,14 @@ pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
22 region->end = res->end; 22 region->end = res->end;
23} 23}
24 24
25static inline void
26pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
27 struct pci_bus_region *region)
28{
29 res->start = region->start;
30 res->end = region->end;
31}
32
25#define pcibios_scan_all_fns(a, b) 0 33#define pcibios_scan_all_fns(a, b) 0
26 34
27#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ 35#ifndef HAVE_ARCH_PCI_GET_LEGACY_IDE_IRQ
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h
index 3b709b84934f..9044aeb37828 100644
--- a/include/asm-generic/percpu.h
+++ b/include/asm-generic/percpu.h
@@ -29,7 +29,7 @@ do { \
29#define DEFINE_PER_CPU(type, name) \ 29#define DEFINE_PER_CPU(type, name) \
30 __typeof__(type) per_cpu__##name 30 __typeof__(type) per_cpu__##name
31 31
32#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 32#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
33#define __get_cpu_var(var) per_cpu__##var 33#define __get_cpu_var(var) per_cpu__##var
34 34
35#endif /* SMP */ 35#endif /* SMP */
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 195ccdc069e6..450eae22c39a 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -11,5 +11,6 @@ extern char _sinittext[], _einittext[];
11extern char _sextratext[] __attribute__((weak)); 11extern char _sextratext[] __attribute__((weak));
12extern char _eextratext[] __attribute__((weak)); 12extern char _eextratext[] __attribute__((weak));
13extern char _end[]; 13extern char _end[];
14extern char __per_cpu_start[], __per_cpu_end[];
14 15
15#endif /* _ASM_GENERIC_SECTIONS_H_ */ 16#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
index ec96e8b0f190..5d9d70cd17fc 100644
--- a/include/asm-generic/topology.h
+++ b/include/asm-generic/topology.h
@@ -41,8 +41,15 @@
41#ifndef node_to_first_cpu 41#ifndef node_to_first_cpu
42#define node_to_first_cpu(node) (0) 42#define node_to_first_cpu(node) (0)
43#endif 43#endif
44#ifndef pcibus_to_node
45#define pcibus_to_node(node) (-1)
46#endif
47
44#ifndef pcibus_to_cpumask 48#ifndef pcibus_to_cpumask
45#define pcibus_to_cpumask(bus) (cpu_online_map) 49#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ? \
50 CPU_MASK_ALL : \
51 node_to_cpumask(pcibus_to_node(bus)) \
52 )
46#endif 53#endif
47 54
48#endif /* _ASM_GENERIC_TOPOLOGY_H */ 55#endif /* _ASM_GENERIC_TOPOLOGY_H */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 99cef06a364a..b3bb326ae5b6 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -73,7 +73,7 @@
73 } 73 }
74 74
75#define SECURITY_INIT \ 75#define SECURITY_INIT \
76 .security_initcall.init : { \ 76 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET) { \
77 VMLINUX_SYMBOL(__security_initcall_start) = .; \ 77 VMLINUX_SYMBOL(__security_initcall_start) = .; \
78 *(.security_initcall.init) \ 78 *(.security_initcall.init) \
79 VMLINUX_SYMBOL(__security_initcall_end) = .; \ 79 VMLINUX_SYMBOL(__security_initcall_end) = .; \
diff --git a/include/asm-h8300/emergency-restart.h b/include/asm-h8300/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-h8300/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-h8300/pci.h b/include/asm-h8300/pci.h
index d032729b19df..5edad5b70fd5 100644
--- a/include/asm-h8300/pci.h
+++ b/include/asm-h8300/pci.h
@@ -15,7 +15,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
15 /* No special bus mastering setup handling */ 15 /* No special bus mastering setup handling */
16} 16}
17 17
18extern inline void pcibios_penalize_isa_irq(int irq) 18extern inline void pcibios_penalize_isa_irq(int irq, int active)
19{ 19{
20 /* We don't do dynamic PCI IRQ allocation */ 20 /* We don't do dynamic PCI IRQ allocation */
21} 21}
diff --git a/include/asm-h8300/thread_info.h b/include/asm-h8300/thread_info.h
index b07c9344776f..bfcc755c3bb1 100644
--- a/include/asm-h8300/thread_info.h
+++ b/include/asm-h8300/thread_info.h
@@ -23,7 +23,7 @@ struct thread_info {
23 struct exec_domain *exec_domain; /* execution domain */ 23 struct exec_domain *exec_domain; /* execution domain */
24 unsigned long flags; /* low level flags */ 24 unsigned long flags; /* low level flags */
25 int cpu; /* cpu we're on */ 25 int cpu; /* cpu we're on */
26 int preempt_count; /* 0 => preemptable, <0 => BUG*/ 26 int preempt_count; /* 0 => preemptable, <0 => BUG */
27 struct restart_block restart_block; 27 struct restart_block restart_block;
28}; 28};
29 29
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index c976c1dadece..cf828ace13f9 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -28,6 +28,8 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h>
32
31#include <asm/system.h> /* defines cmpxchg */ 33#include <asm/system.h> /* defines cmpxchg */
32 34
33#define COMPILER_DEPENDENT_INT64 long long 35#define COMPILER_DEPENDENT_INT64 long long
@@ -101,12 +103,6 @@ __acpi_release_global_lock (unsigned int *lock)
101 :"=r"(n_hi), "=r"(n_lo) \ 103 :"=r"(n_hi), "=r"(n_lo) \
102 :"0"(n_hi), "1"(n_lo)) 104 :"0"(n_hi), "1"(n_lo))
103 105
104/*
105 * Refer Intel ACPI _PDC support document for bit definitions
106 */
107#define ACPI_PDC_EST_CAPABILITY_SMP 0xa
108#define ACPI_PDC_EST_CAPABILITY_MSR 0x1
109
110#ifdef CONFIG_ACPI_BOOT 106#ifdef CONFIG_ACPI_BOOT
111extern int acpi_lapic; 107extern int acpi_lapic;
112extern int acpi_ioapic; 108extern int acpi_ioapic;
@@ -185,6 +181,8 @@ extern void acpi_reserve_bootmem(void);
185 181
186extern u8 x86_acpiid_to_apicid[]; 182extern u8 x86_acpiid_to_apicid[];
187 183
184#define ARCH_HAS_POWER_PDC_INIT 1
185
188#endif /*__KERNEL__*/ 186#endif /*__KERNEL__*/
189 187
190#endif /*_ASM_ACPI_H*/ 188#endif /*_ASM_ACPI_H*/
diff --git a/include/asm-i386/apic.h b/include/asm-i386/apic.h
index a5810cf7b578..6a1b1882285c 100644
--- a/include/asm-i386/apic.h
+++ b/include/asm-i386/apic.h
@@ -5,6 +5,7 @@
5#include <linux/pm.h> 5#include <linux/pm.h>
6#include <asm/fixmap.h> 6#include <asm/fixmap.h>
7#include <asm/apicdef.h> 7#include <asm/apicdef.h>
8#include <asm/processor.h>
8#include <asm/system.h> 9#include <asm/system.h>
9 10
10#define Dprintk(x...) 11#define Dprintk(x...)
@@ -16,8 +17,20 @@
16#define APIC_VERBOSE 1 17#define APIC_VERBOSE 1
17#define APIC_DEBUG 2 18#define APIC_DEBUG 2
18 19
20extern int enable_local_apic;
19extern int apic_verbosity; 21extern int apic_verbosity;
20 22
23static inline void lapic_disable(void)
24{
25 enable_local_apic = -1;
26 clear_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability);
27}
28
29static inline void lapic_enable(void)
30{
31 enable_local_apic = 1;
32}
33
21/* 34/*
22 * Define the default level of output to be very little 35 * Define the default level of output to be very little
23 * This can be turned up by using apic=verbose for more 36 * This can be turned up by using apic=verbose for more
@@ -87,7 +100,7 @@ extern void (*wait_timer_tick)(void);
87extern int get_maxlvt(void); 100extern int get_maxlvt(void);
88extern void clear_local_APIC(void); 101extern void clear_local_APIC(void);
89extern void connect_bsp_APIC (void); 102extern void connect_bsp_APIC (void);
90extern void disconnect_bsp_APIC (void); 103extern void disconnect_bsp_APIC (int virt_wire_setup);
91extern void disable_local_APIC (void); 104extern void disable_local_APIC (void);
92extern void lapic_shutdown (void); 105extern void lapic_shutdown (void);
93extern int verify_local_APIC (void); 106extern int verify_local_APIC (void);
diff --git a/include/asm-i386/apicdef.h b/include/asm-i386/apicdef.h
index c689554ad5b9..a96a8f48fbfc 100644
--- a/include/asm-i386/apicdef.h
+++ b/include/asm-i386/apicdef.h
@@ -86,11 +86,12 @@
86#define APIC_LVT_REMOTE_IRR (1<<14) 86#define APIC_LVT_REMOTE_IRR (1<<14)
87#define APIC_INPUT_POLARITY (1<<13) 87#define APIC_INPUT_POLARITY (1<<13)
88#define APIC_SEND_PENDING (1<<12) 88#define APIC_SEND_PENDING (1<<12)
89#define APIC_MODE_MASK 0x700
89#define GET_APIC_DELIVERY_MODE(x) (((x)>>8)&0x7) 90#define GET_APIC_DELIVERY_MODE(x) (((x)>>8)&0x7)
90#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8)) 91#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8))
91#define APIC_MODE_FIXED 0x0 92#define APIC_MODE_FIXED 0x0
92#define APIC_MODE_NMI 0x4 93#define APIC_MODE_NMI 0x4
93#define APIC_MODE_EXINT 0x7 94#define APIC_MODE_EXTINT 0x7
94#define APIC_LVT1 0x360 95#define APIC_LVT1 0x360
95#define APIC_LVTERR 0x370 96#define APIC_LVTERR 0x370
96#define APIC_TMICT 0x380 97#define APIC_TMICT 0x380
@@ -108,11 +109,7 @@
108 109
109#define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) 110#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
110 111
111#ifdef CONFIG_NUMA 112#define MAX_IO_APICS 64
112 #define MAX_IO_APICS 32
113#else
114 #define MAX_IO_APICS 8
115#endif
116 113
117/* 114/*
118 * the local APIC register structure, memory mapped. Not terribly well 115 * the local APIC register structure, memory mapped. Not terribly well
diff --git a/include/asm-i386/bitops.h b/include/asm-i386/bitops.h
index 9db0b712d57a..ddf1739dc7fd 100644
--- a/include/asm-i386/bitops.h
+++ b/include/asm-i386/bitops.h
@@ -311,6 +311,20 @@ static inline int find_first_zero_bit(const unsigned long *addr, unsigned size)
311int find_next_zero_bit(const unsigned long *addr, int size, int offset); 311int find_next_zero_bit(const unsigned long *addr, int size, int offset);
312 312
313/** 313/**
314 * __ffs - find first bit in word.
315 * @word: The word to search
316 *
317 * Undefined if no bit exists, so code should check against 0 first.
318 */
319static inline unsigned long __ffs(unsigned long word)
320{
321 __asm__("bsfl %1,%0"
322 :"=r" (word)
323 :"rm" (word));
324 return word;
325}
326
327/**
314 * find_first_bit - find the first set bit in a memory region 328 * find_first_bit - find the first set bit in a memory region
315 * @addr: The address to start the search at 329 * @addr: The address to start the search at
316 * @size: The maximum size to search 330 * @size: The maximum size to search
@@ -320,22 +334,15 @@ int find_next_zero_bit(const unsigned long *addr, int size, int offset);
320 */ 334 */
321static inline int find_first_bit(const unsigned long *addr, unsigned size) 335static inline int find_first_bit(const unsigned long *addr, unsigned size)
322{ 336{
323 int d0, d1; 337 int x = 0;
324 int res; 338
325 339 while (x < size) {
326 /* This looks at memory. Mark it volatile to tell gcc not to move it around */ 340 unsigned long val = *addr++;
327 __asm__ __volatile__( 341 if (val)
328 "xorl %%eax,%%eax\n\t" 342 return __ffs(val) + x;
329 "repe; scasl\n\t" 343 x += (sizeof(*addr)<<3);
330 "jz 1f\n\t" 344 }
331 "leal -4(%%edi),%%edi\n\t" 345 return x;
332 "bsfl (%%edi),%%eax\n"
333 "1:\tsubl %%ebx,%%edi\n\t"
334 "shll $3,%%edi\n\t"
335 "addl %%edi,%%eax"
336 :"=a" (res), "=&c" (d0), "=&D" (d1)
337 :"1" ((size + 31) >> 5), "2" (addr), "b" (addr) : "memory");
338 return res;
339} 346}
340 347
341/** 348/**
@@ -360,20 +367,6 @@ static inline unsigned long ffz(unsigned long word)
360 return word; 367 return word;
361} 368}
362 369
363/**
364 * __ffs - find first bit in word.
365 * @word: The word to search
366 *
367 * Undefined if no bit exists, so code should check against 0 first.
368 */
369static inline unsigned long __ffs(unsigned long word)
370{
371 __asm__("bsfl %1,%0"
372 :"=r" (word)
373 :"rm" (word));
374 return word;
375}
376
377/* 370/*
378 * fls: find last bit set. 371 * fls: find last bit set.
379 */ 372 */
diff --git a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h
index 641342002bcd..f949e44c2a35 100644
--- a/include/asm-i386/checksum.h
+++ b/include/asm-i386/checksum.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/in6.h> 4#include <linux/in6.h>
5 5
6#include <asm/uaccess.h>
7
6/* 8/*
7 * computes the checksum of a memory block at buff, length len, 9 * computes the checksum of a memory block at buff, length len,
8 * and adds in "sum" (32-bit) 10 * and adds in "sum" (32-bit)
diff --git a/include/asm-i386/cpu.h b/include/asm-i386/cpu.h
index 002740b21951..e7252c216ca8 100644
--- a/include/asm-i386/cpu.h
+++ b/include/asm-i386/cpu.h
@@ -5,6 +5,7 @@
5#include <linux/cpu.h> 5#include <linux/cpu.h>
6#include <linux/topology.h> 6#include <linux/topology.h>
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <linux/percpu.h>
8 9
9#include <asm/node.h> 10#include <asm/node.h>
10 11
@@ -16,4 +17,5 @@ extern int arch_register_cpu(int num);
16extern void arch_unregister_cpu(int); 17extern void arch_unregister_cpu(int);
17#endif 18#endif
18 19
20DECLARE_PER_CPU(int, cpu_state);
19#endif /* _ASM_I386_CPU_H_ */ 21#endif /* _ASM_I386_CPU_H_ */
diff --git a/include/asm-i386/emergency-restart.h b/include/asm-i386/emergency-restart.h
new file mode 100644
index 000000000000..680c39563345
--- /dev/null
+++ b/include/asm-i386/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4extern void machine_emergency_restart(void);
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-i386/genapic.h b/include/asm-i386/genapic.h
index fc813b2e8274..b3783a32abee 100644
--- a/include/asm-i386/genapic.h
+++ b/include/asm-i386/genapic.h
@@ -78,7 +78,6 @@ struct genapic {
78 .int_delivery_mode = INT_DELIVERY_MODE, \ 78 .int_delivery_mode = INT_DELIVERY_MODE, \
79 .int_dest_mode = INT_DEST_MODE, \ 79 .int_dest_mode = INT_DEST_MODE, \
80 .no_balance_irq = NO_BALANCE_IRQ, \ 80 .no_balance_irq = NO_BALANCE_IRQ, \
81 .no_ioapic_check = NO_IOAPIC_CHECK, \
82 .ESR_DISABLE = esr_disable, \ 81 .ESR_DISABLE = esr_disable, \
83 .apic_destination_logical = APIC_DEST_LOGICAL, \ 82 .apic_destination_logical = APIC_DEST_LOGICAL, \
84 APICFUNC(apic_id_registered), \ 83 APICFUNC(apic_id_registered), \
diff --git a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h
index 1df42bf347df..0fd331306b60 100644
--- a/include/asm-i386/highmem.h
+++ b/include/asm-i386/highmem.h
@@ -70,6 +70,7 @@ void *kmap(struct page *page);
70void kunmap(struct page *page); 70void kunmap(struct page *page);
71void *kmap_atomic(struct page *page, enum km_type type); 71void *kmap_atomic(struct page *page, enum km_type type);
72void kunmap_atomic(void *kvaddr, enum km_type type); 72void kunmap_atomic(void *kvaddr, enum km_type type);
73void *kmap_atomic_pfn(unsigned long pfn, enum km_type type);
73struct page *kmap_atomic_to_page(void *ptr); 74struct page *kmap_atomic_to_page(void *ptr);
74 75
75#define flush_cache_kmaps() do { } while (0) 76#define flush_cache_kmaps() do { } while (0)
diff --git a/include/asm-i386/i387.h b/include/asm-i386/i387.h
index f6feb98a9397..6747006743f9 100644
--- a/include/asm-i386/i387.h
+++ b/include/asm-i386/i387.h
@@ -19,10 +19,21 @@
19 19
20extern void mxcsr_feature_mask_init(void); 20extern void mxcsr_feature_mask_init(void);
21extern void init_fpu(struct task_struct *); 21extern void init_fpu(struct task_struct *);
22
22/* 23/*
23 * FPU lazy state save handling... 24 * FPU lazy state save handling...
24 */ 25 */
25extern void restore_fpu( struct task_struct *tsk ); 26
27/*
28 * The "nop" is needed to make the instructions the same
29 * length.
30 */
31#define restore_fpu(tsk) \
32 alternative_input( \
33 "nop ; frstor %1", \
34 "fxrstor %1", \
35 X86_FEATURE_FXSR, \
36 "m" ((tsk)->thread.i387.fxsave))
26 37
27extern void kernel_fpu_begin(void); 38extern void kernel_fpu_begin(void);
28#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0) 39#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
@@ -32,13 +43,12 @@ extern void kernel_fpu_begin(void);
32 */ 43 */
33static inline void __save_init_fpu( struct task_struct *tsk ) 44static inline void __save_init_fpu( struct task_struct *tsk )
34{ 45{
35 if ( cpu_has_fxsr ) { 46 alternative_input(
36 asm volatile( "fxsave %0 ; fnclex" 47 "fnsave %1 ; fwait ;" GENERIC_NOP2,
37 : "=m" (tsk->thread.i387.fxsave) ); 48 "fxsave %1 ; fnclex",
38 } else { 49 X86_FEATURE_FXSR,
39 asm volatile( "fnsave %0 ; fwait" 50 "m" (tsk->thread.i387.fxsave)
40 : "=m" (tsk->thread.i387.fsave) ); 51 :"memory");
41 }
42 tsk->thread_info->status &= ~TS_USEDFPU; 52 tsk->thread_info->status &= ~TS_USEDFPU;
43} 53}
44 54
diff --git a/include/asm-i386/i8253.h b/include/asm-i386/i8253.h
new file mode 100644
index 000000000000..015d8df07690
--- /dev/null
+++ b/include/asm-i386/i8253.h
@@ -0,0 +1,6 @@
1#ifndef __ASM_I8253_H__
2#define __ASM_I8253_H__
3
4extern spinlock_t i8253_lock;
5
6#endif /* __ASM_I8253_H__ */
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h
index 859ebf4da632..79dfab87135d 100644
--- a/include/asm-i386/ide.h
+++ b/include/asm-i386/ide.h
@@ -41,13 +41,17 @@ static __inline__ int ide_default_irq(unsigned long base)
41 41
42static __inline__ unsigned long ide_default_io_base(int index) 42static __inline__ unsigned long ide_default_io_base(int index)
43{ 43{
44 if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) {
45 switch(index) {
46 case 2: return 0x1e8;
47 case 3: return 0x168;
48 case 4: return 0x1e0;
49 case 5: return 0x160;
50 }
51 }
44 switch (index) { 52 switch (index) {
45 case 0: return 0x1f0; 53 case 0: return 0x1f0;
46 case 1: return 0x170; 54 case 1: return 0x170;
47 case 2: return 0x1e8;
48 case 3: return 0x168;
49 case 4: return 0x1e0;
50 case 5: return 0x160;
51 default: 55 default:
52 return 0; 56 return 0;
53 } 57 }
diff --git a/include/asm-i386/irq.h b/include/asm-i386/irq.h
index 05b9e61b0a72..270f1986b19f 100644
--- a/include/asm-i386/irq.h
+++ b/include/asm-i386/irq.h
@@ -29,13 +29,19 @@ extern void release_vm86_irqs(struct task_struct *);
29 29
30#ifdef CONFIG_4KSTACKS 30#ifdef CONFIG_4KSTACKS
31 extern void irq_ctx_init(int cpu); 31 extern void irq_ctx_init(int cpu);
32 extern void irq_ctx_exit(int cpu);
32# define __ARCH_HAS_DO_SOFTIRQ 33# define __ARCH_HAS_DO_SOFTIRQ
33#else 34#else
34# define irq_ctx_init(cpu) do { } while (0) 35# define irq_ctx_init(cpu) do { } while (0)
36# define irq_ctx_exit(cpu) do { } while (0)
35#endif 37#endif
36 38
37#ifdef CONFIG_IRQBALANCE 39#ifdef CONFIG_IRQBALANCE
38extern int irqbalance_disable(char *str); 40extern int irqbalance_disable(char *str);
39#endif 41#endif
40 42
43#ifdef CONFIG_HOTPLUG_CPU
44extern void fixup_irqs(cpumask_t map);
45#endif
46
41#endif /* _ASM_IRQ_H */ 47#endif /* _ASM_IRQ_H */
diff --git a/include/asm-i386/kdebug.h b/include/asm-i386/kdebug.h
index de6498b0d493..b3f8d5f59d5d 100644
--- a/include/asm-i386/kdebug.h
+++ b/include/asm-i386/kdebug.h
@@ -18,7 +18,7 @@ struct die_args {
18}; 18};
19 19
20/* Note - you should never unregister because that can race with NMIs. 20/* Note - you should never unregister because that can race with NMIs.
21 If you really want to do it first unregister - then synchronize_kernel - then free. 21 If you really want to do it first unregister - then synchronize_sched - then free.
22 */ 22 */
23int register_die_notifier(struct notifier_block *nb); 23int register_die_notifier(struct notifier_block *nb);
24extern struct notifier_block *i386die_chain; 24extern struct notifier_block *i386die_chain;
diff --git a/include/asm-i386/kexec.h b/include/asm-i386/kexec.h
new file mode 100644
index 000000000000..6ed2a03e37b3
--- /dev/null
+++ b/include/asm-i386/kexec.h
@@ -0,0 +1,33 @@
1#ifndef _I386_KEXEC_H
2#define _I386_KEXEC_H
3
4#include <asm/fixmap.h>
5
6/*
7 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
8 * I.e. Maximum page that is mapped directly into kernel memory,
9 * and kmap is not required.
10 *
11 * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
12 * calculation for the amount of memory directly mappable into the
13 * kernel memory space.
14 */
15
16/* Maximum physical address we can use pages from */
17#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
18/* Maximum address we can reach in physical address mode */
19#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
20/* Maximum address we can use for the control code buffer */
21#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
22
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_386
27
28#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30
31extern note_buf_t crash_notes[];
32
33#endif /* _I386_KEXEC_H */
diff --git a/include/asm-i386/kprobes.h b/include/asm-i386/kprobes.h
index 4092f68d123a..8b6d3a90cd78 100644
--- a/include/asm-i386/kprobes.h
+++ b/include/asm-i386/kprobes.h
@@ -39,6 +39,9 @@ typedef u8 kprobe_opcode_t;
39 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 39 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
40 40
41#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 41#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
42#define ARCH_SUPPORTS_KRETPROBES
43
44void kretprobe_trampoline(void);
42 45
43/* Architecture specific copy of original instruction*/ 46/* Architecture specific copy of original instruction*/
44struct arch_specific_insn { 47struct arch_specific_insn {
diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-i386/mach-bigsmp/mach_apic.h
index 2339868270ef..ba936d4daedb 100644
--- a/include/asm-i386/mach-bigsmp/mach_apic.h
+++ b/include/asm-i386/mach-bigsmp/mach_apic.h
@@ -14,8 +14,6 @@
14#define NO_BALANCE_IRQ (1) 14#define NO_BALANCE_IRQ (1)
15#define esr_disable (1) 15#define esr_disable (1)
16 16
17#define NO_IOAPIC_CHECK (0)
18
19static inline int apic_id_registered(void) 17static inline int apic_id_registered(void)
20{ 18{
21 return (1); 19 return (1);
diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-i386/mach-default/do_timer.h
index 03dd13a48a8c..56211414fc95 100644
--- a/include/asm-i386/mach-default/do_timer.h
+++ b/include/asm-i386/mach-default/do_timer.h
@@ -1,6 +1,7 @@
1/* defines for inline arch setup functions */ 1/* defines for inline arch setup functions */
2 2
3#include <asm/apic.h> 3#include <asm/apic.h>
4#include <asm/i8259.h>
4 5
5/** 6/**
6 * do_timer_interrupt_hook - hook into timer tick 7 * do_timer_interrupt_hook - hook into timer tick
diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-i386/mach-default/mach_apic.h
index 627f1cd084ba..3ef6292db780 100644
--- a/include/asm-i386/mach-default/mach_apic.h
+++ b/include/asm-i386/mach-default/mach_apic.h
@@ -19,8 +19,6 @@ static inline cpumask_t target_cpus(void)
19#define NO_BALANCE_IRQ (0) 19#define NO_BALANCE_IRQ (0)
20#define esr_disable (0) 20#define esr_disable (0)
21 21
22#define NO_IOAPIC_CHECK (0)
23
24#define INT_DELIVERY_MODE dest_LowestPrio 22#define INT_DELIVERY_MODE dest_LowestPrio
25#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ 23#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
26 24
diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-i386/mach-default/mach_ipi.h
index 6f2b17a20089..cc756a67cd63 100644
--- a/include/asm-i386/mach-default/mach_ipi.h
+++ b/include/asm-i386/mach-default/mach_ipi.h
@@ -4,11 +4,34 @@
4void send_IPI_mask_bitmask(cpumask_t mask, int vector); 4void send_IPI_mask_bitmask(cpumask_t mask, int vector);
5void __send_IPI_shortcut(unsigned int shortcut, int vector); 5void __send_IPI_shortcut(unsigned int shortcut, int vector);
6 6
7extern int no_broadcast;
8
7static inline void send_IPI_mask(cpumask_t mask, int vector) 9static inline void send_IPI_mask(cpumask_t mask, int vector)
8{ 10{
9 send_IPI_mask_bitmask(mask, vector); 11 send_IPI_mask_bitmask(mask, vector);
10} 12}
11 13
14static inline void __local_send_IPI_allbutself(int vector)
15{
16 if (no_broadcast) {
17 cpumask_t mask = cpu_online_map;
18 int this_cpu = get_cpu();
19
20 cpu_clear(this_cpu, mask);
21 send_IPI_mask(mask, vector);
22 put_cpu();
23 } else
24 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
25}
26
27static inline void __local_send_IPI_all(int vector)
28{
29 if (no_broadcast)
30 send_IPI_mask(cpu_online_map, vector);
31 else
32 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
33}
34
12static inline void send_IPI_allbutself(int vector) 35static inline void send_IPI_allbutself(int vector)
13{ 36{
14 /* 37 /*
@@ -18,13 +41,13 @@ static inline void send_IPI_allbutself(int vector)
18 if (!(num_online_cpus() > 1)) 41 if (!(num_online_cpus() > 1))
19 return; 42 return;
20 43
21 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); 44 __local_send_IPI_allbutself(vector);
22 return; 45 return;
23} 46}
24 47
25static inline void send_IPI_all(int vector) 48static inline void send_IPI_all(int vector)
26{ 49{
27 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 50 __local_send_IPI_all(vector);
28} 51}
29 52
30#endif /* __ASM_MACH_IPI_H */ 53#endif /* __ASM_MACH_IPI_H */
diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-i386/mach-es7000/mach_apic.h
index ceab2c464b13..b5f3f0d0b2bc 100644
--- a/include/asm-i386/mach-es7000/mach_apic.h
+++ b/include/asm-i386/mach-es7000/mach_apic.h
@@ -38,8 +38,6 @@ static inline cpumask_t target_cpus(void)
38#define WAKE_SECONDARY_VIA_INIT 38#define WAKE_SECONDARY_VIA_INIT
39#endif 39#endif
40 40
41#define NO_IOAPIC_CHECK (1)
42
43static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) 41static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid)
44{ 42{
45 return 0; 43 return 0;
diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-i386/mach-generic/mach_apic.h
index ab36d02ebede..b13767a4e934 100644
--- a/include/asm-i386/mach-generic/mach_apic.h
+++ b/include/asm-i386/mach-generic/mach_apic.h
@@ -5,7 +5,6 @@
5 5
6#define esr_disable (genapic->ESR_DISABLE) 6#define esr_disable (genapic->ESR_DISABLE)
7#define NO_BALANCE_IRQ (genapic->no_balance_irq) 7#define NO_BALANCE_IRQ (genapic->no_balance_irq)
8#define NO_IOAPIC_CHECK (genapic->no_ioapic_check)
9#define INT_DELIVERY_MODE (genapic->int_delivery_mode) 8#define INT_DELIVERY_MODE (genapic->int_delivery_mode)
10#define INT_DEST_MODE (genapic->int_dest_mode) 9#define INT_DEST_MODE (genapic->int_dest_mode)
11#undef APIC_DEST_LOGICAL 10#undef APIC_DEST_LOGICAL
diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-i386/mach-numaq/mach_apic.h
index e1a04494764a..9d158095da82 100644
--- a/include/asm-i386/mach-numaq/mach_apic.h
+++ b/include/asm-i386/mach-numaq/mach_apic.h
@@ -17,8 +17,6 @@ static inline cpumask_t target_cpus(void)
17#define NO_BALANCE_IRQ (1) 17#define NO_BALANCE_IRQ (1)
18#define esr_disable (1) 18#define esr_disable (1)
19 19
20#define NO_IOAPIC_CHECK (0)
21
22#define INT_DELIVERY_MODE dest_LowestPrio 20#define INT_DELIVERY_MODE dest_LowestPrio
23#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */ 21#define INT_DEST_MODE 0 /* physical delivery on LOCAL quad */
24 22
diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-i386/mach-summit/mach_apic.h
index 74e9cbc8c01b..3d6d12937e1f 100644
--- a/include/asm-i386/mach-summit/mach_apic.h
+++ b/include/asm-i386/mach-summit/mach_apic.h
@@ -7,8 +7,6 @@
7#define esr_disable (1) 7#define esr_disable (1)
8#define NO_BALANCE_IRQ (0) 8#define NO_BALANCE_IRQ (0)
9 9
10#define NO_IOAPIC_CHECK (1) /* Don't check I/O APIC ID for xAPIC */
11
12/* In clustered mode, the high nibble of APIC ID is a cluster number. 10/* In clustered mode, the high nibble of APIC ID is a cluster number.
13 * The low nibble is a 4-bit bitmap. */ 11 * The low nibble is a 4-bit bitmap. */
14#define XAPIC_DEST_CPUS_SHIFT 4 12#define XAPIC_DEST_CPUS_SHIFT 4
diff --git a/include/asm-i386/mach-visws/do_timer.h b/include/asm-i386/mach-visws/do_timer.h
index 33acd50fd9a8..92d638fc8b11 100644
--- a/include/asm-i386/mach-visws/do_timer.h
+++ b/include/asm-i386/mach-visws/do_timer.h
@@ -1,6 +1,7 @@
1/* defines for inline arch setup functions */ 1/* defines for inline arch setup functions */
2 2
3#include <asm/fixmap.h> 3#include <asm/fixmap.h>
4#include <asm/i8259.h>
4#include "cobalt.h" 5#include "cobalt.h"
5 6
6static inline void do_timer_interrupt_hook(struct pt_regs *regs) 7static inline void do_timer_interrupt_hook(struct pt_regs *regs)
diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-i386/mach-visws/mach_apic.h
index 4e6cdfb8b091..de438c7147a8 100644
--- a/include/asm-i386/mach-visws/mach_apic.h
+++ b/include/asm-i386/mach-visws/mach_apic.h
@@ -9,8 +9,6 @@
9#define no_balance_irq (0) 9#define no_balance_irq (0)
10#define esr_disable (0) 10#define esr_disable (0)
11 11
12#define NO_IOAPIC_CHECK (0)
13
14#define INT_DELIVERY_MODE dest_LowestPrio 12#define INT_DELIVERY_MODE dest_LowestPrio
15#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */ 13#define INT_DEST_MODE 1 /* logical delivery broadcast to all procs */
16 14
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h
index 13830ae67cac..516421300ea2 100644
--- a/include/asm-i386/mmzone.h
+++ b/include/asm-i386/mmzone.h
@@ -8,21 +8,43 @@
8 8
9#include <asm/smp.h> 9#include <asm/smp.h>
10 10
11#ifdef CONFIG_DISCONTIGMEM
12
13#ifdef CONFIG_NUMA 11#ifdef CONFIG_NUMA
14 #ifdef CONFIG_X86_NUMAQ 12extern struct pglist_data *node_data[];
15 #include <asm/numaq.h> 13#define NODE_DATA(nid) (node_data[nid])
16 #else /* summit or generic arch */ 14
17 #include <asm/srat.h> 15#ifdef CONFIG_X86_NUMAQ
18 #endif 16 #include <asm/numaq.h>
17#else /* summit or generic arch */
18 #include <asm/srat.h>
19#endif
20
21extern int get_memcfg_numa_flat(void );
22/*
23 * This allows any one NUMA architecture to be compiled
24 * for, and still fall back to the flat function if it
25 * fails.
26 */
27static inline void get_memcfg_numa(void)
28{
29#ifdef CONFIG_X86_NUMAQ
30 if (get_memcfg_numaq())
31 return;
32#elif CONFIG_ACPI_SRAT
33 if (get_memcfg_from_srat())
34 return;
35#endif
36
37 get_memcfg_numa_flat();
38}
39
40extern int early_pfn_to_nid(unsigned long pfn);
41
19#else /* !CONFIG_NUMA */ 42#else /* !CONFIG_NUMA */
20 #define get_memcfg_numa get_memcfg_numa_flat 43#define get_memcfg_numa get_memcfg_numa_flat
21 #define get_zholes_size(n) (0) 44#define get_zholes_size(n) (0)
22#endif /* CONFIG_NUMA */ 45#endif /* CONFIG_NUMA */
23 46
24extern struct pglist_data *node_data[]; 47#ifdef CONFIG_DISCONTIGMEM
25#define NODE_DATA(nid) (node_data[nid])
26 48
27/* 49/*
28 * generic node memory support, the following assumptions apply: 50 * generic node memory support, the following assumptions apply:
@@ -48,26 +70,6 @@ static inline int pfn_to_nid(unsigned long pfn)
48#endif 70#endif
49} 71}
50 72
51/*
52 * Following are macros that are specific to this numa platform.
53 */
54#define reserve_bootmem(addr, size) \
55 reserve_bootmem_node(NODE_DATA(0), (addr), (size))
56#define alloc_bootmem(x) \
57 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
58#define alloc_bootmem_low(x) \
59 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
60#define alloc_bootmem_pages(x) \
61 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
62#define alloc_bootmem_low_pages(x) \
63 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
64#define alloc_bootmem_node(ignore, x) \
65 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
66#define alloc_bootmem_pages_node(ignore, x) \
67 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
68#define alloc_bootmem_low_pages_node(ignore, x) \
69 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
70
71#define node_localnr(pfn, nid) ((pfn) - node_data[nid]->node_start_pfn) 73#define node_localnr(pfn, nid) ((pfn) - node_data[nid]->node_start_pfn)
72 74
73/* 75/*
@@ -79,7 +81,6 @@ static inline int pfn_to_nid(unsigned long pfn)
79 */ 81 */
80#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT) 82#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
81 83
82#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
83#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 84#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
84#define node_end_pfn(nid) \ 85#define node_end_pfn(nid) \
85({ \ 86({ \
@@ -100,7 +101,7 @@ static inline int pfn_to_nid(unsigned long pfn)
100({ \ 101({ \
101 unsigned long __pfn = pfn; \ 102 unsigned long __pfn = pfn; \
102 int __node = pfn_to_nid(__pfn); \ 103 int __node = pfn_to_nid(__pfn); \
103 &node_mem_map(__node)[node_localnr(__pfn,__node)]; \ 104 &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)]; \
104}) 105})
105 106
106#define page_to_pfn(pg) \ 107#define page_to_pfn(pg) \
@@ -122,26 +123,32 @@ static inline int pfn_valid(int pfn)
122 return (pfn < node_end_pfn(nid)); 123 return (pfn < node_end_pfn(nid));
123 return 0; 124 return 0;
124} 125}
125#endif 126#endif /* CONFIG_X86_NUMAQ */
127
128#endif /* CONFIG_DISCONTIGMEM */
129
130#ifdef CONFIG_NEED_MULTIPLE_NODES
126 131
127extern int get_memcfg_numa_flat(void );
128/* 132/*
129 * This allows any one NUMA architecture to be compiled 133 * Following are macros that are specific to this numa platform.
130 * for, and still fall back to the flat function if it
131 * fails.
132 */ 134 */
133static inline void get_memcfg_numa(void) 135#define reserve_bootmem(addr, size) \
134{ 136 reserve_bootmem_node(NODE_DATA(0), (addr), (size))
135#ifdef CONFIG_X86_NUMAQ 137#define alloc_bootmem(x) \
136 if (get_memcfg_numaq()) 138 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
137 return; 139#define alloc_bootmem_low(x) \
138#elif CONFIG_ACPI_SRAT 140 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, 0)
139 if (get_memcfg_from_srat()) 141#define alloc_bootmem_pages(x) \
140 return; 142 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
141#endif 143#define alloc_bootmem_low_pages(x) \
144 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
145#define alloc_bootmem_node(ignore, x) \
146 __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
147#define alloc_bootmem_pages_node(ignore, x) \
148 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
149#define alloc_bootmem_low_pages_node(ignore, x) \
150 __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0)
142 151
143 get_memcfg_numa_flat(); 152#endif /* CONFIG_NEED_MULTIPLE_NODES */
144}
145 153
146#endif /* CONFIG_DISCONTIGMEM */
147#endif /* _ASM_MMZONE_H_ */ 154#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index 41400d342d44..8d93f732d72d 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -120,13 +120,18 @@ static __inline__ int get_order(unsigned long size)
120 120
121extern int sysctl_legacy_va_layout; 121extern int sysctl_legacy_va_layout;
122 122
123extern int page_is_ram(unsigned long pagenr);
124
123#endif /* __ASSEMBLY__ */ 125#endif /* __ASSEMBLY__ */
124 126
125#ifdef __ASSEMBLY__ 127#ifdef __ASSEMBLY__
126#define __PAGE_OFFSET (0xC0000000) 128#define __PAGE_OFFSET (0xC0000000)
129#define __PHYSICAL_START CONFIG_PHYSICAL_START
127#else 130#else
128#define __PAGE_OFFSET (0xC0000000UL) 131#define __PAGE_OFFSET (0xC0000000UL)
132#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START)
129#endif 133#endif
134#define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START)
130 135
131 136
132#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) 137#define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET)
@@ -135,11 +140,11 @@ extern int sysctl_legacy_va_layout;
135#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) 140#define __pa(x) ((unsigned long)(x)-PAGE_OFFSET)
136#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 141#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
137#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 142#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
138#ifndef CONFIG_DISCONTIGMEM 143#ifdef CONFIG_FLATMEM
139#define pfn_to_page(pfn) (mem_map + (pfn)) 144#define pfn_to_page(pfn) (mem_map + (pfn))
140#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 145#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
141#define pfn_valid(pfn) ((pfn) < max_mapnr) 146#define pfn_valid(pfn) ((pfn) < max_mapnr)
142#endif /* !CONFIG_DISCONTIGMEM */ 147#endif /* CONFIG_FLATMEM */
143#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 148#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
144 149
145#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 150#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
diff --git a/include/asm-i386/param.h b/include/asm-i386/param.h
index b6440526e42a..fa02e67ea86b 100644
--- a/include/asm-i386/param.h
+++ b/include/asm-i386/param.h
@@ -1,8 +1,10 @@
1#include <linux/config.h>
2
1#ifndef _ASMi386_PARAM_H 3#ifndef _ASMi386_PARAM_H
2#define _ASMi386_PARAM_H 4#define _ASMi386_PARAM_H
3 5
4#ifdef __KERNEL__ 6#ifdef __KERNEL__
5# define HZ 1000 /* Internal kernel timer frequency */ 7# define HZ CONFIG_HZ /* Internal kernel timer frequency */
6# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 8# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
7# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 9# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
8#endif 10#endif
diff --git a/include/asm-i386/pci.h b/include/asm-i386/pci.h
index fb749b85a739..78c85985aee3 100644
--- a/include/asm-i386/pci.h
+++ b/include/asm-i386/pci.h
@@ -27,7 +27,7 @@ void pcibios_config_init(void);
27struct pci_bus * pcibios_scan_root(int bus); 27struct pci_bus * pcibios_scan_root(int bus);
28 28
29void pcibios_set_master(struct pci_dev *dev); 29void pcibios_set_master(struct pci_dev *dev);
30void pcibios_penalize_isa_irq(int irq); 30void pcibios_penalize_isa_irq(int irq, int active);
31struct irq_routing_table *pcibios_get_irq_routing_table(void); 31struct irq_routing_table *pcibios_get_irq_routing_table(void);
32int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); 32int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
33 33
@@ -99,6 +99,16 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
99{ 99{
100} 100}
101 101
102#ifdef CONFIG_PCI
103static inline void pci_dma_burst_advice(struct pci_dev *pdev,
104 enum pci_dma_burst_strategy *strat,
105 unsigned long *strategy_parameter)
106{
107 *strat = PCI_DMA_BURST_INFINITY;
108 *strategy_parameter = ~0UL;
109}
110#endif
111
102#endif /* __KERNEL__ */ 112#endif /* __KERNEL__ */
103 113
104/* implement the pci_ DMA API in terms of the generic device dma_ one */ 114/* implement the pci_ DMA API in terms of the generic device dma_ one */
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index e9efe148fdf7..77c6497f416e 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -398,9 +398,9 @@ extern void noexec_setup(const char *str);
398 398
399#endif /* !__ASSEMBLY__ */ 399#endif /* !__ASSEMBLY__ */
400 400
401#ifndef CONFIG_DISCONTIGMEM 401#ifdef CONFIG_FLATMEM
402#define kern_addr_valid(addr) (1) 402#define kern_addr_valid(addr) (1)
403#endif /* !CONFIG_DISCONTIGMEM */ 403#endif /* CONFIG_FLATMEM */
404 404
405#define io_remap_page_range(vma, vaddr, paddr, size, prot) \ 405#define io_remap_page_range(vma, vaddr, paddr, size, prot) \
406 remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) 406 remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot)
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h
index 359bb0151742..d0d8b0160090 100644
--- a/include/asm-i386/processor.h
+++ b/include/asm-i386/processor.h
@@ -29,7 +29,7 @@ struct desc_struct {
29}; 29};
30 30
31#define desc_empty(desc) \ 31#define desc_empty(desc) \
32 (!((desc)->a + (desc)->b)) 32 (!((desc)->a | (desc)->b))
33 33
34#define desc_equal(desc1, desc2) \ 34#define desc_equal(desc1, desc2) \
35 (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) 35 (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
@@ -501,12 +501,16 @@ static inline void load_esp0(struct tss_struct *tss, struct thread_struct *threa
501} while (0) 501} while (0)
502 502
503/* 503/*
504 * This special macro can be used to load a debugging register 504 * These special macros can be used to get or set a debugging register
505 */ 505 */
506#define loaddebug(thread,register) \ 506#define get_debugreg(var, register) \
507 __asm__("movl %0,%%db" #register \ 507 __asm__("movl %%db" #register ", %0" \
508 : /* no output */ \ 508 :"=r" (var))
509 :"r" ((thread)->debugreg[register])) 509#define set_debugreg(value, register) \
510 __asm__("movl %0,%%db" #register \
511 : /* no output */ \
512 :"r" (value))
513
510 514
511/* Forward declaration, a strange C thing */ 515/* Forward declaration, a strange C thing */
512struct task_struct; 516struct task_struct;
@@ -687,5 +691,15 @@ extern void select_idle_routine(const struct cpuinfo_x86 *c);
687#define cache_line_size() (boot_cpu_data.x86_cache_alignment) 691#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
688 692
689extern unsigned long boot_option_idle_override; 693extern unsigned long boot_option_idle_override;
694extern void enable_sep_cpu(void);
695extern int sysenter_setup(void);
696
697#ifdef CONFIG_MTRR
698extern void mtrr_ap_init(void);
699extern void mtrr_bp_init(void);
700#else
701#define mtrr_ap_init() do {} while (0)
702#define mtrr_bp_init() do {} while (0)
703#endif
690 704
691#endif /* __ASM_I386_PROCESSOR_H */ 705#endif /* __ASM_I386_PROCESSOR_H */
diff --git a/include/asm-i386/ptrace.h b/include/asm-i386/ptrace.h
index 8618914b3521..05532875e39e 100644
--- a/include/asm-i386/ptrace.h
+++ b/include/asm-i386/ptrace.h
@@ -55,15 +55,26 @@ struct pt_regs {
55#define PTRACE_SET_THREAD_AREA 26 55#define PTRACE_SET_THREAD_AREA 26
56 56
57#ifdef __KERNEL__ 57#ifdef __KERNEL__
58
59#include <asm/vm86.h>
60
58struct task_struct; 61struct task_struct;
59extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code); 62extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, int error_code);
60#define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) 63
64static inline int user_mode(struct pt_regs *regs)
65{
66 return (regs->xcs & 3) != 0;
67}
68static inline int user_mode_vm(struct pt_regs *regs)
69{
70 return ((regs->xcs & 3) | (regs->eflags & VM_MASK)) != 0;
71}
61#define instruction_pointer(regs) ((regs)->eip) 72#define instruction_pointer(regs) ((regs)->eip)
62#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) 73#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
63extern unsigned long profile_pc(struct pt_regs *regs); 74extern unsigned long profile_pc(struct pt_regs *regs);
64#else 75#else
65#define profile_pc(regs) instruction_pointer(regs) 76#define profile_pc(regs) instruction_pointer(regs)
66#endif 77#endif
67#endif 78#endif /* __KERNEL__ */
68 79
69#endif 80#endif
diff --git a/include/asm-i386/serial.h b/include/asm-i386/serial.h
index 21ddecc77c77..e1ecfccb743b 100644
--- a/include/asm-i386/serial.h
+++ b/include/asm-i386/serial.h
@@ -22,109 +22,9 @@
22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
23#endif 23#endif
24 24
25#ifdef CONFIG_SERIAL_MANY_PORTS 25#define SERIAL_PORT_DFNS \
26#define FOURPORT_FLAGS ASYNC_FOURPORT
27#define ACCENT_FLAGS 0
28#define BOCA_FLAGS 0
29#define HUB6_FLAGS 0
30#endif
31
32#define MCA_COM_FLAGS (STD_COM_FLAGS|ASYNC_BOOT_ONLYMCA)
33
34/*
35 * The following define the access methods for the HUB6 card. All
36 * access is through two ports for all 24 possible chips. The card is
37 * selected through the high 2 bits, the port on that card with the
38 * "middle" 3 bits, and the register on that port with the bottom
39 * 3 bits.
40 *
41 * While the access port and interrupt is configurable, the default
42 * port locations are 0x302 for the port control register, and 0x303
43 * for the data read/write register. Normally, the interrupt is at irq3
44 * but can be anything from 3 to 7 inclusive. Note that using 3 will
45 * require disabling com2.
46 */
47
48#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
49
50#define STD_SERIAL_PORT_DEFNS \
51 /* UART CLK PORT IRQ FLAGS */ \ 26 /* UART CLK PORT IRQ FLAGS */ \
52 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 27 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
53 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 28 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
54 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 29 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
55 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 30 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
56
57
58#ifdef CONFIG_SERIAL_MANY_PORTS
59#define EXTRA_SERIAL_PORT_DEFNS \
60 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
61 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
62 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
63 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
64 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
65 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
66 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
67 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
68 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
69 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
70 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
71 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
72 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
73 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
74 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
75 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
76 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
77 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
78 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
79 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
80 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
81 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
82 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
83 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
84 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
85 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
86 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
87 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
88#else
89#define EXTRA_SERIAL_PORT_DEFNS
90#endif
91
92/* You can have up to four HUB6's in the system, but I've only
93 * included two cards here for a total of twelve ports.
94 */
95#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
96#define HUB6_SERIAL_PORT_DFNS \
97 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \
98 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \
99 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \
100 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \
101 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \
102 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \
103 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \
104 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \
105 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \
106 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \
107 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \
108 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
109#else
110#define HUB6_SERIAL_PORT_DFNS
111#endif
112
113#ifdef CONFIG_MCA
114#define MCA_SERIAL_PORT_DFNS \
115 { 0, BASE_BAUD, 0x3220, 3, MCA_COM_FLAGS }, \
116 { 0, BASE_BAUD, 0x3228, 3, MCA_COM_FLAGS }, \
117 { 0, BASE_BAUD, 0x4220, 3, MCA_COM_FLAGS }, \
118 { 0, BASE_BAUD, 0x4228, 3, MCA_COM_FLAGS }, \
119 { 0, BASE_BAUD, 0x5220, 3, MCA_COM_FLAGS }, \
120 { 0, BASE_BAUD, 0x5228, 3, MCA_COM_FLAGS },
121#else
122#define MCA_SERIAL_PORT_DFNS
123#endif
124
125#define SERIAL_PORT_DFNS \
126 STD_SERIAL_PORT_DEFNS \
127 EXTRA_SERIAL_PORT_DEFNS \
128 HUB6_SERIAL_PORT_DFNS \
129 MCA_SERIAL_PORT_DFNS
130
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index 55ef31f66bbe..a283738b80b3 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -37,15 +37,19 @@ extern int smp_num_siblings;
37extern cpumask_t cpu_sibling_map[]; 37extern cpumask_t cpu_sibling_map[];
38extern cpumask_t cpu_core_map[]; 38extern cpumask_t cpu_core_map[];
39 39
40extern void smp_flush_tlb(void);
41extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
42extern void smp_invalidate_rcv(void); /* Process an NMI */
43extern void (*mtrr_hook) (void); 40extern void (*mtrr_hook) (void);
44extern void zap_low_mappings (void); 41extern void zap_low_mappings (void);
42extern void lock_ipi_call_lock(void);
43extern void unlock_ipi_call_lock(void);
45 44
46#define MAX_APICID 256 45#define MAX_APICID 256
47extern u8 x86_cpu_to_apicid[]; 46extern u8 x86_cpu_to_apicid[];
48 47
48#ifdef CONFIG_HOTPLUG_CPU
49extern void cpu_exit_clear(void);
50extern void cpu_uninit(void);
51#endif
52
49/* 53/*
50 * This function is needed by all SMP systems. It must _always_ be valid 54 * This function is needed by all SMP systems. It must _always_ be valid
51 * from the initial startup. We map APIC_BASE very early in page_setup(), 55 * from the initial startup. We map APIC_BASE very early in page_setup(),
@@ -83,6 +87,9 @@ static __inline int logical_smp_processor_id(void)
83} 87}
84 88
85#endif 89#endif
90
91extern int __cpu_disable(void);
92extern void __cpu_die(unsigned int cpu);
86#endif /* !__ASSEMBLY__ */ 93#endif /* !__ASSEMBLY__ */
87 94
88#define NO_PROC_ID 0xFF /* No processor magic marker */ 95#define NO_PROC_ID 0xFF /* No processor magic marker */
diff --git a/include/asm-i386/sparsemem.h b/include/asm-i386/sparsemem.h
new file mode 100644
index 000000000000..cfeed990585f
--- /dev/null
+++ b/include/asm-i386/sparsemem.h
@@ -0,0 +1,31 @@
1#ifndef _I386_SPARSEMEM_H
2#define _I386_SPARSEMEM_H
3#ifdef CONFIG_SPARSEMEM
4
5/*
6 * generic non-linear memory support:
7 *
8 * 1) we will not split memory into more chunks than will fit into the
9 * flags field of the struct page
10 */
11
12/*
13 * SECTION_SIZE_BITS 2^N: how big each section will be
14 * MAX_PHYSADDR_BITS 2^N: how much physical address space we have
15 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
16 */
17#ifdef CONFIG_X86_PAE
18#define SECTION_SIZE_BITS 30
19#define MAX_PHYSADDR_BITS 36
20#define MAX_PHYSMEM_BITS 36
21#else
22#define SECTION_SIZE_BITS 26
23#define MAX_PHYSADDR_BITS 32
24#define MAX_PHYSMEM_BITS 32
25#endif
26
27/* XXX: FIXME -- wli */
28#define kern_addr_valid(kaddr) (0)
29
30#endif /* CONFIG_SPARSEMEM */
31#endif /* _I386_SPARSEMEM_H */
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 6a78ac58c194..02c8f5d22065 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -116,7 +116,8 @@ __asm__ __volatile__(
116 "orb $1,%%al\n" 116 "orb $1,%%al\n"
117 "3:" 117 "3:"
118 :"=a" (__res), "=&S" (d0), "=&D" (d1) 118 :"=a" (__res), "=&S" (d0), "=&D" (d1)
119 :"1" (cs),"2" (ct)); 119 :"1" (cs),"2" (ct)
120 :"memory");
120return __res; 121return __res;
121} 122}
122 123
@@ -138,8 +139,9 @@ __asm__ __volatile__(
138 "3:\tsbbl %%eax,%%eax\n\t" 139 "3:\tsbbl %%eax,%%eax\n\t"
139 "orb $1,%%al\n" 140 "orb $1,%%al\n"
140 "4:" 141 "4:"
141 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2) 142 :"=a" (__res), "=&S" (d0), "=&D" (d1), "=&c" (d2)
142 :"1" (cs),"2" (ct),"3" (count)); 143 :"1" (cs),"2" (ct),"3" (count)
144 :"memory");
143return __res; 145return __res;
144} 146}
145 147
@@ -158,7 +160,9 @@ __asm__ __volatile__(
158 "movl $1,%1\n" 160 "movl $1,%1\n"
159 "2:\tmovl %1,%0\n\t" 161 "2:\tmovl %1,%0\n\t"
160 "decl %0" 162 "decl %0"
161 :"=a" (__res), "=&S" (d0) : "1" (s),"0" (c)); 163 :"=a" (__res), "=&S" (d0)
164 :"1" (s),"0" (c)
165 :"memory");
162return __res; 166return __res;
163} 167}
164 168
@@ -175,7 +179,9 @@ __asm__ __volatile__(
175 "leal -1(%%esi),%0\n" 179 "leal -1(%%esi),%0\n"
176 "2:\ttestb %%al,%%al\n\t" 180 "2:\ttestb %%al,%%al\n\t"
177 "jne 1b" 181 "jne 1b"
178 :"=g" (__res), "=&S" (d0), "=&a" (d1) :"0" (0),"1" (s),"2" (c)); 182 :"=g" (__res), "=&S" (d0), "=&a" (d1)
183 :"0" (0),"1" (s),"2" (c)
184 :"memory");
179return __res; 185return __res;
180} 186}
181 187
@@ -189,7 +195,9 @@ __asm__ __volatile__(
189 "scasb\n\t" 195 "scasb\n\t"
190 "notl %0\n\t" 196 "notl %0\n\t"
191 "decl %0" 197 "decl %0"
192 :"=c" (__res), "=&D" (d0) :"1" (s),"a" (0), "0" (0xffffffffu)); 198 :"=c" (__res), "=&D" (d0)
199 :"1" (s),"a" (0), "0" (0xffffffffu)
200 :"memory");
193return __res; 201return __res;
194} 202}
195 203
@@ -333,7 +341,9 @@ __asm__ __volatile__(
333 "je 1f\n\t" 341 "je 1f\n\t"
334 "movl $1,%0\n" 342 "movl $1,%0\n"
335 "1:\tdecl %0" 343 "1:\tdecl %0"
336 :"=D" (__res), "=&c" (d0) : "a" (c),"0" (cs),"1" (count)); 344 :"=D" (__res), "=&c" (d0)
345 :"a" (c),"0" (cs),"1" (count)
346 :"memory");
337return __res; 347return __res;
338} 348}
339 349
@@ -369,7 +379,7 @@ __asm__ __volatile__(
369 "je 2f\n\t" 379 "je 2f\n\t"
370 "stosb\n" 380 "stosb\n"
371 "2:" 381 "2:"
372 : "=&c" (d0), "=&D" (d1) 382 :"=&c" (d0), "=&D" (d1)
373 :"a" (c), "q" (count), "0" (count/4), "1" ((long) s) 383 :"a" (c), "q" (count), "0" (count/4), "1" ((long) s)
374 :"memory"); 384 :"memory");
375return (s); 385return (s);
@@ -392,7 +402,8 @@ __asm__ __volatile__(
392 "jne 1b\n" 402 "jne 1b\n"
393 "3:\tsubl %2,%0" 403 "3:\tsubl %2,%0"
394 :"=a" (__res), "=&d" (d0) 404 :"=a" (__res), "=&d" (d0)
395 :"c" (s),"1" (count)); 405 :"c" (s),"1" (count)
406 :"memory");
396return __res; 407return __res;
397} 408}
398/* end of additional stuff */ 409/* end of additional stuff */
@@ -473,7 +484,8 @@ static inline void * memscan(void * addr, int c, size_t size)
473 "dec %%edi\n" 484 "dec %%edi\n"
474 "1:" 485 "1:"
475 : "=D" (addr), "=c" (size) 486 : "=D" (addr), "=c" (size)
476 : "0" (addr), "1" (size), "a" (c)); 487 : "0" (addr), "1" (size), "a" (c)
488 : "memory");
477 return addr; 489 return addr;
478} 490}
479 491
diff --git a/include/asm-i386/thread_info.h b/include/asm-i386/thread_info.h
index 2cd57271801d..95add81237ea 100644
--- a/include/asm-i386/thread_info.h
+++ b/include/asm-i386/thread_info.h
@@ -31,7 +31,7 @@ struct thread_info {
31 unsigned long flags; /* low level flags */ 31 unsigned long flags; /* low level flags */
32 unsigned long status; /* thread-synchronous flags */ 32 unsigned long status; /* thread-synchronous flags */
33 __u32 cpu; /* current CPU */ 33 __u32 cpu; /* current CPU */
34 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 34 int preempt_count; /* 0 => preemptable, <0 => BUG */
35 35
36 36
37 mm_segment_t addr_limit; /* thread address space: 37 mm_segment_t addr_limit; /* thread address space:
diff --git a/include/asm-i386/timer.h b/include/asm-i386/timer.h
index c34709849839..dcf1e07db08a 100644
--- a/include/asm-i386/timer.h
+++ b/include/asm-i386/timer.h
@@ -22,6 +22,7 @@ struct timer_opts {
22 unsigned long (*get_offset)(void); 22 unsigned long (*get_offset)(void);
23 unsigned long long (*monotonic_clock)(void); 23 unsigned long long (*monotonic_clock)(void);
24 void (*delay)(unsigned long); 24 void (*delay)(unsigned long);
25 unsigned long (*read_timer)(void);
25}; 26};
26 27
27struct init_timer_opts { 28struct init_timer_opts {
@@ -52,6 +53,7 @@ extern struct init_timer_opts timer_cyclone_init;
52#endif 53#endif
53 54
54extern unsigned long calibrate_tsc(void); 55extern unsigned long calibrate_tsc(void);
56extern unsigned long read_timer_tsc(void);
55extern void init_cpu_khz(void); 57extern void init_cpu_khz(void);
56extern int recalibrate_cpu_khz(void); 58extern int recalibrate_cpu_khz(void);
57#ifdef CONFIG_HPET_TIMER 59#ifdef CONFIG_HPET_TIMER
diff --git a/include/asm-i386/timex.h b/include/asm-i386/timex.h
index b41e484c3445..292b5a68f627 100644
--- a/include/asm-i386/timex.h
+++ b/include/asm-i386/timex.h
@@ -47,6 +47,9 @@ static inline cycles_t get_cycles (void)
47 return ret; 47 return ret;
48} 48}
49 49
50extern unsigned long cpu_khz; 50extern unsigned int cpu_khz;
51
52extern int read_current_timer(unsigned long *timer_value);
53#define ARCH_HAS_READ_CURRENT_TIMER 1
51 54
52#endif 55#endif
diff --git a/include/asm-i386/tlbflush.h b/include/asm-i386/tlbflush.h
index f22fab0cea26..ab216e1370ef 100644
--- a/include/asm-i386/tlbflush.h
+++ b/include/asm-i386/tlbflush.h
@@ -22,16 +22,18 @@
22 */ 22 */
23#define __flush_tlb_global() \ 23#define __flush_tlb_global() \
24 do { \ 24 do { \
25 unsigned int tmpreg; \ 25 unsigned int tmpreg, cr4, cr4_orig; \
26 \ 26 \
27 __asm__ __volatile__( \ 27 __asm__ __volatile__( \
28 "movl %1, %%cr4; # turn off PGE \n" \ 28 "movl %%cr4, %2; # turn off PGE \n" \
29 "movl %2, %1; \n" \
30 "andl %3, %1; \n" \
31 "movl %1, %%cr4; \n" \
29 "movl %%cr3, %0; \n" \ 32 "movl %%cr3, %0; \n" \
30 "movl %0, %%cr3; # flush TLB \n" \ 33 "movl %0, %%cr3; # flush TLB \n" \
31 "movl %2, %%cr4; # turn PGE back on \n" \ 34 "movl %2, %%cr4; # turn PGE back on \n" \
32 : "=&r" (tmpreg) \ 35 : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig) \
33 : "r" (mmu_cr4_features & ~X86_CR4_PGE), \ 36 : "i" (~X86_CR4_PGE) \
34 "r" (mmu_cr4_features) \
35 : "memory"); \ 37 : "memory"); \
36 } while (0) 38 } while (0)
37 39
diff --git a/include/asm-i386/topology.h b/include/asm-i386/topology.h
index 98f9e6850cba..2461b731781e 100644
--- a/include/asm-i386/topology.h
+++ b/include/asm-i386/topology.h
@@ -60,12 +60,8 @@ static inline int node_to_first_cpu(int node)
60 return first_cpu(mask); 60 return first_cpu(mask);
61} 61}
62 62
63/* Returns the number of the node containing PCI bus number 'busnr' */ 63#define pcibus_to_node(bus) mp_bus_id_to_node[(bus)->number]
64static inline cpumask_t __pcibus_to_cpumask(int busnr) 64#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus))
65{
66 return node_to_cpumask(mp_bus_id_to_node[busnr]);
67}
68#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number)
69 65
70/* sched_domains SD_NODE_INIT for NUMAQ machines */ 66/* sched_domains SD_NODE_INIT for NUMAQ machines */
71#define SD_NODE_INIT (struct sched_domain) { \ 67#define SD_NODE_INIT (struct sched_domain) { \
@@ -78,11 +74,14 @@ static inline cpumask_t __pcibus_to_cpumask(int busnr)
78 .imbalance_pct = 125, \ 74 .imbalance_pct = 125, \
79 .cache_hot_time = (10*1000000), \ 75 .cache_hot_time = (10*1000000), \
80 .cache_nice_tries = 1, \ 76 .cache_nice_tries = 1, \
77 .busy_idx = 3, \
78 .idle_idx = 1, \
79 .newidle_idx = 2, \
80 .wake_idx = 1, \
81 .per_cpu_gain = 100, \ 81 .per_cpu_gain = 100, \
82 .flags = SD_LOAD_BALANCE \ 82 .flags = SD_LOAD_BALANCE \
83 | SD_BALANCE_EXEC \ 83 | SD_BALANCE_EXEC \
84 | SD_BALANCE_NEWIDLE \ 84 | SD_BALANCE_FORK \
85 | SD_WAKE_IDLE \
86 | SD_WAKE_BALANCE, \ 85 | SD_WAKE_BALANCE, \
87 .last_balance = jiffies, \ 86 .last_balance = jiffies, \
88 .balance_interval = 1, \ 87 .balance_interval = 1, \
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 176413fb9ae3..a7cb377745bf 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -294,8 +294,13 @@
294#define __NR_add_key 286 294#define __NR_add_key 286
295#define __NR_request_key 287 295#define __NR_request_key 287
296#define __NR_keyctl 288 296#define __NR_keyctl 288
297#define __NR_ioprio_set 289
298#define __NR_ioprio_get 290
299#define __NR_inotify_init 291
300#define __NR_inotify_add_watch 292
301#define __NR_inotify_rm_watch 293
297 302
298#define NR_syscalls 289 303#define NR_syscalls 294
299 304
300/* 305/*
301 * user-visible error numbers are in the range -1 - -128: see 306 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 6a26a977f253..4c06d455139c 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -98,6 +98,15 @@ const char *acpi_get_sysname (void);
98int acpi_request_vector (u32 int_type); 98int acpi_request_vector (u32 int_type);
99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 99int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
100 100
101/*
102 * Record the cpei override flag and current logical cpu. This is
103 * useful for CPU removal.
104 */
105extern unsigned int can_cpei_retarget(void);
106extern unsigned int is_cpu_cpei_target(unsigned int cpu);
107extern void set_cpei_target_cpu(unsigned int cpu);
108extern unsigned int get_cpei_target_cpu(void);
109
101#ifdef CONFIG_ACPI_NUMA 110#ifdef CONFIG_ACPI_NUMA
102/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/ 111/* Proximity bitmap length; _PXM is at most 255 (8 bit)*/
103#define MAX_PXM_DOMAINS (256) 112#define MAX_PXM_DOMAINS (256)
diff --git a/include/asm-ia64/break.h b/include/asm-ia64/break.h
index 97c7b2d79600..8167828edc4b 100644
--- a/include/asm-ia64/break.h
+++ b/include/asm-ia64/break.h
@@ -12,6 +12,8 @@
12 * OS-specific debug break numbers: 12 * OS-specific debug break numbers:
13 */ 13 */
14#define __IA64_BREAK_KDB 0x80100 14#define __IA64_BREAK_KDB 0x80100
15#define __IA64_BREAK_KPROBE 0x80200
16#define __IA64_BREAK_JPROBE 0x80300
15 17
16/* 18/*
17 * OS-specific break numbers: 19 * OS-specific break numbers:
diff --git a/include/asm-ia64/compat.h b/include/asm-ia64/compat.h
index cc0ff0a4bdd0..0c05e5bad8a0 100644
--- a/include/asm-ia64/compat.h
+++ b/include/asm-ia64/compat.h
@@ -27,6 +27,7 @@ typedef u16 compat_ipc_pid_t;
27typedef s32 compat_daddr_t; 27typedef s32 compat_daddr_t;
28typedef u32 compat_caddr_t; 28typedef u32 compat_caddr_t;
29typedef __kernel_fsid_t compat_fsid_t; 29typedef __kernel_fsid_t compat_fsid_t;
30typedef s32 compat_timer_t;
30 31
31typedef s32 compat_int_t; 32typedef s32 compat_int_t;
32typedef s32 compat_long_t; 33typedef s32 compat_long_t;
diff --git a/include/asm-ia64/emergency-restart.h b/include/asm-ia64/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-ia64/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index d193981bb1d8..c9f8d835d0cc 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -81,4 +81,6 @@ struct flock {
81 81
82#define F_LINUX_SPECIFIC_BASE 1024 82#define F_LINUX_SPECIFIC_BASE 1024
83 83
84#define force_o_largefile() ( ! (current->personality & PER_LINUX32) )
85
84#endif /* _ASM_IA64_FCNTL_H */ 86#endif /* _ASM_IA64_FCNTL_H */
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index cd4e06b74ab6..041ab8c51a64 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -81,7 +81,6 @@ extern __u8 isa_irq_to_vector_map[16];
81 81
82extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ 82extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
83 83
84extern int assign_irq_vector_nopanic (int irq); /* allocate a free vector without panic */
85extern int assign_irq_vector (int irq); /* allocate a free vector */ 84extern int assign_irq_vector (int irq); /* allocate a free vector */
86extern void free_irq_vector (int vector); 85extern void free_irq_vector (int vector);
87extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 86extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
index 491e9d1fc538..54e7637a326c 100644
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -120,14 +120,6 @@ static inline void ___ia64_mmiowb(void)
120 ia64_mfa(); 120 ia64_mfa();
121} 121}
122 122
123static inline const unsigned long
124__ia64_get_io_port_base (void)
125{
126 extern unsigned long ia64_iobase;
127
128 return ia64_iobase;
129}
130
131static inline void* 123static inline void*
132__ia64_mk_io_addr (unsigned long port) 124__ia64_mk_io_addr (unsigned long port)
133{ 125{
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index 38a7a72791cc..a429fe225b07 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -71,8 +71,13 @@ static inline void iosapic_eoi(char __iomem *iosapic, u32 vector)
71} 71}
72 72
73extern void __init iosapic_system_init (int pcat_compat); 73extern void __init iosapic_system_init (int pcat_compat);
74extern void __init iosapic_init (unsigned long address, 74extern int __devinit iosapic_init (unsigned long address,
75 unsigned int gsi_base); 75 unsigned int gsi_base);
76#ifdef CONFIG_HOTPLUG
77extern int iosapic_remove (unsigned int gsi_base);
78#else
79#define iosapic_remove(gsi_base) (-EINVAL)
80#endif /* CONFIG_HOTPLUG */
76extern int gsi_to_vector (unsigned int gsi); 81extern int gsi_to_vector (unsigned int gsi);
77extern int gsi_to_irq (unsigned int gsi); 82extern int gsi_to_irq (unsigned int gsi);
78extern void iosapic_enable_intr (unsigned int vector); 83extern void iosapic_enable_intr (unsigned int vector);
@@ -94,11 +99,12 @@ extern unsigned int iosapic_version (char __iomem *addr);
94 99
95extern void iosapic_pci_fixup (int); 100extern void iosapic_pci_fixup (int);
96#ifdef CONFIG_NUMA 101#ifdef CONFIG_NUMA
97extern void __init map_iosapic_to_node (unsigned int, int); 102extern void __devinit map_iosapic_to_node (unsigned int, int);
98#endif 103#endif
99#else 104#else
100#define iosapic_system_init(pcat_compat) do { } while (0) 105#define iosapic_system_init(pcat_compat) do { } while (0)
101#define iosapic_init(address,gsi_base) do { } while (0) 106#define iosapic_init(address,gsi_base) (-EINVAL)
107#define iosapic_remove(gsi_base) (-ENODEV)
102#define iosapic_register_intr(gsi,polarity,trigger) (gsi) 108#define iosapic_register_intr(gsi,polarity,trigger) (gsi)
103#define iosapic_unregister_intr(irq) do { } while (0) 109#define iosapic_unregister_intr(irq) do { } while (0)
104#define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0) 110#define iosapic_override_isa_irq(isa_irq,gsi,polarity,trigger) do { } while (0)
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h
new file mode 100644
index 000000000000..4d376e1663f7
--- /dev/null
+++ b/include/asm-ia64/kdebug.h
@@ -0,0 +1,61 @@
1#ifndef _IA64_KDEBUG_H
2#define _IA64_KDEBUG_H 1
3/*
4 * include/asm-ia64/kdebug.h
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 *
20 * Copyright (C) Intel Corporation, 2005
21 *
22 * 2005-Apr Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
23 * <anil.s.keshavamurthy@intel.com> adopted from
24 * include/asm-x86_64/kdebug.h
25 */
26#include <linux/notifier.h>
27
28struct pt_regs;
29
30struct die_args {
31 struct pt_regs *regs;
32 const char *str;
33 long err;
34 int trapnr;
35 int signr;
36};
37
38int register_die_notifier(struct notifier_block *nb);
39extern struct notifier_block *ia64die_chain;
40
41enum die_val {
42 DIE_BREAK = 1,
43 DIE_SS,
44 DIE_PAGE_FAULT,
45};
46
47static inline int notify_die(enum die_val val, char *str, struct pt_regs *regs,
48 long err, int trap, int sig)
49{
50 struct die_args args = {
51 .regs = regs,
52 .str = str,
53 .err = err,
54 .trapnr = trap,
55 .signr = sig
56 };
57
58 return notifier_call_chain(&ia64die_chain, val, &args);
59}
60
61#endif
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
new file mode 100644
index 000000000000..bf36a32e37e4
--- /dev/null
+++ b/include/asm-ia64/kprobes.h
@@ -0,0 +1,120 @@
1#ifndef _ASM_KPROBES_H
2#define _ASM_KPROBES_H
3/*
4 * Kernel Probes (KProbes)
5 * include/asm-ia64/kprobes.h
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * Copyright (C) IBM Corporation, 2002, 2004
22 * Copyright (C) Intel Corporation, 2005
23 *
24 * 2005-Apr Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
25 * <anil.s.keshavamurthy@intel.com> adapted from i386
26 */
27#include <linux/types.h>
28#include <linux/ptrace.h>
29#include <asm/break.h>
30
31#define MAX_INSN_SIZE 16
32#define BREAK_INST (long)(__IA64_BREAK_KPROBE << 6)
33
34typedef union cmp_inst {
35 struct {
36 unsigned long long qp : 6;
37 unsigned long long p1 : 6;
38 unsigned long long c : 1;
39 unsigned long long r2 : 7;
40 unsigned long long r3 : 7;
41 unsigned long long p2 : 6;
42 unsigned long long ta : 1;
43 unsigned long long x2 : 2;
44 unsigned long long tb : 1;
45 unsigned long long opcode : 4;
46 unsigned long long reserved : 23;
47 }f;
48 unsigned long long l;
49} cmp_inst_t;
50
51struct kprobe;
52
53typedef struct _bundle {
54 struct {
55 unsigned long long template : 5;
56 unsigned long long slot0 : 41;
57 unsigned long long slot1_p0 : 64-46;
58 } quad0;
59 struct {
60 unsigned long long slot1_p1 : 41 - (64-46);
61 unsigned long long slot2 : 41;
62 } quad1;
63} __attribute__((__aligned__(16))) bundle_t;
64
65#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
66
67#define ARCH_SUPPORTS_KRETPROBES
68
69#define SLOT0_OPCODE_SHIFT (37)
70#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
71#define SLOT2_OPCODE_SHIFT (37)
72
73#define INDIRECT_CALL_OPCODE (1)
74#define IP_RELATIVE_CALL_OPCODE (5)
75#define IP_RELATIVE_BRANCH_OPCODE (4)
76#define IP_RELATIVE_PREDICT_OPCODE (7)
77#define LONG_BRANCH_OPCODE (0xC)
78#define LONG_CALL_OPCODE (0xD)
79
80typedef struct kprobe_opcode {
81 bundle_t bundle;
82} kprobe_opcode_t;
83
84struct fnptr {
85 unsigned long ip;
86 unsigned long gp;
87};
88
89/* Architecture specific copy of original instruction*/
90struct arch_specific_insn {
91 /* copy of the instruction to be emulated */
92 kprobe_opcode_t insn;
93 #define INST_FLAG_FIX_RELATIVE_IP_ADDR 1
94 #define INST_FLAG_FIX_BRANCH_REG 2
95 unsigned long inst_flag;
96 unsigned short target_br_reg;
97};
98
99/* ia64 does not need this */
100static inline void arch_copy_kprobe(struct kprobe *p)
101{
102}
103
104#ifdef CONFIG_KPROBES
105extern int kprobe_exceptions_notify(struct notifier_block *self,
106 unsigned long val, void *data);
107
108/* ia64 does not need this */
109static inline void jprobe_return(void)
110{
111}
112
113#else /* !CONFIG_KPROBES */
114static inline int kprobe_exceptions_notify(struct notifier_block *self,
115 unsigned long val, void *data)
116{
117 return 0;
118}
119#endif
120#endif /* _ASM_KPROBES_H */
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h
index 0096e7e05012..e3e5fededb04 100644
--- a/include/asm-ia64/mmu_context.h
+++ b/include/asm-ia64/mmu_context.h
@@ -132,6 +132,9 @@ reload_context (mm_context_t context)
132 ia64_srlz_i(); /* srlz.i implies srlz.d */ 132 ia64_srlz_i(); /* srlz.i implies srlz.d */
133} 133}
134 134
135/*
136 * Must be called with preemption off
137 */
135static inline void 138static inline void
136activate_context (struct mm_struct *mm) 139activate_context (struct mm_struct *mm)
137{ 140{
diff --git a/include/asm-ia64/mmzone.h b/include/asm-ia64/mmzone.h
index 83ca4043fc11..d32f51e3d6c2 100644
--- a/include/asm-ia64/mmzone.h
+++ b/include/asm-ia64/mmzone.h
@@ -15,6 +15,8 @@
15#include <asm/page.h> 15#include <asm/page.h>
16#include <asm/meminit.h> 16#include <asm/meminit.h>
17 17
18#ifdef CONFIG_DISCONTIGMEM
19
18static inline int pfn_to_nid(unsigned long pfn) 20static inline int pfn_to_nid(unsigned long pfn)
19{ 21{
20#ifdef CONFIG_NUMA 22#ifdef CONFIG_NUMA
@@ -29,8 +31,6 @@ static inline int pfn_to_nid(unsigned long pfn)
29#endif 31#endif
30} 32}
31 33
32#ifdef CONFIG_DISCONTIGMEM
33
34#ifdef CONFIG_IA64_DIG /* DIG systems are small */ 34#ifdef CONFIG_IA64_DIG /* DIG systems are small */
35# define MAX_PHYSNODE_ID 8 35# define MAX_PHYSNODE_ID 8
36# define NR_NODE_MEMBLKS (MAX_NUMNODES * 8) 36# define NR_NODE_MEMBLKS (MAX_NUMNODES * 8)
diff --git a/include/asm-ia64/param.h b/include/asm-ia64/param.h
index 6c6b679b7a9e..5e1e0d2d7baf 100644
--- a/include/asm-ia64/param.h
+++ b/include/asm-ia64/param.h
@@ -27,7 +27,7 @@
27 */ 27 */
28# define HZ 32 28# define HZ 32
29# else 29# else
30# define HZ 1024 30# define HZ CONFIG_HZ
31# endif 31# endif
32# define USER_HZ HZ 32# define USER_HZ HZ
33# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */ 33# define CLOCKS_PER_SEC HZ /* frequency at which times() counts */
diff --git a/include/asm-ia64/pci.h b/include/asm-ia64/pci.h
index a8314ee4e7d2..dba9f220be71 100644
--- a/include/asm-ia64/pci.h
+++ b/include/asm-ia64/pci.h
@@ -47,7 +47,7 @@ pcibios_set_master (struct pci_dev *dev)
47} 47}
48 48
49static inline void 49static inline void
50pcibios_penalize_isa_irq (int irq) 50pcibios_penalize_isa_irq (int irq, int active)
51{ 51{
52 /* We don't do dynamic PCI IRQ allocation */ 52 /* We don't do dynamic PCI IRQ allocation */
53} 53}
@@ -82,6 +82,25 @@ extern int pcibios_prep_mwi (struct pci_dev *);
82#define sg_dma_len(sg) ((sg)->dma_length) 82#define sg_dma_len(sg) ((sg)->dma_length)
83#define sg_dma_address(sg) ((sg)->dma_address) 83#define sg_dma_address(sg) ((sg)->dma_address)
84 84
85#ifdef CONFIG_PCI
86static inline void pci_dma_burst_advice(struct pci_dev *pdev,
87 enum pci_dma_burst_strategy *strat,
88 unsigned long *strategy_parameter)
89{
90 unsigned long cacheline_size;
91 u8 byte;
92
93 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
94 if (byte == 0)
95 cacheline_size = 1024;
96 else
97 cacheline_size = (int) byte * 4;
98
99 *strat = PCI_DMA_BURST_MULTIPLE;
100 *strategy_parameter = cacheline_size;
101}
102#endif
103
85#define HAVE_PCI_MMAP 104#define HAVE_PCI_MMAP
86extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma, 105extern int pci_mmap_page_range (struct pci_dev *dev, struct vm_area_struct *vma,
87 enum pci_mmap_state mmap_state, int write_combine); 106 enum pci_mmap_state mmap_state, int write_combine);
@@ -109,6 +128,7 @@ struct pci_controller {
109 void *acpi_handle; 128 void *acpi_handle;
110 void *iommu; 129 void *iommu;
111 int segment; 130 int segment;
131 int node; /* nearest node with memory or -1 for global allocation */
112 132
113 unsigned int windows; 133 unsigned int windows;
114 struct pci_window *window; 134 struct pci_window *window;
diff --git a/include/asm-ia64/percpu.h b/include/asm-ia64/percpu.h
index 1e87f19dad56..2b14dee29ce7 100644
--- a/include/asm-ia64/percpu.h
+++ b/include/asm-ia64/percpu.h
@@ -50,7 +50,7 @@ extern void *per_cpu_init(void);
50 50
51#else /* ! SMP */ 51#else /* ! SMP */
52 52
53#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 53#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
54#define __get_cpu_var(var) per_cpu__##var 54#define __get_cpu_var(var) per_cpu__##var
55#define per_cpu_init() (__phys_per_cpu_start) 55#define per_cpu_init() (__phys_per_cpu_start)
56 56
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h
index 8e3dbde1b429..e9eb7f62d32b 100644
--- a/include/asm-ia64/sections.h
+++ b/include/asm-ia64/sections.h
@@ -17,6 +17,7 @@ extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[];
17extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[]; 17extern char __start_gate_fsyscall_patchlist[], __end_gate_fsyscall_patchlist[];
18extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[]; 18extern char __start_gate_brl_fsys_bubble_down_patchlist[], __end_gate_brl_fsys_bubble_down_patchlist[];
19extern char __start_unwind[], __end_unwind[]; 19extern char __start_unwind[], __end_unwind[];
20extern char __start_ivt_text[], __end_ivt_text[];
20 21
21#endif /* _ASM_IA64_SECTIONS_H */ 22#endif /* _ASM_IA64_SECTIONS_H */
22 23
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
index 1bfdfb4d7b01..103d745dc5f2 100644
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -216,6 +216,10 @@
216#define TIO_SWIN_WIDGETNUM(x) (((x) >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK) 216#define TIO_SWIN_WIDGETNUM(x) (((x) >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK)
217 217
218 218
219#define TIO_IOSPACE_ADDR(n,x) \
220 /* Move in the Chiplet ID for TIO Local Block MMR */ \
221 (REMOTE_ADDR(n,x) | 1UL << (NASID_SHIFT - 2))
222
219/* 223/*
220 * The following macros produce the correct base virtual address for 224 * The following macros produce the correct base virtual address for
221 * the hub registers. The REMOTE_HUB_* macro produce 225 * the hub registers. The REMOTE_HUB_* macro produce
@@ -233,13 +237,16 @@
233#define REMOTE_HUB_ADDR(n,x) \ 237#define REMOTE_HUB_ADDR(n,x) \
234 ((n & 1) ? \ 238 ((n & 1) ? \
235 /* TIO: */ \ 239 /* TIO: */ \
236 ((volatile u64 *)(GLOBAL_MMR_ADDR(n,x))) \ 240 (is_shub2() ? \
237 : /* SHUB: */ \ 241 /* TIO on Shub2 */ \
238 (((x) & BWIN_TOP) ? ((volatile u64 *)(GLOBAL_MMR_ADDR(n,x)))\ 242 (volatile u64 *)(TIO_IOSPACE_ADDR(n,x)) \
243 : /* TIO on shub1 */ \
244 (volatile u64 *)(GLOBAL_MMR_ADDR(n,x))) \
245 \
246 : /* SHUB1 and SHUB2 MMRs: */ \
247 (((x) & BWIN_TOP) ? ((volatile u64 *)(GLOBAL_MMR_ADDR(n,x))) \
239 : ((volatile u64 *)(NODE_SWIN_BASE(n,1) + 0x800000 + (x))))) 248 : ((volatile u64 *)(NODE_SWIN_BASE(n,1) + 0x800000 + (x)))))
240 249
241
242
243#define HUB_L(x) (*((volatile typeof(*x) *)x)) 250#define HUB_L(x) (*((volatile typeof(*x) *)x))
244#define HUB_S(x,d) (*((volatile typeof(*x) *)x) = (d)) 251#define HUB_S(x,d) (*((volatile typeof(*x) *)x) = (d))
245 252
diff --git a/include/asm-ia64/sn/arch.h b/include/asm-ia64/sn/arch.h
index 635fdce854a8..ab827d298569 100644
--- a/include/asm-ia64/sn/arch.h
+++ b/include/asm-ia64/sn/arch.h
@@ -11,6 +11,7 @@
11#ifndef _ASM_IA64_SN_ARCH_H 11#ifndef _ASM_IA64_SN_ARCH_H
12#define _ASM_IA64_SN_ARCH_H 12#define _ASM_IA64_SN_ARCH_H
13 13
14#include <linux/numa.h>
14#include <asm/types.h> 15#include <asm/types.h>
15#include <asm/percpu.h> 16#include <asm/percpu.h>
16#include <asm/sn/types.h> 17#include <asm/sn/types.h>
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
index e51471fb0867..e190dd4213d5 100644
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -9,6 +9,8 @@
9#ifndef _ASM_IA64_SN_INTR_H 9#ifndef _ASM_IA64_SN_INTR_H
10#define _ASM_IA64_SN_INTR_H 10#define _ASM_IA64_SN_INTR_H
11 11
12#include <linux/rcupdate.h>
13
12#define SGI_UART_VECTOR (0xe9) 14#define SGI_UART_VECTOR (0xe9)
13#define SGI_PCIBR_ERROR (0x33) 15#define SGI_PCIBR_ERROR (0x33)
14 16
@@ -33,7 +35,7 @@
33 35
34// The SN PROM irq struct 36// The SN PROM irq struct
35struct sn_irq_info { 37struct sn_irq_info {
36 struct sn_irq_info *irq_next; /* sharing irq list */ 38 struct sn_irq_info *irq_next; /* deprecated DO NOT USE */
37 short irq_nasid; /* Nasid IRQ is assigned to */ 39 short irq_nasid; /* Nasid IRQ is assigned to */
38 int irq_slice; /* slice IRQ is assigned to */ 40 int irq_slice; /* slice IRQ is assigned to */
39 int irq_cpuid; /* kernel logical cpuid */ 41 int irq_cpuid; /* kernel logical cpuid */
@@ -47,6 +49,8 @@ struct sn_irq_info {
47 int irq_cookie; /* unique cookie */ 49 int irq_cookie; /* unique cookie */
48 int irq_flags; /* flags */ 50 int irq_flags; /* flags */
49 int irq_share_cnt; /* num devices sharing IRQ */ 51 int irq_share_cnt; /* num devices sharing IRQ */
52 struct list_head list; /* list of sn_irq_info structs */
53 struct rcu_head rcu; /* rcu callback list */
50}; 54};
51 55
52extern void sn_send_IPI_phys(int, long, int, int); 56extern void sn_send_IPI_phys(int, long, int, int);
diff --git a/include/asm-ia64/sn/l1.h b/include/asm-ia64/sn/l1.h
index 08050d37b662..2e5f0aa38889 100644
--- a/include/asm-ia64/sn/l1.h
+++ b/include/asm-ia64/sn/l1.h
@@ -33,5 +33,6 @@
33#define L1_BRICKTYPE_PA 0x6a /* j */ 33#define L1_BRICKTYPE_PA 0x6a /* j */
34#define L1_BRICKTYPE_IA 0x6b /* k */ 34#define L1_BRICKTYPE_IA 0x6b /* k */
35#define L1_BRICKTYPE_ATHENA 0x2b /* + */ 35#define L1_BRICKTYPE_ATHENA 0x2b /* + */
36#define L1_BRICKTYPE_DAYTONA 0x7a /* z */
36 37
37#endif /* _ASM_IA64_SN_L1_H */ 38#endif /* _ASM_IA64_SN_L1_H */
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
new file mode 100644
index 000000000000..2b42d9ece26b
--- /dev/null
+++ b/include/asm-ia64/sn/pcibr_provider.h
@@ -0,0 +1,159 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
9#define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
10
11#include <asm/sn/intr.h>
12#include <asm/sn/pcibus_provider_defs.h>
13
14/* Workarounds */
15#define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */
16
17#define BUSTYPE_MASK 0x1
18
19/* Macros given a pcibus structure */
20#define IS_PCIX(ps) ((ps)->pbi_bridge_mode & BUSTYPE_MASK)
21#define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \
22 asic == PCIIO_ASIC_TYPE_TIOCP)
23#define IS_PIC_SOFT(ps) (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC)
24
25
26/*
27 * The different PCI Bridge types supported on the SGI Altix platforms
28 */
29#define PCIBR_BRIDGETYPE_UNKNOWN -1
30#define PCIBR_BRIDGETYPE_PIC 2
31#define PCIBR_BRIDGETYPE_TIOCP 3
32
33/*
34 * Bridge 64bit Direct Map Attributes
35 */
36#define PCI64_ATTR_PREF (1ull << 59)
37#define PCI64_ATTR_PREC (1ull << 58)
38#define PCI64_ATTR_VIRTUAL (1ull << 57)
39#define PCI64_ATTR_BAR (1ull << 56)
40#define PCI64_ATTR_SWAP (1ull << 55)
41#define PCI64_ATTR_VIRTUAL1 (1ull << 54)
42
43#define PCI32_LOCAL_BASE 0
44#define PCI32_MAPPED_BASE 0x40000000
45#define PCI32_DIRECT_BASE 0x80000000
46
47#define IS_PCI32_MAPPED(x) ((uint64_t)(x) < PCI32_DIRECT_BASE && \
48 (uint64_t)(x) >= PCI32_MAPPED_BASE)
49#define IS_PCI32_DIRECT(x) ((uint64_t)(x) >= PCI32_MAPPED_BASE)
50
51
52/*
53 * Bridge PMU Address Transaltion Entry Attibutes
54 */
55#define PCI32_ATE_V (0x1 << 0)
56#define PCI32_ATE_CO (0x1 << 1)
57#define PCI32_ATE_PREC (0x1 << 2)
58#define PCI32_ATE_PREF (0x1 << 3)
59#define PCI32_ATE_BAR (0x1 << 4)
60#define PCI32_ATE_ADDR_SHFT 12
61
62#define MINIMAL_ATES_REQUIRED(addr, size) \
63 (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
64
65#define MINIMAL_ATE_FLAG(addr, size) \
66 (MINIMAL_ATES_REQUIRED((uint64_t)addr, size) ? 1 : 0)
67
68/* bit 29 of the pci address is the SWAP bit */
69#define ATE_SWAPSHIFT 29
70#define ATE_SWAP_ON(x) ((x) |= (1 << ATE_SWAPSHIFT))
71#define ATE_SWAP_OFF(x) ((x) &= ~(1 << ATE_SWAPSHIFT))
72
73/*
74 * I/O page size
75 */
76#if PAGE_SIZE < 16384
77#define IOPFNSHIFT 12 /* 4K per mapped page */
78#else
79#define IOPFNSHIFT 14 /* 16K per mapped page */
80#endif
81
82#define IOPGSIZE (1 << IOPFNSHIFT)
83#define IOPG(x) ((x) >> IOPFNSHIFT)
84#define IOPGOFF(x) ((x) & (IOPGSIZE-1))
85
86#define PCIBR_DEV_SWAP_DIR (1ull << 19)
87#define PCIBR_CTRL_PAGE_SIZE (0x1 << 21)
88
89/*
90 * PMU resources.
91 */
92struct ate_resource{
93 uint64_t *ate;
94 uint64_t num_ate;
95 uint64_t lowest_free_index;
96};
97
98struct pcibus_info {
99 struct pcibus_bussoft pbi_buscommon; /* common header */
100 uint32_t pbi_moduleid;
101 short pbi_bridge_type;
102 short pbi_bridge_mode;
103
104 struct ate_resource pbi_int_ate_resource;
105 uint64_t pbi_int_ate_size;
106
107 uint64_t pbi_dir_xbase;
108 char pbi_hub_xid;
109
110 uint64_t pbi_devreg[8];
111
112 uint32_t pbi_valid_devices;
113 uint32_t pbi_enabled_devices;
114
115 spinlock_t pbi_lock;
116};
117
118/*
119 * pcibus_info structure locking macros
120 */
121inline static unsigned long
122pcibr_lock(struct pcibus_info *pcibus_info)
123{
124 unsigned long flag;
125 spin_lock_irqsave(&pcibus_info->pbi_lock, flag);
126 return(flag);
127}
128#define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag)
129
130extern int pcibr_init_provider(void);
131extern void *pcibr_bus_fixup(struct pcibus_bussoft *, struct pci_controller *);
132extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t);
133extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t);
134extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
135
136/*
137 * prototypes for the bridge asic register access routines in pcibr_reg.c
138 */
139extern void pcireg_control_bit_clr(struct pcibus_info *, uint64_t);
140extern void pcireg_control_bit_set(struct pcibus_info *, uint64_t);
141extern uint64_t pcireg_tflush_get(struct pcibus_info *);
142extern uint64_t pcireg_intr_status_get(struct pcibus_info *);
143extern void pcireg_intr_enable_bit_clr(struct pcibus_info *, uint64_t);
144extern void pcireg_intr_enable_bit_set(struct pcibus_info *, uint64_t);
145extern void pcireg_intr_addr_addr_set(struct pcibus_info *, int, uint64_t);
146extern void pcireg_force_intr_set(struct pcibus_info *, int);
147extern uint64_t pcireg_wrb_flush_get(struct pcibus_info *, int);
148extern void pcireg_int_ate_set(struct pcibus_info *, int, uint64_t);
149extern uint64_t * pcireg_int_ate_addr(struct pcibus_info *, int);
150extern void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info);
151extern void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info);
152extern int pcibr_ate_alloc(struct pcibus_info *, int);
153extern void pcibr_ate_free(struct pcibus_info *, int);
154extern void ate_write(struct pcibus_info *, int, int, uint64_t);
155extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
156 void *resp);
157extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
158 int action, void *resp);
159#endif
diff --git a/include/asm-ia64/sn/pcibus_provider_defs.h b/include/asm-ia64/sn/pcibus_provider_defs.h
index 04e27d5b3820..976f5eff0539 100644
--- a/include/asm-ia64/sn/pcibus_provider_defs.h
+++ b/include/asm-ia64/sn/pcibus_provider_defs.h
@@ -37,6 +37,7 @@ struct pcibus_bussoft {
37 struct xwidget_info *bs_xwidget_info; 37 struct xwidget_info *bs_xwidget_info;
38}; 38};
39 39
40struct pci_controller;
40/* 41/*
41 * SN pci bus indirection 42 * SN pci bus indirection
42 */ 43 */
@@ -45,7 +46,7 @@ struct sn_pcibus_provider {
45 dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t); 46 dma_addr_t (*dma_map)(struct pci_dev *, unsigned long, size_t);
46 dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t); 47 dma_addr_t (*dma_map_consistent)(struct pci_dev *, unsigned long, size_t);
47 void (*dma_unmap)(struct pci_dev *, dma_addr_t, int); 48 void (*dma_unmap)(struct pci_dev *, dma_addr_t, int);
48 void * (*bus_fixup)(struct pcibus_bussoft *); 49 void * (*bus_fixup)(struct pcibus_bussoft *, struct pci_controller *);
49}; 50};
50 51
51extern struct sn_pcibus_provider *sn_pci_provider[]; 52extern struct sn_pcibus_provider *sn_pci_provider[];
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
index ed4031d80811..49711d00ad04 100644
--- a/include/asm-ia64/sn/pcidev.h
+++ b/include/asm-ia64/sn/pcidev.h
@@ -10,11 +10,11 @@
10 10
11#include <linux/pci.h> 11#include <linux/pci.h>
12 12
13extern struct sn_irq_info **sn_irq;
14
15#define SN_PCIDEV_INFO(pci_dev) \ 13#define SN_PCIDEV_INFO(pci_dev) \
16 ((struct pcidev_info *)(pci_dev)->sysdata) 14 ((struct pcidev_info *)(pci_dev)->sysdata)
17 15
16#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
17 (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
18/* 18/*
19 * Given a pci_bus, return the sn pcibus_bussoft struct. Note that 19 * Given a pci_bus, return the sn pcibus_bussoft struct. Note that
20 * this only works for root busses, not for busses represented by PPB's. 20 * this only works for root busses, not for busses represented by PPB's.
@@ -23,6 +23,8 @@ extern struct sn_irq_info **sn_irq;
23#define SN_PCIBUS_BUSSOFT(pci_bus) \ 23#define SN_PCIBUS_BUSSOFT(pci_bus) \
24 ((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data)) 24 ((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
25 25
26#define SN_PCIBUS_BUSSOFT_INFO(pci_bus) \
27 (struct pcibus_info *)((struct pcibus_bussoft *)(PCI_CONTROLLER((pci_bus))->platform_data))
26/* 28/*
27 * Given a struct pci_dev, return the sn pcibus_bussoft struct. Note 29 * Given a struct pci_dev, return the sn pcibus_bussoft struct. Note
28 * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due 30 * that this is not equivalent to SN_PCIBUS_BUSSOFT(pci_dev->bus) due
@@ -50,9 +52,17 @@ struct pcidev_info {
50 52
51 struct sn_irq_info *pdi_sn_irq_info; 53 struct sn_irq_info *pdi_sn_irq_info;
52 struct sn_pcibus_provider *pdi_provider; /* sn pci ops */ 54 struct sn_pcibus_provider *pdi_provider; /* sn pci ops */
55 struct pci_dev *host_pci_dev; /* host bus link */
53}; 56};
54 57
55extern void sn_irq_fixup(struct pci_dev *pci_dev, 58extern void sn_irq_fixup(struct pci_dev *pci_dev,
56 struct sn_irq_info *sn_irq_info); 59 struct sn_irq_info *sn_irq_info);
57 60extern void sn_irq_unfixup(struct pci_dev *pci_dev);
61extern void sn_pci_controller_fixup(int segment, int busnum,
62 struct pci_bus *bus);
63extern void sn_bus_store_sysdata(struct pci_dev *dev);
64extern void sn_bus_free_sysdata(void);
65extern void sn_pci_fixup_slot(struct pci_dev *dev);
66extern void sn_pci_unfixup_slot(struct pci_dev *dev);
67extern void sn_irq_lh_init(void);
58#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */ 68#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/include/asm-ia64/sn/pic.h b/include/asm-ia64/sn/pic.h
new file mode 100644
index 000000000000..0de82e6b0893
--- /dev/null
+++ b/include/asm-ia64/sn/pic.h
@@ -0,0 +1,261 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PIC_H
9#define _ASM_IA64_SN_PCI_PIC_H
10
11/*
12 * PIC AS DEVICE ZERO
13 * ------------------
14 *
15 * PIC handles PCI/X busses. PCI/X requires that the 'bridge' (i.e. PIC)
16 * be designated as 'device 0'. That is a departure from earlier SGI
17 * PCI bridges. Because of that we use config space 1 to access the
18 * config space of the first actual PCI device on the bus.
19 * Here's what the PIC manual says:
20 *
21 * The current PCI-X bus specification now defines that the parent
22 * hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC
23 * reduced the total number of devices from 8 to 4 and removed the
24 * device registers and windows, now only supporting devices 0,1,2, and
25 * 3. PIC did leave all 8 configuration space windows. The reason was
26 * there was nothing to gain by removing them. Here in lies the problem.
27 * The device numbering we do using 0 through 3 is unrelated to the device
28 * numbering which PCI-X requires in configuration space. In the past we
29 * correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc.
30 * PCI-X requires we start a 1, not 0 and currently the PX brick
31 * does associate our:
32 *
33 * device 0 with configuration space window 1,
34 * device 1 with configuration space window 2,
35 * device 2 with configuration space window 3,
36 * device 3 with configuration space window 4.
37 *
38 * The net effect is that all config space access are off-by-one with
39 * relation to other per-slot accesses on the PIC.
40 * Here is a table that shows some of that:
41 *
42 * Internal Slot#
43 * |
44 * | 0 1 2 3
45 * ----------|---------------------------------------
46 * config | 0x21000 0x22000 0x23000 0x24000
47 * |
48 * even rrb | 0[0] n/a 1[0] n/a [] == implied even/odd
49 * |
50 * odd rrb | n/a 0[1] n/a 1[1]
51 * |
52 * int dev | 00 01 10 11
53 * |
54 * ext slot# | 1 2 3 4
55 * ----------|---------------------------------------
56 */
57
58#define PIC_ATE_TARGETID_SHFT 8
59#define PIC_HOST_INTR_ADDR 0x0000FFFFFFFFFFFFUL
60#define PIC_PCI64_ATTR_TARG_SHFT 60
61
62
63/*****************************************************************************
64 *********************** PIC MMR structure mapping ***************************
65 *****************************************************************************/
66
67/* NOTE: PIC WAR. PV#854697. PIC does not allow writes just to [31:0]
68 * of a 64-bit register. When writing PIC registers, always write the
69 * entire 64 bits.
70 */
71
72struct pic {
73
74 /* 0x000000-0x00FFFF -- Local Registers */
75
76 /* 0x000000-0x000057 -- Standard Widget Configuration */
77 uint64_t p_wid_id; /* 0x000000 */
78 uint64_t p_wid_stat; /* 0x000008 */
79 uint64_t p_wid_err_upper; /* 0x000010 */
80 uint64_t p_wid_err_lower; /* 0x000018 */
81 #define p_wid_err p_wid_err_lower
82 uint64_t p_wid_control; /* 0x000020 */
83 uint64_t p_wid_req_timeout; /* 0x000028 */
84 uint64_t p_wid_int_upper; /* 0x000030 */
85 uint64_t p_wid_int_lower; /* 0x000038 */
86 #define p_wid_int p_wid_int_lower
87 uint64_t p_wid_err_cmdword; /* 0x000040 */
88 uint64_t p_wid_llp; /* 0x000048 */
89 uint64_t p_wid_tflush; /* 0x000050 */
90
91 /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
92 uint64_t p_wid_aux_err; /* 0x000058 */
93 uint64_t p_wid_resp_upper; /* 0x000060 */
94 uint64_t p_wid_resp_lower; /* 0x000068 */
95 #define p_wid_resp p_wid_resp_lower
96 uint64_t p_wid_tst_pin_ctrl; /* 0x000070 */
97 uint64_t p_wid_addr_lkerr; /* 0x000078 */
98
99 /* 0x000080-0x00008F -- PMU & MAP */
100 uint64_t p_dir_map; /* 0x000080 */
101 uint64_t _pad_000088; /* 0x000088 */
102
103 /* 0x000090-0x00009F -- SSRAM */
104 uint64_t p_map_fault; /* 0x000090 */
105 uint64_t _pad_000098; /* 0x000098 */
106
107 /* 0x0000A0-0x0000AF -- Arbitration */
108 uint64_t p_arb; /* 0x0000A0 */
109 uint64_t _pad_0000A8; /* 0x0000A8 */
110
111 /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
112 uint64_t p_ate_parity_err; /* 0x0000B0 */
113 uint64_t _pad_0000B8; /* 0x0000B8 */
114
115 /* 0x0000C0-0x0000FF -- PCI/GIO */
116 uint64_t p_bus_timeout; /* 0x0000C0 */
117 uint64_t p_pci_cfg; /* 0x0000C8 */
118 uint64_t p_pci_err_upper; /* 0x0000D0 */
119 uint64_t p_pci_err_lower; /* 0x0000D8 */
120 #define p_pci_err p_pci_err_lower
121 uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */
122
123 /* 0x000100-0x0001FF -- Interrupt */
124 uint64_t p_int_status; /* 0x000100 */
125 uint64_t p_int_enable; /* 0x000108 */
126 uint64_t p_int_rst_stat; /* 0x000110 */
127 uint64_t p_int_mode; /* 0x000118 */
128 uint64_t p_int_device; /* 0x000120 */
129 uint64_t p_int_host_err; /* 0x000128 */
130 uint64_t p_int_addr[8]; /* 0x0001{30,,,68} */
131 uint64_t p_err_int_view; /* 0x000170 */
132 uint64_t p_mult_int; /* 0x000178 */
133 uint64_t p_force_always[8]; /* 0x0001{80,,,B8} */
134 uint64_t p_force_pin[8]; /* 0x0001{C0,,,F8} */
135
136 /* 0x000200-0x000298 -- Device */
137 uint64_t p_device[4]; /* 0x0002{00,,,18} */
138 uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */
139 uint64_t p_wr_req_buf[4]; /* 0x0002{40,,,58} */
140 uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */
141 uint64_t p_rrb_map[2]; /* 0x0002{80,,,88} */
142 #define p_even_resp p_rrb_map[0] /* 0x000280 */
143 #define p_odd_resp p_rrb_map[1] /* 0x000288 */
144 uint64_t p_resp_status; /* 0x000290 */
145 uint64_t p_resp_clear; /* 0x000298 */
146
147 uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */
148
149 /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
150 struct {
151 uint64_t upper; /* 0x0003{00,,,F0} */
152 uint64_t lower; /* 0x0003{08,,,F8} */
153 } p_buf_addr_match[16];
154
155 /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
156 struct {
157 uint64_t flush_w_touch; /* 0x000{400,,,5C0} */
158 uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */
159 uint64_t inflight; /* 0x000{410,,,5D0} */
160 uint64_t prefetch; /* 0x000{418,,,5D8} */
161 uint64_t total_pci_retry; /* 0x000{420,,,5E0} */
162 uint64_t max_pci_retry; /* 0x000{428,,,5E8} */
163 uint64_t max_latency; /* 0x000{430,,,5F0} */
164 uint64_t clear_all; /* 0x000{438,,,5F8} */
165 } p_buf_count[8];
166
167
168 /* 0x000600-0x0009FF -- PCI/X registers */
169 uint64_t p_pcix_bus_err_addr; /* 0x000600 */
170 uint64_t p_pcix_bus_err_attr; /* 0x000608 */
171 uint64_t p_pcix_bus_err_data; /* 0x000610 */
172 uint64_t p_pcix_pio_split_addr; /* 0x000618 */
173 uint64_t p_pcix_pio_split_attr; /* 0x000620 */
174 uint64_t p_pcix_dma_req_err_attr; /* 0x000628 */
175 uint64_t p_pcix_dma_req_err_addr; /* 0x000630 */
176 uint64_t p_pcix_timeout; /* 0x000638 */
177
178 uint64_t _pad_000640[120]; /* 0x000{640,,,9F8} */
179
180 /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
181 struct {
182 uint64_t p_buf_addr; /* 0x000{A00,,,AF0} */
183 uint64_t p_buf_attr; /* 0X000{A08,,,AF8} */
184 } p_pcix_read_buf_64[16];
185
186 struct {
187 uint64_t p_buf_addr; /* 0x000{B00,,,BE0} */
188 uint64_t p_buf_attr; /* 0x000{B08,,,BE8} */
189 uint64_t p_buf_valid; /* 0x000{B10,,,BF0} */
190 uint64_t __pad1; /* 0x000{B18,,,BF8} */
191 } p_pcix_write_buf_64[8];
192
193 /* End of Local Registers -- Start of Address Map space */
194
195 char _pad_000c00[0x010000 - 0x000c00];
196
197 /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
198 uint64_t p_int_ate_ram[1024]; /* 0x010000-0x011fff */
199
200 /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
201 uint64_t p_int_ate_ram_mp[1024]; /* 0x012000-0x013fff */
202
203 char _pad_014000[0x18000 - 0x014000];
204
205 /* 0x18000-0x197F8 -- PIC Write Request Ram */
206 uint64_t p_wr_req_lower[256]; /* 0x18000 - 0x187F8 */
207 uint64_t p_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */
208 uint64_t p_wr_req_parity[256]; /* 0x19000 - 0x197F8 */
209
210 char _pad_019800[0x20000 - 0x019800];
211
212 /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
213 union {
214 uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
215 uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
216 uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
217 uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
218 union {
219 uint8_t c[0x100 / 1];
220 uint16_t s[0x100 / 2];
221 uint32_t l[0x100 / 4];
222 uint64_t d[0x100 / 8];
223 } f[8];
224 } p_type0_cfg_dev[8]; /* 0x02{0000,,,7FFF} */
225
226 /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
227 union {
228 uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */
229 uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */
230 uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */
231 uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */
232 union {
233 uint8_t c[0x100 / 1];
234 uint16_t s[0x100 / 2];
235 uint32_t l[0x100 / 4];
236 uint64_t d[0x100 / 8];
237 } f[8];
238 } p_type1_cfg; /* 0x028000-0x029000 */
239
240 char _pad_029000[0x030000-0x029000];
241
242 /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
243 union {
244 uint8_t c[8 / 1];
245 uint16_t s[8 / 2];
246 uint32_t l[8 / 4];
247 uint64_t d[8 / 8];
248 } p_pci_iack; /* 0x030000-0x030007 */
249
250 char _pad_030007[0x040000-0x030008];
251
252 /* 0x040000-0x030007 -- PCIX Special Cycle */
253 union {
254 uint8_t c[8 / 1];
255 uint16_t s[8 / 2];
256 uint32_t l[8 / 4];
257 uint64_t d[8 / 8];
258 } p_pcix_cycle; /* 0x040000-0x040007 */
259};
260
261#endif /* _ASM_IA64_SN_PCI_PIC_H */
diff --git a/include/asm-ia64/sn/shub_mmr.h b/include/asm-ia64/sn/shub_mmr.h
index 323fa0cd8d83..7de1d1d4b71a 100644
--- a/include/asm-ia64/sn/shub_mmr.h
+++ b/include/asm-ia64/sn/shub_mmr.h
@@ -14,96 +14,98 @@
14/* Register "SH_IPI_INT" */ 14/* Register "SH_IPI_INT" */
15/* SHub Inter-Processor Interrupt Registers */ 15/* SHub Inter-Processor Interrupt Registers */
16/* ==================================================================== */ 16/* ==================================================================== */
17#define SH1_IPI_INT 0x0000000110000380 17#define SH1_IPI_INT __IA64_UL_CONST(0x0000000110000380)
18#define SH2_IPI_INT 0x0000000010000380 18#define SH2_IPI_INT __IA64_UL_CONST(0x0000000010000380)
19 19
20/* SH_IPI_INT_TYPE */ 20/* SH_IPI_INT_TYPE */
21/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ 21/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */
22#define SH_IPI_INT_TYPE_SHFT 0 22#define SH_IPI_INT_TYPE_SHFT 0
23#define SH_IPI_INT_TYPE_MASK 0x0000000000000007 23#define SH_IPI_INT_TYPE_MASK __IA64_UL_CONST(0x0000000000000007)
24 24
25/* SH_IPI_INT_AGT */ 25/* SH_IPI_INT_AGT */
26/* Description: Agent, must be 0 for SHub */ 26/* Description: Agent, must be 0 for SHub */
27#define SH_IPI_INT_AGT_SHFT 3 27#define SH_IPI_INT_AGT_SHFT 3
28#define SH_IPI_INT_AGT_MASK 0x0000000000000008 28#define SH_IPI_INT_AGT_MASK __IA64_UL_CONST(0x0000000000000008)
29 29
30/* SH_IPI_INT_PID */ 30/* SH_IPI_INT_PID */
31/* Description: Processor ID, same setting as on targeted McKinley */ 31/* Description: Processor ID, same setting as on targeted McKinley */
32#define SH_IPI_INT_PID_SHFT 4 32#define SH_IPI_INT_PID_SHFT 4
33#define SH_IPI_INT_PID_MASK 0x00000000000ffff0 33#define SH_IPI_INT_PID_MASK __IA64_UL_CONST(0x00000000000ffff0)
34 34
35/* SH_IPI_INT_BASE */ 35/* SH_IPI_INT_BASE */
36/* Description: Optional interrupt vector area, 2MB aligned */ 36/* Description: Optional interrupt vector area, 2MB aligned */
37#define SH_IPI_INT_BASE_SHFT 21 37#define SH_IPI_INT_BASE_SHFT 21
38#define SH_IPI_INT_BASE_MASK 0x0003ffffffe00000 38#define SH_IPI_INT_BASE_MASK __IA64_UL_CONST(0x0003ffffffe00000)
39 39
40/* SH_IPI_INT_IDX */ 40/* SH_IPI_INT_IDX */
41/* Description: Targeted McKinley interrupt vector */ 41/* Description: Targeted McKinley interrupt vector */
42#define SH_IPI_INT_IDX_SHFT 52 42#define SH_IPI_INT_IDX_SHFT 52
43#define SH_IPI_INT_IDX_MASK 0x0ff0000000000000 43#define SH_IPI_INT_IDX_MASK __IA64_UL_CONST(0x0ff0000000000000)
44 44
45/* SH_IPI_INT_SEND */ 45/* SH_IPI_INT_SEND */
46/* Description: Send Interrupt Message to PI, This generates a puls */ 46/* Description: Send Interrupt Message to PI, This generates a puls */
47#define SH_IPI_INT_SEND_SHFT 63 47#define SH_IPI_INT_SEND_SHFT 63
48#define SH_IPI_INT_SEND_MASK 0x8000000000000000 48#define SH_IPI_INT_SEND_MASK __IA64_UL_CONST(0x8000000000000000)
49 49
50/* ==================================================================== */ 50/* ==================================================================== */
51/* Register "SH_EVENT_OCCURRED" */ 51/* Register "SH_EVENT_OCCURRED" */
52/* SHub Interrupt Event Occurred */ 52/* SHub Interrupt Event Occurred */
53/* ==================================================================== */ 53/* ==================================================================== */
54#define SH1_EVENT_OCCURRED 0x0000000110010000 54#define SH1_EVENT_OCCURRED __IA64_UL_CONST(0x0000000110010000)
55#define SH1_EVENT_OCCURRED_ALIAS 0x0000000110010008 55#define SH1_EVENT_OCCURRED_ALIAS __IA64_UL_CONST(0x0000000110010008)
56#define SH2_EVENT_OCCURRED 0x0000000010010000 56#define SH2_EVENT_OCCURRED __IA64_UL_CONST(0x0000000010010000)
57#define SH2_EVENT_OCCURRED_ALIAS 0x0000000010010008 57#define SH2_EVENT_OCCURRED_ALIAS __IA64_UL_CONST(0x0000000010010008)
58 58
59/* ==================================================================== */ 59/* ==================================================================== */
60/* Register "SH_PI_CAM_CONTROL" */ 60/* Register "SH_PI_CAM_CONTROL" */
61/* CRB CAM MMR Access Control */ 61/* CRB CAM MMR Access Control */
62/* ==================================================================== */ 62/* ==================================================================== */
63#define SH1_PI_CAM_CONTROL 0x0000000120050300 63#define SH1_PI_CAM_CONTROL __IA64_UL_CONST(0x0000000120050300)
64 64
65/* ==================================================================== */ 65/* ==================================================================== */
66/* Register "SH_SHUB_ID" */ 66/* Register "SH_SHUB_ID" */
67/* SHub ID Number */ 67/* SHub ID Number */
68/* ==================================================================== */ 68/* ==================================================================== */
69#define SH1_SHUB_ID 0x0000000110060580 69#define SH1_SHUB_ID __IA64_UL_CONST(0x0000000110060580)
70#define SH1_SHUB_ID_REVISION_SHFT 28 70#define SH1_SHUB_ID_REVISION_SHFT 28
71#define SH1_SHUB_ID_REVISION_MASK 0x00000000f0000000 71#define SH1_SHUB_ID_REVISION_MASK __IA64_UL_CONST(0x00000000f0000000)
72 72
73/* ==================================================================== */ 73/* ==================================================================== */
74/* Register "SH_RTC" */ 74/* Register "SH_RTC" */
75/* Real-time Clock */ 75/* Real-time Clock */
76/* ==================================================================== */ 76/* ==================================================================== */
77#define SH1_RTC 0x00000001101c0000 77#define SH1_RTC __IA64_UL_CONST(0x00000001101c0000)
78#define SH2_RTC 0x00000002101c0000 78#define SH2_RTC __IA64_UL_CONST(0x00000002101c0000)
79#define SH_RTC_MASK 0x007fffffffffffff 79#define SH_RTC_MASK __IA64_UL_CONST(0x007fffffffffffff)
80 80
81/* ==================================================================== */ 81/* ==================================================================== */
82/* Register "SH_PIO_WRITE_STATUS_0|1" */ 82/* Register "SH_PIO_WRITE_STATUS_0|1" */
83/* PIO Write Status for CPU 0 & 1 */ 83/* PIO Write Status for CPU 0 & 1 */
84/* ==================================================================== */ 84/* ==================================================================== */
85#define SH1_PIO_WRITE_STATUS_0 0x0000000120070200 85#define SH1_PIO_WRITE_STATUS_0 __IA64_UL_CONST(0x0000000120070200)
86#define SH1_PIO_WRITE_STATUS_1 0x0000000120070280 86#define SH1_PIO_WRITE_STATUS_1 __IA64_UL_CONST(0x0000000120070280)
87#define SH2_PIO_WRITE_STATUS_0 0x0000000020070200 87#define SH2_PIO_WRITE_STATUS_0 __IA64_UL_CONST(0x0000000020070200)
88#define SH2_PIO_WRITE_STATUS_1 0x0000000020070280 88#define SH2_PIO_WRITE_STATUS_1 __IA64_UL_CONST(0x0000000020070280)
89#define SH2_PIO_WRITE_STATUS_2 0x0000000020070300 89#define SH2_PIO_WRITE_STATUS_2 __IA64_UL_CONST(0x0000000020070300)
90#define SH2_PIO_WRITE_STATUS_3 0x0000000020070380 90#define SH2_PIO_WRITE_STATUS_3 __IA64_UL_CONST(0x0000000020070380)
91 91
92/* SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK */ 92/* SH_PIO_WRITE_STATUS_0_WRITE_DEADLOCK */
93/* Description: Deadlock response detected */ 93/* Description: Deadlock response detected */
94#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT 1 94#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT 1
95#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK 0x0000000000000002 95#define SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_MASK \
96 __IA64_UL_CONST(0x0000000000000002)
96 97
97/* SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT */ 98/* SH_PIO_WRITE_STATUS_0_PENDING_WRITE_COUNT */
98/* Description: Count of currently pending PIO writes */ 99/* Description: Count of currently pending PIO writes */
99#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_SHFT 56 100#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_SHFT 56
100#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK 0x3f00000000000000 101#define SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK \
102 __IA64_UL_CONST(0x3f00000000000000)
101 103
102/* ==================================================================== */ 104/* ==================================================================== */
103/* Register "SH_PIO_WRITE_STATUS_0_ALIAS" */ 105/* Register "SH_PIO_WRITE_STATUS_0_ALIAS" */
104/* ==================================================================== */ 106/* ==================================================================== */
105#define SH1_PIO_WRITE_STATUS_0_ALIAS 0x0000000120070208 107#define SH1_PIO_WRITE_STATUS_0_ALIAS __IA64_UL_CONST(0x0000000120070208)
106#define SH2_PIO_WRITE_STATUS_0_ALIAS 0x0000000020070208 108#define SH2_PIO_WRITE_STATUS_0_ALIAS __IA64_UL_CONST(0x0000000020070208)
107 109
108/* ==================================================================== */ 110/* ==================================================================== */
109/* Register "SH_EVENT_OCCURRED" */ 111/* Register "SH_EVENT_OCCURRED" */
@@ -111,33 +113,33 @@
111/* ==================================================================== */ 113/* ==================================================================== */
112/* SH_EVENT_OCCURRED_UART_INT */ 114/* SH_EVENT_OCCURRED_UART_INT */
113/* Description: Pending Junk Bus UART Interrupt */ 115/* Description: Pending Junk Bus UART Interrupt */
114#define SH_EVENT_OCCURRED_UART_INT_SHFT 20 116#define SH_EVENT_OCCURRED_UART_INT_SHFT 20
115#define SH_EVENT_OCCURRED_UART_INT_MASK 0x0000000000100000 117#define SH_EVENT_OCCURRED_UART_INT_MASK __IA64_UL_CONST(0x0000000000100000)
116 118
117/* SH_EVENT_OCCURRED_IPI_INT */ 119/* SH_EVENT_OCCURRED_IPI_INT */
118/* Description: Pending IPI Interrupt */ 120/* Description: Pending IPI Interrupt */
119#define SH_EVENT_OCCURRED_IPI_INT_SHFT 28 121#define SH_EVENT_OCCURRED_IPI_INT_SHFT 28
120#define SH_EVENT_OCCURRED_IPI_INT_MASK 0x0000000010000000 122#define SH_EVENT_OCCURRED_IPI_INT_MASK __IA64_UL_CONST(0x0000000010000000)
121 123
122/* SH_EVENT_OCCURRED_II_INT0 */ 124/* SH_EVENT_OCCURRED_II_INT0 */
123/* Description: Pending II 0 Interrupt */ 125/* Description: Pending II 0 Interrupt */
124#define SH_EVENT_OCCURRED_II_INT0_SHFT 29 126#define SH_EVENT_OCCURRED_II_INT0_SHFT 29
125#define SH_EVENT_OCCURRED_II_INT0_MASK 0x0000000020000000 127#define SH_EVENT_OCCURRED_II_INT0_MASK __IA64_UL_CONST(0x0000000020000000)
126 128
127/* SH_EVENT_OCCURRED_II_INT1 */ 129/* SH_EVENT_OCCURRED_II_INT1 */
128/* Description: Pending II 1 Interrupt */ 130/* Description: Pending II 1 Interrupt */
129#define SH_EVENT_OCCURRED_II_INT1_SHFT 30 131#define SH_EVENT_OCCURRED_II_INT1_SHFT 30
130#define SH_EVENT_OCCURRED_II_INT1_MASK 0x0000000040000000 132#define SH_EVENT_OCCURRED_II_INT1_MASK __IA64_UL_CONST(0x0000000040000000)
131 133
132/* SH2_EVENT_OCCURRED_EXTIO_INT2 */ 134/* SH2_EVENT_OCCURRED_EXTIO_INT2 */
133/* Description: Pending SHUB 2 EXT IO INT2 */ 135/* Description: Pending SHUB 2 EXT IO INT2 */
134#define SH2_EVENT_OCCURRED_EXTIO_INT2_SHFT 33 136#define SH2_EVENT_OCCURRED_EXTIO_INT2_SHFT 33
135#define SH2_EVENT_OCCURRED_EXTIO_INT2_MASK 0x0000000200000000 137#define SH2_EVENT_OCCURRED_EXTIO_INT2_MASK __IA64_UL_CONST(0x0000000200000000)
136 138
137/* SH2_EVENT_OCCURRED_EXTIO_INT3 */ 139/* SH2_EVENT_OCCURRED_EXTIO_INT3 */
138/* Description: Pending SHUB 2 EXT IO INT3 */ 140/* Description: Pending SHUB 2 EXT IO INT3 */
139#define SH2_EVENT_OCCURRED_EXTIO_INT3_SHFT 34 141#define SH2_EVENT_OCCURRED_EXTIO_INT3_SHFT 34
140#define SH2_EVENT_OCCURRED_EXTIO_INT3_MASK 0x0000000400000000 142#define SH2_EVENT_OCCURRED_EXTIO_INT3_MASK __IA64_UL_CONST(0x0000000400000000)
141 143
142#define SH_ALL_INT_MASK \ 144#define SH_ALL_INT_MASK \
143 (SH_EVENT_OCCURRED_UART_INT_MASK | SH_EVENT_OCCURRED_IPI_INT_MASK | \ 145 (SH_EVENT_OCCURRED_UART_INT_MASK | SH_EVENT_OCCURRED_IPI_INT_MASK | \
@@ -149,310 +151,310 @@
149/* ==================================================================== */ 151/* ==================================================================== */
150/* LEDS */ 152/* LEDS */
151/* ==================================================================== */ 153/* ==================================================================== */
152#define SH1_REAL_JUNK_BUS_LED0 0x7fed00000UL 154#define SH1_REAL_JUNK_BUS_LED0 0x7fed00000UL
153#define SH1_REAL_JUNK_BUS_LED1 0x7fed10000UL 155#define SH1_REAL_JUNK_BUS_LED1 0x7fed10000UL
154#define SH1_REAL_JUNK_BUS_LED2 0x7fed20000UL 156#define SH1_REAL_JUNK_BUS_LED2 0x7fed20000UL
155#define SH1_REAL_JUNK_BUS_LED3 0x7fed30000UL 157#define SH1_REAL_JUNK_BUS_LED3 0x7fed30000UL
156 158
157#define SH2_REAL_JUNK_BUS_LED0 0xf0000000UL 159#define SH2_REAL_JUNK_BUS_LED0 0xf0000000UL
158#define SH2_REAL_JUNK_BUS_LED1 0xf0010000UL 160#define SH2_REAL_JUNK_BUS_LED1 0xf0010000UL
159#define SH2_REAL_JUNK_BUS_LED2 0xf0020000UL 161#define SH2_REAL_JUNK_BUS_LED2 0xf0020000UL
160#define SH2_REAL_JUNK_BUS_LED3 0xf0030000UL 162#define SH2_REAL_JUNK_BUS_LED3 0xf0030000UL
161 163
162/* ==================================================================== */ 164/* ==================================================================== */
163/* Register "SH1_PTC_0" */ 165/* Register "SH1_PTC_0" */
164/* Puge Translation Cache Message Configuration Information */ 166/* Puge Translation Cache Message Configuration Information */
165/* ==================================================================== */ 167/* ==================================================================== */
166#define SH1_PTC_0 0x00000001101a0000 168#define SH1_PTC_0 __IA64_UL_CONST(0x00000001101a0000)
167 169
168/* SH1_PTC_0_A */ 170/* SH1_PTC_0_A */
169/* Description: Type */ 171/* Description: Type */
170#define SH1_PTC_0_A_SHFT 0 172#define SH1_PTC_0_A_SHFT 0
171 173
172/* SH1_PTC_0_PS */ 174/* SH1_PTC_0_PS */
173/* Description: Page Size */ 175/* Description: Page Size */
174#define SH1_PTC_0_PS_SHFT 2 176#define SH1_PTC_0_PS_SHFT 2
175 177
176/* SH1_PTC_0_RID */ 178/* SH1_PTC_0_RID */
177/* Description: Region ID */ 179/* Description: Region ID */
178#define SH1_PTC_0_RID_SHFT 8 180#define SH1_PTC_0_RID_SHFT 8
179 181
180/* SH1_PTC_0_START */ 182/* SH1_PTC_0_START */
181/* Description: Start */ 183/* Description: Start */
182#define SH1_PTC_0_START_SHFT 63 184#define SH1_PTC_0_START_SHFT 63
183 185
184/* ==================================================================== */ 186/* ==================================================================== */
185/* Register "SH1_PTC_1" */ 187/* Register "SH1_PTC_1" */
186/* Puge Translation Cache Message Configuration Information */ 188/* Puge Translation Cache Message Configuration Information */
187/* ==================================================================== */ 189/* ==================================================================== */
188#define SH1_PTC_1 0x00000001101a0080 190#define SH1_PTC_1 __IA64_UL_CONST(0x00000001101a0080)
189 191
190/* SH1_PTC_1_START */ 192/* SH1_PTC_1_START */
191/* Description: PTC_1 Start */ 193/* Description: PTC_1 Start */
192#define SH1_PTC_1_START_SHFT 63 194#define SH1_PTC_1_START_SHFT 63
193
194 195
195/* ==================================================================== */ 196/* ==================================================================== */
196/* Register "SH2_PTC" */ 197/* Register "SH2_PTC" */
197/* Puge Translation Cache Message Configuration Information */ 198/* Puge Translation Cache Message Configuration Information */
198/* ==================================================================== */ 199/* ==================================================================== */
199#define SH2_PTC 0x0000000170000000 200#define SH2_PTC __IA64_UL_CONST(0x0000000170000000)
200 201
201/* SH2_PTC_A */ 202/* SH2_PTC_A */
202/* Description: Type */ 203/* Description: Type */
203#define SH2_PTC_A_SHFT 0 204#define SH2_PTC_A_SHFT 0
204 205
205/* SH2_PTC_PS */ 206/* SH2_PTC_PS */
206/* Description: Page Size */ 207/* Description: Page Size */
207#define SH2_PTC_PS_SHFT 2 208#define SH2_PTC_PS_SHFT 2
208 209
209/* SH2_PTC_RID */ 210/* SH2_PTC_RID */
210/* Description: Region ID */ 211/* Description: Region ID */
211#define SH2_PTC_RID_SHFT 4 212#define SH2_PTC_RID_SHFT 4
212 213
213/* SH2_PTC_START */ 214/* SH2_PTC_START */
214/* Description: Start */ 215/* Description: Start */
215#define SH2_PTC_START_SHFT 63 216#define SH2_PTC_START_SHFT 63
216 217
217/* SH2_PTC_ADDR_RID */ 218/* SH2_PTC_ADDR_RID */
218/* Description: Region ID */ 219/* Description: Region ID */
219#define SH2_PTC_ADDR_SHFT 4 220#define SH2_PTC_ADDR_SHFT 4
220#define SH2_PTC_ADDR_MASK 0x1ffffffffffff000 221#define SH2_PTC_ADDR_MASK __IA64_UL_CONST(0x1ffffffffffff000)
221 222
222/* ==================================================================== */ 223/* ==================================================================== */
223/* Register "SH_RTC1_INT_CONFIG" */ 224/* Register "SH_RTC1_INT_CONFIG" */
224/* SHub RTC 1 Interrupt Config Registers */ 225/* SHub RTC 1 Interrupt Config Registers */
225/* ==================================================================== */ 226/* ==================================================================== */
226 227
227#define SH1_RTC1_INT_CONFIG 0x0000000110001480 228#define SH1_RTC1_INT_CONFIG __IA64_UL_CONST(0x0000000110001480)
228#define SH2_RTC1_INT_CONFIG 0x0000000010001480 229#define SH2_RTC1_INT_CONFIG __IA64_UL_CONST(0x0000000010001480)
229#define SH_RTC1_INT_CONFIG_MASK 0x0ff3ffffffefffff 230#define SH_RTC1_INT_CONFIG_MASK __IA64_UL_CONST(0x0ff3ffffffefffff)
230#define SH_RTC1_INT_CONFIG_INIT 0x0000000000000000 231#define SH_RTC1_INT_CONFIG_INIT __IA64_UL_CONST(0x0000000000000000)
231 232
232/* SH_RTC1_INT_CONFIG_TYPE */ 233/* SH_RTC1_INT_CONFIG_TYPE */
233/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ 234/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */
234#define SH_RTC1_INT_CONFIG_TYPE_SHFT 0 235#define SH_RTC1_INT_CONFIG_TYPE_SHFT 0
235#define SH_RTC1_INT_CONFIG_TYPE_MASK 0x0000000000000007 236#define SH_RTC1_INT_CONFIG_TYPE_MASK __IA64_UL_CONST(0x0000000000000007)
236 237
237/* SH_RTC1_INT_CONFIG_AGT */ 238/* SH_RTC1_INT_CONFIG_AGT */
238/* Description: Agent, must be 0 for SHub */ 239/* Description: Agent, must be 0 for SHub */
239#define SH_RTC1_INT_CONFIG_AGT_SHFT 3 240#define SH_RTC1_INT_CONFIG_AGT_SHFT 3
240#define SH_RTC1_INT_CONFIG_AGT_MASK 0x0000000000000008 241#define SH_RTC1_INT_CONFIG_AGT_MASK __IA64_UL_CONST(0x0000000000000008)
241 242
242/* SH_RTC1_INT_CONFIG_PID */ 243/* SH_RTC1_INT_CONFIG_PID */
243/* Description: Processor ID, same setting as on targeted McKinley */ 244/* Description: Processor ID, same setting as on targeted McKinley */
244#define SH_RTC1_INT_CONFIG_PID_SHFT 4 245#define SH_RTC1_INT_CONFIG_PID_SHFT 4
245#define SH_RTC1_INT_CONFIG_PID_MASK 0x00000000000ffff0 246#define SH_RTC1_INT_CONFIG_PID_MASK __IA64_UL_CONST(0x00000000000ffff0)
246 247
247/* SH_RTC1_INT_CONFIG_BASE */ 248/* SH_RTC1_INT_CONFIG_BASE */
248/* Description: Optional interrupt vector area, 2MB aligned */ 249/* Description: Optional interrupt vector area, 2MB aligned */
249#define SH_RTC1_INT_CONFIG_BASE_SHFT 21 250#define SH_RTC1_INT_CONFIG_BASE_SHFT 21
250#define SH_RTC1_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 251#define SH_RTC1_INT_CONFIG_BASE_MASK __IA64_UL_CONST(0x0003ffffffe00000)
251 252
252/* SH_RTC1_INT_CONFIG_IDX */ 253/* SH_RTC1_INT_CONFIG_IDX */
253/* Description: Targeted McKinley interrupt vector */ 254/* Description: Targeted McKinley interrupt vector */
254#define SH_RTC1_INT_CONFIG_IDX_SHFT 52 255#define SH_RTC1_INT_CONFIG_IDX_SHFT 52
255#define SH_RTC1_INT_CONFIG_IDX_MASK 0x0ff0000000000000 256#define SH_RTC1_INT_CONFIG_IDX_MASK __IA64_UL_CONST(0x0ff0000000000000)
256 257
257/* ==================================================================== */ 258/* ==================================================================== */
258/* Register "SH_RTC1_INT_ENABLE" */ 259/* Register "SH_RTC1_INT_ENABLE" */
259/* SHub RTC 1 Interrupt Enable Registers */ 260/* SHub RTC 1 Interrupt Enable Registers */
260/* ==================================================================== */ 261/* ==================================================================== */
261 262
262#define SH1_RTC1_INT_ENABLE 0x0000000110001500 263#define SH1_RTC1_INT_ENABLE __IA64_UL_CONST(0x0000000110001500)
263#define SH2_RTC1_INT_ENABLE 0x0000000010001500 264#define SH2_RTC1_INT_ENABLE __IA64_UL_CONST(0x0000000010001500)
264#define SH_RTC1_INT_ENABLE_MASK 0x0000000000000001 265#define SH_RTC1_INT_ENABLE_MASK __IA64_UL_CONST(0x0000000000000001)
265#define SH_RTC1_INT_ENABLE_INIT 0x0000000000000000 266#define SH_RTC1_INT_ENABLE_INIT __IA64_UL_CONST(0x0000000000000000)
266 267
267/* SH_RTC1_INT_ENABLE_RTC1_ENABLE */ 268/* SH_RTC1_INT_ENABLE_RTC1_ENABLE */
268/* Description: Enable RTC 1 Interrupt */ 269/* Description: Enable RTC 1 Interrupt */
269#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_SHFT 0 270#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_SHFT 0
270#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_MASK 0x0000000000000001 271#define SH_RTC1_INT_ENABLE_RTC1_ENABLE_MASK \
272 __IA64_UL_CONST(0x0000000000000001)
271 273
272/* ==================================================================== */ 274/* ==================================================================== */
273/* Register "SH_RTC2_INT_CONFIG" */ 275/* Register "SH_RTC2_INT_CONFIG" */
274/* SHub RTC 2 Interrupt Config Registers */ 276/* SHub RTC 2 Interrupt Config Registers */
275/* ==================================================================== */ 277/* ==================================================================== */
276 278
277#define SH1_RTC2_INT_CONFIG 0x0000000110001580 279#define SH1_RTC2_INT_CONFIG __IA64_UL_CONST(0x0000000110001580)
278#define SH2_RTC2_INT_CONFIG 0x0000000010001580 280#define SH2_RTC2_INT_CONFIG __IA64_UL_CONST(0x0000000010001580)
279#define SH_RTC2_INT_CONFIG_MASK 0x0ff3ffffffefffff 281#define SH_RTC2_INT_CONFIG_MASK __IA64_UL_CONST(0x0ff3ffffffefffff)
280#define SH_RTC2_INT_CONFIG_INIT 0x0000000000000000 282#define SH_RTC2_INT_CONFIG_INIT __IA64_UL_CONST(0x0000000000000000)
281 283
282/* SH_RTC2_INT_CONFIG_TYPE */ 284/* SH_RTC2_INT_CONFIG_TYPE */
283/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ 285/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */
284#define SH_RTC2_INT_CONFIG_TYPE_SHFT 0 286#define SH_RTC2_INT_CONFIG_TYPE_SHFT 0
285#define SH_RTC2_INT_CONFIG_TYPE_MASK 0x0000000000000007 287#define SH_RTC2_INT_CONFIG_TYPE_MASK __IA64_UL_CONST(0x0000000000000007)
286 288
287/* SH_RTC2_INT_CONFIG_AGT */ 289/* SH_RTC2_INT_CONFIG_AGT */
288/* Description: Agent, must be 0 for SHub */ 290/* Description: Agent, must be 0 for SHub */
289#define SH_RTC2_INT_CONFIG_AGT_SHFT 3 291#define SH_RTC2_INT_CONFIG_AGT_SHFT 3
290#define SH_RTC2_INT_CONFIG_AGT_MASK 0x0000000000000008 292#define SH_RTC2_INT_CONFIG_AGT_MASK __IA64_UL_CONST(0x0000000000000008)
291 293
292/* SH_RTC2_INT_CONFIG_PID */ 294/* SH_RTC2_INT_CONFIG_PID */
293/* Description: Processor ID, same setting as on targeted McKinley */ 295/* Description: Processor ID, same setting as on targeted McKinley */
294#define SH_RTC2_INT_CONFIG_PID_SHFT 4 296#define SH_RTC2_INT_CONFIG_PID_SHFT 4
295#define SH_RTC2_INT_CONFIG_PID_MASK 0x00000000000ffff0 297#define SH_RTC2_INT_CONFIG_PID_MASK __IA64_UL_CONST(0x00000000000ffff0)
296 298
297/* SH_RTC2_INT_CONFIG_BASE */ 299/* SH_RTC2_INT_CONFIG_BASE */
298/* Description: Optional interrupt vector area, 2MB aligned */ 300/* Description: Optional interrupt vector area, 2MB aligned */
299#define SH_RTC2_INT_CONFIG_BASE_SHFT 21 301#define SH_RTC2_INT_CONFIG_BASE_SHFT 21
300#define SH_RTC2_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 302#define SH_RTC2_INT_CONFIG_BASE_MASK __IA64_UL_CONST(0x0003ffffffe00000)
301 303
302/* SH_RTC2_INT_CONFIG_IDX */ 304/* SH_RTC2_INT_CONFIG_IDX */
303/* Description: Targeted McKinley interrupt vector */ 305/* Description: Targeted McKinley interrupt vector */
304#define SH_RTC2_INT_CONFIG_IDX_SHFT 52 306#define SH_RTC2_INT_CONFIG_IDX_SHFT 52
305#define SH_RTC2_INT_CONFIG_IDX_MASK 0x0ff0000000000000 307#define SH_RTC2_INT_CONFIG_IDX_MASK __IA64_UL_CONST(0x0ff0000000000000)
306 308
307/* ==================================================================== */ 309/* ==================================================================== */
308/* Register "SH_RTC2_INT_ENABLE" */ 310/* Register "SH_RTC2_INT_ENABLE" */
309/* SHub RTC 2 Interrupt Enable Registers */ 311/* SHub RTC 2 Interrupt Enable Registers */
310/* ==================================================================== */ 312/* ==================================================================== */
311 313
312#define SH1_RTC2_INT_ENABLE 0x0000000110001600 314#define SH1_RTC2_INT_ENABLE __IA64_UL_CONST(0x0000000110001600)
313#define SH2_RTC2_INT_ENABLE 0x0000000010001600 315#define SH2_RTC2_INT_ENABLE __IA64_UL_CONST(0x0000000010001600)
314#define SH_RTC2_INT_ENABLE_MASK 0x0000000000000001 316#define SH_RTC2_INT_ENABLE_MASK __IA64_UL_CONST(0x0000000000000001)
315#define SH_RTC2_INT_ENABLE_INIT 0x0000000000000000 317#define SH_RTC2_INT_ENABLE_INIT __IA64_UL_CONST(0x0000000000000000)
316 318
317/* SH_RTC2_INT_ENABLE_RTC2_ENABLE */ 319/* SH_RTC2_INT_ENABLE_RTC2_ENABLE */
318/* Description: Enable RTC 2 Interrupt */ 320/* Description: Enable RTC 2 Interrupt */
319#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_SHFT 0 321#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_SHFT 0
320#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_MASK 0x0000000000000001 322#define SH_RTC2_INT_ENABLE_RTC2_ENABLE_MASK \
323 __IA64_UL_CONST(0x0000000000000001)
321 324
322/* ==================================================================== */ 325/* ==================================================================== */
323/* Register "SH_RTC3_INT_CONFIG" */ 326/* Register "SH_RTC3_INT_CONFIG" */
324/* SHub RTC 3 Interrupt Config Registers */ 327/* SHub RTC 3 Interrupt Config Registers */
325/* ==================================================================== */ 328/* ==================================================================== */
326 329
327#define SH1_RTC3_INT_CONFIG 0x0000000110001680 330#define SH1_RTC3_INT_CONFIG __IA64_UL_CONST(0x0000000110001680)
328#define SH2_RTC3_INT_CONFIG 0x0000000010001680 331#define SH2_RTC3_INT_CONFIG __IA64_UL_CONST(0x0000000010001680)
329#define SH_RTC3_INT_CONFIG_MASK 0x0ff3ffffffefffff 332#define SH_RTC3_INT_CONFIG_MASK __IA64_UL_CONST(0x0ff3ffffffefffff)
330#define SH_RTC3_INT_CONFIG_INIT 0x0000000000000000 333#define SH_RTC3_INT_CONFIG_INIT __IA64_UL_CONST(0x0000000000000000)
331 334
332/* SH_RTC3_INT_CONFIG_TYPE */ 335/* SH_RTC3_INT_CONFIG_TYPE */
333/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */ 336/* Description: Type of Interrupt: 0=INT, 2=PMI, 4=NMI, 5=INIT */
334#define SH_RTC3_INT_CONFIG_TYPE_SHFT 0 337#define SH_RTC3_INT_CONFIG_TYPE_SHFT 0
335#define SH_RTC3_INT_CONFIG_TYPE_MASK 0x0000000000000007 338#define SH_RTC3_INT_CONFIG_TYPE_MASK __IA64_UL_CONST(0x0000000000000007)
336 339
337/* SH_RTC3_INT_CONFIG_AGT */ 340/* SH_RTC3_INT_CONFIG_AGT */
338/* Description: Agent, must be 0 for SHub */ 341/* Description: Agent, must be 0 for SHub */
339#define SH_RTC3_INT_CONFIG_AGT_SHFT 3 342#define SH_RTC3_INT_CONFIG_AGT_SHFT 3
340#define SH_RTC3_INT_CONFIG_AGT_MASK 0x0000000000000008 343#define SH_RTC3_INT_CONFIG_AGT_MASK __IA64_UL_CONST(0x0000000000000008)
341 344
342/* SH_RTC3_INT_CONFIG_PID */ 345/* SH_RTC3_INT_CONFIG_PID */
343/* Description: Processor ID, same setting as on targeted McKinley */ 346/* Description: Processor ID, same setting as on targeted McKinley */
344#define SH_RTC3_INT_CONFIG_PID_SHFT 4 347#define SH_RTC3_INT_CONFIG_PID_SHFT 4
345#define SH_RTC3_INT_CONFIG_PID_MASK 0x00000000000ffff0 348#define SH_RTC3_INT_CONFIG_PID_MASK __IA64_UL_CONST(0x00000000000ffff0)
346 349
347/* SH_RTC3_INT_CONFIG_BASE */ 350/* SH_RTC3_INT_CONFIG_BASE */
348/* Description: Optional interrupt vector area, 2MB aligned */ 351/* Description: Optional interrupt vector area, 2MB aligned */
349#define SH_RTC3_INT_CONFIG_BASE_SHFT 21 352#define SH_RTC3_INT_CONFIG_BASE_SHFT 21
350#define SH_RTC3_INT_CONFIG_BASE_MASK 0x0003ffffffe00000 353#define SH_RTC3_INT_CONFIG_BASE_MASK __IA64_UL_CONST(0x0003ffffffe00000)
351 354
352/* SH_RTC3_INT_CONFIG_IDX */ 355/* SH_RTC3_INT_CONFIG_IDX */
353/* Description: Targeted McKinley interrupt vector */ 356/* Description: Targeted McKinley interrupt vector */
354#define SH_RTC3_INT_CONFIG_IDX_SHFT 52 357#define SH_RTC3_INT_CONFIG_IDX_SHFT 52
355#define SH_RTC3_INT_CONFIG_IDX_MASK 0x0ff0000000000000 358#define SH_RTC3_INT_CONFIG_IDX_MASK __IA64_UL_CONST(0x0ff0000000000000)
356 359
357/* ==================================================================== */ 360/* ==================================================================== */
358/* Register "SH_RTC3_INT_ENABLE" */ 361/* Register "SH_RTC3_INT_ENABLE" */
359/* SHub RTC 3 Interrupt Enable Registers */ 362/* SHub RTC 3 Interrupt Enable Registers */
360/* ==================================================================== */ 363/* ==================================================================== */
361 364
362#define SH1_RTC3_INT_ENABLE 0x0000000110001700 365#define SH1_RTC3_INT_ENABLE __IA64_UL_CONST(0x0000000110001700)
363#define SH2_RTC3_INT_ENABLE 0x0000000010001700 366#define SH2_RTC3_INT_ENABLE __IA64_UL_CONST(0x0000000010001700)
364#define SH_RTC3_INT_ENABLE_MASK 0x0000000000000001 367#define SH_RTC3_INT_ENABLE_MASK __IA64_UL_CONST(0x0000000000000001)
365#define SH_RTC3_INT_ENABLE_INIT 0x0000000000000000 368#define SH_RTC3_INT_ENABLE_INIT __IA64_UL_CONST(0x0000000000000000)
366 369
367/* SH_RTC3_INT_ENABLE_RTC3_ENABLE */ 370/* SH_RTC3_INT_ENABLE_RTC3_ENABLE */
368/* Description: Enable RTC 3 Interrupt */ 371/* Description: Enable RTC 3 Interrupt */
369#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_SHFT 0 372#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_SHFT 0
370#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_MASK 0x0000000000000001 373#define SH_RTC3_INT_ENABLE_RTC3_ENABLE_MASK \
374 __IA64_UL_CONST(0x0000000000000001)
371 375
372/* SH_EVENT_OCCURRED_RTC1_INT */ 376/* SH_EVENT_OCCURRED_RTC1_INT */
373/* Description: Pending RTC 1 Interrupt */ 377/* Description: Pending RTC 1 Interrupt */
374#define SH_EVENT_OCCURRED_RTC1_INT_SHFT 24 378#define SH_EVENT_OCCURRED_RTC1_INT_SHFT 24
375#define SH_EVENT_OCCURRED_RTC1_INT_MASK 0x0000000001000000 379#define SH_EVENT_OCCURRED_RTC1_INT_MASK __IA64_UL_CONST(0x0000000001000000)
376 380
377/* SH_EVENT_OCCURRED_RTC2_INT */ 381/* SH_EVENT_OCCURRED_RTC2_INT */
378/* Description: Pending RTC 2 Interrupt */ 382/* Description: Pending RTC 2 Interrupt */
379#define SH_EVENT_OCCURRED_RTC2_INT_SHFT 25 383#define SH_EVENT_OCCURRED_RTC2_INT_SHFT 25
380#define SH_EVENT_OCCURRED_RTC2_INT_MASK 0x0000000002000000 384#define SH_EVENT_OCCURRED_RTC2_INT_MASK __IA64_UL_CONST(0x0000000002000000)
381 385
382/* SH_EVENT_OCCURRED_RTC3_INT */ 386/* SH_EVENT_OCCURRED_RTC3_INT */
383/* Description: Pending RTC 3 Interrupt */ 387/* Description: Pending RTC 3 Interrupt */
384#define SH_EVENT_OCCURRED_RTC3_INT_SHFT 26 388#define SH_EVENT_OCCURRED_RTC3_INT_SHFT 26
385#define SH_EVENT_OCCURRED_RTC3_INT_MASK 0x0000000004000000 389#define SH_EVENT_OCCURRED_RTC3_INT_MASK __IA64_UL_CONST(0x0000000004000000)
386 390
387/* ==================================================================== */ 391/* ==================================================================== */
388/* Register "SH_IPI_ACCESS" */ 392/* Register "SH_IPI_ACCESS" */
389/* CPU interrupt Access Permission Bits */ 393/* CPU interrupt Access Permission Bits */
390/* ==================================================================== */ 394/* ==================================================================== */
391 395
392#define SH1_IPI_ACCESS 0x0000000110060480 396#define SH1_IPI_ACCESS __IA64_UL_CONST(0x0000000110060480)
393#define SH2_IPI_ACCESS0 0x0000000010060c00 397#define SH2_IPI_ACCESS0 __IA64_UL_CONST(0x0000000010060c00)
394#define SH2_IPI_ACCESS1 0x0000000010060c80 398#define SH2_IPI_ACCESS1 __IA64_UL_CONST(0x0000000010060c80)
395#define SH2_IPI_ACCESS2 0x0000000010060d00 399#define SH2_IPI_ACCESS2 __IA64_UL_CONST(0x0000000010060d00)
396#define SH2_IPI_ACCESS3 0x0000000010060d80 400#define SH2_IPI_ACCESS3 __IA64_UL_CONST(0x0000000010060d80)
397 401
398/* ==================================================================== */ 402/* ==================================================================== */
399/* Register "SH_INT_CMPB" */ 403/* Register "SH_INT_CMPB" */
400/* RTC Compare Value for Processor B */ 404/* RTC Compare Value for Processor B */
401/* ==================================================================== */ 405/* ==================================================================== */
402 406
403#define SH1_INT_CMPB 0x00000001101b0080 407#define SH1_INT_CMPB __IA64_UL_CONST(0x00000001101b0080)
404#define SH2_INT_CMPB 0x00000000101b0080 408#define SH2_INT_CMPB __IA64_UL_CONST(0x00000000101b0080)
405#define SH_INT_CMPB_MASK 0x007fffffffffffff 409#define SH_INT_CMPB_MASK __IA64_UL_CONST(0x007fffffffffffff)
406#define SH_INT_CMPB_INIT 0x0000000000000000 410#define SH_INT_CMPB_INIT __IA64_UL_CONST(0x0000000000000000)
407 411
408/* SH_INT_CMPB_REAL_TIME_CMPB */ 412/* SH_INT_CMPB_REAL_TIME_CMPB */
409/* Description: Real Time Clock Compare */ 413/* Description: Real Time Clock Compare */
410#define SH_INT_CMPB_REAL_TIME_CMPB_SHFT 0 414#define SH_INT_CMPB_REAL_TIME_CMPB_SHFT 0
411#define SH_INT_CMPB_REAL_TIME_CMPB_MASK 0x007fffffffffffff 415#define SH_INT_CMPB_REAL_TIME_CMPB_MASK __IA64_UL_CONST(0x007fffffffffffff)
412 416
413/* ==================================================================== */ 417/* ==================================================================== */
414/* Register "SH_INT_CMPC" */ 418/* Register "SH_INT_CMPC" */
415/* RTC Compare Value for Processor C */ 419/* RTC Compare Value for Processor C */
416/* ==================================================================== */ 420/* ==================================================================== */
417 421
418#define SH1_INT_CMPC 0x00000001101b0100 422#define SH1_INT_CMPC __IA64_UL_CONST(0x00000001101b0100)
419#define SH2_INT_CMPC 0x00000000101b0100 423#define SH2_INT_CMPC __IA64_UL_CONST(0x00000000101b0100)
420#define SH_INT_CMPC_MASK 0x007fffffffffffff 424#define SH_INT_CMPC_MASK __IA64_UL_CONST(0x007fffffffffffff)
421#define SH_INT_CMPC_INIT 0x0000000000000000 425#define SH_INT_CMPC_INIT __IA64_UL_CONST(0x0000000000000000)
422 426
423/* SH_INT_CMPC_REAL_TIME_CMPC */ 427/* SH_INT_CMPC_REAL_TIME_CMPC */
424/* Description: Real Time Clock Compare */ 428/* Description: Real Time Clock Compare */
425#define SH_INT_CMPC_REAL_TIME_CMPC_SHFT 0 429#define SH_INT_CMPC_REAL_TIME_CMPC_SHFT 0
426#define SH_INT_CMPC_REAL_TIME_CMPC_MASK 0x007fffffffffffff 430#define SH_INT_CMPC_REAL_TIME_CMPC_MASK __IA64_UL_CONST(0x007fffffffffffff)
427 431
428/* ==================================================================== */ 432/* ==================================================================== */
429/* Register "SH_INT_CMPD" */ 433/* Register "SH_INT_CMPD" */
430/* RTC Compare Value for Processor D */ 434/* RTC Compare Value for Processor D */
431/* ==================================================================== */ 435/* ==================================================================== */
432 436
433#define SH1_INT_CMPD 0x00000001101b0180 437#define SH1_INT_CMPD __IA64_UL_CONST(0x00000001101b0180)
434#define SH2_INT_CMPD 0x00000000101b0180 438#define SH2_INT_CMPD __IA64_UL_CONST(0x00000000101b0180)
435#define SH_INT_CMPD_MASK 0x007fffffffffffff 439#define SH_INT_CMPD_MASK __IA64_UL_CONST(0x007fffffffffffff)
436#define SH_INT_CMPD_INIT 0x0000000000000000 440#define SH_INT_CMPD_INIT __IA64_UL_CONST(0x0000000000000000)
437 441
438/* SH_INT_CMPD_REAL_TIME_CMPD */ 442/* SH_INT_CMPD_REAL_TIME_CMPD */
439/* Description: Real Time Clock Compare */ 443/* Description: Real Time Clock Compare */
440#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT 0 444#define SH_INT_CMPD_REAL_TIME_CMPD_SHFT 0
441#define SH_INT_CMPD_REAL_TIME_CMPD_MASK 0x007fffffffffffff 445#define SH_INT_CMPD_REAL_TIME_CMPD_MASK __IA64_UL_CONST(0x007fffffffffffff)
442 446
443/* ==================================================================== */ 447/* ==================================================================== */
444/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */ 448/* Register "SH_MD_DQLP_MMR_DIR_PRIVEC0" */
445/* privilege vector for acc=0 */ 449/* privilege vector for acc=0 */
446/* ==================================================================== */ 450/* ==================================================================== */
447 451#define SH1_MD_DQLP_MMR_DIR_PRIVEC0 __IA64_UL_CONST(0x0000000100030300)
448#define SH1_MD_DQLP_MMR_DIR_PRIVEC0 0x0000000100030300
449 452
450/* ==================================================================== */ 453/* ==================================================================== */
451/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */ 454/* Register "SH_MD_DQRP_MMR_DIR_PRIVEC0" */
452/* privilege vector for acc=0 */ 455/* privilege vector for acc=0 */
453/* ==================================================================== */ 456/* ==================================================================== */
454 457#define SH1_MD_DQRP_MMR_DIR_PRIVEC0 __IA64_UL_CONST(0x0000000100050300)
455#define SH1_MD_DQRP_MMR_DIR_PRIVEC0 0x0000000100050300
456 458
457/* ==================================================================== */ 459/* ==================================================================== */
458/* Some MMRs are functionally identical (or close enough) on both SHUB1 */ 460/* Some MMRs are functionally identical (or close enough) on both SHUB1 */
@@ -484,17 +486,17 @@
484/* Engine 0 Control and Status Register */ 486/* Engine 0 Control and Status Register */
485/* ========================================================================== */ 487/* ========================================================================== */
486 488
487#define SH2_BT_ENG_CSR_0 0x0000000030040000 489#define SH2_BT_ENG_CSR_0 __IA64_UL_CONST(0x0000000030040000)
488#define SH2_BT_ENG_SRC_ADDR_0 0x0000000030040080 490#define SH2_BT_ENG_SRC_ADDR_0 __IA64_UL_CONST(0x0000000030040080)
489#define SH2_BT_ENG_DEST_ADDR_0 0x0000000030040100 491#define SH2_BT_ENG_DEST_ADDR_0 __IA64_UL_CONST(0x0000000030040100)
490#define SH2_BT_ENG_NOTIF_ADDR_0 0x0000000030040180 492#define SH2_BT_ENG_NOTIF_ADDR_0 __IA64_UL_CONST(0x0000000030040180)
491 493
492/* ========================================================================== */ 494/* ========================================================================== */
493/* BTE interfaces 1-3 */ 495/* BTE interfaces 1-3 */
494/* ========================================================================== */ 496/* ========================================================================== */
495 497
496#define SH2_BT_ENG_CSR_1 0x0000000030050000 498#define SH2_BT_ENG_CSR_1 __IA64_UL_CONST(0x0000000030050000)
497#define SH2_BT_ENG_CSR_2 0x0000000030060000 499#define SH2_BT_ENG_CSR_2 __IA64_UL_CONST(0x0000000030060000)
498#define SH2_BT_ENG_CSR_3 0x0000000030070000 500#define SH2_BT_ENG_CSR_3 __IA64_UL_CONST(0x0000000030070000)
499 501
500#endif /* _ASM_IA64_SN_SHUB_MMR_H */ 502#endif /* _ASM_IA64_SN_SHUB_MMR_H */
diff --git a/include/asm-ia64/sn/simulator.h b/include/asm-ia64/sn/simulator.h
index 78eb4f869c8b..16a48b5a039c 100644
--- a/include/asm-ia64/sn/simulator.h
+++ b/include/asm-ia64/sn/simulator.h
@@ -10,18 +10,12 @@
10 10
11#include <linux/config.h> 11#include <linux/config.h>
12 12
13#ifdef CONFIG_IA64_SGI_SN_SIM
14
15#define SNMAGIC 0xaeeeeeee8badbeefL 13#define SNMAGIC 0xaeeeeeee8badbeefL
16#define IS_RUNNING_ON_SIMULATOR() ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;}) 14#define IS_MEDUSA() ({long sn; asm("mov %0=cpuid[%1]" : "=r"(sn) : "r"(2)); sn == SNMAGIC;})
17
18#define SIMULATOR_SLEEP() asm("nop.i 0x8beef")
19
20#else
21
22#define IS_RUNNING_ON_SIMULATOR() (0)
23#define SIMULATOR_SLEEP()
24 15
25#endif 16#define SIMULATOR_SLEEP() asm("nop.i 0x8beef")
17#define IS_RUNNING_ON_SIMULATOR() (sn_prom_type)
18#define IS_RUNNING_ON_FAKE_PROM() (sn_prom_type == 2)
19extern int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
26 20
27#endif /* _ASM_IA64_SN_SIMULATOR_H */ 21#endif /* _ASM_IA64_SN_SIMULATOR_H */
diff --git a/include/asm-ia64/sn/sn2/sn_hwperf.h b/include/asm-ia64/sn/sn2/sn_hwperf.h
index b0c4d6dd77ba..df75f4c4aec3 100644
--- a/include/asm-ia64/sn/sn2/sn_hwperf.h
+++ b/include/asm-ia64/sn/sn2/sn_hwperf.h
@@ -223,4 +223,6 @@ struct sn_hwperf_ioctl_args {
223#define SN_HWPERF_OP_RECONFIGURE 253 223#define SN_HWPERF_OP_RECONFIGURE 253
224#define SN_HWPERF_OP_INVAL 254 224#define SN_HWPERF_OP_INVAL 254
225 225
226int sn_topology_open(struct inode *inode, struct file *file);
227int sn_topology_release(struct inode *inode, struct file *file);
226#endif /* SN_HWPERF_H */ 228#endif /* SN_HWPERF_H */
diff --git a/include/asm-ia64/sn/sn_cpuid.h b/include/asm-ia64/sn/sn_cpuid.h
index 20b300187669..d2c1d34dcce4 100644
--- a/include/asm-ia64/sn/sn_cpuid.h
+++ b/include/asm-ia64/sn/sn_cpuid.h
@@ -81,11 +81,6 @@
81 * 81 *
82 */ 82 */
83 83
84#ifndef CONFIG_SMP
85#define cpu_physical_id(cpuid) ((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
86#endif
87
88
89#define get_node_number(addr) NASID_GET(addr) 84#define get_node_number(addr) NASID_GET(addr)
90 85
91/* 86/*
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index eb0395ad0d6a..27976d223186 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -132,43 +132,30 @@
132#define SALRET_INVALID_ARG (-2) 132#define SALRET_INVALID_ARG (-2)
133#define SALRET_ERROR (-3) 133#define SALRET_ERROR (-3)
134 134
135#define SN_SAL_FAKE_PROM 0x02009999
135 136
136/** 137/**
137 * sn_sal_rev_major - get the major SGI SAL revision number 138 * sn_sal_revision - get the SGI SAL revision number
138 * 139 *
139 * The SGI PROM stores its version in sal_[ab]_rev_(major|minor). 140 * The SGI PROM stores its version in the sal_[ab]_rev_(major|minor).
140 * This routine simply extracts the major value from the 141 * This routine simply extracts the major and minor values and
141 * @ia64_sal_systab structure constructed by ia64_sal_init(). 142 * presents them in a u32 format.
142 */ 143 *
143static inline int 144 * For example, version 4.05 would be represented at 0x0405.
144sn_sal_rev_major(void) 145 */
146static inline u32
147sn_sal_rev(void)
145{ 148{
146 struct ia64_sal_systab *systab = efi.sal_systab; 149 struct ia64_sal_systab *systab = efi.sal_systab;
147 150
148 return (int)systab->sal_b_rev_major; 151 return (u32)(systab->sal_b_rev_major << 8 | systab->sal_b_rev_minor);
149}
150
151/**
152 * sn_sal_rev_minor - get the minor SGI SAL revision number
153 *
154 * The SGI PROM stores its version in sal_[ab]_rev_(major|minor).
155 * This routine simply extracts the minor value from the
156 * @ia64_sal_systab structure constructed by ia64_sal_init().
157 */
158static inline int
159sn_sal_rev_minor(void)
160{
161 struct ia64_sal_systab *systab = efi.sal_systab;
162
163 return (int)systab->sal_b_rev_minor;
164} 152}
165 153
166/* 154/*
167 * Specify the minimum PROM revsion required for this kernel. 155 * Specify the minimum PROM revsion required for this kernel.
168 * Note that they're stored in hex format... 156 * Note that they're stored in hex format...
169 */ 157 */
170#define SN_SAL_MIN_MAJOR 0x4 /* SN2 kernels need at least PROM 4.0 */ 158#define SN_SAL_MIN_VERSION 0x0404
171#define SN_SAL_MIN_MINOR 0x0
172 159
173/* 160/*
174 * Returns the master console nasid, if the call fails, return an illegal 161 * Returns the master console nasid, if the call fails, return an illegal
@@ -1105,4 +1092,12 @@ ia64_sn_bte_recovery(nasid_t nasid)
1105 return (int) rv.status; 1092 return (int) rv.status;
1106} 1093}
1107 1094
1095static inline int
1096ia64_sn_is_fake_prom(void)
1097{
1098 struct ia64_sal_retval rv;
1099 SAL_CALL_NOLOCK(rv, SN_SAL_FAKE_PROM, 0, 0, 0, 0, 0, 0, 0);
1100 return (rv.status == 0);
1101}
1102
1108#endif /* _ASM_IA64_SN_SN_SAL_H */ 1103#endif /* _ASM_IA64_SN_SN_SAL_H */
diff --git a/include/asm-ia64/sn/tioca_provider.h b/include/asm-ia64/sn/tioca_provider.h
index b6acc22ab239..5ccec608d325 100644
--- a/include/asm-ia64/sn/tioca_provider.h
+++ b/include/asm-ia64/sn/tioca_provider.h
@@ -201,6 +201,7 @@ tioca_tlbflush(struct tioca_kernel *tioca_kernel)
201} 201}
202 202
203extern uint32_t tioca_gart_found; 203extern uint32_t tioca_gart_found;
204extern struct list_head tioca_list;
204extern int tioca_init_provider(void); 205extern int tioca_init_provider(void);
205extern void tioca_fastwrite_enable(struct tioca_kernel *tioca_kern); 206extern void tioca_fastwrite_enable(struct tioca_kernel *tioca_kern);
206#endif /* _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H */ 207#endif /* _ASM_IA64_SN_TIO_CA_AGP_PROVIDER_H */
diff --git a/include/asm-ia64/sn/tiocp.h b/include/asm-ia64/sn/tiocp.h
new file mode 100644
index 000000000000..5f2489c9d2dd
--- /dev/null
+++ b/include/asm-ia64/sn/tiocp.h
@@ -0,0 +1,256 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_TIOCP_H
9#define _ASM_IA64_SN_PCI_TIOCP_H
10
11#define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL
12#define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60)
13
14
15/*****************************************************************************
16 *********************** TIOCP MMR structure mapping ***************************
17 *****************************************************************************/
18
19struct tiocp{
20
21 /* 0x000000-0x00FFFF -- Local Registers */
22
23 /* 0x000000-0x000057 -- (Legacy Widget Space) Configuration */
24 uint64_t cp_id; /* 0x000000 */
25 uint64_t cp_stat; /* 0x000008 */
26 uint64_t cp_err_upper; /* 0x000010 */
27 uint64_t cp_err_lower; /* 0x000018 */
28 #define cp_err cp_err_lower
29 uint64_t cp_control; /* 0x000020 */
30 uint64_t cp_req_timeout; /* 0x000028 */
31 uint64_t cp_intr_upper; /* 0x000030 */
32 uint64_t cp_intr_lower; /* 0x000038 */
33 #define cp_intr cp_intr_lower
34 uint64_t cp_err_cmdword; /* 0x000040 */
35 uint64_t _pad_000048; /* 0x000048 */
36 uint64_t cp_tflush; /* 0x000050 */
37
38 /* 0x000058-0x00007F -- Bridge-specific Configuration */
39 uint64_t cp_aux_err; /* 0x000058 */
40 uint64_t cp_resp_upper; /* 0x000060 */
41 uint64_t cp_resp_lower; /* 0x000068 */
42 #define cp_resp cp_resp_lower
43 uint64_t cp_tst_pin_ctrl; /* 0x000070 */
44 uint64_t cp_addr_lkerr; /* 0x000078 */
45
46 /* 0x000080-0x00008F -- PMU & MAP */
47 uint64_t cp_dir_map; /* 0x000080 */
48 uint64_t _pad_000088; /* 0x000088 */
49
50 /* 0x000090-0x00009F -- SSRAM */
51 uint64_t cp_map_fault; /* 0x000090 */
52 uint64_t _pad_000098; /* 0x000098 */
53
54 /* 0x0000A0-0x0000AF -- Arbitration */
55 uint64_t cp_arb; /* 0x0000A0 */
56 uint64_t _pad_0000A8; /* 0x0000A8 */
57
58 /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
59 uint64_t cp_ate_parity_err; /* 0x0000B0 */
60 uint64_t _pad_0000B8; /* 0x0000B8 */
61
62 /* 0x0000C0-0x0000FF -- PCI/GIO */
63 uint64_t cp_bus_timeout; /* 0x0000C0 */
64 uint64_t cp_pci_cfg; /* 0x0000C8 */
65 uint64_t cp_pci_err_upper; /* 0x0000D0 */
66 uint64_t cp_pci_err_lower; /* 0x0000D8 */
67 #define cp_pci_err cp_pci_err_lower
68 uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */
69
70 /* 0x000100-0x0001FF -- Interrupt */
71 uint64_t cp_int_status; /* 0x000100 */
72 uint64_t cp_int_enable; /* 0x000108 */
73 uint64_t cp_int_rst_stat; /* 0x000110 */
74 uint64_t cp_int_mode; /* 0x000118 */
75 uint64_t cp_int_device; /* 0x000120 */
76 uint64_t cp_int_host_err; /* 0x000128 */
77 uint64_t cp_int_addr[8]; /* 0x0001{30,,,68} */
78 uint64_t cp_err_int_view; /* 0x000170 */
79 uint64_t cp_mult_int; /* 0x000178 */
80 uint64_t cp_force_always[8]; /* 0x0001{80,,,B8} */
81 uint64_t cp_force_pin[8]; /* 0x0001{C0,,,F8} */
82
83 /* 0x000200-0x000298 -- Device */
84 uint64_t cp_device[4]; /* 0x0002{00,,,18} */
85 uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */
86 uint64_t cp_wr_req_buf[4]; /* 0x0002{40,,,58} */
87 uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */
88 uint64_t cp_rrb_map[2]; /* 0x0002{80,,,88} */
89 #define cp_even_resp cp_rrb_map[0] /* 0x000280 */
90 #define cp_odd_resp cp_rrb_map[1] /* 0x000288 */
91 uint64_t cp_resp_status; /* 0x000290 */
92 uint64_t cp_resp_clear; /* 0x000298 */
93
94 uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */
95
96 /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
97 struct {
98 uint64_t upper; /* 0x0003{00,,,F0} */
99 uint64_t lower; /* 0x0003{08,,,F8} */
100 } cp_buf_addr_match[16];
101
102 /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
103 struct {
104 uint64_t flush_w_touch; /* 0x000{400,,,5C0} */
105 uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */
106 uint64_t inflight; /* 0x000{410,,,5D0} */
107 uint64_t prefetch; /* 0x000{418,,,5D8} */
108 uint64_t total_pci_retry; /* 0x000{420,,,5E0} */
109 uint64_t max_pci_retry; /* 0x000{428,,,5E8} */
110 uint64_t max_latency; /* 0x000{430,,,5F0} */
111 uint64_t clear_all; /* 0x000{438,,,5F8} */
112 } cp_buf_count[8];
113
114
115 /* 0x000600-0x0009FF -- PCI/X registers */
116 uint64_t cp_pcix_bus_err_addr; /* 0x000600 */
117 uint64_t cp_pcix_bus_err_attr; /* 0x000608 */
118 uint64_t cp_pcix_bus_err_data; /* 0x000610 */
119 uint64_t cp_pcix_pio_split_addr; /* 0x000618 */
120 uint64_t cp_pcix_pio_split_attr; /* 0x000620 */
121 uint64_t cp_pcix_dma_req_err_attr; /* 0x000628 */
122 uint64_t cp_pcix_dma_req_err_addr; /* 0x000630 */
123 uint64_t cp_pcix_timeout; /* 0x000638 */
124
125 uint64_t _pad_000640[24]; /* 0x000{640,,,6F8} */
126
127 /* 0x000700-0x000737 -- Debug Registers */
128 uint64_t cp_ct_debug_ctl; /* 0x000700 */
129 uint64_t cp_br_debug_ctl; /* 0x000708 */
130 uint64_t cp_mux3_debug_ctl; /* 0x000710 */
131 uint64_t cp_mux4_debug_ctl; /* 0x000718 */
132 uint64_t cp_mux5_debug_ctl; /* 0x000720 */
133 uint64_t cp_mux6_debug_ctl; /* 0x000728 */
134 uint64_t cp_mux7_debug_ctl; /* 0x000730 */
135
136 uint64_t _pad_000738[89]; /* 0x000{738,,,9F8} */
137
138 /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
139 struct {
140 uint64_t cp_buf_addr; /* 0x000{A00,,,AF0} */
141 uint64_t cp_buf_attr; /* 0X000{A08,,,AF8} */
142 } cp_pcix_read_buf_64[16];
143
144 struct {
145 uint64_t cp_buf_addr; /* 0x000{B00,,,BE0} */
146 uint64_t cp_buf_attr; /* 0x000{B08,,,BE8} */
147 uint64_t cp_buf_valid; /* 0x000{B10,,,BF0} */
148 uint64_t __pad1; /* 0x000{B18,,,BF8} */
149 } cp_pcix_write_buf_64[8];
150
151 /* End of Local Registers -- Start of Address Map space */
152
153 char _pad_000c00[0x010000 - 0x000c00];
154
155 /* 0x010000-0x011FF8 -- Internal ATE RAM (Auto Parity Generation) */
156 uint64_t cp_int_ate_ram[1024]; /* 0x010000-0x011FF8 */
157
158 char _pad_012000[0x14000 - 0x012000];
159
160 /* 0x014000-0x015FF8 -- Internal ATE RAM (Manual Parity Generation) */
161 uint64_t cp_int_ate_ram_mp[1024]; /* 0x014000-0x015FF8 */
162
163 char _pad_016000[0x18000 - 0x016000];
164
165 /* 0x18000-0x197F8 -- TIOCP Write Request Ram */
166 uint64_t cp_wr_req_lower[256]; /* 0x18000 - 0x187F8 */
167 uint64_t cp_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */
168 uint64_t cp_wr_req_parity[256]; /* 0x19000 - 0x197F8 */
169
170 char _pad_019800[0x1C000 - 0x019800];
171
172 /* 0x1C000-0x1EFF8 -- TIOCP Read Response Ram */
173 uint64_t cp_rd_resp_lower[512]; /* 0x1C000 - 0x1CFF8 */
174 uint64_t cp_rd_resp_upper[512]; /* 0x1D000 - 0x1DFF8 */
175 uint64_t cp_rd_resp_parity[512]; /* 0x1E000 - 0x1EFF8 */
176
177 char _pad_01F000[0x20000 - 0x01F000];
178
179 /* 0x020000-0x021FFF -- Host Device (CP) Configuration Space (not used) */
180 char _pad_020000[0x021000 - 0x20000];
181
182 /* 0x021000-0x027FFF -- PCI Device Configuration Spaces */
183 union {
184 uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
185 uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
186 uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
187 uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
188 union {
189 uint8_t c[0x100 / 1];
190 uint16_t s[0x100 / 2];
191 uint32_t l[0x100 / 4];
192 uint64_t d[0x100 / 8];
193 } f[8];
194 } cp_type0_cfg_dev[7]; /* 0x02{1000,,,7FFF} */
195
196 /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
197 union {
198 uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */
199 uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */
200 uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */
201 uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */
202 union {
203 uint8_t c[0x100 / 1];
204 uint16_t s[0x100 / 2];
205 uint32_t l[0x100 / 4];
206 uint64_t d[0x100 / 8];
207 } f[8];
208 } cp_type1_cfg; /* 0x028000-0x029000 */
209
210 char _pad_029000[0x030000-0x029000];
211
212 /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
213 union {
214 uint8_t c[8 / 1];
215 uint16_t s[8 / 2];
216 uint32_t l[8 / 4];
217 uint64_t d[8 / 8];
218 } cp_pci_iack; /* 0x030000-0x030007 */
219
220 char _pad_030007[0x040000-0x030008];
221
222 /* 0x040000-0x040007 -- PCIX Special Cycle */
223 union {
224 uint8_t c[8 / 1];
225 uint16_t s[8 / 2];
226 uint32_t l[8 / 4];
227 uint64_t d[8 / 8];
228 } cp_pcix_cycle; /* 0x040000-0x040007 */
229
230 char _pad_040007[0x200000-0x040008];
231
232 /* 0x200000-0x7FFFFF -- PCI/GIO Device Spaces */
233 union {
234 uint8_t c[0x100000 / 1];
235 uint16_t s[0x100000 / 2];
236 uint32_t l[0x100000 / 4];
237 uint64_t d[0x100000 / 8];
238 } cp_devio_raw[6]; /* 0x200000-0x7FFFFF */
239
240 #define cp_devio(n) cp_devio_raw[((n)<2)?(n*2):(n+2)]
241
242 char _pad_800000[0xA00000-0x800000];
243
244 /* 0xA00000-0xBFFFFF -- PCI/GIO Device Spaces w/flush */
245 union {
246 uint8_t c[0x100000 / 1];
247 uint16_t s[0x100000 / 2];
248 uint32_t l[0x100000 / 4];
249 uint64_t d[0x100000 / 8];
250 } cp_devio_raw_flush[6]; /* 0xA00000-0xBFFFFF */
251
252 #define cp_devio_flush(n) cp_devio_raw_flush[((n)<2)?(n*2):(n+2)]
253
254};
255
256#endif /* _ASM_IA64_SN_PCI_TIOCP_H */
diff --git a/include/asm-ia64/sn/xp.h b/include/asm-ia64/sn/xp.h
index 9902185c0288..1df1c9f61a65 100644
--- a/include/asm-ia64/sn/xp.h
+++ b/include/asm-ia64/sn/xp.h
@@ -16,7 +16,6 @@
16#define _ASM_IA64_SN_XP_H 16#define _ASM_IA64_SN_XP_H
17 17
18 18
19#include <linux/version.h>
20#include <linux/cache.h> 19#include <linux/cache.h>
21#include <linux/hardirq.h> 20#include <linux/hardirq.h>
22#include <asm/sn/types.h> 21#include <asm/sn/types.h>
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h
index 6f516e76d1f0..cd2cf76b2db1 100644
--- a/include/asm-ia64/system.h
+++ b/include/asm-ia64/system.h
@@ -183,8 +183,6 @@ do { \
183 183
184#ifdef __KERNEL__ 184#ifdef __KERNEL__
185 185
186#define prepare_to_switch() do { } while(0)
187
188#ifdef CONFIG_IA32_SUPPORT 186#ifdef CONFIG_IA32_SUPPORT
189# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0) 187# define IS_IA32_PROCESS(regs) (ia64_psr(regs)->is != 0)
190#else 188#else
@@ -274,13 +272,7 @@ extern void ia64_load_extra (struct task_struct *task);
274 * of that CPU which will not be released, because there we wait for the 272 * of that CPU which will not be released, because there we wait for the
275 * tasklist_lock to become available. 273 * tasklist_lock to become available.
276 */ 274 */
277#define prepare_arch_switch(rq, next) \ 275#define __ARCH_WANT_UNLOCKED_CTXSW
278do { \
279 spin_lock(&(next)->switch_lock); \
280 spin_unlock(&(rq)->lock); \
281} while (0)
282#define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock)
283#define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
284 276
285#define ia64_platform_is(x) (strcmp(x, platform_name) == 0) 277#define ia64_platform_is(x) (strcmp(x, platform_name) == 0)
286 278
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h
index 8d5b7e77028c..7dc8951708a3 100644
--- a/include/asm-ia64/thread_info.h
+++ b/include/asm-ia64/thread_info.h
@@ -25,7 +25,7 @@ struct thread_info {
25 __u32 flags; /* thread_info flags (see TIF_*) */ 25 __u32 flags; /* thread_info flags (see TIF_*) */
26 __u32 cpu; /* current CPU */ 26 __u32 cpu; /* current CPU */
27 mm_segment_t addr_limit; /* user-level address space limit */ 27 mm_segment_t addr_limit; /* user-level address space limit */
28 __s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ 28 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
29 struct restart_block restart_block; 29 struct restart_block restart_block;
30 struct { 30 struct {
31 int signo; 31 int signo;
diff --git a/include/asm-ia64/topology.h b/include/asm-ia64/topology.h
index 21cf351fd05c..399bc29729fd 100644
--- a/include/asm-ia64/topology.h
+++ b/include/asm-ia64/topology.h
@@ -40,27 +40,61 @@
40 */ 40 */
41#define node_to_first_cpu(node) (__ffs(node_to_cpumask(node))) 41#define node_to_first_cpu(node) (__ffs(node_to_cpumask(node)))
42 42
43/*
44 * Determines the node for a given pci bus
45 */
46#define pcibus_to_node(bus) PCI_CONTROLLER(bus)->node
47
43void build_cpu_to_node_map(void); 48void build_cpu_to_node_map(void);
44 49
50#define SD_CPU_INIT (struct sched_domain) { \
51 .span = CPU_MASK_NONE, \
52 .parent = NULL, \
53 .groups = NULL, \
54 .min_interval = 1, \
55 .max_interval = 4, \
56 .busy_factor = 64, \
57 .imbalance_pct = 125, \
58 .cache_hot_time = (10*1000000), \
59 .per_cpu_gain = 100, \
60 .cache_nice_tries = 2, \
61 .busy_idx = 2, \
62 .idle_idx = 1, \
63 .newidle_idx = 2, \
64 .wake_idx = 1, \
65 .forkexec_idx = 1, \
66 .flags = SD_LOAD_BALANCE \
67 | SD_BALANCE_NEWIDLE \
68 | SD_BALANCE_EXEC \
69 | SD_WAKE_AFFINE, \
70 .last_balance = jiffies, \
71 .balance_interval = 1, \
72 .nr_balance_failed = 0, \
73}
74
45/* sched_domains SD_NODE_INIT for IA64 NUMA machines */ 75/* sched_domains SD_NODE_INIT for IA64 NUMA machines */
46#define SD_NODE_INIT (struct sched_domain) { \ 76#define SD_NODE_INIT (struct sched_domain) { \
47 .span = CPU_MASK_NONE, \ 77 .span = CPU_MASK_NONE, \
48 .parent = NULL, \ 78 .parent = NULL, \
49 .groups = NULL, \ 79 .groups = NULL, \
50 .min_interval = 80, \ 80 .min_interval = 8, \
51 .max_interval = 320, \ 81 .max_interval = 8*(min(num_online_cpus(), 32)), \
52 .busy_factor = 320, \ 82 .busy_factor = 64, \
53 .imbalance_pct = 125, \ 83 .imbalance_pct = 125, \
54 .cache_hot_time = (10*1000000), \ 84 .cache_hot_time = (10*1000000), \
55 .cache_nice_tries = 1, \ 85 .cache_nice_tries = 2, \
86 .busy_idx = 3, \
87 .idle_idx = 2, \
88 .newidle_idx = 0, /* unused */ \
89 .wake_idx = 1, \
90 .forkexec_idx = 1, \
56 .per_cpu_gain = 100, \ 91 .per_cpu_gain = 100, \
57 .flags = SD_LOAD_BALANCE \ 92 .flags = SD_LOAD_BALANCE \
58 | SD_BALANCE_EXEC \ 93 | SD_BALANCE_EXEC \
59 | SD_BALANCE_NEWIDLE \ 94 | SD_BALANCE_FORK \
60 | SD_WAKE_IDLE \
61 | SD_WAKE_BALANCE, \ 95 | SD_WAKE_BALANCE, \
62 .last_balance = jiffies, \ 96 .last_balance = jiffies, \
63 .balance_interval = 1, \ 97 .balance_interval = 64, \
64 .nr_balance_failed = 0, \ 98 .nr_balance_failed = 0, \
65} 99}
66 100
@@ -69,17 +103,21 @@ void build_cpu_to_node_map(void);
69 .span = CPU_MASK_NONE, \ 103 .span = CPU_MASK_NONE, \
70 .parent = NULL, \ 104 .parent = NULL, \
71 .groups = NULL, \ 105 .groups = NULL, \
72 .min_interval = 80, \ 106 .min_interval = 64, \
73 .max_interval = 320, \ 107 .max_interval = 64*num_online_cpus(), \
74 .busy_factor = 320, \ 108 .busy_factor = 128, \
75 .imbalance_pct = 125, \ 109 .imbalance_pct = 133, \
76 .cache_hot_time = (10*1000000), \ 110 .cache_hot_time = (10*1000000), \
77 .cache_nice_tries = 1, \ 111 .cache_nice_tries = 1, \
112 .busy_idx = 3, \
113 .idle_idx = 3, \
114 .newidle_idx = 0, /* unused */ \
115 .wake_idx = 0, /* unused */ \
116 .forkexec_idx = 0, /* unused */ \
78 .per_cpu_gain = 100, \ 117 .per_cpu_gain = 100, \
79 .flags = SD_LOAD_BALANCE \ 118 .flags = SD_LOAD_BALANCE, \
80 | SD_BALANCE_EXEC, \
81 .last_balance = jiffies, \ 119 .last_balance = jiffies, \
82 .balance_interval = 100*(63+num_online_cpus())/64, \ 120 .balance_interval = 64, \
83 .nr_balance_failed = 0, \ 121 .nr_balance_failed = 0, \
84} 122}
85 123
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index f7f43ec2483a..3a0c69524656 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -263,7 +263,12 @@
263#define __NR_add_key 1271 263#define __NR_add_key 1271
264#define __NR_request_key 1272 264#define __NR_request_key 1272
265#define __NR_keyctl 1273 265#define __NR_keyctl 1273
266#define __NR_ioprio_set 1274
267#define __NR_ioprio_get 1275
266#define __NR_set_zone_reclaim 1276 268#define __NR_set_zone_reclaim 1276
269#define __NR_inotify_init 1277
270#define __NR_inotify_add_watch 1278
271#define __NR_inotify_rm_watch 1279
267 272
268#ifdef __KERNEL__ 273#ifdef __KERNEL__
269 274
diff --git a/include/asm-ia64/vga.h b/include/asm-ia64/vga.h
index 1f446d6841f6..bc3349ffc505 100644
--- a/include/asm-ia64/vga.h
+++ b/include/asm-ia64/vga.h
@@ -14,7 +14,10 @@
14 * videoram directly without any black magic. 14 * videoram directly without any black magic.
15 */ 15 */
16 16
17#define VGA_MAP_MEM(x) ((unsigned long) ioremap((x), 0)) 17extern unsigned long vga_console_iobase;
18extern unsigned long vga_console_membase;
19
20#define VGA_MAP_MEM(x) ((unsigned long) ioremap(vga_console_membase + (x), 0))
18 21
19#define vga_readb(x) (*(x)) 22#define vga_readb(x) (*(x))
20#define vga_writeb(x,y) (*(y) = (x)) 23#define vga_writeb(x,y) (*(y) = (x))
diff --git a/include/asm-m32r/emergency-restart.h b/include/asm-m32r/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-m32r/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-m32r/mmzone.h b/include/asm-m32r/mmzone.h
index ebf0228fec42..d58878ec899e 100644
--- a/include/asm-m32r/mmzone.h
+++ b/include/asm-m32r/mmzone.h
@@ -14,7 +14,6 @@ extern struct pglist_data *node_data[];
14#define NODE_DATA(nid) (node_data[nid]) 14#define NODE_DATA(nid) (node_data[nid])
15 15
16#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) 16#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
17#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
18#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 17#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
19#define node_end_pfn(nid) \ 18#define node_end_pfn(nid) \
20({ \ 19({ \
@@ -32,7 +31,7 @@ extern struct pglist_data *node_data[];
32({ \ 31({ \
33 unsigned long __pfn = pfn; \ 32 unsigned long __pfn = pfn; \
34 int __node = pfn_to_nid(__pfn); \ 33 int __node = pfn_to_nid(__pfn); \
35 &node_mem_map(__node)[node_localnr(__pfn,__node)]; \ 34 &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)]; \
36}) 35})
37 36
38#define page_to_pfn(pg) \ 37#define page_to_pfn(pg) \
diff --git a/include/asm-m32r/s1d13806.h b/include/asm-m32r/s1d13806.h
new file mode 100644
index 000000000000..248d36a82d79
--- /dev/null
+++ b/include/asm-m32r/s1d13806.h
@@ -0,0 +1,199 @@
1//----------------------------------------------------------------------------
2//
3// File generated by S1D13806CFG.EXE
4//
5// Copyright (c) 2000,2001 Epson Research and Development, Inc.
6// All rights reserved.
7//
8//----------------------------------------------------------------------------
9
10// Panel: (active) 640x480 77Hz STN Single 8-bit (PCLK=CLKI=25.175MHz)
11// Memory: Embedded SDRAM (MCLK=CLKI3=50.000MHz) (BUSCLK=33.333MHz)
12
13#define SWIVEL_VIEW 0 /* 0:none, 1:90 not completed */
14
15static struct s1d13xxxfb_regval s1d13xxxfb_initregs[] = {
16
17 {0x0001,0x00}, // Miscellaneous Register
18 {0x01FC,0x00}, // Display Mode Register
19#if defined(CONFIG_PLAT_MAPPI)
20 {0x0004,0x00}, // General IO Pins Configuration Register 0
21 {0x0005,0x00}, // General IO Pins Configuration Register 1
22 {0x0008,0x00}, // General IO Pins Control Register 0
23 {0x0009,0x00}, // General IO Pins Control Register 1
24 {0x0010,0x00}, // Memory Clock Configuration Register
25 {0x0014,0x00}, // LCD Pixel Clock Configuration Register
26 {0x0018,0x00}, // CRT/TV Pixel Clock Configuration Register
27 {0x001C,0x00}, // MediaPlug Clock Configuration Register
28/*
29 * .. 10MHz: 0x00
30 * .. 30MHz: 0x01
31 * 30MHz ..: 0x02
32 */
33 {0x001E,0x02}, // CPU To Memory Wait State Select Register
34 {0x0021,0x02}, // DRAM Refresh Rate Register
35 {0x002A,0x11}, // DRAM Timings Control Register 0
36 {0x002B,0x13}, // DRAM Timings Control Register 1
37 {0x0020,0x80}, // Memory Configuration Register
38 {0x0030,0x25}, // Panel Type Register
39 {0x0031,0x00}, // MOD Rate Register
40 {0x0032,0x4F}, // LCD Horizontal Display Width Register
41 {0x0034,0x12}, // LCD Horizontal Non-Display Period Register
42 {0x0035,0x01}, // TFT FPLINE Start Position Register
43 {0x0036,0x0B}, // TFT FPLINE Pulse Width Register
44 {0x0038,0xDF}, // LCD Vertical Display Height Register 0
45 {0x0039,0x01}, // LCD Vertical Display Height Register 1
46 {0x003A,0x2C}, // LCD Vertical Non-Display Period Register
47 {0x003B,0x0A}, // TFT FPFRAME Start Position Register
48 {0x003C,0x01}, // TFT FPFRAME Pulse Width Register
49
50 {0x0041,0x00}, // LCD Miscellaneous Register
51 {0x0042,0x00}, // LCD Display Start Address Register 0
52 {0x0043,0x00}, // LCD Display Start Address Register 1
53 {0x0044,0x00}, // LCD Display Start Address Register 2
54
55#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3)
56 {0x0004,0x07}, // GPIO[0:7] direction
57 {0x0005,0x00}, // GPIO[8:12] direction
58 {0x0008,0x00}, // GPIO[0:7] data
59 {0x0009,0x00}, // GPIO[8:12] data
60 {0x0008,0x04}, // LCD panel Vcc on
61 {0x0008,0x05}, // LCD panel reset
62 {0x0010,0x01}, // Memory Clock Configuration Register
63 {0x0014,0x30}, // LCD Pixel Clock Configuration Register (CLKI 22MHz/4)
64 {0x0018,0x00}, // CRT/TV Pixel Clock Configuration Register
65 {0x001C,0x00}, // MediaPlug Clock Configuration Register(10MHz)
66 {0x001E,0x00}, // CPU To Memory Wait State Select Register
67 {0x0020,0x80}, // Memory Configuration Register
68 {0x0021,0x03}, // DRAM Refresh Rate Register
69 {0x002A,0x00}, // DRAM Timings Control Register 0
70 {0x002B,0x01}, // DRAM Timings Control Register 1
71 {0x0030,0x25}, // Panel Type Register
72 {0x0031,0x00}, // MOD Rate Register
73 {0x0032,0x1d}, // LCD Horizontal Display Width Register
74 {0x0034,0x05}, // LCD Horizontal Non-Display Period Register
75 {0x0035,0x01}, // TFT FPLINE Start Position Register
76 {0x0036,0x01}, // TFT FPLINE Pulse Width Register
77 {0x0038,0x3F}, // LCD Vertical Display Height Register 0
78 {0x0039,0x01}, // LCD Vertical Display Height Register 1
79 {0x003A,0x0b}, // LCD Vertical Non-Display Period Register
80 {0x003B,0x07}, // TFT FPFRAME Start Position Register
81 {0x003C,0x02}, // TFT FPFRAME Pulse Width Register
82
83 {0x0041,0x00}, // LCD Miscellaneous Register
84#if (SWIVEL_VIEW == 0)
85 {0x0042,0x00}, // LCD Display Start Address Register 0
86 {0x0043,0x00}, // LCD Display Start Address Register 1
87 {0x0044,0x00}, // LCD Display Start Address Register 2
88
89#elif (SWIVEL_VIEW == 1)
90 // 1024 - W(320) = 0x2C0
91 {0x0042,0xC0}, // LCD Display Start Address Register 0
92 {0x0043,0x02}, // LCD Display Start Address Register 1
93 {0x0044,0x00}, // LCD Display Start Address Register 2
94 // 1024
95 {0x0046,0x00}, // LCD Memory Address Offset Register 0
96 {0x0047,0x02}, // LCD Memory Address Offset Register 1
97#else
98#error unsupported SWIVEL_VIEW mode
99#endif
100#else
101#error no platform configuration
102#endif /* CONFIG_PLAT_XXX */
103
104 {0x0048,0x00}, // LCD Pixel Panning Register
105 {0x004A,0x00}, // LCD Display FIFO High Threshold Control Register
106 {0x004B,0x00}, // LCD Display FIFO Low Threshold Control Register
107 {0x0050,0x4F}, // CRT/TV Horizontal Display Width Register
108 {0x0052,0x13}, // CRT/TV Horizontal Non-Display Period Register
109 {0x0053,0x01}, // CRT/TV HRTC Start Position Register
110 {0x0054,0x0B}, // CRT/TV HRTC Pulse Width Register
111 {0x0056,0xDF}, // CRT/TV Vertical Display Height Register 0
112 {0x0057,0x01}, // CRT/TV Vertical Display Height Register 1
113 {0x0058,0x2B}, // CRT/TV Vertical Non-Display Period Register
114 {0x0059,0x09}, // CRT/TV VRTC Start Position Register
115 {0x005A,0x01}, // CRT/TV VRTC Pulse Width Register
116 {0x005B,0x10}, // TV Output Control Register
117
118 {0x0062,0x00}, // CRT/TV Display Start Address Register 0
119 {0x0063,0x00}, // CRT/TV Display Start Address Register 1
120 {0x0064,0x00}, // CRT/TV Display Start Address Register 2
121
122 {0x0068,0x00}, // CRT/TV Pixel Panning Register
123 {0x006A,0x00}, // CRT/TV Display FIFO High Threshold Control Register
124 {0x006B,0x00}, // CRT/TV Display FIFO Low Threshold Control Register
125 {0x0070,0x00}, // LCD Ink/Cursor Control Register
126 {0x0071,0x01}, // LCD Ink/Cursor Start Address Register
127 {0x0072,0x00}, // LCD Cursor X Position Register 0
128 {0x0073,0x00}, // LCD Cursor X Position Register 1
129 {0x0074,0x00}, // LCD Cursor Y Position Register 0
130 {0x0075,0x00}, // LCD Cursor Y Position Register 1
131 {0x0076,0x00}, // LCD Ink/Cursor Blue Color 0 Register
132 {0x0077,0x00}, // LCD Ink/Cursor Green Color 0 Register
133 {0x0078,0x00}, // LCD Ink/Cursor Red Color 0 Register
134 {0x007A,0x1F}, // LCD Ink/Cursor Blue Color 1 Register
135 {0x007B,0x3F}, // LCD Ink/Cursor Green Color 1 Register
136 {0x007C,0x1F}, // LCD Ink/Cursor Red Color 1 Register
137 {0x007E,0x00}, // LCD Ink/Cursor FIFO Threshold Register
138 {0x0080,0x00}, // CRT/TV Ink/Cursor Control Register
139 {0x0081,0x01}, // CRT/TV Ink/Cursor Start Address Register
140 {0x0082,0x00}, // CRT/TV Cursor X Position Register 0
141 {0x0083,0x00}, // CRT/TV Cursor X Position Register 1
142 {0x0084,0x00}, // CRT/TV Cursor Y Position Register 0
143 {0x0085,0x00}, // CRT/TV Cursor Y Position Register 1
144 {0x0086,0x00}, // CRT/TV Ink/Cursor Blue Color 0 Register
145 {0x0087,0x00}, // CRT/TV Ink/Cursor Green Color 0 Register
146 {0x0088,0x00}, // CRT/TV Ink/Cursor Red Color 0 Register
147 {0x008A,0x1F}, // CRT/TV Ink/Cursor Blue Color 1 Register
148 {0x008B,0x3F}, // CRT/TV Ink/Cursor Green Color 1 Register
149 {0x008C,0x1F}, // CRT/TV Ink/Cursor Red Color 1 Register
150 {0x008E,0x00}, // CRT/TV Ink/Cursor FIFO Threshold Register
151 {0x0100,0x00}, // BitBlt Control Register 0
152 {0x0101,0x00}, // BitBlt Control Register 1
153 {0x0102,0x00}, // BitBlt ROP Code/Color Expansion Register
154 {0x0103,0x00}, // BitBlt Operation Register
155 {0x0104,0x00}, // BitBlt Source Start Address Register 0
156 {0x0105,0x00}, // BitBlt Source Start Address Register 1
157 {0x0106,0x00}, // BitBlt Source Start Address Register 2
158 {0x0108,0x00}, // BitBlt Destination Start Address Register 0
159 {0x0109,0x00}, // BitBlt Destination Start Address Register 1
160 {0x010A,0x00}, // BitBlt Destination Start Address Register 2
161 {0x010C,0x00}, // BitBlt Memory Address Offset Register 0
162 {0x010D,0x00}, // BitBlt Memory Address Offset Register 1
163 {0x0110,0x00}, // BitBlt Width Register 0
164 {0x0111,0x00}, // BitBlt Width Register 1
165 {0x0112,0x00}, // BitBlt Height Register 0
166 {0x0113,0x00}, // BitBlt Height Register 1
167 {0x0114,0x00}, // BitBlt Background Color Register 0
168 {0x0115,0x00}, // BitBlt Background Color Register 1
169 {0x0118,0x00}, // BitBlt Foreground Color Register 0
170 {0x0119,0x00}, // BitBlt Foreground Color Register 1
171 {0x01E0,0x00}, // Look-Up Table Mode Register
172 {0x01E2,0x00}, // Look-Up Table Address Register
173 {0x01F0,0x10}, // Power Save Configuration Register
174 {0x01F1,0x00}, // Power Save Status Register
175 {0x01F4,0x00}, // CPU-to-Memory Access Watchdog Timer Register
176#if (SWIVEL_VIEW == 0)
177 {0x01FC,0x01}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT)
178#elif (SWIVEL_VIEW == 1)
179 {0x01FC,0x41}, // Display Mode Register(0x01:LCD, 0x02:CRT, 0x03:LCD&CRT)
180#else
181#error unsupported SWIVEL_VIEW mode
182#endif /* SWIVEL_VIEW */
183
184#if defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3)
185 {0x0008,0x07}, // LCD panel Vdd & Vg on
186#endif
187
188 {0x0040,0x05}, // LCD Display Mode Register (2:4bpp,3:8bpp,5:16bpp)
189#if defined(CONFIG_PLAT_MAPPI)
190 {0x0046,0x80}, // LCD Memory Address Offset Register 0
191 {0x0047,0x02}, // LCD Memory Address Offset Register 1
192#elif defined(CONFIG_PLAT_M32700UT) || defined(CONFIG_PLAT_OPSPUT) || defined(CONFIG_PLAT_MAPPI3)
193 {0x0046,0xf0}, // LCD Memory Address Offset Register 0
194 {0x0047,0x00}, // LCD Memory Address Offset Register 1
195#endif
196 {0x0060,0x05}, // CRT/TV Display Mode Register (2:4bpp,3:8bpp,5:16bpp)
197 {0x0066,0x80}, // CRT/TV Memory Address Offset Register 0 // takeo
198 {0x0067,0x02}, // CRT/TV Memory Address Offset Register 1
199};
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h
index b9a20cdad65f..7885b7df84a2 100644
--- a/include/asm-m32r/smp.h
+++ b/include/asm-m32r/smp.h
@@ -61,9 +61,7 @@ extern physid_mask_t phys_cpu_present_map;
61 * Some lowlevel functions might want to know about 61 * Some lowlevel functions might want to know about
62 * the real CPU ID <-> CPU # mapping. 62 * the real CPU ID <-> CPU # mapping.
63 */ 63 */
64extern volatile int physid_2_cpu[NR_CPUS];
65extern volatile int cpu_2_physid[NR_CPUS]; 64extern volatile int cpu_2_physid[NR_CPUS];
66#define physid_to_cpu(physid) physid_2_cpu[physid]
67#define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] 65#define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id]
68 66
69#define raw_smp_processor_id() (current_thread_info()->cpu) 67#define raw_smp_processor_id() (current_thread_info()->cpu)
diff --git a/include/asm-m32r/thread_info.h b/include/asm-m32r/thread_info.h
index 9f3a0fcf6e2b..7a6be7727a92 100644
--- a/include/asm-m32r/thread_info.h
+++ b/include/asm-m32r/thread_info.h
@@ -28,7 +28,7 @@ struct thread_info {
28 unsigned long flags; /* low level flags */ 28 unsigned long flags; /* low level flags */
29 unsigned long status; /* thread-synchronous flags */ 29 unsigned long status; /* thread-synchronous flags */
30 __u32 cpu; /* current CPU */ 30 __u32 cpu; /* current CPU */
31 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 31 int preempt_count; /* 0 => preemptable, <0 => BUG */
32 32
33 mm_segment_t addr_limit; /* thread address space: 33 mm_segment_t addr_limit; /* thread address space:
34 0-0xBFFFFFFF for user-thread 34 0-0xBFFFFFFF for user-thread
diff --git a/include/asm-m32r/topology.h b/include/asm-m32r/topology.h
index 299a89d91bde..d607eb32bd7e 100644
--- a/include/asm-m32r/topology.h
+++ b/include/asm-m32r/topology.h
@@ -1,48 +1,6 @@
1/*
2 * linux/include/asm-generic/topology.h
3 *
4 * Written by: Matthew Dobson, IBM Corporation
5 *
6 * Copyright (C) 2002, IBM Corp.
7 *
8 * All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
18 * NON INFRINGEMENT. See the GNU General Public License for more
19 * details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Send feedback to <colpatch@us.ibm.com>
26 */
27#ifndef _ASM_M32R_TOPOLOGY_H 1#ifndef _ASM_M32R_TOPOLOGY_H
28#define _ASM_M32R_TOPOLOGY_H 2#define _ASM_M32R_TOPOLOGY_H
29 3
30/* Other architectures wishing to use this simple topology API should fill 4#include <asm-generic/topology.h>
31 in the below functions as appropriate in their own <asm/topology.h> file. */
32
33#define cpu_to_node(cpu) (0)
34
35#ifndef parent_node
36#define parent_node(node) (0)
37#endif
38#ifndef node_to_cpumask
39#define node_to_cpumask(node) (cpu_online_map)
40#endif
41#ifndef node_to_first_cpu
42#define node_to_first_cpu(node) (0)
43#endif
44#ifndef pcibus_to_cpumask
45#define pcibus_to_cpumask(bus) (cpu_online_map)
46#endif
47 5
48#endif /* _ASM_M32R_TOPOLOGY_H */ 6#endif /* _ASM_M32R_TOPOLOGY_H */
diff --git a/include/asm-m68k/emergency-restart.h b/include/asm-m68k/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-m68k/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index 99a516709210..206313e2a817 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -138,13 +138,13 @@ extern unsigned long m68k_memoffset;
138#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) 138#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset)
139#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) 139#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset))
140#else 140#else
141#define __pa(vaddr) virt_to_phys((void *)vaddr) 141#define __pa(vaddr) virt_to_phys((void *)(vaddr))
142#define __va(paddr) phys_to_virt((unsigned long)paddr) 142#define __va(paddr) phys_to_virt((unsigned long)(paddr))
143#endif 143#endif
144 144
145#else /* !CONFIG_SUN3 */ 145#else /* !CONFIG_SUN3 */
146/* This #define is a horrible hack to suppress lots of warnings. --m */ 146/* This #define is a horrible hack to suppress lots of warnings. --m */
147#define __pa(x) ___pa((unsigned long)x) 147#define __pa(x) ___pa((unsigned long)(x))
148static inline unsigned long ___pa(unsigned long x) 148static inline unsigned long ___pa(unsigned long x)
149{ 149{
150 if(x == 0) 150 if(x == 0)
diff --git a/include/asm-m68k/pci.h b/include/asm-m68k/pci.h
index 9e7d79ab5d13..9d2c07abe44f 100644
--- a/include/asm-m68k/pci.h
+++ b/include/asm-m68k/pci.h
@@ -43,7 +43,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
43 /* No special bus mastering setup handling */ 43 /* No special bus mastering setup handling */
44} 44}
45 45
46static inline void pcibios_penalize_isa_irq(int irq) 46static inline void pcibios_penalize_isa_irq(int irq, int active)
47{ 47{
48 /* We don't do dynamic PCI IRQ allocation */ 48 /* We don't do dynamic PCI IRQ allocation */
49} 49}
diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h
index 9f5bcdc105fc..3fe29f8b0194 100644
--- a/include/asm-m68k/serial.h
+++ b/include/asm-m68k/serial.h
@@ -26,54 +26,9 @@
26#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 26#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
27#endif 27#endif
28 28
29#ifdef CONFIG_SERIAL_MANY_PORTS 29#define SERIAL_PORT_DFNS \
30#define FOURPORT_FLAGS ASYNC_FOURPORT
31#define ACCENT_FLAGS 0
32#define BOCA_FLAGS 0
33#endif
34
35#define STD_SERIAL_PORT_DEFNS \
36 /* UART CLK PORT IRQ FLAGS */ \ 30 /* UART CLK PORT IRQ FLAGS */ \
37 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 31 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
38 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 32 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
39 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 33 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
40 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 34 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
41
42
43#ifdef CONFIG_SERIAL_MANY_PORTS
44#define EXTRA_SERIAL_PORT_DEFNS \
45 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
46 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
47 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
48 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
49 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
50 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
51 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
52 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
53 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
54 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
55 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
56 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
57 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
58 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
59 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
60 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
61 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
62 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
63 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
64 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
65 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
66 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
67 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
68 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
69 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
70 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
71 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
72 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
73#else
74#define EXTRA_SERIAL_PORT_DEFNS
75#endif
76
77#define SERIAL_PORT_DFNS \
78 STD_SERIAL_PORT_DEFNS \
79 EXTRA_SERIAL_PORT_DEFNS
diff --git a/include/asm-m68k/thread_info.h b/include/asm-m68k/thread_info.h
index 5f58939c59db..2aed24f6fd2e 100644
--- a/include/asm-m68k/thread_info.h
+++ b/include/asm-m68k/thread_info.h
@@ -8,7 +8,7 @@
8struct thread_info { 8struct thread_info {
9 struct task_struct *task; /* main task structure */ 9 struct task_struct *task; /* main task structure */
10 struct exec_domain *exec_domain; /* execution domain */ 10 struct exec_domain *exec_domain; /* execution domain */
11 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 11 int preempt_count; /* 0 => preemptable, <0 => BUG */
12 __u32 cpu; /* should always be 0 on m68k */ 12 __u32 cpu; /* should always be 0 on m68k */
13 struct restart_block restart_block; 13 struct restart_block restart_block;
14 14
diff --git a/include/asm-m68knommu/emergency-restart.h b/include/asm-m68knommu/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-m68knommu/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-m68knommu/thread_info.h b/include/asm-m68knommu/thread_info.h
index c8153b7c1f5c..7b9a3fa3af5d 100644
--- a/include/asm-m68knommu/thread_info.h
+++ b/include/asm-m68knommu/thread_info.h
@@ -36,7 +36,7 @@ struct thread_info {
36 struct exec_domain *exec_domain; /* execution domain */ 36 struct exec_domain *exec_domain; /* execution domain */
37 unsigned long flags; /* low level flags */ 37 unsigned long flags; /* low level flags */
38 int cpu; /* cpu we're on */ 38 int cpu; /* cpu we're on */
39 int preempt_count; /* 0 => preemptable, <0 => BUG*/ 39 int preempt_count; /* 0 => preemptable, <0 => BUG */
40 struct restart_block restart_block; 40 struct restart_block restart_block;
41}; 41};
42 42
diff --git a/include/asm-mips/compat.h b/include/asm-mips/compat.h
index dce92079e7fc..d78002afb1e1 100644
--- a/include/asm-mips/compat.h
+++ b/include/asm-mips/compat.h
@@ -29,6 +29,7 @@ typedef s32 compat_caddr_t;
29typedef struct { 29typedef struct {
30 s32 val[2]; 30 s32 val[2];
31} compat_fsid_t; 31} compat_fsid_t;
32typedef s32 compat_timer_t;
32 33
33typedef s32 compat_int_t; 34typedef s32 compat_int_t;
34typedef s32 compat_long_t; 35typedef s32 compat_long_t;
diff --git a/include/asm-mips/emergency-restart.h b/include/asm-mips/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-mips/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index 29ee13be0b2a..d721143dbd47 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -8,6 +8,8 @@
8#include <asm/page.h> 8#include <asm/page.h>
9#include <mmzone.h> 9#include <mmzone.h>
10 10
11#ifdef CONFIG_DISCONTIGMEM
12
11#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr)) 13#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr))
12#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) 14#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
13 15
@@ -36,4 +38,6 @@
36/* XXX: FIXME -- wli */ 38/* XXX: FIXME -- wli */
37#define kern_addr_valid(addr) (0) 39#define kern_addr_valid(addr) (0)
38 40
41#endif /* CONFIG_DISCONTIGMEM */
42
39#endif /* _ASM_MMZONE_H_ */ 43#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index d1bf8240e73b..5cae35cd9ba9 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -127,7 +127,7 @@ static __inline__ int get_order(unsigned long size)
127 127
128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) 128#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
129 129
130#ifndef CONFIG_DISCONTIGMEM 130#ifndef CONFIG_NEED_MULTIPLE_NODES
131#define pfn_to_page(pfn) (mem_map + (pfn)) 131#define pfn_to_page(pfn) (mem_map + (pfn))
132#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 132#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
133#define pfn_valid(pfn) ((pfn) < max_mapnr) 133#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-mips/pci.h b/include/asm-mips/pci.h
index c9c576b48556..d70dc355c1f3 100644
--- a/include/asm-mips/pci.h
+++ b/include/asm-mips/pci.h
@@ -69,7 +69,7 @@ extern unsigned long PCIBIOS_MIN_MEM;
69 69
70extern void pcibios_set_master(struct pci_dev *dev); 70extern void pcibios_set_master(struct pci_dev *dev);
71 71
72static inline void pcibios_penalize_isa_irq(int irq) 72static inline void pcibios_penalize_isa_irq(int irq, int active)
73{ 73{
74 /* We don't do dynamic PCI IRQ allocation */ 74 /* We don't do dynamic PCI IRQ allocation */
75} 75}
@@ -130,6 +130,16 @@ extern void pci_dac_dma_sync_single_for_cpu(struct pci_dev *pdev,
130extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, 130extern void pci_dac_dma_sync_single_for_device(struct pci_dev *pdev,
131 dma64_addr_t dma_addr, size_t len, int direction); 131 dma64_addr_t dma_addr, size_t len, int direction);
132 132
133#ifdef CONFIG_PCI
134static inline void pci_dma_burst_advice(struct pci_dev *pdev,
135 enum pci_dma_burst_strategy *strat,
136 unsigned long *strategy_parameter)
137{
138 *strat = PCI_DMA_BURST_INFINITY;
139 *strategy_parameter = ~0UL;
140}
141#endif
142
133extern void pcibios_resource_to_bus(struct pci_dev *dev, 143extern void pcibios_resource_to_bus(struct pci_dev *dev,
134 struct pci_bus_region *region, struct resource *res); 144 struct pci_bus_region *region, struct resource *res);
135 145
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index 878843203d67..e76ccd6e3a5d 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -350,7 +350,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
350 __update_cache(vma, address, pte); 350 __update_cache(vma, address, pte);
351} 351}
352 352
353#ifndef CONFIG_DISCONTIGMEM 353#ifndef CONFIG_NEED_MULTIPLE_NODES
354#define kern_addr_valid(addr) (1) 354#define kern_addr_valid(addr) (1)
355#endif 355#endif
356 356
diff --git a/include/asm-mips/serial.h b/include/asm-mips/serial.h
index 8a70ff58f760..4eed8e2acdc3 100644
--- a/include/asm-mips/serial.h
+++ b/include/asm-mips/serial.h
@@ -29,32 +29,6 @@
29#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 29#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
30#endif 30#endif
31 31
32#ifdef CONFIG_SERIAL_MANY_PORTS
33#define FOURPORT_FLAGS ASYNC_FOURPORT
34#define ACCENT_FLAGS 0
35#define BOCA_FLAGS 0
36#define HUB6_FLAGS 0
37#define RS_TABLE_SIZE 64
38#else
39#define RS_TABLE_SIZE
40#endif
41
42/*
43 * The following define the access methods for the HUB6 card. All
44 * access is through two ports for all 24 possible chips. The card is
45 * selected through the high 2 bits, the port on that card with the
46 * "middle" 3 bits, and the register on that port with the bottom
47 * 3 bits.
48 *
49 * While the access port and interrupt is configurable, the default
50 * port locations are 0x302 for the port control register, and 0x303
51 * for the data read/write register. Normally, the interrupt is at irq3
52 * but can be anything from 3 to 7 inclusive. Note that using 3 will
53 * require disabling com2.
54 */
55
56#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
57
58#ifdef CONFIG_MACH_JAZZ 32#ifdef CONFIG_MACH_JAZZ
59#include <asm/jazz.h> 33#include <asm/jazz.h>
60 34
@@ -240,66 +214,10 @@
240 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 214 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
241 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 215 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
242 216
243#ifdef CONFIG_SERIAL_MANY_PORTS
244#define EXTRA_SERIAL_PORT_DEFNS \
245 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
246 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
247 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
248 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
249 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
250 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
251 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
252 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
253 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
254 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
255 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
256 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
257 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
258 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
259 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
260 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
261 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
262 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
263 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
264 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
265 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
266 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
267 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
268 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
269 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
270 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
271 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
272 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
273#else /* CONFIG_SERIAL_MANY_PORTS */
274#define EXTRA_SERIAL_PORT_DEFNS
275#endif /* CONFIG_SERIAL_MANY_PORTS */
276
277#else /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */ 217#else /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */
278#define STD_SERIAL_PORT_DEFNS 218#define STD_SERIAL_PORT_DEFNS
279#define EXTRA_SERIAL_PORT_DEFNS
280#endif /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */ 219#endif /* CONFIG_HAVE_STD_PC_SERIAL_PORTS */
281 220
282/* You can have up to four HUB6's in the system, but I've only
283 * included two cards here for a total of twelve ports.
284 */
285#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
286#define HUB6_SERIAL_PORT_DFNS \
287 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \
288 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \
289 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \
290 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \
291 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \
292 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \
293 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \
294 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \
295 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \
296 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \
297 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \
298 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
299#else
300#define HUB6_SERIAL_PORT_DFNS
301#endif
302
303#ifdef CONFIG_MOMENCO_JAGUAR_ATX 221#ifdef CONFIG_MOMENCO_JAGUAR_ATX
304/* Ordinary NS16552 duart with a 20MHz crystal. */ 222/* Ordinary NS16552 duart with a 20MHz crystal. */
305#define JAGUAR_ATX_UART_CLK 20000000 223#define JAGUAR_ATX_UART_CLK 20000000
@@ -427,8 +345,6 @@
427 COBALT_SERIAL_PORT_DEFNS \ 345 COBALT_SERIAL_PORT_DEFNS \
428 DDB5477_SERIAL_PORT_DEFNS \ 346 DDB5477_SERIAL_PORT_DEFNS \
429 EV96100_SERIAL_PORT_DEFNS \ 347 EV96100_SERIAL_PORT_DEFNS \
430 EXTRA_SERIAL_PORT_DEFNS \
431 HUB6_SERIAL_PORT_DFNS \
432 IP32_SERIAL_PORT_DEFNS \ 348 IP32_SERIAL_PORT_DEFNS \
433 ITE_SERIAL_PORT_DEFNS \ 349 ITE_SERIAL_PORT_DEFNS \
434 IVR_SERIAL_PORT_DEFNS \ 350 IVR_SERIAL_PORT_DEFNS \
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 888fd8908467..169f3d4265b1 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -422,16 +422,10 @@ extern void __die_if_kernel(const char *, struct pt_regs *, const char *file,
422extern int stop_a_enabled; 422extern int stop_a_enabled;
423 423
424/* 424/*
425 * Taken from include/asm-ia64/system.h; prevents deadlock on SMP 425 * See include/asm-ia64/system.h; prevents deadlock on SMP
426 * systems. 426 * systems.
427 */ 427 */
428#define prepare_arch_switch(rq, next) \ 428#define __ARCH_WANT_UNLOCKED_CTXSW
429do { \
430 spin_lock(&(next)->switch_lock); \
431 spin_unlock(&(rq)->lock); \
432} while (0)
433#define finish_arch_switch(rq, prev) spin_unlock_irq(&(prev)->switch_lock)
434#define task_running(rq, p) ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
435 429
436#define arch_align_stack(x) (x) 430#define arch_align_stack(x) (x)
437 431
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h
index 768900305e2f..42fcd6f2c206 100644
--- a/include/asm-mips/thread_info.h
+++ b/include/asm-mips/thread_info.h
@@ -27,7 +27,7 @@ struct thread_info {
27 struct exec_domain *exec_domain; /* execution domain */ 27 struct exec_domain *exec_domain; /* execution domain */
28 unsigned long flags; /* low level flags */ 28 unsigned long flags; /* low level flags */
29 __u32 cpu; /* current CPU */ 29 __u32 cpu; /* current CPU */
30 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 30 int preempt_count; /* 0 => preemptable, <0 => BUG */
31 31
32 mm_segment_t addr_limit; /* thread address space: 32 mm_segment_t addr_limit; /* thread address space:
33 0-0xBFFFFFFF for user-thead 33 0-0xBFFFFFFF for user-thead
diff --git a/include/asm-parisc/compat.h b/include/asm-parisc/compat.h
index ca0eac647a05..7630d1ad2391 100644
--- a/include/asm-parisc/compat.h
+++ b/include/asm-parisc/compat.h
@@ -24,7 +24,7 @@ typedef u16 compat_nlink_t;
24typedef u16 compat_ipc_pid_t; 24typedef u16 compat_ipc_pid_t;
25typedef s32 compat_daddr_t; 25typedef s32 compat_daddr_t;
26typedef u32 compat_caddr_t; 26typedef u32 compat_caddr_t;
27typedef u32 compat_timer_t; 27typedef s32 compat_timer_t;
28 28
29typedef s32 compat_int_t; 29typedef s32 compat_int_t;
30typedef s32 compat_long_t; 30typedef s32 compat_long_t;
diff --git a/include/asm-parisc/emergency-restart.h b/include/asm-parisc/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-parisc/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-parisc/mmzone.h b/include/asm-parisc/mmzone.h
index 928bf50c4693..595d3dce120a 100644
--- a/include/asm-parisc/mmzone.h
+++ b/include/asm-parisc/mmzone.h
@@ -19,7 +19,6 @@ extern struct node_map_data node_data[];
19 */ 19 */
20#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT) 20#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
21 21
22#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
23#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 22#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
24#define node_end_pfn(nid) \ 23#define node_end_pfn(nid) \
25({ \ 24({ \
@@ -38,7 +37,7 @@ extern struct node_map_data node_data[];
38({ \ 37({ \
39 unsigned long __pfn = (pfn); \ 38 unsigned long __pfn = (pfn); \
40 int __node = pfn_to_nid(__pfn); \ 39 int __node = pfn_to_nid(__pfn); \
41 &node_mem_map(__node)[node_localnr(__pfn,__node)]; \ 40 &NODE_DATA(__node)->node_mem_map[node_localnr(__pfn,__node)]; \
42}) 41})
43 42
44#define page_to_pfn(pg) \ 43#define page_to_pfn(pg) \
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index 0763c2982fb0..98d79a3d54fa 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -230,10 +230,33 @@ extern inline void pcibios_register_hba(struct pci_hba_data *x)
230/* export the pci_ DMA API in terms of the dma_ one */ 230/* export the pci_ DMA API in terms of the dma_ one */
231#include <asm-generic/pci-dma-compat.h> 231#include <asm-generic/pci-dma-compat.h>
232 232
233#ifdef CONFIG_PCI
234static inline void pci_dma_burst_advice(struct pci_dev *pdev,
235 enum pci_dma_burst_strategy *strat,
236 unsigned long *strategy_parameter)
237{
238 unsigned long cacheline_size;
239 u8 byte;
240
241 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
242 if (byte == 0)
243 cacheline_size = 1024;
244 else
245 cacheline_size = (int) byte * 4;
246
247 *strat = PCI_DMA_BURST_MULTIPLE;
248 *strategy_parameter = cacheline_size;
249}
250#endif
251
233extern void 252extern void
234pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 253pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
235 struct resource *res); 254 struct resource *res);
236 255
256extern void
257pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
258 struct pci_bus_region *region);
259
237static inline void pcibios_add_platform_entries(struct pci_dev *dev) 260static inline void pcibios_add_platform_entries(struct pci_dev *dev)
238{ 261{
239} 262}
diff --git a/include/asm-parisc/serial.h b/include/asm-parisc/serial.h
index 239c5dcab7e6..82fd820d684f 100644
--- a/include/asm-parisc/serial.h
+++ b/include/asm-parisc/serial.h
@@ -19,18 +19,4 @@
19 * A500 w/ PCI serial cards: 5 + 4 * card ~= 17 19 * A500 w/ PCI serial cards: 5 + 4 * card ~= 17
20 */ 20 */
21 21
22#define STD_SERIAL_PORT_DEFNS \ 22#define SERIAL_PORT_DFNS
23 { 0, }, /* ttyS0 */ \
24 { 0, }, /* ttyS1 */ \
25 { 0, }, /* ttyS2 */ \
26 { 0, }, /* ttyS3 */ \
27 { 0, }, /* ttyS4 */ \
28 { 0, }, /* ttyS5 */ \
29 { 0, }, /* ttyS6 */ \
30 { 0, }, /* ttyS7 */ \
31 { 0, }, /* ttyS8 */
32
33
34#define SERIAL_PORT_DFNS \
35 STD_SERIAL_PORT_DEFNS
36
diff --git a/include/asm-parisc/thread_info.h b/include/asm-parisc/thread_info.h
index fe9b7f8ae4c6..57bbb76cb6c1 100644
--- a/include/asm-parisc/thread_info.h
+++ b/include/asm-parisc/thread_info.h
@@ -12,7 +12,7 @@ struct thread_info {
12 unsigned long flags; /* thread_info flags (see TIF_*) */ 12 unsigned long flags; /* thread_info flags (see TIF_*) */
13 mm_segment_t addr_limit; /* user-level address space limit */ 13 mm_segment_t addr_limit; /* user-level address space limit */
14 __u32 cpu; /* current CPU */ 14 __u32 cpu; /* current CPU */
15 __s32 preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */ 15 int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
16 struct restart_block restart_block; 16 struct restart_block restart_block;
17}; 17};
18 18
diff --git a/include/asm-ppc/cpm2.h b/include/asm-ppc/cpm2.h
index c5883dbed63f..9483d4bfacf7 100644
--- a/include/asm-ppc/cpm2.h
+++ b/include/asm-ppc/cpm2.h
@@ -109,6 +109,7 @@ static inline long IS_DPERR(const uint offset)
109 * and dual port ram. 109 * and dual port ram.
110 */ 110 */
111extern cpm_cpm2_t *cpmp; /* Pointer to comm processor */ 111extern cpm_cpm2_t *cpmp; /* Pointer to comm processor */
112
112extern uint cpm_dpalloc(uint size, uint align); 113extern uint cpm_dpalloc(uint size, uint align);
113extern int cpm_dpfree(uint offset); 114extern int cpm_dpfree(uint offset);
114extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align); 115extern uint cpm_dpalloc_fixed(uint offset, uint size, uint align);
@@ -116,6 +117,8 @@ extern void cpm_dpdump(void);
116extern void *cpm_dpram_addr(uint offset); 117extern void *cpm_dpram_addr(uint offset);
117extern void cpm_setbrg(uint brg, uint rate); 118extern void cpm_setbrg(uint brg, uint rate);
118extern void cpm2_fastbrg(uint brg, uint rate, int div16); 119extern void cpm2_fastbrg(uint brg, uint rate, int div16);
120extern void cpm2_reset(void);
121
119 122
120/* Buffer descriptors used by many of the CPM protocols. 123/* Buffer descriptors used by many of the CPM protocols.
121*/ 124*/
@@ -1087,5 +1090,3 @@ typedef struct im_idma {
1087 1090
1088#endif /* __CPM2__ */ 1091#endif /* __CPM2__ */
1089#endif /* __KERNEL__ */ 1092#endif /* __KERNEL__ */
1090
1091
diff --git a/include/asm-ppc/dma-mapping.h b/include/asm-ppc/dma-mapping.h
index 7f0487afebbe..6f74f59938d4 100644
--- a/include/asm-ppc/dma-mapping.h
+++ b/include/asm-ppc/dma-mapping.h
@@ -117,7 +117,7 @@ dma_map_page(struct device *dev, struct page *page,
117 117
118 __dma_sync_page(page, offset, size, direction); 118 __dma_sync_page(page, offset, size, direction);
119 119
120 return (page - mem_map) * PAGE_SIZE + PCI_DRAM_OFFSET + offset; 120 return page_to_bus(page) + offset;
121} 121}
122 122
123/* We do nothing. */ 123/* We do nothing. */
diff --git a/include/asm-ppc/emergency-restart.h b/include/asm-ppc/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-ppc/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-ppc/fsl_ocp.h b/include/asm-ppc/fsl_ocp.h
deleted file mode 100644
index 050fbba8d049..000000000000
--- a/include/asm-ppc/fsl_ocp.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * include/asm-ppc/fsl_ocp.h
3 *
4 * Definitions for the on-chip peripherals on Freescale PPC processors
5 *
6 * Maintainer: Kumar Gala (kumar.gala@freescale.com)
7 *
8 * Copyright 2004 Freescale Semiconductor, Inc
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the
12 * Free Software Foundation; either version 2 of the License, or (at your
13 * option) any later version.
14 */
15
16#ifdef __KERNEL__
17#ifndef __ASM_FS_OCP_H__
18#define __ASM_FS_OCP_H__
19
20/* A table of information for supporting the Gianfar Ethernet Controller
21 * This helps identify which enet controller we are dealing with,
22 * and what type of enet controller it is
23 */
24struct ocp_gfar_data {
25 uint interruptTransmit;
26 uint interruptError;
27 uint interruptReceive;
28 uint interruptPHY;
29 uint flags;
30 uint phyid;
31 uint phyregidx;
32 unsigned char mac_addr[6];
33};
34
35/* Flags in the flags field */
36#define GFAR_HAS_COALESCE 0x20
37#define GFAR_HAS_RMON 0x10
38#define GFAR_HAS_MULTI_INTR 0x08
39#define GFAR_FIRM_SET_MACADDR 0x04
40#define GFAR_HAS_PHY_INTR 0x02 /* if not set use a timer */
41#define GFAR_HAS_GIGABIT 0x01
42
43/* Data structure for I2C support. Just contains a couple flags
44 * to distinguish various I2C implementations*/
45struct ocp_fs_i2c_data {
46 uint flags;
47};
48
49/* Flags for I2C */
50#define FS_I2C_SEPARATE_DFSRR 0x02
51#define FS_I2C_CLOCK_5200 0x01
52
53#endif /* __ASM_FS_OCP_H__ */
54#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ibm44x.h b/include/asm-ppc/ibm44x.h
index 87f051138b9d..e5374be86aef 100644
--- a/include/asm-ppc/ibm44x.h
+++ b/include/asm-ppc/ibm44x.h
@@ -35,8 +35,10 @@
35#define PPC44x_LOW_SLOT 63 35#define PPC44x_LOW_SLOT 63
36 36
37/* LS 32-bits of UART0 physical address location for early serial text debug */ 37/* LS 32-bits of UART0 physical address location for early serial text debug */
38#ifdef CONFIG_440SP 38#if defined(CONFIG_440SP)
39#define UART0_PHYS_IO_BASE 0xf0000200 39#define UART0_PHYS_IO_BASE 0xf0000200
40#elif defined(CONFIG_440EP)
41#define UART0_PHYS_IO_BASE 0xe0000000
40#else 42#else
41#define UART0_PHYS_IO_BASE 0x40000200 43#define UART0_PHYS_IO_BASE 0x40000200
42#endif 44#endif
@@ -49,11 +51,16 @@
49/* 51/*
50 * Standard 4GB "page" definitions 52 * Standard 4GB "page" definitions
51 */ 53 */
52#ifdef CONFIG_440SP 54#if defined(CONFIG_440SP)
53#define PPC44x_IO_PAGE 0x0000000100000000ULL 55#define PPC44x_IO_PAGE 0x0000000100000000ULL
54#define PPC44x_PCICFG_PAGE 0x0000000900000000ULL 56#define PPC44x_PCICFG_PAGE 0x0000000900000000ULL
55#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE 57#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE
56#define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL 58#define PPC44x_PCIMEM_PAGE 0x0000000a00000000ULL
59#elif defined(CONFIG_440EP)
60#define PPC44x_IO_PAGE 0x0000000000000000ULL
61#define PPC44x_PCICFG_PAGE 0x0000000000000000ULL
62#define PPC44x_PCIIO_PAGE PPC44x_PCICFG_PAGE
63#define PPC44x_PCIMEM_PAGE 0x0000000000000000ULL
57#else 64#else
58#define PPC44x_IO_PAGE 0x0000000100000000ULL 65#define PPC44x_IO_PAGE 0x0000000100000000ULL
59#define PPC44x_PCICFG_PAGE 0x0000000200000000ULL 66#define PPC44x_PCICFG_PAGE 0x0000000200000000ULL
@@ -64,7 +71,7 @@
64/* 71/*
65 * 36-bit trap ranges 72 * 36-bit trap ranges
66 */ 73 */
67#ifdef CONFIG_440SP 74#if defined(CONFIG_440SP)
68#define PPC44x_IO_LO 0xf0000000UL 75#define PPC44x_IO_LO 0xf0000000UL
69#define PPC44x_IO_HI 0xf0000fffUL 76#define PPC44x_IO_HI 0xf0000fffUL
70#define PPC44x_PCI0CFG_LO 0x0ec00000UL 77#define PPC44x_PCI0CFG_LO 0x0ec00000UL
@@ -75,6 +82,13 @@
75#define PPC44x_PCI2CFG_HI 0x2ec00007UL 82#define PPC44x_PCI2CFG_HI 0x2ec00007UL
76#define PPC44x_PCIMEM_LO 0x80000000UL 83#define PPC44x_PCIMEM_LO 0x80000000UL
77#define PPC44x_PCIMEM_HI 0xdfffffffUL 84#define PPC44x_PCIMEM_HI 0xdfffffffUL
85#elif defined(CONFIG_440EP)
86#define PPC44x_IO_LO 0xef500000UL
87#define PPC44x_IO_HI 0xefffffffUL
88#define PPC44x_PCI0CFG_LO 0xeec00000UL
89#define PPC44x_PCI0CFG_HI 0xeecfffffUL
90#define PPC44x_PCIMEM_LO 0xa0000000UL
91#define PPC44x_PCIMEM_HI 0xdfffffffUL
78#else 92#else
79#define PPC44x_IO_LO 0x40000000UL 93#define PPC44x_IO_LO 0x40000000UL
80#define PPC44x_IO_HI 0x40000fffUL 94#define PPC44x_IO_HI 0x40000fffUL
@@ -152,6 +166,12 @@
152#define DCRN_SDR_UART0 0x0120 166#define DCRN_SDR_UART0 0x0120
153#define DCRN_SDR_UART1 0x0121 167#define DCRN_SDR_UART1 0x0121
154 168
169#ifdef CONFIG_440EP
170#define DCRN_SDR_UART2 0x0122
171#define DCRN_SDR_UART3 0x0123
172#define DCRN_SDR_CUST0 0x4000
173#endif
174
155/* SDR read/write helper macros */ 175/* SDR read/write helper macros */
156#define SDR_READ(offset) ({\ 176#define SDR_READ(offset) ({\
157 mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \ 177 mtdcr(DCRN_SDR_CONFIG_ADDR, offset); \
@@ -169,6 +189,14 @@
169#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */ 189#define DCRNCAP_DMA_SG 1 /* have DMA scatter/gather capability */
170#define DCRN_MAL_BASE 0x180 190#define DCRN_MAL_BASE 0x180
171 191
192#ifdef CONFIG_440EP
193#define DCRN_DMA2P40_BASE 0x300
194#define DCRN_DMA2P41_BASE 0x308
195#define DCRN_DMA2P42_BASE 0x310
196#define DCRN_DMA2P43_BASE 0x318
197#define DCRN_DMA2P4SR_BASE 0x320
198#endif
199
172/* UIC */ 200/* UIC */
173#define DCRN_UIC0_BASE 0xc0 201#define DCRN_UIC0_BASE 0xc0
174#define DCRN_UIC1_BASE 0xd0 202#define DCRN_UIC1_BASE 0xd0
@@ -395,11 +423,7 @@
395#define MQ0_CONFIG_SIZE_2G 0x0000c000 423#define MQ0_CONFIG_SIZE_2G 0x0000c000
396 424
397/* Internal SRAM Controller 440GX/440SP */ 425/* Internal SRAM Controller 440GX/440SP */
398#ifdef CONFIG_440SP
399#define DCRN_SRAM0_BASE 0x100
400#else /* 440GX */
401#define DCRN_SRAM0_BASE 0x000 426#define DCRN_SRAM0_BASE 0x000
402#endif
403 427
404#define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020) 428#define DCRN_SRAM0_SB0CR (DCRN_SRAM0_BASE + 0x020)
405#define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021) 429#define DCRN_SRAM0_SB1CR (DCRN_SRAM0_BASE + 0x021)
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 35260afa33a9..e807be96e981 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -97,6 +97,10 @@ void ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
97 97
98#elif CONFIG_44x 98#elif CONFIG_44x
99 99
100#if defined(CONFIG_BAMBOO)
101#include <platforms/4xx/bamboo.h>
102#endif
103
100#if defined(CONFIG_EBONY) 104#if defined(CONFIG_EBONY)
101#include <platforms/4xx/ebony.h> 105#include <platforms/4xx/ebony.h>
102#endif 106#endif
diff --git a/include/asm-ppc/ibm_ocp.h b/include/asm-ppc/ibm_ocp.h
index 8c61d93043af..3f7b5669e6d5 100644
--- a/include/asm-ppc/ibm_ocp.h
+++ b/include/asm-ppc/ibm_ocp.h
@@ -71,6 +71,8 @@ struct ocp_func_emac_data {
71 71
72/* Sysfs support */ 72/* Sysfs support */
73#define OCP_SYSFS_EMAC_DATA() \ 73#define OCP_SYSFS_EMAC_DATA() \
74OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, rgmii_idx) \
75OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, rgmii_mux) \
74OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_idx) \ 76OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_idx) \
75OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_mux) \ 77OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, zmii_mux) \
76OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_idx) \ 78OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_idx) \
@@ -78,9 +80,14 @@ OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_rx_chan) \
78OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_tx_chan) \ 80OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mal_tx_chan) \
79OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, wol_irq) \ 81OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, wol_irq) \
80OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \ 82OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, mdio_idx) \
83OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, tah_idx) \
84OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "%d\n", emac, phy_mode) \
85OCP_SYSFS_ADDTL(struct ocp_func_emac_data, "0x%08x\n", emac, phy_map) \
81 \ 86 \
82void ocp_show_emac_data(struct device *dev) \ 87void ocp_show_emac_data(struct device *dev) \
83{ \ 88{ \
89 device_create_file(dev, &dev_attr_emac_rgmii_idx); \
90 device_create_file(dev, &dev_attr_emac_rgmii_mux); \
84 device_create_file(dev, &dev_attr_emac_zmii_idx); \ 91 device_create_file(dev, &dev_attr_emac_zmii_idx); \
85 device_create_file(dev, &dev_attr_emac_zmii_mux); \ 92 device_create_file(dev, &dev_attr_emac_zmii_mux); \
86 device_create_file(dev, &dev_attr_emac_mal_idx); \ 93 device_create_file(dev, &dev_attr_emac_mal_idx); \
@@ -88,6 +95,9 @@ void ocp_show_emac_data(struct device *dev) \
88 device_create_file(dev, &dev_attr_emac_mal_tx_chan); \ 95 device_create_file(dev, &dev_attr_emac_mal_tx_chan); \
89 device_create_file(dev, &dev_attr_emac_wol_irq); \ 96 device_create_file(dev, &dev_attr_emac_wol_irq); \
90 device_create_file(dev, &dev_attr_emac_mdio_idx); \ 97 device_create_file(dev, &dev_attr_emac_mdio_idx); \
98 device_create_file(dev, &dev_attr_emac_tah_idx); \
99 device_create_file(dev, &dev_attr_emac_phy_mode); \
100 device_create_file(dev, &dev_attr_emac_phy_map); \
91} 101}
92 102
93#ifdef CONFIG_40x 103#ifdef CONFIG_40x
@@ -157,7 +167,7 @@ OCP_SYSFS_ADDTL(struct ocp_func_iic_data, "%d\n", iic, fast_mode) \
157 \ 167 \
158void ocp_show_iic_data(struct device *dev) \ 168void ocp_show_iic_data(struct device *dev) \
159{ \ 169{ \
160 device_create_file(dev, &dev_attr_iic_fast_mode); \ 170 device_create_file(dev, &dev_attr_iic_fast_mode); \
161} 171}
162#endif /* __IBM_OCP_H__ */ 172#endif /* __IBM_OCP_H__ */
163#endif /* __KERNEL__ */ 173#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/kexec.h b/include/asm-ppc/kexec.h
new file mode 100644
index 000000000000..6d2aa0aa4642
--- /dev/null
+++ b/include/asm-ppc/kexec.h
@@ -0,0 +1,40 @@
1#ifndef _PPC_KEXEC_H
2#define _PPC_KEXEC_H
3
4#ifdef CONFIG_KEXEC
5
6/*
7 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
8 * I.e. Maximum page that is mapped directly into kernel memory,
9 * and kmap is not required.
10 *
11 * Someone correct me if FIXADDR_START - PAGEOFFSET is not the correct
12 * calculation for the amount of memory directly mappable into the
13 * kernel memory space.
14 */
15
16/* Maximum physical address we can use pages from */
17#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
18/* Maximum address we can reach in physical address mode */
19#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
20/* Maximum address we can use for the control code buffer */
21#define KEXEC_CONTROL_MEMORY_LIMIT TASK_SIZE
22
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_PPC
27
28#ifndef __ASSEMBLY__
29
30extern void *crash_notes;
31
32struct kimage;
33
34extern void machine_kexec_simple(struct kimage *image);
35
36#endif /* __ASSEMBLY__ */
37
38#endif /* CONFIG_KEXEC */
39
40#endif /* _PPC_KEXEC_H */
diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h
index b78d40870c95..1d4ab70a56f3 100644
--- a/include/asm-ppc/machdep.h
+++ b/include/asm-ppc/machdep.h
@@ -4,6 +4,7 @@
4 4
5#include <linux/config.h> 5#include <linux/config.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/kexec.h>
7 8
8#include <asm/setup.h> 9#include <asm/setup.h>
9#include <asm/page.h> 10#include <asm/page.h>
@@ -114,6 +115,36 @@ struct machdep_calls {
114 /* functions for dealing with other cpus */ 115 /* functions for dealing with other cpus */
115 struct smp_ops_t *smp_ops; 116 struct smp_ops_t *smp_ops;
116#endif /* CONFIG_SMP */ 117#endif /* CONFIG_SMP */
118
119#ifdef CONFIG_KEXEC
120 /* Called to shutdown machine specific hardware not already controlled
121 * by other drivers.
122 * XXX Should we move this one out of kexec scope?
123 */
124 void (*machine_shutdown)(void);
125
126 /* Called to do the minimal shutdown needed to run a kexec'd kernel
127 * to run successfully.
128 * XXX Should we move this one out of kexec scope?
129 */
130 void (*machine_crash_shutdown)(void);
131
132 /* Called to do what every setup is needed on image and the
133 * reboot code buffer. Returns 0 on success.
134 * Provide your own (maybe dummy) implementation if your platform
135 * claims to support kexec.
136 */
137 int (*machine_kexec_prepare)(struct kimage *image);
138
139 /* Called to handle any machine specific cleanup on image */
140 void (*machine_kexec_cleanup)(struct kimage *image);
141
142 /* Called to perform the _real_ kexec.
143 * Do NOT allocate memory or fail here. We are past the point of
144 * no return.
145 */
146 void (*machine_kexec)(struct kimage *image);
147#endif /* CONFIG_KEXEC */
117}; 148};
118 149
119extern struct machdep_calls ppc_md; 150extern struct machdep_calls ppc_md;
diff --git a/include/asm-ppc/macio.h b/include/asm-ppc/macio.h
index 2cafc9978607..a481b772d154 100644
--- a/include/asm-ppc/macio.h
+++ b/include/asm-ppc/macio.h
@@ -1,6 +1,7 @@
1#ifndef __MACIO_ASIC_H__ 1#ifndef __MACIO_ASIC_H__
2#define __MACIO_ASIC_H__ 2#define __MACIO_ASIC_H__
3 3
4#include <linux/mod_devicetable.h>
4#include <asm/of_device.h> 5#include <asm/of_device.h>
5 6
6extern struct bus_type macio_bus_type; 7extern struct bus_type macio_bus_type;
@@ -120,10 +121,10 @@ static inline struct pci_dev *macio_get_pci_dev(struct macio_dev *mdev)
120struct macio_driver 121struct macio_driver
121{ 122{
122 char *name; 123 char *name;
123 struct of_match *match_table; 124 struct of_device_id *match_table;
124 struct module *owner; 125 struct module *owner;
125 126
126 int (*probe)(struct macio_dev* dev, const struct of_match *match); 127 int (*probe)(struct macio_dev* dev, const struct of_device_id *match);
127 int (*remove)(struct macio_dev* dev); 128 int (*remove)(struct macio_dev* dev);
128 129
129 int (*suspend)(struct macio_dev* dev, pm_message_t state); 130 int (*suspend)(struct macio_dev* dev, pm_message_t state);
diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h
index d465aee1c82e..9205db404c7a 100644
--- a/include/asm-ppc/mmu.h
+++ b/include/asm-ppc/mmu.h
@@ -405,7 +405,7 @@ typedef struct _P601_BAT {
405 405
406#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000) 406#define MAS0_TLBSEL(x) ((x << 28) & 0x30000000)
407#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000) 407#define MAS0_ESEL(x) ((x << 16) & 0x0FFF0000)
408#define MAS0_NV 0x00000FFF 408#define MAS0_NV(x) ((x) & 0x00000FFF)
409 409
410#define MAS1_VALID 0x80000000 410#define MAS1_VALID 0x80000000
411#define MAS1_IPROT 0x40000000 411#define MAS1_IPROT 0x40000000
diff --git a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
index 9222fa6ca172..afe26ffc2e2d 100644
--- a/include/asm-ppc/mmu_context.h
+++ b/include/asm-ppc/mmu_context.h
@@ -63,7 +63,7 @@ static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
63#define LAST_CONTEXT 255 63#define LAST_CONTEXT 255
64#define FIRST_CONTEXT 1 64#define FIRST_CONTEXT 1
65 65
66#elif defined(CONFIG_E500) 66#elif defined(CONFIG_E200) || defined(CONFIG_E500)
67#define NO_CONTEXT 256 67#define NO_CONTEXT 256
68#define LAST_CONTEXT 255 68#define LAST_CONTEXT 255
69#define FIRST_CONTEXT 1 69#define FIRST_CONTEXT 1
@@ -149,6 +149,7 @@ static inline void get_mmu_context(struct mm_struct *mm)
149 */ 149 */
150static inline void destroy_context(struct mm_struct *mm) 150static inline void destroy_context(struct mm_struct *mm)
151{ 151{
152 preempt_disable();
152 if (mm->context != NO_CONTEXT) { 153 if (mm->context != NO_CONTEXT) {
153 clear_bit(mm->context, context_map); 154 clear_bit(mm->context, context_map);
154 mm->context = NO_CONTEXT; 155 mm->context = NO_CONTEXT;
@@ -156,6 +157,7 @@ static inline void destroy_context(struct mm_struct *mm)
156 atomic_inc(&nr_free_contexts); 157 atomic_inc(&nr_free_contexts);
157#endif 158#endif
158 } 159 }
160 preempt_enable();
159} 161}
160 162
161static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 163static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
diff --git a/include/asm-ppc/mpc10x.h b/include/asm-ppc/mpc10x.h
index f5196a4efbe0..77b1e092c206 100644
--- a/include/asm-ppc/mpc10x.h
+++ b/include/asm-ppc/mpc10x.h
@@ -163,7 +163,8 @@ enum ppc_sys_devices {
163 MPC10X_IIC1, 163 MPC10X_IIC1,
164 MPC10X_DMA0, 164 MPC10X_DMA0,
165 MPC10X_DMA1, 165 MPC10X_DMA1,
166 MPC10X_DUART, 166 MPC10X_UART0,
167 MPC10X_UART1,
167}; 168};
168 169
169int mpc10x_bridge_init(struct pci_controller *hose, 170int mpc10x_bridge_init(struct pci_controller *hose,
diff --git a/include/asm-ppc/mpc8xx.h b/include/asm-ppc/mpc8xx.h
index 714d69c819d3..7c31f2d564a1 100644
--- a/include/asm-ppc/mpc8xx.h
+++ b/include/asm-ppc/mpc8xx.h
@@ -68,6 +68,10 @@
68#include <platforms/lantec.h> 68#include <platforms/lantec.h>
69#endif 69#endif
70 70
71#if defined(CONFIG_MPC885ADS)
72#include <platforms/mpc885ads.h>
73#endif
74
71/* Currently, all 8xx boards that support a processor to PCI/ISA bridge 75/* Currently, all 8xx boards that support a processor to PCI/ISA bridge
72 * use the same memory map. 76 * use the same memory map.
73 */ 77 */
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
index c726f1845190..983116f59d90 100644
--- a/include/asm-ppc/ocp.h
+++ b/include/asm-ppc/ocp.h
@@ -202,10 +202,6 @@ static DEVICE_ATTR(name##_##field, S_IRUGO, show_##name##_##field, NULL);
202#include <asm/ibm_ocp.h> 202#include <asm/ibm_ocp.h>
203#endif 203#endif
204 204
205#ifdef CONFIG_FSL_OCP
206#include <asm/fsl_ocp.h>
207#endif
208
209#endif /* CONFIG_PPC_OCP */ 205#endif /* CONFIG_PPC_OCP */
210#endif /* __OCP_H__ */ 206#endif /* __OCP_H__ */
211#endif /* __KERNEL__ */ 207#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/of_device.h b/include/asm-ppc/of_device.h
index 7229735a7c18..4b264cfd3998 100644
--- a/include/asm-ppc/of_device.h
+++ b/include/asm-ppc/of_device.h
@@ -24,20 +24,8 @@ struct of_device
24}; 24};
25#define to_of_device(d) container_of(d, struct of_device, dev) 25#define to_of_device(d) container_of(d, struct of_device, dev)
26 26
27/* 27extern const struct of_device_id *of_match_device(
28 * Struct used for matching a device 28 const struct of_device_id *matches, const struct of_device *dev);
29 */
30struct of_match
31{
32 char *name;
33 char *type;
34 char *compatible;
35 void *data;
36};
37#define OF_ANY_MATCH ((char *)-1L)
38
39extern const struct of_match *of_match_device(
40 const struct of_match *matches, const struct of_device *dev);
41 29
42extern struct of_device *of_dev_get(struct of_device *dev); 30extern struct of_device *of_dev_get(struct of_device *dev);
43extern void of_dev_put(struct of_device *dev); 31extern void of_dev_put(struct of_device *dev);
@@ -49,10 +37,10 @@ extern void of_dev_put(struct of_device *dev);
49struct of_platform_driver 37struct of_platform_driver
50{ 38{
51 char *name; 39 char *name;
52 struct of_match *match_table; 40 struct of_device_id *match_table;
53 struct module *owner; 41 struct module *owner;
54 42
55 int (*probe)(struct of_device* dev, const struct of_match *match); 43 int (*probe)(struct of_device* dev, const struct of_device_id *match);
56 int (*remove)(struct of_device* dev); 44 int (*remove)(struct of_device* dev);
57 45
58 int (*suspend)(struct of_device* dev, pm_message_t state); 46 int (*suspend)(struct of_device* dev, pm_message_t state);
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
index dbe853319741..7848aa610c05 100644
--- a/include/asm-ppc/open_pic.h
+++ b/include/asm-ppc/open_pic.h
@@ -25,6 +25,11 @@
25#define OPENPIC_VEC_IPI 118 /* and up */ 25#define OPENPIC_VEC_IPI 118 /* and up */
26#define OPENPIC_VEC_SPURIOUS 255 26#define OPENPIC_VEC_SPURIOUS 255
27 27
28/* Priorities */
29#define OPENPIC_PRIORITY_IPI_BASE 10
30#define OPENPIC_PRIORITY_DEFAULT 4
31#define OPENPIC_PRIORITY_NMI 9
32
28/* OpenPIC IRQ controller structure */ 33/* OpenPIC IRQ controller structure */
29extern struct hw_interrupt_type open_pic; 34extern struct hw_interrupt_type open_pic;
30 35
@@ -42,6 +47,7 @@ extern int epic_serial_mode;
42extern void openpic_set_sources(int first_irq, int num_irqs, void __iomem *isr); 47extern void openpic_set_sources(int first_irq, int num_irqs, void __iomem *isr);
43extern void openpic_init(int linux_irq_offset); 48extern void openpic_init(int linux_irq_offset);
44extern void openpic_init_nmi_irq(u_int irq); 49extern void openpic_init_nmi_irq(u_int irq);
50extern void openpic_set_irq_priority(u_int irq, u_int pri);
45extern void openpic_hookup_cascade(u_int irq, char *name, 51extern void openpic_hookup_cascade(u_int irq, char *name,
46 int (*cascade_fn)(struct pt_regs *)); 52 int (*cascade_fn)(struct pt_regs *));
47extern u_int openpic_irq(void); 53extern u_int openpic_irq(void);
diff --git a/include/asm-ppc/pc_serial.h b/include/asm-ppc/pc_serial.h
index fa9cbb67ce3e..8f994f9f8857 100644
--- a/include/asm-ppc/pc_serial.h
+++ b/include/asm-ppc/pc_serial.h
@@ -35,93 +35,9 @@
35#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 35#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
36#endif 36#endif
37 37
38#ifdef CONFIG_SERIAL_MANY_PORTS 38#define SERIAL_PORT_DFNS \
39#define FOURPORT_FLAGS ASYNC_FOURPORT
40#define ACCENT_FLAGS 0
41#define BOCA_FLAGS 0
42#define HUB6_FLAGS 0
43#endif
44
45/*
46 * The following define the access methods for the HUB6 card. All
47 * access is through two ports for all 24 possible chips. The card is
48 * selected through the high 2 bits, the port on that card with the
49 * "middle" 3 bits, and the register on that port with the bottom
50 * 3 bits.
51 *
52 * While the access port and interrupt is configurable, the default
53 * port locations are 0x302 for the port control register, and 0x303
54 * for the data read/write register. Normally, the interrupt is at irq3
55 * but can be anything from 3 to 7 inclusive. Note that using 3 will
56 * require disabling com2.
57 */
58
59#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
60
61#define STD_SERIAL_PORT_DEFNS \
62 /* UART CLK PORT IRQ FLAGS */ \ 39 /* UART CLK PORT IRQ FLAGS */ \
63 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 40 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
64 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 41 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
65 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 42 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
66 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 43 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
67
68
69#ifdef CONFIG_SERIAL_MANY_PORTS
70#define EXTRA_SERIAL_PORT_DEFNS \
71 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
72 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
73 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
74 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
75 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
76 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
77 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
78 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
79 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
80 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
81 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
82 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
83 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
84 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
85 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
86 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
87 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
88 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
89 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
90 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
91 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
92 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
93 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
94 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
95 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
96 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
97 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
98 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
99#else
100#define EXTRA_SERIAL_PORT_DEFNS
101#endif
102
103/* You can have up to four HUB6's in the system, but I've only
104 * included two cards here for a total of twelve ports.
105 */
106#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
107#define HUB6_SERIAL_PORT_DFNS \
108 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \
109 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \
110 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \
111 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \
112 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \
113 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \
114 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \
115 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \
116 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \
117 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \
118 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \
119 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
120#else
121#define HUB6_SERIAL_PORT_DFNS
122#endif
123
124#define SERIAL_PORT_DFNS \
125 STD_SERIAL_PORT_DEFNS \
126 EXTRA_SERIAL_PORT_DEFNS \
127 HUB6_SERIAL_PORT_DFNS
diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h
index ce5ae6d048f5..a811e440c978 100644
--- a/include/asm-ppc/pci.h
+++ b/include/asm-ppc/pci.h
@@ -37,7 +37,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
37 /* No special bus mastering setup handling */ 37 /* No special bus mastering setup handling */
38} 38}
39 39
40extern inline void pcibios_penalize_isa_irq(int irq) 40extern inline void pcibios_penalize_isa_irq(int irq, int active)
41{ 41{
42 /* We don't do dynamic PCI IRQ allocation */ 42 /* We don't do dynamic PCI IRQ allocation */
43} 43}
@@ -69,6 +69,16 @@ extern unsigned long pci_bus_to_phys(unsigned int ba, int busnr);
69#define pci_unmap_len(PTR, LEN_NAME) (0) 69#define pci_unmap_len(PTR, LEN_NAME) (0)
70#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0) 70#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
71 71
72#ifdef CONFIG_PCI
73static inline void pci_dma_burst_advice(struct pci_dev *pdev,
74 enum pci_dma_burst_strategy *strat,
75 unsigned long *strategy_parameter)
76{
77 *strat = PCI_DMA_BURST_INFINITY;
78 *strategy_parameter = ~0UL;
79}
80#endif
81
72/* 82/*
73 * At present there are very few 32-bit PPC machines that can have 83 * At present there are very few 32-bit PPC machines that can have
74 * memory above the 4GB point, and we don't support that. 84 * memory above the 4GB point, and we don't support that.
@@ -95,6 +105,10 @@ extern void
95pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 105pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
96 struct resource *res); 106 struct resource *res);
97 107
108extern void
109pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
110 struct pci_bus_region *region);
111
98extern void pcibios_add_platform_entries(struct pci_dev *dev); 112extern void pcibios_add_platform_entries(struct pci_dev *dev);
99 113
100struct file; 114struct file;
@@ -103,6 +117,12 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
103 unsigned long size, 117 unsigned long size,
104 pgprot_t prot); 118 pgprot_t prot);
105 119
120#define HAVE_ARCH_PCI_RESOURCE_TO_USER
121extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
122 const struct resource *rsrc,
123 u64 *start, u64 *end);
124
125
106#endif /* __KERNEL__ */ 126#endif /* __KERNEL__ */
107 127
108#endif /* __PPC_PCI_H */ 128#endif /* __PPC_PCI_H */
diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h
index 4d4b20c9de78..92f30b28b252 100644
--- a/include/asm-ppc/pgtable.h
+++ b/include/asm-ppc/pgtable.h
@@ -202,18 +202,64 @@ extern unsigned long ioremap_bot, ioremap_base;
202 * 202 *
203 * Note that these bits preclude future use of a page size 203 * Note that these bits preclude future use of a page size
204 * less than 4KB. 204 * less than 4KB.
205 *
206 *
207 * PPC 440 core has following TLB attribute fields;
208 *
209 * TLB1:
210 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
211 * RPN................................. - - - - - - ERPN.......
212 *
213 * TLB2:
214 * 0 1 2 3 4 ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
215 * - - - - - - U0 U1 U2 U3 W I M G E - UX UW UR SX SW SR
216 *
217 * There are some constrains and options, to decide mapping software bits
218 * into TLB entry.
219 *
220 * - PRESENT *must* be in the bottom three bits because swap cache
221 * entries use the top 29 bits for TLB2.
222 *
223 * - FILE *must* be in the bottom three bits because swap cache
224 * entries use the top 29 bits for TLB2.
225 *
226 * - CACHE COHERENT bit (M) has no effect on PPC440 core, because it
227 * doesn't support SMP. So we can use this as software bit, like
228 * DIRTY.
229 *
230 * With the PPC 44x Linux implementation, the 0-11th LSBs of the PTE are used
231 * for memory protection related functions (see PTE structure in
232 * include/asm-ppc/mmu.h). The _PAGE_XXX definitions in this file map to the
233 * above bits. Note that the bit values are CPU specific, not architecture
234 * specific.
235 *
236 * The kernel PTE entry holds an arch-dependent swp_entry structure under
237 * certain situations. In other words, in such situations some portion of
238 * the PTE bits are used as a swp_entry. In the PPC implementation, the
239 * 3-24th LSB are shared with swp_entry, however the 0-2nd three LSB still
240 * hold protection values. That means the three protection bits are
241 * reserved for both PTE and SWAP entry at the most significant three
242 * LSBs.
243 *
244 * There are three protection bits available for SWAP entry:
245 * _PAGE_PRESENT
246 * _PAGE_FILE
247 * _PAGE_HASHPTE (if HW has)
248 *
249 * So those three bits have to be inside of 0-2nd LSB of PTE.
250 *
205 */ 251 */
252
206#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */ 253#define _PAGE_PRESENT 0x00000001 /* S: PTE valid */
207#define _PAGE_RW 0x00000002 /* S: Write permission */ 254#define _PAGE_RW 0x00000002 /* S: Write permission */
208#define _PAGE_DIRTY 0x00000004 /* S: Page dirty */ 255#define _PAGE_FILE 0x00000004 /* S: nonlinear file mapping */
209#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */ 256#define _PAGE_ACCESSED 0x00000008 /* S: Page referenced */
210#define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */ 257#define _PAGE_HWWRITE 0x00000010 /* H: Dirty & RW */
211#define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */ 258#define _PAGE_HWEXEC 0x00000020 /* H: Execute permission */
212#define _PAGE_USER 0x00000040 /* S: User page */ 259#define _PAGE_USER 0x00000040 /* S: User page */
213#define _PAGE_ENDIAN 0x00000080 /* H: E bit */ 260#define _PAGE_ENDIAN 0x00000080 /* H: E bit */
214#define _PAGE_GUARDED 0x00000100 /* H: G bit */ 261#define _PAGE_GUARDED 0x00000100 /* H: G bit */
215#define _PAGE_COHERENT 0x00000200 /* H: M bit */ 262#define _PAGE_DIRTY 0x00000200 /* S: Page dirty */
216#define _PAGE_FILE 0x00000400 /* S: nonlinear file mapping */
217#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */ 263#define _PAGE_NO_CACHE 0x00000400 /* H: I bit */
218#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */ 264#define _PAGE_WRITETHRU 0x00000800 /* H: W bit */
219 265
diff --git a/include/asm-ppc/ppc4xx_dma.h b/include/asm-ppc/ppc4xx_dma.h
index 8636cdbf6f8f..a415001165fa 100644
--- a/include/asm-ppc/ppc4xx_dma.h
+++ b/include/asm-ppc/ppc4xx_dma.h
@@ -285,7 +285,7 @@ typedef uint32_t sgl_handle_t;
285 285
286#define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan)) 286#define GET_DMA_POLARITY(chan) (DMAReq_ActiveLow(chan) | DMAAck_ActiveLow(chan) | EOT_ActiveLow(chan))
287 287
288#elif defined(CONFIG_STBXXX_DMA) /* stb03xxx */ 288#elif defined(CONFIG_STB03xxx) /* stb03xxx */
289 289
290#define DMA_PPC4xx_SIZE 4096 290#define DMA_PPC4xx_SIZE 4096
291 291
diff --git a/include/asm-ppc/ppc_asm.h b/include/asm-ppc/ppc_asm.h
index 13fa8e7483c1..bb53e2def363 100644
--- a/include/asm-ppc/ppc_asm.h
+++ b/include/asm-ppc/ppc_asm.h
@@ -174,6 +174,8 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
174#define CLR_TOP32(r) 174#define CLR_TOP32(r)
175#endif /* CONFIG_PPC64BRIDGE */ 175#endif /* CONFIG_PPC64BRIDGE */
176 176
177#define RFCI .long 0x4c000066 /* rfci instruction */
178#define RFDI .long 0x4c00004e /* rfdi instruction */
177#define RFMCI .long 0x4c00004c /* rfmci instruction */ 179#define RFMCI .long 0x4c00004c /* rfmci instruction */
178 180
179#ifdef CONFIG_IBM405_ERR77 181#ifdef CONFIG_IBM405_ERR77
@@ -184,6 +186,12 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
184#define PPC405_ERR77_SYNC 186#define PPC405_ERR77_SYNC
185#endif 187#endif
186 188
189#ifdef CONFIG_IBM440EP_ERR42
190#define PPC440EP_ERR42 isync
191#else
192#define PPC440EP_ERR42
193#endif
194
187/* The boring bits... */ 195/* The boring bits... */
188 196
189/* Condition Register Bit Fields */ 197/* Condition Register Bit Fields */
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index c418aab7cd34..88b4222154d4 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -160,6 +160,7 @@
160#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */ 160#define HID0_ICFI (1<<11) /* Instr. Cache Flash Invalidate */
161#define HID0_DCI (1<<10) /* Data Cache Invalidate */ 161#define HID0_DCI (1<<10) /* Data Cache Invalidate */
162#define HID0_SPD (1<<9) /* Speculative disable */ 162#define HID0_SPD (1<<9) /* Speculative disable */
163#define HID0_DAPUEN (1<<8) /* Debug APU enable */
163#define HID0_SGE (1<<7) /* Store Gathering Enable */ 164#define HID0_SGE (1<<7) /* Store Gathering Enable */
164#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */ 165#define HID0_SIED (1<<7) /* Serial Instr. Execution [Disable] */
165#define HID0_DFCA (1<<6) /* Data Cache Flush Assist */ 166#define HID0_DFCA (1<<6) /* Data Cache Flush Assist */
diff --git a/include/asm-ppc/reg_booke.h b/include/asm-ppc/reg_booke.h
index 45c5e6f2b7ab..00ad9c754c78 100644
--- a/include/asm-ppc/reg_booke.h
+++ b/include/asm-ppc/reg_booke.h
@@ -165,6 +165,8 @@ do { \
165#define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */ 165#define SPRN_MCSRR1 0x23B /* Machine Check Save and Restore Register 1 */
166#define SPRN_MCSR 0x23C /* Machine Check Status Register */ 166#define SPRN_MCSR 0x23C /* Machine Check Status Register */
167#define SPRN_MCAR 0x23D /* Machine Check Address Register */ 167#define SPRN_MCAR 0x23D /* Machine Check Address Register */
168#define SPRN_DSRR0 0x23E /* Debug Save and Restore Register 0 */
169#define SPRN_DSRR1 0x23F /* Debug Save and Restore Register 1 */
168#define SPRN_MAS0 0x270 /* MMU Assist Register 0 */ 170#define SPRN_MAS0 0x270 /* MMU Assist Register 0 */
169#define SPRN_MAS1 0x271 /* MMU Assist Register 1 */ 171#define SPRN_MAS1 0x271 /* MMU Assist Register 1 */
170#define SPRN_MAS2 0x272 /* MMU Assist Register 2 */ 172#define SPRN_MAS2 0x272 /* MMU Assist Register 2 */
@@ -264,6 +266,17 @@ do { \
264#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */ 266#define MCSR_BUS_IPERR 0x00000002UL /* Instruction parity Error */
265#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */ 267#define MCSR_BUS_RPERR 0x00000001UL /* Read parity Error */
266#endif 268#endif
269#ifdef CONFIG_E200
270#define MCSR_MCP 0x80000000UL /* Machine Check Input Pin */
271#define MCSR_CP_PERR 0x20000000UL /* Cache Push Parity Error */
272#define MCSR_CPERR 0x10000000UL /* Cache Parity Error */
273#define MCSR_EXCP_ERR 0x08000000UL /* ISI, ITLB, or Bus Error on 1st insn
274 fetch for an exception handler */
275#define MCSR_BUS_IRERR 0x00000010UL /* Read Bus Error on instruction fetch*/
276#define MCSR_BUS_DRERR 0x00000008UL /* Read Bus Error on data load */
277#define MCSR_BUS_WRERR 0x00000004UL /* Write Bus Error on buffered
278 store or cache line push */
279#endif
267 280
268/* Bit definitions for the DBSR. */ 281/* Bit definitions for the DBSR. */
269/* 282/*
@@ -311,6 +324,7 @@ do { \
311#define ESR_ST 0x00800000 /* Store Operation */ 324#define ESR_ST 0x00800000 /* Store Operation */
312#define ESR_DLK 0x00200000 /* Data Cache Locking */ 325#define ESR_DLK 0x00200000 /* Data Cache Locking */
313#define ESR_ILK 0x00100000 /* Instr. Cache Locking */ 326#define ESR_ILK 0x00100000 /* Instr. Cache Locking */
327#define ESR_PUO 0x00040000 /* Unimplemented Operation exception */
314#define ESR_BO 0x00020000 /* Byte Ordering */ 328#define ESR_BO 0x00020000 /* Byte Ordering */
315 329
316/* Bit definitions related to the DBCR0. */ 330/* Bit definitions related to the DBCR0. */
@@ -387,10 +401,12 @@ do { \
387#define ICCR_CACHE 1 /* Cacheable */ 401#define ICCR_CACHE 1 /* Cacheable */
388 402
389/* Bit definitions for L1CSR0. */ 403/* Bit definitions for L1CSR0. */
404#define L1CSR0_CLFC 0x00000100 /* Cache Lock Bits Flash Clear */
390#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */ 405#define L1CSR0_DCFI 0x00000002 /* Data Cache Flash Invalidate */
406#define L1CSR0_CFI 0x00000002 /* Cache Flash Invalidate */
391#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */ 407#define L1CSR0_DCE 0x00000001 /* Data Cache Enable */
392 408
393/* Bit definitions for L1CSR0. */ 409/* Bit definitions for L1CSR1. */
394#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */ 410#define L1CSR1_ICLFR 0x00000100 /* Instr Cache Lock Bits Flash Reset */
395#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */ 411#define L1CSR1_ICFI 0x00000002 /* Instr Cache Flash Invalidate */
396#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */ 412#define L1CSR1_ICE 0x00000001 /* Instr Cache Enable */
diff --git a/include/asm-ppc/thread_info.h b/include/asm-ppc/thread_info.h
index e3b5284a6f91..27903db42efc 100644
--- a/include/asm-ppc/thread_info.h
+++ b/include/asm-ppc/thread_info.h
@@ -20,7 +20,8 @@ struct thread_info {
20 unsigned long flags; /* low level flags */ 20 unsigned long flags; /* low level flags */
21 unsigned long local_flags; /* non-racy flags */ 21 unsigned long local_flags; /* non-racy flags */
22 int cpu; /* cpu we're on */ 22 int cpu; /* cpu we're on */
23 int preempt_count; 23 int preempt_count; /* 0 => preemptable,
24 <0 => BUG */
24 struct restart_block restart_block; 25 struct restart_block restart_block;
25}; 26};
26 27
diff --git a/include/asm-ppc/time.h b/include/asm-ppc/time.h
index ce09b47fa819..321fb75b5f22 100644
--- a/include/asm-ppc/time.h
+++ b/include/asm-ppc/time.h
@@ -58,7 +58,7 @@ static __inline__ void set_dec(unsigned int val)
58/* Accessor functions for the timebase (RTC on 601) registers. */ 58/* Accessor functions for the timebase (RTC on 601) registers. */
59/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */ 59/* If one day CONFIG_POWER is added just define __USE_RTC as 1 */
60#ifdef CONFIG_6xx 60#ifdef CONFIG_6xx
61extern __inline__ int const __USE_RTC(void) { 61extern __inline__ int __attribute_pure__ __USE_RTC(void) {
62 return (mfspr(SPRN_PVR)>>16) == 1; 62 return (mfspr(SPRN_PVR)>>16) == 1;
63} 63}
64#else 64#else
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index cc51e5c9acc2..3173ab3d2eb9 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -262,7 +262,7 @@
262#define __NR_rtas 255 262#define __NR_rtas 255
263#define __NR_sys_debug_setcontext 256 263#define __NR_sys_debug_setcontext 256
264/* Number 257 is reserved for vserver */ 264/* Number 257 is reserved for vserver */
265/* Number 258 is reserved for new sys_remap_file_pages */ 265/* 258 currently unused */
266/* Number 259 is reserved for new sys_mbind */ 266/* Number 259 is reserved for new sys_mbind */
267/* Number 260 is reserved for new sys_get_mempolicy */ 267/* Number 260 is reserved for new sys_get_mempolicy */
268/* Number 261 is reserved for new sys_set_mempolicy */ 268/* Number 261 is reserved for new sys_set_mempolicy */
@@ -277,8 +277,13 @@
277#define __NR_request_key 270 277#define __NR_request_key 270
278#define __NR_keyctl 271 278#define __NR_keyctl 271
279#define __NR_waitid 272 279#define __NR_waitid 272
280#define __NR_ioprio_set 273
281#define __NR_ioprio_get 274
282#define __NR_inotify_init 275
283#define __NR_inotify_add_watch 276
284#define __NR_inotify_rm_watch 277
280 285
281#define __NR_syscalls 273 286#define __NR_syscalls 278
282 287
283#define __NR(n) #n 288#define __NR(n) #n
284 289
diff --git a/include/asm-ppc64/bug.h b/include/asm-ppc64/bug.h
index 169868fa307d..160178278861 100644
--- a/include/asm-ppc64/bug.h
+++ b/include/asm-ppc64/bug.h
@@ -43,8 +43,8 @@ struct bug_entry *find_bug(unsigned long bugaddr);
43 ".section __bug_table,\"a\"\n\t" \ 43 ".section __bug_table,\"a\"\n\t" \
44 " .llong 1b,%1,%2,%3\n" \ 44 " .llong 1b,%1,%2,%3\n" \
45 ".previous" \ 45 ".previous" \
46 : : "r" (x), "i" (__LINE__), "i" (__FILE__), \ 46 : : "r" ((long long)(x)), "i" (__LINE__), \
47 "i" (__FUNCTION__)); \ 47 "i" (__FILE__), "i" (__FUNCTION__)); \
48} while (0) 48} while (0)
49 49
50#define WARN_ON(x) do { \ 50#define WARN_ON(x) do { \
@@ -53,7 +53,8 @@ struct bug_entry *find_bug(unsigned long bugaddr);
53 ".section __bug_table,\"a\"\n\t" \ 53 ".section __bug_table,\"a\"\n\t" \
54 " .llong 1b,%1,%2,%3\n" \ 54 " .llong 1b,%1,%2,%3\n" \
55 ".previous" \ 55 ".previous" \
56 : : "r" (x), "i" (__LINE__ + BUG_WARNING_TRAP), \ 56 : : "r" ((long long)(x)), \
57 "i" (__LINE__ + BUG_WARNING_TRAP), \
57 "i" (__FILE__), "i" (__FUNCTION__)); \ 58 "i" (__FILE__), "i" (__FUNCTION__)); \
58} while (0) 59} while (0)
59 60
diff --git a/include/asm-ppc64/byteorder.h b/include/asm-ppc64/byteorder.h
index 80327532de64..8b57da62b674 100644
--- a/include/asm-ppc64/byteorder.h
+++ b/include/asm-ppc64/byteorder.h
@@ -40,7 +40,6 @@ static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
40 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr)); 40 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
41} 41}
42 42
43#if 0
44static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value) 43static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 value)
45{ 44{
46 __u16 result; 45 __u16 result;
@@ -63,17 +62,8 @@ static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 value)
63 return result; 62 return result;
64} 63}
65 64
66static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 value)
67{
68 __u64 result;
69#error implement me
70}
71
72#define __arch__swab16(x) ___arch__swab16(x) 65#define __arch__swab16(x) ___arch__swab16(x)
73#define __arch__swab32(x) ___arch__swab32(x) 66#define __arch__swab32(x) ___arch__swab32(x)
74#define __arch__swab64(x) ___arch__swab64(x)
75
76#endif
77 67
78/* The same, but returns converted value from the location pointer by addr. */ 68/* The same, but returns converted value from the location pointer by addr. */
79#define __arch__swab16p(addr) ld_le16(addr) 69#define __arch__swab16p(addr) ld_le16(addr)
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
index 09c28d28ce6c..12414f5fc666 100644
--- a/include/asm-ppc64/compat.h
+++ b/include/asm-ppc64/compat.h
@@ -26,6 +26,7 @@ typedef s32 compat_daddr_t;
26typedef u32 compat_caddr_t; 26typedef u32 compat_caddr_t;
27typedef __kernel_fsid_t compat_fsid_t; 27typedef __kernel_fsid_t compat_fsid_t;
28typedef s32 compat_key_t; 28typedef s32 compat_key_t;
29typedef s32 compat_timer_t;
29 30
30typedef s32 compat_int_t; 31typedef s32 compat_int_t;
31typedef s32 compat_long_t; 32typedef s32 compat_long_t;
diff --git a/include/asm-ppc64/cputable.h b/include/asm-ppc64/cputable.h
index cbbfbec78b6b..d67fa9e26079 100644
--- a/include/asm-ppc64/cputable.h
+++ b/include/asm-ppc64/cputable.h
@@ -138,6 +138,7 @@ extern firmware_feature_t firmware_features_table[];
138#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) 138#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
139#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) 139#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
140#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) 140#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000)
141#define CPU_FTR_CTRL ASM_CONST(0x0000100000000000)
141 142
142/* Platform firmware features */ 143/* Platform firmware features */
143#define FW_FTR_ ASM_CONST(0x0000000000000001) 144#define FW_FTR_ ASM_CONST(0x0000000000000001)
@@ -148,7 +149,7 @@ extern firmware_feature_t firmware_features_table[];
148 149
149#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \ 150#define CPU_FTR_PPCAS_ARCH_V2_BASE (CPU_FTR_SLB | \
150 CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \ 151 CPU_FTR_TLBIEL | CPU_FTR_NOEXECUTE | \
151 CPU_FTR_NODSISRALIGN) 152 CPU_FTR_NODSISRALIGN | CPU_FTR_CTRL)
152 153
153/* iSeries doesn't support large pages */ 154/* iSeries doesn't support large pages */
154#ifdef CONFIG_PPC_ISERIES 155#ifdef CONFIG_PPC_ISERIES
diff --git a/include/asm-ppc64/emergency-restart.h b/include/asm-ppc64/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-ppc64/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-ppc64/hvconsole.h b/include/asm-ppc64/hvconsole.h
index d89d94c91815..6da93ce74dc0 100644
--- a/include/asm-ppc64/hvconsole.h
+++ b/include/asm-ppc64/hvconsole.h
@@ -29,12 +29,21 @@
29 */ 29 */
30#define MAX_NR_HVC_CONSOLES 16 30#define MAX_NR_HVC_CONSOLES 16
31 31
32/* implemented by a low level driver */
33struct hv_ops {
34 int (*get_chars)(uint32_t vtermno, char *buf, int count);
35 int (*put_chars)(uint32_t vtermno, const char *buf, int count);
36};
32extern int hvc_get_chars(uint32_t vtermno, char *buf, int count); 37extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
33extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count); 38extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
34 39
35/* Early discovery of console adapters. */ 40struct hvc_struct;
36extern int hvc_find_vtys(void);
37 41
38/* Implemented by a console driver */ 42/* Register a vterm and a slot index for use as a console (console_init) */
39extern int hvc_instantiate(uint32_t vtermno, int index); 43extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops);
44/* register a vterm for hvc tty operation (module_init or hotplug add) */
45extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq,
46 struct hv_ops *ops);
47/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */
48extern int __devexit hvc_remove(struct hvc_struct *hp);
40#endif /* _PPC64_HVCONSOLE_H */ 49#endif /* _PPC64_HVCONSOLE_H */
diff --git a/include/asm-ppc64/iSeries/HvCallHpt.h b/include/asm-ppc64/iSeries/HvCallHpt.h
index 66f38222ff75..43a1969230b8 100644
--- a/include/asm-ppc64/iSeries/HvCallHpt.h
+++ b/include/asm-ppc64/iSeries/HvCallHpt.h
@@ -77,27 +77,26 @@ static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
77 return compressedStatus; 77 return compressedStatus;
78} 78}
79 79
80static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn) 80static inline u64 HvCallHpt_findValid(hpte_t *hpte, u64 vpn)
81{ 81{
82 return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0); 82 return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0);
83} 83}
84 84
85static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex, 85static inline u64 HvCallHpt_findNextValid(hpte_t *hpte, u32 hpteIndex,
86 u8 bitson, u8 bitsoff) 86 u8 bitson, u8 bitsoff)
87{ 87{
88 return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex, 88 return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex,
89 bitson, bitsoff); 89 bitson, bitsoff);
90} 90}
91 91
92static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex) 92static inline void HvCallHpt_get(hpte_t *hpte, u32 hpteIndex)
93{ 93{
94 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0); 94 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
95} 95}
96 96
97static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte) 97static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, hpte_t *hpte)
98{ 98{
99 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)), 99 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, hpte->v, hpte->r);
100 (*(((u64 *)hpte)+1)));
101} 100}
102 101
103#endif /* _HVCALLHPT_H */ 102#endif /* _HVCALLHPT_H */
diff --git a/include/asm-ppc64/iSeries/HvReleaseData.h b/include/asm-ppc64/iSeries/HvReleaseData.h
index 01a1f13ea4a0..c8162e5ccb21 100644
--- a/include/asm-ppc64/iSeries/HvReleaseData.h
+++ b/include/asm-ppc64/iSeries/HvReleaseData.h
@@ -39,6 +39,11 @@
39 * know that this PLIC does not support running an OS "that old". 39 * know that this PLIC does not support running an OS "that old".
40 */ 40 */
41 41
42#define HVREL_TAGSINACTIVE 0x8000
43#define HVREL_32BIT 0x4000
44#define HVREL_NOSHAREDPROCS 0x2000
45#define HVREL_NOHMT 0x1000
46
42struct HvReleaseData { 47struct HvReleaseData {
43 u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */ 48 u32 xDesc; /* Descriptor "HvRD" ebcdic x00-x03 */
44 u16 xSize; /* Size of this control block x04-x05 */ 49 u16 xSize; /* Size of this control block x04-x05 */
@@ -46,11 +51,7 @@ struct HvReleaseData {
46 struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */ 51 struct naca_struct *xSlicNacaAddr; /* Virt addr of SLIC NACA x08-x0F */
47 u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */ 52 u32 xMsNucDataOffset; /* Offset of Linux Mapping Data x10-x13 */
48 u32 xRsvd1; /* Reserved x14-x17 */ 53 u32 xRsvd1; /* Reserved x14-x17 */
49 u16 xTagsMode:1; /* 0 == tags active, 1 == tags inactive */ 54 u16 xFlags;
50 u16 xAddressSize:1; /* 0 == 64-bit, 1 == 32-bit */
51 u16 xNoSharedProcs:1; /* 0 == shared procs, 1 == no shared */
52 u16 xNoHMT:1; /* 0 == allow HMT, 1 == no HMT */
53 u16 xRsvd2:12; /* Reserved x18-x19 */
54 u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */ 55 u16 xVrmIndex; /* VRM Index of OS image x1A-x1B */
55 u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */ 56 u16 xMinSupportedPlicVrmIndex; /* Min PLIC level (soft) x1C-x1D */
56 u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */ 57 u16 xMinCompatablePlicVrmIndex; /* Min PLIC levelP (hard) x1E-x1F */
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h
index 393299e04d7f..69b26ad74135 100644
--- a/include/asm-ppc64/iSeries/ItLpQueue.h
+++ b/include/asm-ppc64/iSeries/ItLpQueue.h
@@ -41,7 +41,7 @@ struct HvLpEvent;
41#define LpEventMaxSize 256 41#define LpEventMaxSize 256
42#define LpEventAlign 64 42#define LpEventAlign 64
43 43
44struct ItLpQueue { 44struct hvlpevent_queue {
45/* 45/*
46 * The xSlicCurEventPtr is the pointer to the next event stack entry 46 * The xSlicCurEventPtr is the pointer to the next event stack entry
47 * that will become valid. The OS must peek at this entry to determine 47 * that will become valid. The OS must peek at this entry to determine
@@ -69,16 +69,13 @@ struct ItLpQueue {
69 char *xSlicEventStackPtr; // 0x20 69 char *xSlicEventStackPtr; // 0x20
70 u8 xIndex; // 0x28 unique sequential index. 70 u8 xIndex; // 0x28 unique sequential index.
71 u8 xSlicRsvd[3]; // 0x29-2b 71 u8 xSlicRsvd[3]; // 0x29-2b
72 u32 xInUseWord; // 0x2C 72 spinlock_t lock;
73 u64 xLpIntCount; // 0x30 Total Lp Int msgs processed
74 u64 xLpIntCountByType[9]; // 0x38-0x7F Event counts by type
75}; 73};
76 74
77extern struct ItLpQueue xItLpQueue; 75extern struct hvlpevent_queue hvlpevent_queue;
78 76
79extern struct HvLpEvent *ItLpQueue_getNextLpEvent(struct ItLpQueue *); 77extern int hvlpevent_is_pending(void);
80extern int ItLpQueue_isLpIntPending(struct ItLpQueue *); 78extern void process_hvlpevents(struct pt_regs *);
81extern unsigned ItLpQueue_process(struct ItLpQueue *, struct pt_regs *); 79extern void setup_hvlpevent_queue(void);
82extern void ItLpQueue_clearValid(struct HvLpEvent *);
83 80
84#endif /* _ITLPQUEUE_H */ 81#endif /* _ITLPQUEUE_H */
diff --git a/include/asm-ppc64/iSeries/LparMap.h b/include/asm-ppc64/iSeries/LparMap.h
index 038e5df7e9f8..a6840b186d03 100644
--- a/include/asm-ppc64/iSeries/LparMap.h
+++ b/include/asm-ppc64/iSeries/LparMap.h
@@ -19,6 +19,8 @@
19#ifndef _LPARMAP_H 19#ifndef _LPARMAP_H
20#define _LPARMAP_H 20#define _LPARMAP_H
21 21
22#ifndef __ASSEMBLY__
23
22#include <asm/types.h> 24#include <asm/types.h>
23 25
24/* 26/*
@@ -49,21 +51,33 @@
49 * entry to map the Esid to the Vsid. 51 * entry to map the Esid to the Vsid.
50*/ 52*/
51 53
54#define HvEsidsToMap 2
55#define HvRangesToMap 1
56
52/* Hypervisor initially maps 32MB of the load area */ 57/* Hypervisor initially maps 32MB of the load area */
53#define HvPagesToMap 8192 58#define HvPagesToMap 8192
54 59
55struct LparMap { 60struct LparMap {
56 u64 xNumberEsids; // Number of ESID/VSID pairs (1) 61 u64 xNumberEsids; // Number of ESID/VSID pairs
57 u64 xNumberRanges; // Number of VA ranges to map (1) 62 u64 xNumberRanges; // Number of VA ranges to map
58 u64 xSegmentTableOffs; // Page number within load area of seg table (0) 63 u64 xSegmentTableOffs; // Page number within load area of seg table
59 u64 xRsvd[5]; 64 u64 xRsvd[5];
60 u64 xKernelEsid; // Esid used to map kernel load (0x0C00000000) 65 struct {
61 u64 xKernelVsid; // Vsid used to map kernel load (0x0C00000000) 66 u64 xKernelEsid; // Esid used to map kernel load
62 u64 xPages; // Number of pages to be mapped (8192) 67 u64 xKernelVsid; // Vsid used to map kernel load
63 u64 xOffset; // Offset from start of load area (0) 68 } xEsids[HvEsidsToMap];
64 u64 xVPN; // Virtual Page Number (0x000C000000000000) 69 struct {
70 u64 xPages; // Number of pages to be mapped
71 u64 xOffset; // Offset from start of load area
72 u64 xVPN; // Virtual Page Number
73 } xRanges[HvRangesToMap];
65}; 74};
66 75
67extern struct LparMap xLparMap; 76extern const struct LparMap xLparMap;
77
78#endif /* __ASSEMBLY__ */
79
80/* the fixed address where the LparMap exists */
81#define LPARMAP_PHYS 0x7000
68 82
69#endif /* _LPARMAP_H */ 83#endif /* _LPARMAP_H */
diff --git a/include/asm-ppc64/kdebug.h b/include/asm-ppc64/kdebug.h
index 488634258a72..d383d161cf8d 100644
--- a/include/asm-ppc64/kdebug.h
+++ b/include/asm-ppc64/kdebug.h
@@ -17,7 +17,7 @@ struct die_args {
17 17
18/* 18/*
19 Note - you should never unregister because that can race with NMIs. 19 Note - you should never unregister because that can race with NMIs.
20 If you really want to do it first unregister - then synchronize_kernel - 20 If you really want to do it first unregister - then synchronize_sched -
21 then free. 21 then free.
22 */ 22 */
23int register_die_notifier(struct notifier_block *nb); 23int register_die_notifier(struct notifier_block *nb);
diff --git a/include/asm-ppc64/kexec.h b/include/asm-ppc64/kexec.h
new file mode 100644
index 000000000000..511908afaeeb
--- /dev/null
+++ b/include/asm-ppc64/kexec.h
@@ -0,0 +1,41 @@
1#ifndef _PPC64_KEXEC_H
2#define _PPC64_KEXEC_H
3
4/*
5 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
6 * I.e. Maximum page that is mapped directly into kernel memory,
7 * and kmap is not required.
8 */
9
10/* Maximum physical address we can use pages from */
11/* XXX: since we copy virt we can use any page we allocate */
12#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
13
14/* Maximum address we can reach in physical address mode */
15/* XXX: I want to allow initrd in highmem. otherwise set to rmo on lpar */
16#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
17
18/* Maximum address we can use for the control code buffer */
19/* XXX: unused today, ppc32 uses TASK_SIZE, probably left over from use_mm */
20#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)
21
22/* XXX: today we don't use this at all, althogh we have a static stack */
23#define KEXEC_CONTROL_CODE_SIZE 4096
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_PPC64
27
28#define MAX_NOTE_BYTES 1024
29
30#ifndef __ASSEMBLY__
31
32typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
33
34extern note_buf_t crash_notes[];
35
36extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
37 master to copy new code to 0 */
38
39#endif /* __ASSEMBLY__ */
40#endif /* _PPC_KEXEC_H */
41
diff --git a/include/asm-ppc64/kprobes.h b/include/asm-ppc64/kprobes.h
index 19b468bed059..0802919c3235 100644
--- a/include/asm-ppc64/kprobes.h
+++ b/include/asm-ppc64/kprobes.h
@@ -42,10 +42,13 @@ typedef unsigned int kprobe_opcode_t;
42 42
43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry) 43#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)((func_descr_t *)pentry)
44 44
45#define ARCH_SUPPORTS_KRETPROBES
46void kretprobe_trampoline(void);
47
45/* Architecture specific copy of original instruction */ 48/* Architecture specific copy of original instruction */
46struct arch_specific_insn { 49struct arch_specific_insn {
47 /* copy of original instruction */ 50 /* copy of original instruction */
48 kprobe_opcode_t insn[MAX_INSN_SIZE]; 51 kprobe_opcode_t *insn;
49}; 52};
50 53
51#ifdef CONFIG_KPROBES 54#ifdef CONFIG_KPROBES
diff --git a/include/asm-ppc64/machdep.h b/include/asm-ppc64/machdep.h
index 5d3cd9d042e2..f0ef06375947 100644
--- a/include/asm-ppc64/machdep.h
+++ b/include/asm-ppc64/machdep.h
@@ -53,10 +53,8 @@ struct machdep_calls {
53 long (*hpte_insert)(unsigned long hpte_group, 53 long (*hpte_insert)(unsigned long hpte_group,
54 unsigned long va, 54 unsigned long va,
55 unsigned long prpn, 55 unsigned long prpn,
56 int secondary, 56 unsigned long vflags,
57 unsigned long hpteflags, 57 unsigned long rflags);
58 int bolted,
59 int large);
60 long (*hpte_remove)(unsigned long hpte_group); 58 long (*hpte_remove)(unsigned long hpte_group);
61 void (*flush_hash_range)(unsigned long context, 59 void (*flush_hash_range)(unsigned long context,
62 unsigned long number, 60 unsigned long number,
@@ -76,6 +74,7 @@ struct machdep_calls {
76 void (*tce_flush)(struct iommu_table *tbl); 74 void (*tce_flush)(struct iommu_table *tbl);
77 void (*iommu_dev_setup)(struct pci_dev *dev); 75 void (*iommu_dev_setup)(struct pci_dev *dev);
78 void (*iommu_bus_setup)(struct pci_bus *bus); 76 void (*iommu_bus_setup)(struct pci_bus *bus);
77 void (*irq_bus_setup)(struct pci_bus *bus);
79 78
80 int (*probe)(int platform); 79 int (*probe)(int platform);
81 void (*setup_arch)(void); 80 void (*setup_arch)(void);
@@ -85,6 +84,7 @@ struct machdep_calls {
85 84
86 void (*init_IRQ)(void); 85 void (*init_IRQ)(void);
87 int (*get_irq)(struct pt_regs *); 86 int (*get_irq)(struct pt_regs *);
87 void (*cpu_irq_down)(int secondary);
88 88
89 /* PCI stuff */ 89 /* PCI stuff */
90 void (*pcibios_fixup)(void); 90 void (*pcibios_fixup)(void);
@@ -138,8 +138,13 @@ struct machdep_calls {
138 unsigned long size, 138 unsigned long size,
139 pgprot_t vma_prot); 139 pgprot_t vma_prot);
140 140
141 /* Idle loop for this platform, leave empty for default idle loop */
142 int (*idle_loop)(void);
141}; 143};
142 144
145extern int default_idle(void);
146extern int native_idle(void);
147
143extern struct machdep_calls ppc_md; 148extern struct machdep_calls ppc_md;
144extern char cmd_line[COMMAND_LINE_SIZE]; 149extern char cmd_line[COMMAND_LINE_SIZE];
145 150
diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h
index c78282a67d8e..70348a851313 100644
--- a/include/asm-ppc64/mmu.h
+++ b/include/asm-ppc64/mmu.h
@@ -47,9 +47,10 @@
47#define SLB_VSID_KS ASM_CONST(0x0000000000000800) 47#define SLB_VSID_KS ASM_CONST(0x0000000000000800)
48#define SLB_VSID_KP ASM_CONST(0x0000000000000400) 48#define SLB_VSID_KP ASM_CONST(0x0000000000000400)
49#define SLB_VSID_N ASM_CONST(0x0000000000000200) /* no-execute */ 49#define SLB_VSID_N ASM_CONST(0x0000000000000200) /* no-execute */
50#define SLB_VSID_L ASM_CONST(0x0000000000000100) /* largepage 16M */ 50#define SLB_VSID_L ASM_CONST(0x0000000000000100) /* largepage */
51#define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */ 51#define SLB_VSID_C ASM_CONST(0x0000000000000080) /* class */
52 52#define SLB_VSID_LS ASM_CONST(0x0000000000000070) /* size of largepage */
53
53#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C) 54#define SLB_VSID_KERNEL (SLB_VSID_KP|SLB_VSID_C)
54#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS) 55#define SLB_VSID_USER (SLB_VSID_KP|SLB_VSID_KS)
55 56
@@ -59,6 +60,22 @@
59 60
60#define HPTES_PER_GROUP 8 61#define HPTES_PER_GROUP 8
61 62
63#define HPTE_V_AVPN_SHIFT 7
64#define HPTE_V_AVPN ASM_CONST(0xffffffffffffff80)
65#define HPTE_V_AVPN_VAL(x) (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
66#define HPTE_V_BOLTED ASM_CONST(0x0000000000000010)
67#define HPTE_V_LOCK ASM_CONST(0x0000000000000008)
68#define HPTE_V_LARGE ASM_CONST(0x0000000000000004)
69#define HPTE_V_SECONDARY ASM_CONST(0x0000000000000002)
70#define HPTE_V_VALID ASM_CONST(0x0000000000000001)
71
72#define HPTE_R_PP0 ASM_CONST(0x8000000000000000)
73#define HPTE_R_TS ASM_CONST(0x4000000000000000)
74#define HPTE_R_RPN_SHIFT 12
75#define HPTE_R_RPN ASM_CONST(0x3ffffffffffff000)
76#define HPTE_R_FLAGS ASM_CONST(0x00000000000003ff)
77#define HPTE_R_PP ASM_CONST(0x0000000000000003)
78
62/* Values for PP (assumes Ks=0, Kp=1) */ 79/* Values for PP (assumes Ks=0, Kp=1) */
63/* pp0 will always be 0 for linux */ 80/* pp0 will always be 0 for linux */
64#define PP_RWXX 0 /* Supervisor read/write, User none */ 81#define PP_RWXX 0 /* Supervisor read/write, User none */
@@ -68,54 +85,13 @@
68 85
69#ifndef __ASSEMBLY__ 86#ifndef __ASSEMBLY__
70 87
71/* Hardware Page Table Entry */
72typedef struct {
73 unsigned long avpn:57; /* vsid | api == avpn */
74 unsigned long : 2; /* Software use */
75 unsigned long bolted: 1; /* HPTE is "bolted" */
76 unsigned long lock: 1; /* lock on pSeries SMP */
77 unsigned long l: 1; /* Virtual page is large (L=1) or 4 KB (L=0) */
78 unsigned long h: 1; /* Hash function identifier */
79 unsigned long v: 1; /* Valid (v=1) or invalid (v=0) */
80} Hpte_dword0;
81
82typedef struct { 88typedef struct {
83 unsigned long pp0: 1; /* Page protection bit 0 */ 89 unsigned long v;
84 unsigned long ts: 1; /* Tag set bit */ 90 unsigned long r;
85 unsigned long rpn: 50; /* Real page number */ 91} hpte_t;
86 unsigned long : 2; /* Reserved */
87 unsigned long ac: 1; /* Address compare */
88 unsigned long r: 1; /* Referenced */
89 unsigned long c: 1; /* Changed */
90 unsigned long w: 1; /* Write-thru cache mode */
91 unsigned long i: 1; /* Cache inhibited */
92 unsigned long m: 1; /* Memory coherence required */
93 unsigned long g: 1; /* Guarded */
94 unsigned long n: 1; /* No-execute */
95 unsigned long pp: 2; /* Page protection bits 1:2 */
96} Hpte_dword1;
97 92
98typedef struct { 93extern hpte_t *htab_address;
99 char padding[6]; /* padding */ 94extern unsigned long htab_hash_mask;
100 unsigned long : 6; /* padding */
101 unsigned long flags: 10; /* HPTE flags */
102} Hpte_dword1_flags;
103
104typedef struct {
105 union {
106 unsigned long dword0;
107 Hpte_dword0 dw0;
108 } dw0;
109
110 union {
111 unsigned long dword1;
112 Hpte_dword1 dw1;
113 Hpte_dword1_flags flags;
114 } dw1;
115} HPTE;
116
117extern HPTE * htab_address;
118extern unsigned long htab_hash_mask;
119 95
120static inline unsigned long hpt_hash(unsigned long vpn, int large) 96static inline unsigned long hpt_hash(unsigned long vpn, int large)
121{ 97{
@@ -180,6 +156,28 @@ static inline void tlbiel(unsigned long va)
180 asm volatile("ptesync": : :"memory"); 156 asm volatile("ptesync": : :"memory");
181} 157}
182 158
159static inline unsigned long slot2va(unsigned long hpte_v, unsigned long slot)
160{
161 unsigned long avpn = HPTE_V_AVPN_VAL(hpte_v);
162 unsigned long va;
163
164 va = avpn << 23;
165
166 if (! (hpte_v & HPTE_V_LARGE)) {
167 unsigned long vpi, pteg;
168
169 pteg = slot / HPTES_PER_GROUP;
170 if (hpte_v & HPTE_V_SECONDARY)
171 pteg = ~pteg;
172
173 vpi = ((va >> 28) ^ pteg) & htab_hash_mask;
174
175 va |= vpi << PAGE_SHIFT;
176 }
177
178 return va;
179}
180
183/* 181/*
184 * Handle a fault by adding an HPTE. If the address can't be determined 182 * Handle a fault by adding an HPTE. If the address can't be determined
185 * to be valid via Linux page tables, return 1. If handled return 0 183 * to be valid via Linux page tables, return 1. If handled return 0
@@ -196,11 +194,13 @@ extern void hpte_init_iSeries(void);
196 194
197extern long pSeries_lpar_hpte_insert(unsigned long hpte_group, 195extern long pSeries_lpar_hpte_insert(unsigned long hpte_group,
198 unsigned long va, unsigned long prpn, 196 unsigned long va, unsigned long prpn,
199 int secondary, unsigned long hpteflags, 197 unsigned long vflags,
200 int bolted, int large); 198 unsigned long rflags);
201extern long native_hpte_insert(unsigned long hpte_group, unsigned long va, 199extern long native_hpte_insert(unsigned long hpte_group, unsigned long va,
202 unsigned long prpn, int secondary, 200 unsigned long prpn,
203 unsigned long hpteflags, int bolted, int large); 201 unsigned long vflags, unsigned long rflags);
202
203extern void stabs_alloc(void);
204 204
205#endif /* __ASSEMBLY__ */ 205#endif /* __ASSEMBLY__ */
206 206
@@ -338,6 +338,9 @@ static inline unsigned long get_vsid(unsigned long context, unsigned long ea)
338 | (ea >> SID_SHIFT)); 338 | (ea >> SID_SHIFT));
339} 339}
340 340
341#define VSID_SCRAMBLE(pvsid) (((pvsid) * VSID_MULTIPLIER) % VSID_MODULUS)
342#define KERNEL_VSID(ea) VSID_SCRAMBLE(GET_ESID(ea))
343
341#endif /* __ASSEMBLY */ 344#endif /* __ASSEMBLY */
342 345
343#endif /* _PPC64_MMU_H_ */ 346#endif /* _PPC64_MMU_H_ */
diff --git a/include/asm-ppc64/mmzone.h b/include/asm-ppc64/mmzone.h
index 0619a41a3c9d..ed473f4b0152 100644
--- a/include/asm-ppc64/mmzone.h
+++ b/include/asm-ppc64/mmzone.h
@@ -10,9 +10,20 @@
10#include <linux/config.h> 10#include <linux/config.h>
11#include <asm/smp.h> 11#include <asm/smp.h>
12 12
13#ifdef CONFIG_DISCONTIGMEM 13/* generic non-linear memory support:
14 *
15 * 1) we will not split memory into more chunks than will fit into the
16 * flags field of the struct page
17 */
18
19
20#ifdef CONFIG_NEED_MULTIPLE_NODES
14 21
15extern struct pglist_data *node_data[]; 22extern struct pglist_data *node_data[];
23/*
24 * Return a pointer to the node data for node n.
25 */
26#define NODE_DATA(nid) (node_data[nid])
16 27
17/* 28/*
18 * Following are specific to this numa platform. 29 * Following are specific to this numa platform.
@@ -47,36 +58,32 @@ static inline int pa_to_nid(unsigned long pa)
47 return nid; 58 return nid;
48} 59}
49 60
50#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
51
52/*
53 * Return a pointer to the node data for node n.
54 */
55#define NODE_DATA(nid) (node_data[nid])
56
57#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn) 61#define node_localnr(pfn, nid) ((pfn) - NODE_DATA(nid)->node_start_pfn)
58 62
59/* 63/*
60 * Following are macros that each numa implmentation must define. 64 * Following are macros that each numa implmentation must define.
61 */ 65 */
62 66
63/*
64 * Given a kernel address, find the home node of the underlying memory.
65 */
66#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr))
67
68#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
69#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 67#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
70#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn) 68#define node_end_pfn(nid) (NODE_DATA(nid)->node_end_pfn)
71 69
72#define local_mapnr(kvaddr) \ 70#define local_mapnr(kvaddr) \
73 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) 71 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr))
74 72
73#ifdef CONFIG_DISCONTIGMEM
74
75/*
76 * Given a kernel address, find the home node of the underlying memory.
77 */
78#define kvaddr_to_nid(kaddr) pa_to_nid(__pa(kaddr))
79
80#define pfn_to_nid(pfn) pa_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
81
75/* Written this way to avoid evaluating arguments twice */ 82/* Written this way to avoid evaluating arguments twice */
76#define discontigmem_pfn_to_page(pfn) \ 83#define discontigmem_pfn_to_page(pfn) \
77({ \ 84({ \
78 unsigned long __tmp = pfn; \ 85 unsigned long __tmp = pfn; \
79 (node_mem_map(pfn_to_nid(__tmp)) + \ 86 (NODE_DATA(pfn_to_nid(__tmp))->node_mem_map + \
80 node_localnr(__tmp, pfn_to_nid(__tmp))); \ 87 node_localnr(__tmp, pfn_to_nid(__tmp))); \
81}) 88})
82 89
@@ -91,4 +98,11 @@ static inline int pa_to_nid(unsigned long pa)
91#define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages) 98#define discontigmem_pfn_valid(pfn) ((pfn) < num_physpages)
92 99
93#endif /* CONFIG_DISCONTIGMEM */ 100#endif /* CONFIG_DISCONTIGMEM */
101
102#endif /* CONFIG_NEED_MULTIPLE_NODES */
103
104#ifdef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
105#define early_pfn_to_nid(pfn) pa_to_nid(((unsigned long)pfn) << PAGE_SHIFT)
106#endif
107
94#endif /* _ASM_MMZONE_H_ */ 108#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-ppc64/nvram.h b/include/asm-ppc64/nvram.h
index 4e6dd370d936..dfaa21566c9a 100644
--- a/include/asm-ppc64/nvram.h
+++ b/include/asm-ppc64/nvram.h
@@ -70,6 +70,7 @@ extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
70 70
71extern int pSeries_nvram_init(void); 71extern int pSeries_nvram_init(void);
72extern int pmac_nvram_init(void); 72extern int pmac_nvram_init(void);
73extern int bpa_nvram_init(void);
73 74
74/* PowerMac specific nvram stuffs */ 75/* PowerMac specific nvram stuffs */
75 76
diff --git a/include/asm-ppc64/paca.h b/include/asm-ppc64/paca.h
index ae76cae1483f..2f0f36f73d38 100644
--- a/include/asm-ppc64/paca.h
+++ b/include/asm-ppc64/paca.h
@@ -20,7 +20,6 @@
20#include <asm/types.h> 20#include <asm/types.h>
21#include <asm/lppaca.h> 21#include <asm/lppaca.h>
22#include <asm/iSeries/ItLpRegSave.h> 22#include <asm/iSeries/ItLpRegSave.h>
23#include <asm/iSeries/ItLpQueue.h>
24#include <asm/mmu.h> 23#include <asm/mmu.h>
25 24
26register struct paca_struct *local_paca asm("r13"); 25register struct paca_struct *local_paca asm("r13");
@@ -62,7 +61,6 @@ struct paca_struct {
62 u16 paca_index; /* Logical processor number */ 61 u16 paca_index; /* Logical processor number */
63 62
64 u32 default_decr; /* Default decrementer value */ 63 u32 default_decr; /* Default decrementer value */
65 struct ItLpQueue *lpqueue_ptr; /* LpQueue handled by this CPU */
66 u64 kernel_toc; /* Kernel TOC address */ 64 u64 kernel_toc; /* Kernel TOC address */
67 u64 stab_real; /* Absolute address of segment table */ 65 u64 stab_real; /* Absolute address of segment table */
68 u64 stab_addr; /* Virtual address of segment table */ 66 u64 stab_addr; /* Virtual address of segment table */
@@ -91,7 +89,6 @@ struct paca_struct {
91 u64 next_jiffy_update_tb; /* TB value for next jiffy update */ 89 u64 next_jiffy_update_tb; /* TB value for next jiffy update */
92 u64 saved_r1; /* r1 save for RTAS calls */ 90 u64 saved_r1; /* r1 save for RTAS calls */
93 u64 saved_msr; /* MSR saved here by enter_rtas */ 91 u64 saved_msr; /* MSR saved here by enter_rtas */
94 u32 lpevent_count; /* lpevents processed */
95 u8 proc_enabled; /* irq soft-enable flag */ 92 u8 proc_enabled; /* irq soft-enable flag */
96 93
97 /* not yet used */ 94 /* not yet used */
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index 257d87eb7c34..a5893a305a09 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -217,7 +217,8 @@ extern u64 ppc64_pft_size; /* Log 2 of page table size */
217#define page_to_pfn(page) discontigmem_page_to_pfn(page) 217#define page_to_pfn(page) discontigmem_page_to_pfn(page)
218#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn) 218#define pfn_to_page(pfn) discontigmem_pfn_to_page(pfn)
219#define pfn_valid(pfn) discontigmem_pfn_valid(pfn) 219#define pfn_valid(pfn) discontigmem_pfn_valid(pfn)
220#else 220#endif
221#ifdef CONFIG_FLATMEM
221#define pfn_to_page(pfn) (mem_map + (pfn)) 222#define pfn_to_page(pfn) (mem_map + (pfn))
222#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 223#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
223#define pfn_valid(pfn) ((pfn) < max_mapnr) 224#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-ppc64/pci.h b/include/asm-ppc64/pci.h
index 6cd593f660a0..4d057452f59b 100644
--- a/include/asm-ppc64/pci.h
+++ b/include/asm-ppc64/pci.h
@@ -37,7 +37,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
37 /* No special bus mastering setup handling */ 37 /* No special bus mastering setup handling */
38} 38}
39 39
40static inline void pcibios_penalize_isa_irq(int irq) 40static inline void pcibios_penalize_isa_irq(int irq, int active)
41{ 41{
42 /* We don't do dynamic PCI IRQ allocation */ 42 /* We don't do dynamic PCI IRQ allocation */
43} 43}
@@ -78,6 +78,25 @@ static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
78 return 0; 78 return 0;
79} 79}
80 80
81#ifdef CONFIG_PCI
82static inline void pci_dma_burst_advice(struct pci_dev *pdev,
83 enum pci_dma_burst_strategy *strat,
84 unsigned long *strategy_parameter)
85{
86 unsigned long cacheline_size;
87 u8 byte;
88
89 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
90 if (byte == 0)
91 cacheline_size = 1024;
92 else
93 cacheline_size = (int) byte * 4;
94
95 *strat = PCI_DMA_BURST_MULTIPLE;
96 *strategy_parameter = cacheline_size;
97}
98#endif
99
81extern int pci_domain_nr(struct pci_bus *bus); 100extern int pci_domain_nr(struct pci_bus *bus);
82 101
83/* Decide whether to display the domain number in /proc */ 102/* Decide whether to display the domain number in /proc */
@@ -115,6 +134,10 @@ extern void
115pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 134pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
116 struct resource *res); 135 struct resource *res);
117 136
137extern void
138pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
139 struct pci_bus_region *region);
140
118extern int 141extern int
119unmap_bus_range(struct pci_bus *bus); 142unmap_bus_range(struct pci_bus *bus);
120 143
@@ -136,6 +159,13 @@ extern pgprot_t pci_phys_mem_access_prot(struct file *file,
136 unsigned long size, 159 unsigned long size,
137 pgprot_t prot); 160 pgprot_t prot);
138 161
162#ifdef CONFIG_PPC_MULTIPLATFORM
163#define HAVE_ARCH_PCI_RESOURCE_TO_USER
164extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
165 const struct resource *rsrc,
166 u64 *start, u64 *end);
167#endif /* CONFIG_PPC_MULTIPLATFORM */
168
139 169
140#endif /* __KERNEL__ */ 170#endif /* __KERNEL__ */
141 171
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index 1d0404897550..6b44a8caf395 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -32,7 +32,7 @@ typedef struct compat_siginfo {
32 32
33 /* POSIX.1b timers */ 33 /* POSIX.1b timers */
34 struct { 34 struct {
35 timer_t _tid; /* timer id */ 35 compat_timer_t _tid; /* timer id */
36 int _overrun; /* overrun count */ 36 int _overrun; /* overrun count */
37 compat_sigval_t _sigval; /* same as below */ 37 compat_sigval_t _sigval; /* same as below */
38 int _sys_private; /* not to be passed to user */ 38 int _sys_private; /* not to be passed to user */
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 3084099086a8..352306cfb579 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -20,6 +20,7 @@
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21#include <asm/types.h> 21#include <asm/types.h>
22#include <asm/systemcfg.h> 22#include <asm/systemcfg.h>
23#include <asm/cputable.h>
23 24
24/* Machine State Register (MSR) Fields */ 25/* Machine State Register (MSR) Fields */
25#define MSR_SF_LG 63 /* Enable 64 bit mode */ 26#define MSR_SF_LG 63 /* Enable 64 bit mode */
@@ -138,8 +139,16 @@
138#define SPRN_NIADORM 0x3F3 /* Hardware Implementation Register 2 */ 139#define SPRN_NIADORM 0x3F3 /* Hardware Implementation Register 2 */
139#define SPRN_HID4 0x3F4 /* 970 HID4 */ 140#define SPRN_HID4 0x3F4 /* 970 HID4 */
140#define SPRN_HID5 0x3F6 /* 970 HID5 */ 141#define SPRN_HID5 0x3F6 /* 970 HID5 */
141#define SPRN_TSC 0x3FD /* Thread switch control */ 142#define SPRN_HID6 0x3F9 /* BE HID 6 */
142#define SPRN_TST 0x3FC /* Thread switch timeout */ 143#define HID6_LB (0x0F<<12) /* Concurrent Large Page Modes */
144#define HID6_DLP (1<<20) /* Disable all large page modes (4K only) */
145#define SPRN_TSCR 0x399 /* Thread switch control on BE */
146#define SPRN_TTR 0x39A /* Thread switch timeout on BE */
147#define TSCR_DEC_ENABLE 0x200000 /* Decrementer Interrupt */
148#define TSCR_EE_ENABLE 0x100000 /* External Interrupt */
149#define TSCR_EE_BOOST 0x080000 /* External Interrupt Boost */
150#define SPRN_TSC 0x3FD /* Thread switch control on others */
151#define SPRN_TST 0x3FC /* Thread switch timeout on others */
143#define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */ 152#define SPRN_L2CR 0x3F9 /* Level 2 Cache Control Regsiter */
144#define SPRN_LR 0x008 /* Link Register */ 153#define SPRN_LR 0x008 /* Link Register */
145#define SPRN_PIR 0x3FF /* Processor Identification Register */ 154#define SPRN_PIR 0x3FF /* Processor Identification Register */
@@ -259,6 +268,7 @@
259#define PV_970FX 0x003C 268#define PV_970FX 0x003C
260#define PV_630 0x0040 269#define PV_630 0x0040
261#define PV_630p 0x0041 270#define PV_630p 0x0041
271#define PV_BE 0x0070
262 272
263/* Platforms supported by PPC64 */ 273/* Platforms supported by PPC64 */
264#define PLATFORM_PSERIES 0x0100 274#define PLATFORM_PSERIES 0x0100
@@ -267,6 +277,7 @@
267#define PLATFORM_LPAR 0x0001 277#define PLATFORM_LPAR 0x0001
268#define PLATFORM_POWERMAC 0x0400 278#define PLATFORM_POWERMAC 0x0400
269#define PLATFORM_MAPLE 0x0500 279#define PLATFORM_MAPLE 0x0500
280#define PLATFORM_BPA 0x1000
270 281
271/* Compatibility with drivers coming from PPC32 world */ 282/* Compatibility with drivers coming from PPC32 world */
272#define _machine (systemcfg->platform) 283#define _machine (systemcfg->platform)
@@ -278,6 +289,7 @@
278#define IC_INVALID 0 289#define IC_INVALID 0
279#define IC_OPEN_PIC 1 290#define IC_OPEN_PIC 1
280#define IC_PPC_XIC 2 291#define IC_PPC_XIC 2
292#define IC_BPA_IIC 3
281 293
282#define XGLUE(a,b) a##b 294#define XGLUE(a,b) a##b
283#define GLUE(a,b) XGLUE(a,b) 295#define GLUE(a,b) XGLUE(a,b)
@@ -490,24 +502,37 @@ static inline void ppc64_runlatch_on(void)
490{ 502{
491 unsigned long ctrl; 503 unsigned long ctrl;
492 504
493 ctrl = mfspr(SPRN_CTRLF); 505 if (cpu_has_feature(CPU_FTR_CTRL)) {
494 ctrl |= CTRL_RUNLATCH; 506 ctrl = mfspr(SPRN_CTRLF);
495 mtspr(SPRN_CTRLT, ctrl); 507 ctrl |= CTRL_RUNLATCH;
508 mtspr(SPRN_CTRLT, ctrl);
509 }
496} 510}
497 511
498static inline void ppc64_runlatch_off(void) 512static inline void ppc64_runlatch_off(void)
499{ 513{
500 unsigned long ctrl; 514 unsigned long ctrl;
501 515
502 ctrl = mfspr(SPRN_CTRLF); 516 if (cpu_has_feature(CPU_FTR_CTRL)) {
503 ctrl &= ~CTRL_RUNLATCH; 517 ctrl = mfspr(SPRN_CTRLF);
504 mtspr(SPRN_CTRLT, ctrl); 518 ctrl &= ~CTRL_RUNLATCH;
519 mtspr(SPRN_CTRLT, ctrl);
520 }
505} 521}
506 522
507#endif /* __KERNEL__ */ 523#endif /* __KERNEL__ */
508 524
509#endif /* __ASSEMBLY__ */ 525#endif /* __ASSEMBLY__ */
510 526
527#ifdef __KERNEL__
528#define RUNLATCH_ON(REG) \
529BEGIN_FTR_SECTION \
530 mfspr (REG),SPRN_CTRLF; \
531 ori (REG),(REG),CTRL_RUNLATCH; \
532 mtspr SPRN_CTRLT,(REG); \
533END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
534#endif
535
511/* 536/*
512 * Number of entries in the SLB. If this ever changes we should handle 537 * Number of entries in the SLB. If this ever changes we should handle
513 * it with a use a cpu feature fixup. 538 * it with a use a cpu feature fixup.
diff --git a/include/asm-ppc64/rtas.h b/include/asm-ppc64/rtas.h
index a8ab0e9db84a..e7d1b5222802 100644
--- a/include/asm-ppc64/rtas.h
+++ b/include/asm-ppc64/rtas.h
@@ -186,8 +186,14 @@ extern int rtas_get_sensor(int sensor, int index, int *state);
186extern int rtas_get_power_level(int powerdomain, int *level); 186extern int rtas_get_power_level(int powerdomain, int *level);
187extern int rtas_set_power_level(int powerdomain, int level, int *setlevel); 187extern int rtas_set_power_level(int powerdomain, int level, int *setlevel);
188extern int rtas_set_indicator(int indicator, int index, int new_value); 188extern int rtas_set_indicator(int indicator, int index, int new_value);
189extern void rtas_progress(char *s, unsigned short hex);
189extern void rtas_initialize(void); 190extern void rtas_initialize(void);
190 191
192struct rtc_time;
193extern void rtas_get_boot_time(struct rtc_time *rtc_time);
194extern void rtas_get_rtc_time(struct rtc_time *rtc_time);
195extern int rtas_set_rtc_time(struct rtc_time *rtc_time);
196
191/* Given an RTAS status code of 9900..9905 compute the hinted delay */ 197/* Given an RTAS status code of 9900..9905 compute the hinted delay */
192unsigned int rtas_extended_busy_delay_time(int status); 198unsigned int rtas_extended_busy_delay_time(int status);
193static inline int rtas_is_extended_busy(int status) 199static inline int rtas_is_extended_busy(int status)
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h
index 8115ecb8feee..d86f742e9a21 100644
--- a/include/asm-ppc64/smp.h
+++ b/include/asm-ppc64/smp.h
@@ -85,6 +85,14 @@ extern void smp_generic_take_timebase(void);
85 85
86extern struct smp_ops_t *smp_ops; 86extern struct smp_ops_t *smp_ops;
87 87
88#ifdef CONFIG_PPC_PSERIES
89void vpa_init(int cpu);
90#else
91static inline void vpa_init(int cpu)
92{
93}
94#endif /* CONFIG_PPC_PSERIES */
95
88#endif /* __ASSEMBLY__ */ 96#endif /* __ASSEMBLY__ */
89 97
90#endif /* !(_PPC64_SMP_H) */ 98#endif /* !(_PPC64_SMP_H) */
diff --git a/include/asm-ppc64/sparsemem.h b/include/asm-ppc64/sparsemem.h
new file mode 100644
index 000000000000..c5bd47e57f17
--- /dev/null
+++ b/include/asm-ppc64/sparsemem.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_PPC64_SPARSEMEM_H
2#define _ASM_PPC64_SPARSEMEM_H 1
3
4#ifdef CONFIG_SPARSEMEM
5/*
6 * SECTION_SIZE_BITS 2^N: how big each section will be
7 * MAX_PHYSADDR_BITS 2^N: how much physical address space we have
8 * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
9 */
10#define SECTION_SIZE_BITS 24
11#define MAX_PHYSADDR_BITS 38
12#define MAX_PHYSMEM_BITS 36
13
14#endif /* CONFIG_SPARSEMEM */
15
16#endif /* _ASM_PPC64_SPARSEMEM_H */
diff --git a/include/asm-ppc64/thread_info.h b/include/asm-ppc64/thread_info.h
index 48b7900e90ec..0494df6fca74 100644
--- a/include/asm-ppc64/thread_info.h
+++ b/include/asm-ppc64/thread_info.h
@@ -24,7 +24,7 @@ struct thread_info {
24 struct task_struct *task; /* main task structure */ 24 struct task_struct *task; /* main task structure */
25 struct exec_domain *exec_domain; /* execution domain */ 25 struct exec_domain *exec_domain; /* execution domain */
26 int cpu; /* cpu we're on */ 26 int cpu; /* cpu we're on */
27 int preempt_count; 27 int preempt_count; /* 0 => preemptable, <0 => BUG */
28 struct restart_block restart_block; 28 struct restart_block restart_block;
29 /* set by force_successful_syscall_return */ 29 /* set by force_successful_syscall_return */
30 unsigned char syscall_noerror; 30 unsigned char syscall_noerror;
diff --git a/include/asm-ppc64/time.h b/include/asm-ppc64/time.h
index 8d6e3760ee10..c6c762cad8b0 100644
--- a/include/asm-ppc64/time.h
+++ b/include/asm-ppc64/time.h
@@ -34,6 +34,15 @@ struct rtc_time;
34extern void to_tm(int tim, struct rtc_time * tm); 34extern void to_tm(int tim, struct rtc_time * tm);
35extern time_t last_rtc_update; 35extern time_t last_rtc_update;
36 36
37void generic_calibrate_decr(void);
38void setup_default_decr(void);
39
40/* Some sane defaults: 125 MHz timebase, 1GHz processor */
41extern unsigned long ppc_proc_freq;
42#define DEFAULT_PROC_FREQ (DEFAULT_TB_FREQ * 8)
43extern unsigned long ppc_tb_freq;
44#define DEFAULT_TB_FREQ 125000000UL
45
37/* 46/*
38 * By putting all of this stuff into a single struct we 47 * By putting all of this stuff into a single struct we
39 * reduce the number of cache lines touched by do_gettimeofday. 48 * reduce the number of cache lines touched by do_gettimeofday.
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
index d58d9dd79998..1e9b19073230 100644
--- a/include/asm-ppc64/topology.h
+++ b/include/asm-ppc64/topology.h
@@ -33,6 +33,7 @@ static inline int node_to_first_cpu(int node)
33 return first_cpu(tmp); 33 return first_cpu(tmp);
34} 34}
35 35
36#define pcibus_to_node(node) (-1)
36#define pcibus_to_cpumask(bus) (cpu_online_map) 37#define pcibus_to_cpumask(bus) (cpu_online_map)
37 38
38#define nr_cpus_node(node) (nr_cpus_in_node[node]) 39#define nr_cpus_node(node) (nr_cpus_in_node[node])
@@ -59,7 +60,7 @@ static inline int node_to_first_cpu(int node)
59 .nr_balance_failed = 0, \ 60 .nr_balance_failed = 0, \
60} 61}
61 62
62#else /* !CONFIG_NUMA */ 63#else
63 64
64#include <asm-generic/topology.h> 65#include <asm-generic/topology.h>
65 66
diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h
index 605d91e011ec..977bc980c1af 100644
--- a/include/asm-ppc64/unistd.h
+++ b/include/asm-ppc64/unistd.h
@@ -268,7 +268,7 @@
268#define __NR_rtas 255 268#define __NR_rtas 255
269/* Number 256 is reserved for sys_debug_setcontext */ 269/* Number 256 is reserved for sys_debug_setcontext */
270/* Number 257 is reserved for vserver */ 270/* Number 257 is reserved for vserver */
271/* Number 258 is reserved for new sys_remap_file_pages */ 271/* 258 currently unused */
272#define __NR_mbind 259 272#define __NR_mbind 259
273#define __NR_get_mempolicy 260 273#define __NR_get_mempolicy 260
274#define __NR_set_mempolicy 261 274#define __NR_set_mempolicy 261
@@ -283,8 +283,13 @@
283#define __NR_request_key 270 283#define __NR_request_key 270
284#define __NR_keyctl 271 284#define __NR_keyctl 271
285#define __NR_waitid 272 285#define __NR_waitid 272
286#define __NR_ioprio_set 273
287#define __NR_ioprio_get 274
288#define __NR_inotify_init 275
289#define __NR_inotify_add_watch 276
290#define __NR_inotify_rm_watch 277
286 291
287#define __NR_syscalls 273 292#define __NR_syscalls 278
288#ifdef __KERNEL__ 293#ifdef __KERNEL__
289#define NR_syscalls __NR_syscalls 294#define NR_syscalls __NR_syscalls
290#endif 295#endif
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
index fdec5e7a7af6..1092af55d707 100644
--- a/include/asm-ppc64/xics.h
+++ b/include/asm-ppc64/xics.h
@@ -17,6 +17,7 @@
17void xics_init_IRQ(void); 17void xics_init_IRQ(void);
18int xics_get_irq(struct pt_regs *); 18int xics_get_irq(struct pt_regs *);
19void xics_setup_cpu(void); 19void xics_setup_cpu(void);
20void xics_teardown_cpu(int secondary);
20void xics_cause_IPI(int cpu); 21void xics_cause_IPI(int cpu);
21void xics_request_IPIs(void); 22void xics_request_IPIs(void);
22void xics_migrate_irqs_away(void); 23void xics_migrate_irqs_away(void);
diff --git a/include/asm-s390/atomic.h b/include/asm-s390/atomic.h
index d5a05cf47168..9d86ba6f12d0 100644
--- a/include/asm-s390/atomic.h
+++ b/include/asm-s390/atomic.h
@@ -123,19 +123,19 @@ typedef struct {
123#define atomic64_read(v) ((v)->counter) 123#define atomic64_read(v) ((v)->counter)
124#define atomic64_set(v,i) (((v)->counter) = (i)) 124#define atomic64_set(v,i) (((v)->counter) = (i))
125 125
126static __inline__ void atomic64_add(int i, atomic64_t * v) 126static __inline__ void atomic64_add(long long i, atomic64_t * v)
127{ 127{
128 __CSG_LOOP(v, i, "agr"); 128 __CSG_LOOP(v, i, "agr");
129} 129}
130static __inline__ long long atomic64_add_return(int i, atomic64_t * v) 130static __inline__ long long atomic64_add_return(long long i, atomic64_t * v)
131{ 131{
132 return __CSG_LOOP(v, i, "agr"); 132 return __CSG_LOOP(v, i, "agr");
133} 133}
134static __inline__ long long atomic64_add_negative(int i, atomic64_t * v) 134static __inline__ long long atomic64_add_negative(long long i, atomic64_t * v)
135{ 135{
136 return __CSG_LOOP(v, i, "agr") < 0; 136 return __CSG_LOOP(v, i, "agr") < 0;
137} 137}
138static __inline__ void atomic64_sub(int i, atomic64_t * v) 138static __inline__ void atomic64_sub(long long i, atomic64_t * v)
139{ 139{
140 __CSG_LOOP(v, i, "sgr"); 140 __CSG_LOOP(v, i, "sgr");
141} 141}
diff --git a/include/asm-s390/bitops.h b/include/asm-s390/bitops.h
index 16bb08499c7f..8651524217fd 100644
--- a/include/asm-s390/bitops.h
+++ b/include/asm-s390/bitops.h
@@ -527,13 +527,64 @@ __constant_test_bit(unsigned long nr, const volatile unsigned long *addr) {
527 __constant_test_bit((nr),(addr)) : \ 527 __constant_test_bit((nr),(addr)) : \
528 __test_bit((nr),(addr)) ) 528 __test_bit((nr),(addr)) )
529 529
530#ifndef __s390x__ 530/*
531 * ffz = Find First Zero in word. Undefined if no zero exists,
532 * so code should check against ~0UL first..
533 */
534static inline unsigned long ffz(unsigned long word)
535{
536 unsigned long bit = 0;
537
538#ifdef __s390x__
539 if (likely((word & 0xffffffff) == 0xffffffff)) {
540 word >>= 32;
541 bit += 32;
542 }
543#endif
544 if (likely((word & 0xffff) == 0xffff)) {
545 word >>= 16;
546 bit += 16;
547 }
548 if (likely((word & 0xff) == 0xff)) {
549 word >>= 8;
550 bit += 8;
551 }
552 return bit + _zb_findmap[word & 0xff];
553}
554
555/*
556 * __ffs = find first bit in word. Undefined if no bit exists,
557 * so code should check against 0UL first..
558 */
559static inline unsigned long __ffs (unsigned long word)
560{
561 unsigned long bit = 0;
562
563#ifdef __s390x__
564 if (likely((word & 0xffffffff) == 0)) {
565 word >>= 32;
566 bit += 32;
567 }
568#endif
569 if (likely((word & 0xffff) == 0)) {
570 word >>= 16;
571 bit += 16;
572 }
573 if (likely((word & 0xff) == 0)) {
574 word >>= 8;
575 bit += 8;
576 }
577 return bit + _sb_findmap[word & 0xff];
578}
531 579
532/* 580/*
533 * Find-bit routines.. 581 * Find-bit routines..
534 */ 582 */
583
584#ifndef __s390x__
585
535static inline int 586static inline int
536find_first_zero_bit(const unsigned long * addr, unsigned int size) 587find_first_zero_bit(const unsigned long * addr, unsigned long size)
537{ 588{
538 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 589 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
539 unsigned long cmp, count; 590 unsigned long cmp, count;
@@ -548,7 +599,7 @@ find_first_zero_bit(const unsigned long * addr, unsigned int size)
548 " srl %2,5\n" 599 " srl %2,5\n"
549 "0: c %1,0(%0,%4)\n" 600 "0: c %1,0(%0,%4)\n"
550 " jne 1f\n" 601 " jne 1f\n"
551 " ahi %0,4\n" 602 " la %0,4(%0)\n"
552 " brct %2,0b\n" 603 " brct %2,0b\n"
553 " lr %0,%3\n" 604 " lr %0,%3\n"
554 " j 4f\n" 605 " j 4f\n"
@@ -574,7 +625,7 @@ find_first_zero_bit(const unsigned long * addr, unsigned int size)
574} 625}
575 626
576static inline int 627static inline int
577find_first_bit(const unsigned long * addr, unsigned int size) 628find_first_bit(const unsigned long * addr, unsigned long size)
578{ 629{
579 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype; 630 typedef struct { long _[__BITOPS_WORDS(size)]; } addrtype;
580 unsigned long cmp, count; 631 unsigned long cmp, count;
@@ -589,7 +640,7 @@ find_first_bit(const unsigned long * addr, unsigned int size)
589 " srl %2,5\n" 640 " srl %2,5\n"
590 "0: c %1,0(%0,%4)\n" 641 "0: c %1,0(%0,%4)\n"
591 " jne 1f\n" 642 " jne 1f\n"
592 " ahi %0,4\n" 643 " la %0,4(%0)\n"
593 " brct %2,0b\n" 644 " brct %2,0b\n"
594 " lr %0,%3\n" 645 " lr %0,%3\n"
595 " j 4f\n" 646 " j 4f\n"
@@ -614,89 +665,8 @@ find_first_bit(const unsigned long * addr, unsigned int size)
614 return (res < size) ? res : size; 665 return (res < size) ? res : size;
615} 666}
616 667
617static inline int
618find_next_zero_bit (const unsigned long * addr, int size, int offset)
619{
620 unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
621 unsigned long bitvec, reg;
622 int set, bit = offset & 31, res;
623
624 if (bit) {
625 /*
626 * Look for zero in first word
627 */
628 bitvec = (*p) >> bit;
629 __asm__(" slr %0,%0\n"
630 " lhi %2,0xff\n"
631 " tml %1,0xffff\n"
632 " jno 0f\n"
633 " ahi %0,16\n"
634 " srl %1,16\n"
635 "0: tml %1,0x00ff\n"
636 " jno 1f\n"
637 " ahi %0,8\n"
638 " srl %1,8\n"
639 "1: nr %1,%2\n"
640 " ic %1,0(%1,%3)\n"
641 " alr %0,%1"
642 : "=&d" (set), "+a" (bitvec), "=&d" (reg)
643 : "a" (&_zb_findmap) : "cc" );
644 if (set < (32 - bit))
645 return set + offset;
646 offset += 32 - bit;
647 p++;
648 }
649 /*
650 * No zero yet, search remaining full words for a zero
651 */
652 res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
653 return (offset + res);
654}
655
656static inline int
657find_next_bit (const unsigned long * addr, int size, int offset)
658{
659 unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
660 unsigned long bitvec, reg;
661 int set, bit = offset & 31, res;
662
663 if (bit) {
664 /*
665 * Look for set bit in first word
666 */
667 bitvec = (*p) >> bit;
668 __asm__(" slr %0,%0\n"
669 " lhi %2,0xff\n"
670 " tml %1,0xffff\n"
671 " jnz 0f\n"
672 " ahi %0,16\n"
673 " srl %1,16\n"
674 "0: tml %1,0x00ff\n"
675 " jnz 1f\n"
676 " ahi %0,8\n"
677 " srl %1,8\n"
678 "1: nr %1,%2\n"
679 " ic %1,0(%1,%3)\n"
680 " alr %0,%1"
681 : "=&d" (set), "+a" (bitvec), "=&d" (reg)
682 : "a" (&_sb_findmap) : "cc" );
683 if (set < (32 - bit))
684 return set + offset;
685 offset += 32 - bit;
686 p++;
687 }
688 /*
689 * No set bit yet, search remaining full words for a bit
690 */
691 res = find_first_bit (p, size - 32 * (p - (unsigned long *) addr));
692 return (offset + res);
693}
694
695#else /* __s390x__ */ 668#else /* __s390x__ */
696 669
697/*
698 * Find-bit routines..
699 */
700static inline unsigned long 670static inline unsigned long
701find_first_zero_bit(const unsigned long * addr, unsigned long size) 671find_first_zero_bit(const unsigned long * addr, unsigned long size)
702{ 672{
@@ -712,7 +682,7 @@ find_first_zero_bit(const unsigned long * addr, unsigned long size)
712 " srlg %2,%2,6\n" 682 " srlg %2,%2,6\n"
713 "0: cg %1,0(%0,%4)\n" 683 "0: cg %1,0(%0,%4)\n"
714 " jne 1f\n" 684 " jne 1f\n"
715 " aghi %0,8\n" 685 " la %0,8(%0)\n"
716 " brct %2,0b\n" 686 " brct %2,0b\n"
717 " lgr %0,%3\n" 687 " lgr %0,%3\n"
718 " j 5f\n" 688 " j 5f\n"
@@ -785,143 +755,66 @@ find_first_bit(const unsigned long * addr, unsigned long size)
785 return (res < size) ? res : size; 755 return (res < size) ? res : size;
786} 756}
787 757
788static inline unsigned long
789find_next_zero_bit (const unsigned long * addr, unsigned long size, unsigned long offset)
790{
791 unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
792 unsigned long bitvec, reg;
793 unsigned long set, bit = offset & 63, res;
794
795 if (bit) {
796 /*
797 * Look for zero in first word
798 */
799 bitvec = (*p) >> bit;
800 __asm__(" lhi %2,-1\n"
801 " slgr %0,%0\n"
802 " clr %1,%2\n"
803 " jne 0f\n"
804 " aghi %0,32\n"
805 " srlg %1,%1,32\n"
806 "0: lghi %2,0xff\n"
807 " tmll %1,0xffff\n"
808 " jno 1f\n"
809 " aghi %0,16\n"
810 " srlg %1,%1,16\n"
811 "1: tmll %1,0x00ff\n"
812 " jno 2f\n"
813 " aghi %0,8\n"
814 " srlg %1,%1,8\n"
815 "2: ngr %1,%2\n"
816 " ic %1,0(%1,%3)\n"
817 " algr %0,%1"
818 : "=&d" (set), "+a" (bitvec), "=&d" (reg)
819 : "a" (&_zb_findmap) : "cc" );
820 if (set < (64 - bit))
821 return set + offset;
822 offset += 64 - bit;
823 p++;
824 }
825 /*
826 * No zero yet, search remaining full words for a zero
827 */
828 res = find_first_zero_bit (p, size - 64 * (p - (unsigned long *) addr));
829 return (offset + res);
830}
831
832static inline unsigned long
833find_next_bit (const unsigned long * addr, unsigned long size, unsigned long offset)
834{
835 unsigned long * p = ((unsigned long *) addr) + (offset >> 6);
836 unsigned long bitvec, reg;
837 unsigned long set, bit = offset & 63, res;
838
839 if (bit) {
840 /*
841 * Look for zero in first word
842 */
843 bitvec = (*p) >> bit;
844 __asm__(" slgr %0,%0\n"
845 " ltr %1,%1\n"
846 " jnz 0f\n"
847 " aghi %0,32\n"
848 " srlg %1,%1,32\n"
849 "0: lghi %2,0xff\n"
850 " tmll %1,0xffff\n"
851 " jnz 1f\n"
852 " aghi %0,16\n"
853 " srlg %1,%1,16\n"
854 "1: tmll %1,0x00ff\n"
855 " jnz 2f\n"
856 " aghi %0,8\n"
857 " srlg %1,%1,8\n"
858 "2: ngr %1,%2\n"
859 " ic %1,0(%1,%3)\n"
860 " algr %0,%1"
861 : "=&d" (set), "+a" (bitvec), "=&d" (reg)
862 : "a" (&_sb_findmap) : "cc" );
863 if (set < (64 - bit))
864 return set + offset;
865 offset += 64 - bit;
866 p++;
867 }
868 /*
869 * No set bit yet, search remaining full words for a bit
870 */
871 res = find_first_bit (p, size - 64 * (p - (unsigned long *) addr));
872 return (offset + res);
873}
874
875#endif /* __s390x__ */ 758#endif /* __s390x__ */
876 759
877/* 760static inline int
878 * ffz = Find First Zero in word. Undefined if no zero exists, 761find_next_zero_bit (const unsigned long * addr, unsigned long size,
879 * so code should check against ~0UL first.. 762 unsigned long offset)
880 */
881static inline unsigned long ffz(unsigned long word)
882{ 763{
883 unsigned long bit = 0; 764 const unsigned long *p;
884 765 unsigned long bit, set;
885#ifdef __s390x__ 766
886 if (likely((word & 0xffffffff) == 0xffffffff)) { 767 if (offset >= size)
887 word >>= 32; 768 return size;
888 bit += 32; 769 bit = offset & (__BITOPS_WORDSIZE - 1);
889 } 770 offset -= bit;
890#endif 771 size -= offset;
891 if (likely((word & 0xffff) == 0xffff)) { 772 p = addr + offset / __BITOPS_WORDSIZE;
892 word >>= 16; 773 if (bit) {
893 bit += 16; 774 /*
775 * s390 version of ffz returns __BITOPS_WORDSIZE
776 * if no zero bit is present in the word.
777 */
778 set = ffz(*p >> bit) + bit;
779 if (set >= size)
780 return size + offset;
781 if (set < __BITOPS_WORDSIZE)
782 return set + offset;
783 offset += __BITOPS_WORDSIZE;
784 size -= __BITOPS_WORDSIZE;
785 p++;
894 } 786 }
895 if (likely((word & 0xff) == 0xff)) { 787 return offset + find_first_zero_bit(p, size);
896 word >>= 8;
897 bit += 8;
898 }
899 return bit + _zb_findmap[word & 0xff];
900} 788}
901 789
902/* 790static inline int
903 * __ffs = find first bit in word. Undefined if no bit exists, 791find_next_bit (const unsigned long * addr, unsigned long size,
904 * so code should check against 0UL first.. 792 unsigned long offset)
905 */
906static inline unsigned long __ffs (unsigned long word)
907{ 793{
908 unsigned long bit = 0; 794 const unsigned long *p;
909 795 unsigned long bit, set;
910#ifdef __s390x__ 796
911 if (likely((word & 0xffffffff) == 0)) { 797 if (offset >= size)
912 word >>= 32; 798 return size;
913 bit += 32; 799 bit = offset & (__BITOPS_WORDSIZE - 1);
800 offset -= bit;
801 size -= offset;
802 p = addr + offset / __BITOPS_WORDSIZE;
803 if (bit) {
804 /*
805 * s390 version of __ffs returns __BITOPS_WORDSIZE
806 * if no one bit is present in the word.
807 */
808 set = __ffs(*p & (~0UL << bit));
809 if (set >= size)
810 return size + offset;
811 if (set < __BITOPS_WORDSIZE)
812 return set + offset;
813 offset += __BITOPS_WORDSIZE;
814 size -= __BITOPS_WORDSIZE;
815 p++;
914 } 816 }
915#endif 817 return offset + find_first_bit(p, size);
916 if (likely((word & 0xffff) == 0)) {
917 word >>= 16;
918 bit += 16;
919 }
920 if (likely((word & 0xff) == 0)) {
921 word >>= 8;
922 bit += 8;
923 }
924 return bit + _sb_findmap[word & 0xff];
925} 818}
926 819
927/* 820/*
@@ -1031,49 +924,6 @@ ext2_find_first_zero_bit(void *vaddr, unsigned int size)
1031 return (res < size) ? res : size; 924 return (res < size) ? res : size;
1032} 925}
1033 926
1034static inline int
1035ext2_find_next_zero_bit(void *vaddr, unsigned int size, unsigned offset)
1036{
1037 unsigned long *addr = vaddr;
1038 unsigned long *p = addr + (offset >> 5);
1039 unsigned long word, reg;
1040 unsigned int bit = offset & 31UL, res;
1041
1042 if (offset >= size)
1043 return size;
1044
1045 if (bit) {
1046 __asm__(" ic %0,0(%1)\n"
1047 " icm %0,2,1(%1)\n"
1048 " icm %0,4,2(%1)\n"
1049 " icm %0,8,3(%1)"
1050 : "=&a" (word) : "a" (p) : "cc" );
1051 word >>= bit;
1052 res = bit;
1053 /* Look for zero in first longword */
1054 __asm__(" lhi %2,0xff\n"
1055 " tml %1,0xffff\n"
1056 " jno 0f\n"
1057 " ahi %0,16\n"
1058 " srl %1,16\n"
1059 "0: tml %1,0x00ff\n"
1060 " jno 1f\n"
1061 " ahi %0,8\n"
1062 " srl %1,8\n"
1063 "1: nr %1,%2\n"
1064 " ic %1,0(%1,%3)\n"
1065 " alr %0,%1"
1066 : "+&d" (res), "+&a" (word), "=&d" (reg)
1067 : "a" (&_zb_findmap) : "cc" );
1068 if (res < 32)
1069 return (p - addr)*32 + res;
1070 p++;
1071 }
1072 /* No zero yet, search remaining full bytes for a zero */
1073 res = ext2_find_first_zero_bit (p, size - 32 * (p - addr));
1074 return (p - addr) * 32 + res;
1075}
1076
1077#else /* __s390x__ */ 927#else /* __s390x__ */
1078 928
1079static inline unsigned long 929static inline unsigned long
@@ -1120,56 +970,46 @@ ext2_find_first_zero_bit(void *vaddr, unsigned long size)
1120 return (res < size) ? res : size; 970 return (res < size) ? res : size;
1121} 971}
1122 972
1123static inline unsigned long 973#endif /* __s390x__ */
974
975static inline int
1124ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset) 976ext2_find_next_zero_bit(void *vaddr, unsigned long size, unsigned long offset)
1125{ 977{
1126 unsigned long *addr = vaddr; 978 unsigned long *addr = vaddr, *p;
1127 unsigned long *p = addr + (offset >> 6); 979 unsigned long word, bit, set;
1128 unsigned long word, reg;
1129 unsigned long bit = offset & 63UL, res;
1130 980
1131 if (offset >= size) 981 if (offset >= size)
1132 return size; 982 return size;
1133 983 bit = offset & (__BITOPS_WORDSIZE - 1);
984 offset -= bit;
985 size -= offset;
986 p = addr + offset / __BITOPS_WORDSIZE;
1134 if (bit) { 987 if (bit) {
1135 __asm__(" lrvg %0,%1" /* load reversed, neat instruction */ 988#ifndef __s390x__
1136 : "=a" (word) : "m" (*p) ); 989 asm(" ic %0,0(%1)\n"
1137 word >>= bit; 990 " icm %0,2,1(%1)\n"
1138 res = bit; 991 " icm %0,4,2(%1)\n"
1139 /* Look for zero in first 8 byte word */ 992 " icm %0,8,3(%1)"
1140 __asm__(" lghi %2,0xff\n" 993 : "=&a" (word) : "a" (p), "m" (*p) : "cc" );
1141 " tmll %1,0xffff\n" 994#else
1142 " jno 2f\n" 995 asm(" lrvg %0,%1" : "=a" (word) : "m" (*p) );
1143 " ahi %0,16\n" 996#endif
1144 " srlg %1,%1,16\n" 997 /*
1145 "0: tmll %1,0xffff\n" 998 * s390 version of ffz returns __BITOPS_WORDSIZE
1146 " jno 2f\n" 999 * if no zero bit is present in the word.
1147 " ahi %0,16\n" 1000 */
1148 " srlg %1,%1,16\n" 1001 set = ffz(word >> bit) + bit;
1149 "1: tmll %1,0xffff\n" 1002 if (set >= size)
1150 " jno 2f\n" 1003 return size + offset;
1151 " ahi %0,16\n" 1004 if (set < __BITOPS_WORDSIZE)
1152 " srl %1,16\n" 1005 return set + offset;
1153 "2: tmll %1,0x00ff\n" 1006 offset += __BITOPS_WORDSIZE;
1154 " jno 3f\n" 1007 size -= __BITOPS_WORDSIZE;
1155 " ahi %0,8\n" 1008 p++;
1156 " srl %1,8\n"
1157 "3: ngr %1,%2\n"
1158 " ic %1,0(%1,%3)\n"
1159 " alr %0,%1"
1160 : "+&d" (res), "+a" (word), "=&d" (reg)
1161 : "a" (&_zb_findmap) : "cc" );
1162 if (res < 64)
1163 return (p - addr)*64 + res;
1164 p++;
1165 } 1009 }
1166 /* No zero yet, search remaining full bytes for a zero */ 1010 return offset + ext2_find_first_zero_bit(p, size);
1167 res = ext2_find_first_zero_bit (p, size - 64 * (p - addr));
1168 return (p - addr) * 64 + res;
1169} 1011}
1170 1012
1171#endif /* __s390x__ */
1172
1173/* Bitmap functions for the minix filesystem. */ 1013/* Bitmap functions for the minix filesystem. */
1174/* FIXME !!! */ 1014/* FIXME !!! */
1175#define minix_test_and_set_bit(nr,addr) \ 1015#define minix_test_and_set_bit(nr,addr) \
diff --git a/include/asm-s390/cpcmd.h b/include/asm-s390/cpcmd.h
index 1d33c5da083e..1fcf65be7a23 100644
--- a/include/asm-s390/cpcmd.h
+++ b/include/asm-s390/cpcmd.h
@@ -11,14 +11,28 @@
11#define __CPCMD__ 11#define __CPCMD__
12 12
13/* 13/*
14 * the lowlevel function for cpcmd
14 * the caller of __cpcmd has to ensure that the response buffer is below 2 GB 15 * the caller of __cpcmd has to ensure that the response buffer is below 2 GB
15 */ 16 */
16extern void __cpcmd(char *cmd, char *response, int rlen); 17extern int __cpcmd(const char *cmd, char *response, int rlen, int *response_code);
17 18
18#ifndef __s390x__ 19#ifndef __s390x__
19#define cpcmd __cpcmd 20#define cpcmd __cpcmd
20#else 21#else
21extern void cpcmd(char *cmd, char *response, int rlen); 22/*
23 * cpcmd is the in-kernel interface for issuing CP commands
24 *
25 * cmd: null-terminated command string, max 240 characters
26 * response: response buffer for VM's textual response
27 * rlen: size of the response buffer, cpcmd will not exceed this size
28 * but will cap the output, if its too large. Everything that
29 * did not fit into the buffer will be silently dropped
30 * response_code: return pointer for VM's error code
31 * return value: the size of the response. The caller can check if the buffer
32 * was large enough by comparing the return value and rlen
33 * NOTE: If the response buffer is not below 2 GB, cpcmd can sleep
34 */
35extern int cpcmd(const char *cmd, char *response, int rlen, int *response_code);
22#endif /*__s390x__*/ 36#endif /*__s390x__*/
23 37
24#endif 38#endif
diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h
index 6bbcdea42a86..92360d90144b 100644
--- a/include/asm-s390/debug.h
+++ b/include/asm-s390/debug.h
@@ -9,6 +9,8 @@
9#ifndef DEBUG_H 9#ifndef DEBUG_H
10#define DEBUG_H 10#define DEBUG_H
11 11
12#include <linux/config.h>
13#include <linux/fs.h>
12#include <linux/string.h> 14#include <linux/string.h>
13 15
14/* Note: 16/* Note:
@@ -31,19 +33,18 @@ struct __debug_entry{
31} __attribute__((packed)); 33} __attribute__((packed));
32 34
33 35
34#define __DEBUG_FEATURE_VERSION 1 /* version of debug feature */ 36#define __DEBUG_FEATURE_VERSION 2 /* version of debug feature */
35 37
36#ifdef __KERNEL__ 38#ifdef __KERNEL__
37#include <linux/spinlock.h> 39#include <linux/spinlock.h>
38#include <linux/kernel.h> 40#include <linux/kernel.h>
39#include <linux/time.h> 41#include <linux/time.h>
40#include <linux/proc_fs.h>
41 42
42#define DEBUG_MAX_LEVEL 6 /* debug levels range from 0 to 6 */ 43#define DEBUG_MAX_LEVEL 6 /* debug levels range from 0 to 6 */
43#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */ 44#define DEBUG_OFF_LEVEL -1 /* level where debug is switched off */
44#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */ 45#define DEBUG_FLUSH_ALL -1 /* parameter to flush all areas */
45#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */ 46#define DEBUG_MAX_VIEWS 10 /* max number of views in proc fs */
46#define DEBUG_MAX_PROCF_LEN 64 /* max length for a proc file name */ 47#define DEBUG_MAX_NAME_LEN 64 /* max length for a debugfs file name */
47#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */ 48#define DEBUG_DEFAULT_LEVEL 3 /* initial debug level */
48 49
49#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */ 50#define DEBUG_DIR_ROOT "s390dbf" /* name of debug root directory in proc fs */
@@ -64,16 +65,17 @@ typedef struct debug_info {
64 spinlock_t lock; 65 spinlock_t lock;
65 int level; 66 int level;
66 int nr_areas; 67 int nr_areas;
67 int page_order; 68 int pages_per_area;
68 int buf_size; 69 int buf_size;
69 int entry_size; 70 int entry_size;
70 debug_entry_t** areas; 71 debug_entry_t*** areas;
71 int active_area; 72 int active_area;
72 int *active_entry; 73 int *active_pages;
73 struct proc_dir_entry* proc_root_entry; 74 int *active_entries;
74 struct proc_dir_entry* proc_entries[DEBUG_MAX_VIEWS]; 75 struct dentry* debugfs_root_entry;
76 struct dentry* debugfs_entries[DEBUG_MAX_VIEWS];
75 struct debug_view* views[DEBUG_MAX_VIEWS]; 77 struct debug_view* views[DEBUG_MAX_VIEWS];
76 char name[DEBUG_MAX_PROCF_LEN]; 78 char name[DEBUG_MAX_NAME_LEN];
77} debug_info_t; 79} debug_info_t;
78 80
79typedef int (debug_header_proc_t) (debug_info_t* id, 81typedef int (debug_header_proc_t) (debug_info_t* id,
@@ -98,7 +100,7 @@ int debug_dflt_header_fn(debug_info_t* id, struct debug_view* view,
98 int area, debug_entry_t* entry, char* out_buf); 100 int area, debug_entry_t* entry, char* out_buf);
99 101
100struct debug_view { 102struct debug_view {
101 char name[DEBUG_MAX_PROCF_LEN]; 103 char name[DEBUG_MAX_NAME_LEN];
102 debug_prolog_proc_t* prolog_proc; 104 debug_prolog_proc_t* prolog_proc;
103 debug_header_proc_t* header_proc; 105 debug_header_proc_t* header_proc;
104 debug_format_proc_t* format_proc; 106 debug_format_proc_t* format_proc;
@@ -120,7 +122,7 @@ debug_entry_t* debug_exception_common(debug_info_t* id, int level,
120 122
121/* Debug Feature API: */ 123/* Debug Feature API: */
122 124
123debug_info_t* debug_register(char* name, int pages_index, int nr_areas, 125debug_info_t* debug_register(char* name, int pages, int nr_areas,
124 int buf_size); 126 int buf_size);
125 127
126void debug_unregister(debug_info_t* id); 128void debug_unregister(debug_info_t* id);
@@ -132,7 +134,8 @@ void debug_stop_all(void);
132extern inline debug_entry_t* 134extern inline debug_entry_t*
133debug_event(debug_info_t* id, int level, void* data, int length) 135debug_event(debug_info_t* id, int level, void* data, int length)
134{ 136{
135 if ((!id) || (level > id->level)) return NULL; 137 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
138 return NULL;
136 return debug_event_common(id,level,data,length); 139 return debug_event_common(id,level,data,length);
137} 140}
138 141
@@ -140,7 +143,8 @@ extern inline debug_entry_t*
140debug_int_event(debug_info_t* id, int level, unsigned int tag) 143debug_int_event(debug_info_t* id, int level, unsigned int tag)
141{ 144{
142 unsigned int t=tag; 145 unsigned int t=tag;
143 if ((!id) || (level > id->level)) return NULL; 146 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
147 return NULL;
144 return debug_event_common(id,level,&t,sizeof(unsigned int)); 148 return debug_event_common(id,level,&t,sizeof(unsigned int));
145} 149}
146 150
@@ -148,14 +152,16 @@ extern inline debug_entry_t *
148debug_long_event (debug_info_t* id, int level, unsigned long tag) 152debug_long_event (debug_info_t* id, int level, unsigned long tag)
149{ 153{
150 unsigned long t=tag; 154 unsigned long t=tag;
151 if ((!id) || (level > id->level)) return NULL; 155 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
156 return NULL;
152 return debug_event_common(id,level,&t,sizeof(unsigned long)); 157 return debug_event_common(id,level,&t,sizeof(unsigned long));
153} 158}
154 159
155extern inline debug_entry_t* 160extern inline debug_entry_t*
156debug_text_event(debug_info_t* id, int level, const char* txt) 161debug_text_event(debug_info_t* id, int level, const char* txt)
157{ 162{
158 if ((!id) || (level > id->level)) return NULL; 163 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
164 return NULL;
159 return debug_event_common(id,level,txt,strlen(txt)); 165 return debug_event_common(id,level,txt,strlen(txt));
160} 166}
161 167
@@ -167,7 +173,8 @@ debug_sprintf_event(debug_info_t* id,int level,char *string,...)
167extern inline debug_entry_t* 173extern inline debug_entry_t*
168debug_exception(debug_info_t* id, int level, void* data, int length) 174debug_exception(debug_info_t* id, int level, void* data, int length)
169{ 175{
170 if ((!id) || (level > id->level)) return NULL; 176 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
177 return NULL;
171 return debug_exception_common(id,level,data,length); 178 return debug_exception_common(id,level,data,length);
172} 179}
173 180
@@ -175,7 +182,8 @@ extern inline debug_entry_t*
175debug_int_exception(debug_info_t* id, int level, unsigned int tag) 182debug_int_exception(debug_info_t* id, int level, unsigned int tag)
176{ 183{
177 unsigned int t=tag; 184 unsigned int t=tag;
178 if ((!id) || (level > id->level)) return NULL; 185 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
186 return NULL;
179 return debug_exception_common(id,level,&t,sizeof(unsigned int)); 187 return debug_exception_common(id,level,&t,sizeof(unsigned int));
180} 188}
181 189
@@ -183,14 +191,16 @@ extern inline debug_entry_t *
183debug_long_exception (debug_info_t* id, int level, unsigned long tag) 191debug_long_exception (debug_info_t* id, int level, unsigned long tag)
184{ 192{
185 unsigned long t=tag; 193 unsigned long t=tag;
186 if ((!id) || (level > id->level)) return NULL; 194 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
195 return NULL;
187 return debug_exception_common(id,level,&t,sizeof(unsigned long)); 196 return debug_exception_common(id,level,&t,sizeof(unsigned long));
188} 197}
189 198
190extern inline debug_entry_t* 199extern inline debug_entry_t*
191debug_text_exception(debug_info_t* id, int level, const char* txt) 200debug_text_exception(debug_info_t* id, int level, const char* txt)
192{ 201{
193 if ((!id) || (level > id->level)) return NULL; 202 if ((!id) || (level > id->level) || (id->pages_per_area == 0))
203 return NULL;
194 return debug_exception_common(id,level,txt,strlen(txt)); 204 return debug_exception_common(id,level,txt,strlen(txt));
195} 205}
196 206
diff --git a/include/asm-s390/emergency-restart.h b/include/asm-s390/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-s390/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-s390/kexec.h b/include/asm-s390/kexec.h
new file mode 100644
index 000000000000..54cf7d9f251c
--- /dev/null
+++ b/include/asm-s390/kexec.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-s390/kexec.h
3 *
4 * (C) Copyright IBM Corp. 2005
5 *
6 * Author(s): Rolf Adelsberger <adelsberger@de.ibm.com>
7 *
8 */
9
10#ifndef _S390_KEXEC_H
11#define _S390_KEXEC_H
12
13#include <asm/page.h>
14#include <asm/processor.h>
15/*
16 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
17 * I.e. Maximum page that is mapped directly into kernel memory,
18 * and kmap is not required.
19 */
20
21/* Maximum physical address we can use pages from */
22#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
23
24/* Maximum address we can reach in physical address mode */
25#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)
26
27/* Maximum address we can use for the control pages */
28/* Not more than 2GB */
29#define KEXEC_CONTROL_MEMORY_LIMIT (1<<31)
30
31/* Allocate one page for the pdp and the second for the code */
32#define KEXEC_CONTROL_CODE_SIZE 4096
33
34/* The native architecture */
35#define KEXEC_ARCH KEXEC_ARCH_S390
36
37#define MAX_NOTE_BYTES 1024
38typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
39
40extern note_buf_t crash_notes[];
41
42#endif /*_S390_KEXEC_H */
diff --git a/include/asm-s390/lowcore.h b/include/asm-s390/lowcore.h
index df5172fc589d..afe6a9f9b0ae 100644
--- a/include/asm-s390/lowcore.h
+++ b/include/asm-s390/lowcore.h
@@ -90,7 +90,6 @@
90#define __LC_SYSTEM_TIMER 0x278 90#define __LC_SYSTEM_TIMER 0x278
91#define __LC_LAST_UPDATE_CLOCK 0x280 91#define __LC_LAST_UPDATE_CLOCK 0x280
92#define __LC_STEAL_CLOCK 0x288 92#define __LC_STEAL_CLOCK 0x288
93#define __LC_DIAG44_OPCODE 0x290
94#define __LC_KERNEL_STACK 0xD40 93#define __LC_KERNEL_STACK 0xD40
95#define __LC_THREAD_INFO 0xD48 94#define __LC_THREAD_INFO 0xD48
96#define __LC_ASYNC_STACK 0xD50 95#define __LC_ASYNC_STACK 0xD50
@@ -109,10 +108,14 @@
109 108
110#ifndef __s390x__ 109#ifndef __s390x__
111#define __LC_PFAULT_INTPARM 0x080 110#define __LC_PFAULT_INTPARM 0x080
111#define __LC_CPU_TIMER_SAVE_AREA 0x0D8
112#define __LC_AREGS_SAVE_AREA 0x120 112#define __LC_AREGS_SAVE_AREA 0x120
113#define __LC_GPREGS_SAVE_AREA 0x180
113#define __LC_CREGS_SAVE_AREA 0x1C0 114#define __LC_CREGS_SAVE_AREA 0x1C0
114#else /* __s390x__ */ 115#else /* __s390x__ */
115#define __LC_PFAULT_INTPARM 0x11B8 116#define __LC_PFAULT_INTPARM 0x11B8
117#define __LC_GPREGS_SAVE_AREA 0x1280
118#define __LC_CPU_TIMER_SAVE_AREA 0x1328
116#define __LC_AREGS_SAVE_AREA 0x1340 119#define __LC_AREGS_SAVE_AREA 0x1340
117#define __LC_CREGS_SAVE_AREA 0x1380 120#define __LC_CREGS_SAVE_AREA 0x1380
118#endif /* __s390x__ */ 121#endif /* __s390x__ */
@@ -167,7 +170,8 @@ struct _lowcore
167 __u16 subchannel_nr; /* 0x0ba */ 170 __u16 subchannel_nr; /* 0x0ba */
168 __u32 io_int_parm; /* 0x0bc */ 171 __u32 io_int_parm; /* 0x0bc */
169 __u32 io_int_word; /* 0x0c0 */ 172 __u32 io_int_word; /* 0x0c0 */
170 __u8 pad3[0xD8-0xC4]; /* 0x0c4 */ 173 __u8 pad3[0xD4-0xC4]; /* 0x0c4 */
174 __u32 extended_save_area_addr; /* 0x0d4 */
171 __u32 cpu_timer_save_area[2]; /* 0x0d8 */ 175 __u32 cpu_timer_save_area[2]; /* 0x0d8 */
172 __u32 clock_comp_save_area[2]; /* 0x0e0 */ 176 __u32 clock_comp_save_area[2]; /* 0x0e0 */
173 __u32 mcck_interruption_code[2]; /* 0x0e8 */ 177 __u32 mcck_interruption_code[2]; /* 0x0e8 */
@@ -281,8 +285,7 @@ struct _lowcore
281 __u64 system_timer; /* 0x278 */ 285 __u64 system_timer; /* 0x278 */
282 __u64 last_update_clock; /* 0x280 */ 286 __u64 last_update_clock; /* 0x280 */
283 __u64 steal_clock; /* 0x288 */ 287 __u64 steal_clock; /* 0x288 */
284 __u32 diag44_opcode; /* 0x290 */ 288 __u8 pad8[0xc00-0x290]; /* 0x290 */
285 __u8 pad8[0xc00-0x294]; /* 0x294 */
286 /* System info area */ 289 /* System info area */
287 __u64 save_area[16]; /* 0xc00 */ 290 __u64 save_area[16]; /* 0xc00 */
288 __u8 pad9[0xd40-0xc80]; /* 0xc80 */ 291 __u8 pad9[0xd40-0xc80]; /* 0xc80 */
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index fb46e9090b50..4ec652ebb3b1 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -203,10 +203,25 @@ unsigned long get_wchan(struct task_struct *p);
203# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory") 203# define cpu_relax() asm volatile ("diag 0,0,68" : : : "memory")
204#else /* __s390x__ */ 204#else /* __s390x__ */
205# define cpu_relax() \ 205# define cpu_relax() \
206 asm volatile ("ex 0,%0" : : "i" (__LC_DIAG44_OPCODE) : "memory") 206 do { \
207 if (MACHINE_HAS_DIAG44) \
208 asm volatile ("diag 0,0,68" : : : "memory"); \
209 } while (0)
207#endif /* __s390x__ */ 210#endif /* __s390x__ */
208 211
209/* 212/*
213 * Set PSW to specified value.
214 */
215static inline void __load_psw(psw_t psw)
216{
217#ifndef __s390x__
218 asm volatile ("lpsw 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
219#else
220 asm volatile ("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
221#endif
222}
223
224/*
210 * Set PSW mask to specified value, while leaving the 225 * Set PSW mask to specified value, while leaving the
211 * PSW addr pointing to the next instruction. 226 * PSW addr pointing to the next instruction.
212 */ 227 */
@@ -214,8 +229,8 @@ unsigned long get_wchan(struct task_struct *p);
214static inline void __load_psw_mask (unsigned long mask) 229static inline void __load_psw_mask (unsigned long mask)
215{ 230{
216 unsigned long addr; 231 unsigned long addr;
217
218 psw_t psw; 232 psw_t psw;
233
219 psw.mask = mask; 234 psw.mask = mask;
220 235
221#ifndef __s390x__ 236#ifndef __s390x__
@@ -241,30 +256,8 @@ static inline void __load_psw_mask (unsigned long mask)
241 */ 256 */
242static inline void enabled_wait(void) 257static inline void enabled_wait(void)
243{ 258{
244 unsigned long reg; 259 __load_psw_mask(PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
245 psw_t wait_psw; 260 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY);
246
247 wait_psw.mask = PSW_BASE_BITS | PSW_MASK_IO | PSW_MASK_EXT |
248 PSW_MASK_MCHECK | PSW_MASK_WAIT | PSW_DEFAULT_KEY;
249#ifndef __s390x__
250 asm volatile (
251 " basr %0,0\n"
252 "0: la %0,1f-0b(%0)\n"
253 " st %0,4(%1)\n"
254 " oi 4(%1),0x80\n"
255 " lpsw 0(%1)\n"
256 "1:"
257 : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
258 : "memory", "cc" );
259#else /* __s390x__ */
260 asm volatile (
261 " larl %0,0f\n"
262 " stg %0,8(%1)\n"
263 " lpswe 0(%1)\n"
264 "0:"
265 : "=&a" (reg) : "a" (&wait_psw), "m" (wait_psw)
266 : "memory", "cc" );
267#endif /* __s390x__ */
268} 261}
269 262
270/* 263/*
@@ -273,13 +266,11 @@ static inline void enabled_wait(void)
273 266
274static inline void disabled_wait(unsigned long code) 267static inline void disabled_wait(unsigned long code)
275{ 268{
276 char psw_buffer[2*sizeof(psw_t)];
277 unsigned long ctl_buf; 269 unsigned long ctl_buf;
278 psw_t *dw_psw = (psw_t *)(((unsigned long) &psw_buffer+sizeof(psw_t)-1) 270 psw_t dw_psw;
279 & -sizeof(psw_t));
280 271
281 dw_psw->mask = PSW_BASE_BITS | PSW_MASK_WAIT; 272 dw_psw.mask = PSW_BASE_BITS | PSW_MASK_WAIT;
282 dw_psw->addr = code; 273 dw_psw.addr = code;
283 /* 274 /*
284 * Store status and then load disabled wait psw, 275 * Store status and then load disabled wait psw,
285 * the processor is dead afterwards 276 * the processor is dead afterwards
@@ -301,7 +292,7 @@ static inline void disabled_wait(unsigned long code)
301 " oi 0x1c0,0x10\n" /* fake protection bit */ 292 " oi 0x1c0,0x10\n" /* fake protection bit */
302 " lpsw 0(%1)" 293 " lpsw 0(%1)"
303 : "=m" (ctl_buf) 294 : "=m" (ctl_buf)
304 : "a" (dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" ); 295 : "a" (&dw_psw), "a" (&ctl_buf), "m" (dw_psw) : "cc" );
305#else /* __s390x__ */ 296#else /* __s390x__ */
306 asm volatile (" stctg 0,0,0(%2)\n" 297 asm volatile (" stctg 0,0,0(%2)\n"
307 " ni 4(%2),0xef\n" /* switch off protection */ 298 " ni 4(%2),0xef\n" /* switch off protection */
@@ -333,7 +324,7 @@ static inline void disabled_wait(unsigned long code)
333 " oi 0x384(1),0x10\n" /* fake protection bit */ 324 " oi 0x384(1),0x10\n" /* fake protection bit */
334 " lpswe 0(%1)" 325 " lpswe 0(%1)"
335 : "=m" (ctl_buf) 326 : "=m" (ctl_buf)
336 : "a" (dw_psw), "a" (&ctl_buf), 327 : "a" (&dw_psw), "a" (&ctl_buf),
337 "m" (dw_psw) : "cc", "0", "1"); 328 "m" (dw_psw) : "cc", "0", "1");
338#endif /* __s390x__ */ 329#endif /* __s390x__ */
339} 330}
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h
index 4eff8f2e3bf1..fc7c96edc697 100644
--- a/include/asm-s390/ptrace.h
+++ b/include/asm-s390/ptrace.h
@@ -276,7 +276,7 @@ typedef struct
276#endif /* __s390x__ */ 276#endif /* __s390x__ */
277 277
278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \ 278#define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \
279 PSW_DEFAULT_KEY) 279 PSW_MASK_MCHECK | PSW_DEFAULT_KEY)
280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ 280#define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \
281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ 281 PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \
282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY) 282 PSW_MASK_PSTATE | PSW_DEFAULT_KEY)
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index 53cc736b9820..8ff10300f7ee 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -11,21 +11,16 @@
11#ifndef __ASM_SPINLOCK_H 11#ifndef __ASM_SPINLOCK_H
12#define __ASM_SPINLOCK_H 12#define __ASM_SPINLOCK_H
13 13
14#ifdef __s390x__ 14static inline int
15/* 15_raw_compare_and_swap(volatile unsigned int *lock,
16 * Grmph, take care of %&#! user space programs that include 16 unsigned int old, unsigned int new)
17 * asm/spinlock.h. The diagnose is only available in kernel 17{
18 * context. 18 asm volatile ("cs %0,%3,0(%4)"
19 */ 19 : "=d" (old), "=m" (*lock)
20#ifdef __KERNEL__ 20 : "0" (old), "d" (new), "a" (lock), "m" (*lock)
21#include <asm/lowcore.h> 21 : "cc", "memory" );
22#define __DIAG44_INSN "ex" 22 return old;
23#define __DIAG44_OPERAND __LC_DIAG44_OPCODE 23}
24#else
25#define __DIAG44_INSN "#"
26#define __DIAG44_OPERAND 0
27#endif
28#endif /* __s390x__ */
29 24
30/* 25/*
31 * Simple spin lock operations. There are two variants, one clears IRQ's 26 * Simple spin lock operations. There are two variants, one clears IRQ's
@@ -41,58 +36,35 @@ typedef struct {
41#endif 36#endif
42} __attribute__ ((aligned (4))) spinlock_t; 37} __attribute__ ((aligned (4))) spinlock_t;
43 38
44#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 } 39#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
45#define spin_lock_init(lp) do { (lp)->lock = 0; } while(0) 40#define spin_lock_init(lp) do { (lp)->lock = 0; } while(0)
46#define spin_unlock_wait(lp) do { barrier(); } while(((volatile spinlock_t *)(lp))->lock) 41#define spin_unlock_wait(lp) do { barrier(); } while(((volatile spinlock_t *)(lp))->lock)
47#define spin_is_locked(x) ((x)->lock != 0) 42#define spin_is_locked(x) ((x)->lock != 0)
48#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) 43#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
49 44
50extern inline void _raw_spin_lock(spinlock_t *lp) 45extern void _raw_spin_lock_wait(spinlock_t *lp, unsigned int pc);
46extern int _raw_spin_trylock_retry(spinlock_t *lp, unsigned int pc);
47
48static inline void _raw_spin_lock(spinlock_t *lp)
51{ 49{
52#ifndef __s390x__ 50 unsigned long pc = (unsigned long) __builtin_return_address(0);
53 unsigned int reg1, reg2; 51
54 __asm__ __volatile__(" bras %0,1f\n" 52 if (unlikely(_raw_compare_and_swap(&lp->lock, 0, pc) != 0))
55 "0: diag 0,0,68\n" 53 _raw_spin_lock_wait(lp, pc);
56 "1: slr %1,%1\n"
57 " cs %1,%0,0(%3)\n"
58 " jl 0b\n"
59 : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
60 : "a" (&lp->lock), "m" (lp->lock)
61 : "cc", "memory" );
62#else /* __s390x__ */
63 unsigned long reg1, reg2;
64 __asm__ __volatile__(" bras %1,1f\n"
65 "0: " __DIAG44_INSN " 0,%4\n"
66 "1: slr %0,%0\n"
67 " cs %0,%1,0(%3)\n"
68 " jl 0b\n"
69 : "=&d" (reg1), "=&d" (reg2), "=m" (lp->lock)
70 : "a" (&lp->lock), "i" (__DIAG44_OPERAND),
71 "m" (lp->lock) : "cc", "memory" );
72#endif /* __s390x__ */
73} 54}
74 55
75extern inline int _raw_spin_trylock(spinlock_t *lp) 56static inline int _raw_spin_trylock(spinlock_t *lp)
76{ 57{
77 unsigned long reg; 58 unsigned long pc = (unsigned long) __builtin_return_address(0);
78 unsigned int result; 59
79 60 if (likely(_raw_compare_and_swap(&lp->lock, 0, pc) == 0))
80 __asm__ __volatile__(" basr %1,0\n" 61 return 1;
81 "0: cs %0,%1,0(%3)" 62 return _raw_spin_trylock_retry(lp, pc);
82 : "=d" (result), "=&d" (reg), "=m" (lp->lock)
83 : "a" (&lp->lock), "m" (lp->lock), "0" (0)
84 : "cc", "memory" );
85 return !result;
86} 63}
87 64
88extern inline void _raw_spin_unlock(spinlock_t *lp) 65static inline void _raw_spin_unlock(spinlock_t *lp)
89{ 66{
90 unsigned int old; 67 _raw_compare_and_swap(&lp->lock, lp->lock, 0);
91
92 __asm__ __volatile__("cs %0,%3,0(%4)"
93 : "=d" (old), "=m" (lp->lock)
94 : "0" (lp->lock), "d" (0), "a" (lp)
95 : "cc", "memory" );
96} 68}
97 69
98/* 70/*
@@ -106,7 +78,7 @@ extern inline void _raw_spin_unlock(spinlock_t *lp)
106 * read-locks. 78 * read-locks.
107 */ 79 */
108typedef struct { 80typedef struct {
109 volatile unsigned long lock; 81 volatile unsigned int lock;
110 volatile unsigned long owner_pc; 82 volatile unsigned long owner_pc;
111#ifdef CONFIG_PREEMPT 83#ifdef CONFIG_PREEMPT
112 unsigned int break_lock; 84 unsigned int break_lock;
@@ -129,123 +101,55 @@ typedef struct {
129 */ 101 */
130#define write_can_lock(x) ((x)->lock == 0) 102#define write_can_lock(x) ((x)->lock == 0)
131 103
132#ifndef __s390x__ 104extern void _raw_read_lock_wait(rwlock_t *lp);
133#define _raw_read_lock(rw) \ 105extern int _raw_read_trylock_retry(rwlock_t *lp);
134 asm volatile(" l 2,0(%1)\n" \ 106extern void _raw_write_lock_wait(rwlock_t *lp);
135 " j 1f\n" \ 107extern int _raw_write_trylock_retry(rwlock_t *lp);
136 "0: diag 0,0,68\n" \ 108
137 "1: la 2,0(2)\n" /* clear high (=write) bit */ \ 109static inline void _raw_read_lock(rwlock_t *rw)
138 " la 3,1(2)\n" /* one more reader */ \ 110{
139 " cs 2,3,0(%1)\n" /* try to write new value */ \ 111 unsigned int old;
140 " jl 0b" \ 112 old = rw->lock & 0x7fffffffU;
141 : "=m" ((rw)->lock) : "a" (&(rw)->lock), \ 113 if (_raw_compare_and_swap(&rw->lock, old, old + 1) != old)
142 "m" ((rw)->lock) : "2", "3", "cc", "memory" ) 114 _raw_read_lock_wait(rw);
143#else /* __s390x__ */ 115}
144#define _raw_read_lock(rw) \ 116
145 asm volatile(" lg 2,0(%1)\n" \ 117static inline void _raw_read_unlock(rwlock_t *rw)
146 " j 1f\n" \ 118{
147 "0: " __DIAG44_INSN " 0,%2\n" \ 119 unsigned int old, cmp;
148 "1: nihh 2,0x7fff\n" /* clear high (=write) bit */ \ 120
149 " la 3,1(2)\n" /* one more reader */ \ 121 old = rw->lock;
150 " csg 2,3,0(%1)\n" /* try to write new value */ \ 122 do {
151 " jl 0b" \ 123 cmp = old;
152 : "=m" ((rw)->lock) \ 124 old = _raw_compare_and_swap(&rw->lock, old, old - 1);
153 : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \ 125 } while (cmp != old);
154 "m" ((rw)->lock) : "2", "3", "cc", "memory" ) 126}
155#endif /* __s390x__ */ 127
156 128static inline void _raw_write_lock(rwlock_t *rw)
157#ifndef __s390x__ 129{
158#define _raw_read_unlock(rw) \ 130 if (unlikely(_raw_compare_and_swap(&rw->lock, 0, 0x80000000) != 0))
159 asm volatile(" l 2,0(%1)\n" \ 131 _raw_write_lock_wait(rw);
160 " j 1f\n" \ 132}
161 "0: diag 0,0,68\n" \ 133
162 "1: lr 3,2\n" \ 134static inline void _raw_write_unlock(rwlock_t *rw)
163 " ahi 3,-1\n" /* one less reader */ \ 135{
164 " cs 2,3,0(%1)\n" \ 136 _raw_compare_and_swap(&rw->lock, 0x80000000, 0);
165 " jl 0b" \ 137}
166 : "=m" ((rw)->lock) : "a" (&(rw)->lock), \ 138
167 "m" ((rw)->lock) : "2", "3", "cc", "memory" ) 139static inline int _raw_read_trylock(rwlock_t *rw)
168#else /* __s390x__ */ 140{
169#define _raw_read_unlock(rw) \ 141 unsigned int old;
170 asm volatile(" lg 2,0(%1)\n" \ 142 old = rw->lock & 0x7fffffffU;
171 " j 1f\n" \ 143 if (likely(_raw_compare_and_swap(&rw->lock, old, old + 1) == old))
172 "0: " __DIAG44_INSN " 0,%2\n" \ 144 return 1;
173 "1: lgr 3,2\n" \ 145 return _raw_read_trylock_retry(rw);
174 " bctgr 3,0\n" /* one less reader */ \ 146}
175 " csg 2,3,0(%1)\n" \ 147
176 " jl 0b" \ 148static inline int _raw_write_trylock(rwlock_t *rw)
177 : "=m" ((rw)->lock) \
178 : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
179 "m" ((rw)->lock) : "2", "3", "cc", "memory" )
180#endif /* __s390x__ */
181
182#ifndef __s390x__
183#define _raw_write_lock(rw) \
184 asm volatile(" lhi 3,1\n" \
185 " sll 3,31\n" /* new lock value = 0x80000000 */ \
186 " j 1f\n" \
187 "0: diag 0,0,68\n" \
188 "1: slr 2,2\n" /* old lock value must be 0 */ \
189 " cs 2,3,0(%1)\n" \
190 " jl 0b" \
191 : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
192 "m" ((rw)->lock) : "2", "3", "cc", "memory" )
193#else /* __s390x__ */
194#define _raw_write_lock(rw) \
195 asm volatile(" llihh 3,0x8000\n" /* new lock value = 0x80...0 */ \
196 " j 1f\n" \
197 "0: " __DIAG44_INSN " 0,%2\n" \
198 "1: slgr 2,2\n" /* old lock value must be 0 */ \
199 " csg 2,3,0(%1)\n" \
200 " jl 0b" \
201 : "=m" ((rw)->lock) \
202 : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
203 "m" ((rw)->lock) : "2", "3", "cc", "memory" )
204#endif /* __s390x__ */
205
206#ifndef __s390x__
207#define _raw_write_unlock(rw) \
208 asm volatile(" slr 3,3\n" /* new lock value = 0 */ \
209 " j 1f\n" \
210 "0: diag 0,0,68\n" \
211 "1: lhi 2,1\n" \
212 " sll 2,31\n" /* old lock value must be 0x80000000 */ \
213 " cs 2,3,0(%1)\n" \
214 " jl 0b" \
215 : "=m" ((rw)->lock) : "a" (&(rw)->lock), \
216 "m" ((rw)->lock) : "2", "3", "cc", "memory" )
217#else /* __s390x__ */
218#define _raw_write_unlock(rw) \
219 asm volatile(" slgr 3,3\n" /* new lock value = 0 */ \
220 " j 1f\n" \
221 "0: " __DIAG44_INSN " 0,%2\n" \
222 "1: llihh 2,0x8000\n" /* old lock value must be 0x8..0 */\
223 " csg 2,3,0(%1)\n" \
224 " jl 0b" \
225 : "=m" ((rw)->lock) \
226 : "a" (&(rw)->lock), "i" (__DIAG44_OPERAND), \
227 "m" ((rw)->lock) : "2", "3", "cc", "memory" )
228#endif /* __s390x__ */
229
230#define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
231
232extern inline int _raw_write_trylock(rwlock_t *rw)
233{ 149{
234 unsigned long result, reg; 150 if (likely(_raw_compare_and_swap(&rw->lock, 0, 0x80000000) == 0))
235 151 return 1;
236 __asm__ __volatile__( 152 return _raw_write_trylock_retry(rw);
237#ifndef __s390x__
238 " lhi %1,1\n"
239 " sll %1,31\n"
240 " cs %0,%1,0(%3)"
241#else /* __s390x__ */
242 " llihh %1,0x8000\n"
243 "0: csg %0,%1,0(%3)\n"
244#endif /* __s390x__ */
245 : "=d" (result), "=&d" (reg), "=m" (rw->lock)
246 : "a" (&rw->lock), "m" (rw->lock), "0" (0UL)
247 : "cc", "memory" );
248 return result == 0;
249} 153}
250 154
251#endif /* __ASM_SPINLOCK_H */ 155#endif /* __ASM_SPINLOCK_H */
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h
index 81514d76edcf..864cae7e1fd6 100644
--- a/include/asm-s390/system.h
+++ b/include/asm-s390/system.h
@@ -16,6 +16,7 @@
16#include <asm/types.h> 16#include <asm/types.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/setup.h> 18#include <asm/setup.h>
19#include <asm/processor.h>
19 20
20#ifdef __KERNEL__ 21#ifdef __KERNEL__
21 22
@@ -103,29 +104,16 @@ static inline void restore_access_regs(unsigned int *acrs)
103 prev = __switch_to(prev,next); \ 104 prev = __switch_to(prev,next); \
104} while (0) 105} while (0)
105 106
106#define prepare_arch_switch(rq, next) do { } while(0)
107#define task_running(rq, p) ((rq)->curr == (p))
108
109#ifdef CONFIG_VIRT_CPU_ACCOUNTING 107#ifdef CONFIG_VIRT_CPU_ACCOUNTING
110extern void account_user_vtime(struct task_struct *); 108extern void account_user_vtime(struct task_struct *);
111extern void account_system_vtime(struct task_struct *); 109extern void account_system_vtime(struct task_struct *);
110#endif
112 111
113#define finish_arch_switch(rq, prev) do { \ 112#define finish_arch_switch(prev) do { \
114 set_fs(current->thread.mm_segment); \ 113 set_fs(current->thread.mm_segment); \
115 spin_unlock(&(rq)->lock); \
116 account_system_vtime(prev); \ 114 account_system_vtime(prev); \
117 local_irq_enable(); \
118} while (0) 115} while (0)
119 116
120#else
121
122#define finish_arch_switch(rq, prev) do { \
123 set_fs(current->thread.mm_segment); \
124 spin_unlock_irq(&(rq)->lock); \
125} while (0)
126
127#endif
128
129#define nop() __asm__ __volatile__ ("nop") 117#define nop() __asm__ __volatile__ ("nop")
130 118
131#define xchg(ptr,x) \ 119#define xchg(ptr,x) \
@@ -331,9 +319,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
331 319
332#ifdef __s390x__ 320#ifdef __s390x__
333 321
334#define __load_psw(psw) \
335 __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" );
336
337#define __ctl_load(array, low, high) ({ \ 322#define __ctl_load(array, low, high) ({ \
338 typedef struct { char _[sizeof(array)]; } addrtype; \ 323 typedef struct { char _[sizeof(array)]; } addrtype; \
339 __asm__ __volatile__ ( \ 324 __asm__ __volatile__ ( \
@@ -390,9 +375,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
390 375
391#else /* __s390x__ */ 376#else /* __s390x__ */
392 377
393#define __load_psw(psw) \
394 __asm__ __volatile__("lpsw 0(%0)" : : "a" (&psw) : "cc" );
395
396#define __ctl_load(array, low, high) ({ \ 378#define __ctl_load(array, low, high) ({ \
397 typedef struct { char _[sizeof(array)]; } addrtype; \ 379 typedef struct { char _[sizeof(array)]; } addrtype; \
398 __asm__ __volatile__ ( \ 380 __asm__ __volatile__ ( \
@@ -451,6 +433,20 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
451/* For spinlocks etc */ 433/* For spinlocks etc */
452#define local_irq_save(x) ((x) = local_irq_disable()) 434#define local_irq_save(x) ((x) = local_irq_disable())
453 435
436/*
437 * Use to set psw mask except for the first byte which
438 * won't be changed by this function.
439 */
440static inline void
441__set_psw_mask(unsigned long mask)
442{
443 local_save_flags(mask);
444 __load_psw_mask(mask);
445}
446
447#define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS)
448#define local_mcck_disable() __set_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK)
449
454#ifdef CONFIG_SMP 450#ifdef CONFIG_SMP
455 451
456extern void smp_ctl_set_bit(int cr, int bit); 452extern void smp_ctl_set_bit(int cr, int bit);
diff --git a/include/asm-s390/thread_info.h b/include/asm-s390/thread_info.h
index aade85c53a63..6c18a3f24316 100644
--- a/include/asm-s390/thread_info.h
+++ b/include/asm-s390/thread_info.h
@@ -50,7 +50,7 @@ struct thread_info {
50 struct exec_domain *exec_domain; /* execution domain */ 50 struct exec_domain *exec_domain; /* execution domain */
51 unsigned long flags; /* low level flags */ 51 unsigned long flags; /* low level flags */
52 unsigned int cpu; /* current CPU */ 52 unsigned int cpu; /* current CPU */
53 unsigned int preempt_count; /* 0 => preemptable */ 53 int preempt_count; /* 0 => preemptable, <0 => BUG */
54 struct restart_block restart_block; 54 struct restart_block restart_block;
55}; 55};
56 56
@@ -96,6 +96,7 @@ static inline struct thread_info *current_thread_info(void)
96#define TIF_RESTART_SVC 4 /* restart svc with new svc number */ 96#define TIF_RESTART_SVC 4 /* restart svc with new svc number */
97#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ 97#define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */
98#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */ 98#define TIF_SINGLE_STEP 6 /* deliver sigtrap on return to user */
99#define TIF_MCCK_PENDING 7 /* machine check handling is pending */
99#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 100#define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */
100#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling 101#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
101 TIF_NEED_RESCHED */ 102 TIF_NEED_RESCHED */
@@ -109,6 +110,7 @@ static inline struct thread_info *current_thread_info(void)
109#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC) 110#define _TIF_RESTART_SVC (1<<TIF_RESTART_SVC)
110#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 111#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
111#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP) 112#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
113#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
112#define _TIF_USEDFPU (1<<TIF_USEDFPU) 114#define _TIF_USEDFPU (1<<TIF_USEDFPU)
113#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 115#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
114#define _TIF_31BIT (1<<TIF_31BIT) 116#define _TIF_31BIT (1<<TIF_31BIT)
diff --git a/include/asm-s390/uaccess.h b/include/asm-s390/uaccess.h
index a7f43a251f81..3e3bfe6a8fa8 100644
--- a/include/asm-s390/uaccess.h
+++ b/include/asm-s390/uaccess.h
@@ -149,11 +149,11 @@ struct exception_table_entry
149}) 149})
150#endif 150#endif
151 151
152#ifndef __CHECKER__
153#define __put_user(x, ptr) \ 152#define __put_user(x, ptr) \
154({ \ 153({ \
155 __typeof__(*(ptr)) __x = (x); \ 154 __typeof__(*(ptr)) __x = (x); \
156 int __pu_err; \ 155 int __pu_err; \
156 __chk_user_ptr(ptr); \
157 switch (sizeof (*(ptr))) { \ 157 switch (sizeof (*(ptr))) { \
158 case 1: \ 158 case 1: \
159 case 2: \ 159 case 2: \
@@ -167,14 +167,6 @@ struct exception_table_entry
167 } \ 167 } \
168 __pu_err; \ 168 __pu_err; \
169}) 169})
170#else
171#define __put_user(x, ptr) \
172({ \
173 void __user *p; \
174 p = (ptr); \
175 0; \
176})
177#endif
178 170
179#define put_user(x, ptr) \ 171#define put_user(x, ptr) \
180({ \ 172({ \
@@ -213,11 +205,11 @@ extern int __put_user_bad(void) __attribute__((noreturn));
213}) 205})
214#endif 206#endif
215 207
216#ifndef __CHECKER__
217#define __get_user(x, ptr) \ 208#define __get_user(x, ptr) \
218({ \ 209({ \
219 __typeof__(*(ptr)) __x; \ 210 __typeof__(*(ptr)) __x; \
220 int __gu_err; \ 211 int __gu_err; \
212 __chk_user_ptr(ptr); \
221 switch (sizeof(*(ptr))) { \ 213 switch (sizeof(*(ptr))) { \
222 case 1: \ 214 case 1: \
223 case 2: \ 215 case 2: \
@@ -232,15 +224,6 @@ extern int __put_user_bad(void) __attribute__((noreturn));
232 (x) = __x; \ 224 (x) = __x; \
233 __gu_err; \ 225 __gu_err; \
234}) 226})
235#else
236#define __get_user(x, ptr) \
237({ \
238 void __user *p; \
239 p = (ptr); \
240 0; \
241})
242#endif
243
244 227
245#define get_user(x, ptr) \ 228#define get_user(x, ptr) \
246({ \ 229({ \
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index f1a204f7c0f0..221e965da924 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -269,13 +269,18 @@
269#define __NR_mq_timedreceive 274 269#define __NR_mq_timedreceive 274
270#define __NR_mq_notify 275 270#define __NR_mq_notify 275
271#define __NR_mq_getsetattr 276 271#define __NR_mq_getsetattr 276
272/* Number 277 is reserved for new sys_kexec_load */ 272#define __NR_kexec_load 277
273#define __NR_add_key 278 273#define __NR_add_key 278
274#define __NR_request_key 279 274#define __NR_request_key 279
275#define __NR_keyctl 280 275#define __NR_keyctl 280
276#define __NR_waitid 281 276#define __NR_waitid 281
277#define __NR_ioprio_set 282
278#define __NR_ioprio_get 283
279#define __NR_inotify_init 284
280#define __NR_inotify_add_watch 285
281#define __NR_inotify_rm_watch 286
277 282
278#define NR_syscalls 282 283#define NR_syscalls 287
279 284
280/* 285/*
281 * There are some system calls that are not present on 64 bit, some 286 * There are some system calls that are not present on 64 bit, some
diff --git a/include/asm-sh/bigsur/serial.h b/include/asm-sh/bigsur/serial.h
index 540f12205923..7233af42f755 100644
--- a/include/asm-sh/bigsur/serial.h
+++ b/include/asm-sh/bigsur/serial.h
@@ -14,13 +14,10 @@
14#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) 14#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
15 15
16 16
17#define STD_SERIAL_PORT_DEFNS \ 17#define SERIAL_PORT_DFNS \
18 /* UART CLK PORT IRQ FLAGS */ \ 18 /* UART CLK PORT IRQ FLAGS */ \
19 { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */ 19 { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */
20 20
21
22#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
23
24/* XXX: This should be moved ino irq.h */ 21/* XXX: This should be moved ino irq.h */
25#define irq_cannonicalize(x) (x) 22#define irq_cannonicalize(x) (x)
26 23
diff --git a/include/asm-sh/ec3104/serial.h b/include/asm-sh/ec3104/serial.h
index f8eb16312ed9..cfe4d78ec1ee 100644
--- a/include/asm-sh/ec3104/serial.h
+++ b/include/asm-sh/ec3104/serial.h
@@ -10,13 +10,11 @@
10 * it's got the keyboard controller behind it so we can't really use it 10 * it's got the keyboard controller behind it so we can't really use it
11 * (without moving the keyboard driver to userspace, which doesn't sound 11 * (without moving the keyboard driver to userspace, which doesn't sound
12 * like a very good idea) */ 12 * like a very good idea) */
13#define STD_SERIAL_PORT_DEFNS \ 13#define SERIAL_PORT_DFNS \
14 /* UART CLK PORT IRQ FLAGS */ \ 14 /* UART CLK PORT IRQ FLAGS */ \
15 { 0, BASE_BAUD, 0x11C00, EC3104_IRQBASE+7, STD_COM_FLAGS }, /* ttyS0 */ \ 15 { 0, BASE_BAUD, 0x11C00, EC3104_IRQBASE+7, STD_COM_FLAGS }, /* ttyS0 */ \
16 { 0, BASE_BAUD, 0x12000, EC3104_IRQBASE+8, STD_COM_FLAGS }, /* ttyS1 */ \ 16 { 0, BASE_BAUD, 0x12000, EC3104_IRQBASE+8, STD_COM_FLAGS }, /* ttyS1 */ \
17 { 0, BASE_BAUD, 0x12400, EC3104_IRQBASE+9, STD_COM_FLAGS }, /* ttyS2 */ 17 { 0, BASE_BAUD, 0x12400, EC3104_IRQBASE+9, STD_COM_FLAGS }, /* ttyS2 */
18 18
19#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
20
21/* XXX: This should be moved ino irq.h */ 19/* XXX: This should be moved ino irq.h */
22#define irq_cannonicalize(x) (x) 20#define irq_cannonicalize(x) (x)
diff --git a/include/asm-sh/emergency-restart.h b/include/asm-sh/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-sh/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-sh/pci.h b/include/asm-sh/pci.h
index 9c3b63d0105e..0a523c85b11c 100644
--- a/include/asm-sh/pci.h
+++ b/include/asm-sh/pci.h
@@ -36,7 +36,7 @@ struct pci_dev;
36 36
37extern void pcibios_set_master(struct pci_dev *dev); 37extern void pcibios_set_master(struct pci_dev *dev);
38 38
39static inline void pcibios_penalize_isa_irq(int irq) 39static inline void pcibios_penalize_isa_irq(int irq, int active)
40{ 40{
41 /* We don't do dynamic PCI IRQ allocation */ 41 /* We don't do dynamic PCI IRQ allocation */
42} 42}
@@ -96,6 +96,16 @@ static inline void pcibios_penalize_isa_irq(int irq)
96#define sg_dma_address(sg) (virt_to_bus((sg)->dma_address)) 96#define sg_dma_address(sg) (virt_to_bus((sg)->dma_address))
97#define sg_dma_len(sg) ((sg)->length) 97#define sg_dma_len(sg) ((sg)->length)
98 98
99#ifdef CONFIG_PCI
100static inline void pci_dma_burst_advice(struct pci_dev *pdev,
101 enum pci_dma_burst_strategy *strat,
102 unsigned long *strategy_parameter)
103{
104 *strat = PCI_DMA_BURST_INFINITY;
105 *strategy_parameter = ~0UL;
106}
107#endif
108
99/* Board-specific fixup routines. */ 109/* Board-specific fixup routines. */
100extern void pcibios_fixup(void); 110extern void pcibios_fixup(void);
101extern void pcibios_fixup_irqs(void); 111extern void pcibios_fixup_irqs(void);
diff --git a/include/asm-sh/serial.h b/include/asm-sh/serial.h
index 5474dbdbaa86..f51e232d5cd9 100644
--- a/include/asm-sh/serial.h
+++ b/include/asm-sh/serial.h
@@ -29,20 +29,18 @@
29#ifdef CONFIG_HD64465 29#ifdef CONFIG_HD64465
30#include <asm/hd64465.h> 30#include <asm/hd64465.h>
31 31
32#define STD_SERIAL_PORT_DEFNS \ 32#define SERIAL_PORT_DFNS \
33 /* UART CLK PORT IRQ FLAGS */ \ 33 /* UART CLK PORT IRQ FLAGS */ \
34 { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */ 34 { 0, BASE_BAUD, 0x3F8, HD64465_IRQ_UART, STD_COM_FLAGS } /* ttyS0 */
35 35
36#else 36#else
37 37
38#define STD_SERIAL_PORT_DEFNS \ 38#define SERIAL_PORT_DFNS \
39 /* UART CLK PORT IRQ FLAGS */ \ 39 /* UART CLK PORT IRQ FLAGS */ \
40 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 40 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
41 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */ 41 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */
42 42
43#endif 43#endif
44 44
45#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
46
47#endif 45#endif
48#endif /* _ASM_SERIAL_H */ 46#endif /* _ASM_SERIAL_H */
diff --git a/include/asm-sh/thread_info.h b/include/asm-sh/thread_info.h
index 4bbbd9f3c37e..46080cefaff8 100644
--- a/include/asm-sh/thread_info.h
+++ b/include/asm-sh/thread_info.h
@@ -20,7 +20,7 @@ struct thread_info {
20 struct exec_domain *exec_domain; /* execution domain */ 20 struct exec_domain *exec_domain; /* execution domain */
21 __u32 flags; /* low level flags */ 21 __u32 flags; /* low level flags */
22 __u32 cpu; 22 __u32 cpu;
23 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 23 int preempt_count; /* 0 => preemptable, <0 => BUG */
24 struct restart_block restart_block; 24 struct restart_block restart_block;
25 __u8 supervisor_stack[0]; 25 __u8 supervisor_stack[0];
26}; 26};
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 245447081f0d..ea89e8f223ea 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -295,8 +295,14 @@
295#define __NR_add_key 285 295#define __NR_add_key 285
296#define __NR_request_key 286 296#define __NR_request_key 286
297#define __NR_keyctl 287 297#define __NR_keyctl 287
298#define __NR_ioprio_set 288
299#define __NR_ioprio_get 289
300#define __NR_inotify_init 290
301#define __NR_inotify_add_watch 291
302#define __NR_inotify_rm_watch 292
298 303
299#define NR_syscalls 288 304
305#define NR_syscalls 293
300 306
301/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */ 307/* user-visible error numbers are in the range -1 - -124: see <asm-sh/errno.h> */
302 308
@@ -406,7 +412,7 @@ register long __sc6 __asm__ ("r6") = (long) arg3; \
406register long __sc7 __asm__ ("r7") = (long) arg4; \ 412register long __sc7 __asm__ ("r7") = (long) arg4; \
407register long __sc0 __asm__ ("r0") = (long) arg5; \ 413register long __sc0 __asm__ ("r0") = (long) arg5; \
408register long __sc1 __asm__ ("r1") = (long) arg6; \ 414register long __sc1 __asm__ ("r1") = (long) arg6; \
409__asm__ __volatile__ ("trapa #0x15" \ 415__asm__ __volatile__ ("trapa #0x16" \
410 : "=z" (__sc0) \ 416 : "=z" (__sc0) \
411 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ 417 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
412 "r" (__sc3), "r" (__sc1) \ 418 "r" (__sc3), "r" (__sc1) \
diff --git a/include/asm-sh64/emergency-restart.h b/include/asm-sh64/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-sh64/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-sh64/pci.h b/include/asm-sh64/pci.h
index 8cc14e139750..aa8043089bb6 100644
--- a/include/asm-sh64/pci.h
+++ b/include/asm-sh64/pci.h
@@ -26,7 +26,7 @@ extern void pcibios_set_master(struct pci_dev *dev);
26/* 26/*
27 * Set penalize isa irq function 27 * Set penalize isa irq function
28 */ 28 */
29static inline void pcibios_penalize_isa_irq(int irq) 29static inline void pcibios_penalize_isa_irq(int irq, int active)
30{ 30{
31 /* We don't do dynamic PCI IRQ allocation */ 31 /* We don't do dynamic PCI IRQ allocation */
32} 32}
@@ -86,6 +86,16 @@ static inline void pcibios_penalize_isa_irq(int irq)
86#define sg_dma_address(sg) ((sg)->dma_address) 86#define sg_dma_address(sg) ((sg)->dma_address)
87#define sg_dma_len(sg) ((sg)->length) 87#define sg_dma_len(sg) ((sg)->length)
88 88
89#ifdef CONFIG_PCI
90static inline void pci_dma_burst_advice(struct pci_dev *pdev,
91 enum pci_dma_burst_strategy *strat,
92 unsigned long *strategy_parameter)
93{
94 *strat = PCI_DMA_BURST_INFINITY;
95 *strategy_parameter = ~0UL;
96}
97#endif
98
89/* Board-specific fixup routines. */ 99/* Board-specific fixup routines. */
90extern void pcibios_fixup(void); 100extern void pcibios_fixup(void);
91extern void pcibios_fixup_irqs(void); 101extern void pcibios_fixup_irqs(void);
diff --git a/include/asm-sh64/serial.h b/include/asm-sh64/serial.h
index 8e39b4e90c76..29c9be15112b 100644
--- a/include/asm-sh64/serial.h
+++ b/include/asm-sh64/serial.h
@@ -20,13 +20,11 @@
20 20
21#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST) 21#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
22 22
23#define STD_SERIAL_PORT_DEFNS \ 23#define SERIAL_PORT_DFNS \
24 /* UART CLK PORT IRQ FLAGS */ \ 24 /* UART CLK PORT IRQ FLAGS */ \
25 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 25 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
26 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */ 26 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS } /* ttyS1 */
27 27
28#define SERIAL_PORT_DFNS STD_SERIAL_PORT_DEFNS
29
30/* XXX: This should be moved ino irq.h */ 28/* XXX: This should be moved ino irq.h */
31#define irq_cannonicalize(x) (x) 29#define irq_cannonicalize(x) (x)
32 30
diff --git a/include/asm-sh64/thread_info.h b/include/asm-sh64/thread_info.h
index 8a32d6bd0b79..10f024c6a2e3 100644
--- a/include/asm-sh64/thread_info.h
+++ b/include/asm-sh64/thread_info.h
@@ -22,7 +22,7 @@ struct thread_info {
22 struct exec_domain *exec_domain; /* execution domain */ 22 struct exec_domain *exec_domain; /* execution domain */
23 unsigned long flags; /* low level flags */ 23 unsigned long flags; /* low level flags */
24 /* Put the 4 32-bit fields together to make asm offsetting easier. */ 24 /* Put the 4 32-bit fields together to make asm offsetting easier. */
25 __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ 25 int preempt_count; /* 0 => preemptable, <0 => BUG */
26 __u16 cpu; 26 __u16 cpu;
27 27
28 mm_segment_t addr_limit; 28 mm_segment_t addr_limit;
diff --git a/include/asm-sh64/unistd.h b/include/asm-sh64/unistd.h
index 95f0b130405c..2a1cfa404ea4 100644
--- a/include/asm-sh64/unistd.h
+++ b/include/asm-sh64/unistd.h
@@ -338,8 +338,13 @@
338#define __NR_add_key 313 338#define __NR_add_key 313
339#define __NR_request_key 314 339#define __NR_request_key 314
340#define __NR_keyctl 315 340#define __NR_keyctl 315
341#define __NR_ioprio_set 316
342#define __NR_ioprio_get 317
343#define __NR_inotify_init 318
344#define __NR_inotify_add_watch 319
345#define __NR_inotify_rm_watch 320
341 346
342#define NR_syscalls 316 347#define NR_syscalls 321
343 348
344/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */ 349/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */
345 350
diff --git a/include/asm-sparc/emergency-restart.h b/include/asm-sparc/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-sparc/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index d200a25a7373..97052baf90c1 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -20,7 +20,7 @@ extern inline void pcibios_set_master(struct pci_dev *dev)
20 /* No special bus mastering setup handling */ 20 /* No special bus mastering setup handling */
21} 21}
22 22
23extern inline void pcibios_penalize_isa_irq(int irq) 23extern inline void pcibios_penalize_isa_irq(int irq, int active)
24{ 24{
25 /* We don't do dynamic PCI IRQ allocation */ 25 /* We don't do dynamic PCI IRQ allocation */
26} 26}
@@ -144,6 +144,16 @@ extern inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
144 144
145#define pci_dac_dma_supported(dev, mask) (0) 145#define pci_dac_dma_supported(dev, mask) (0)
146 146
147#ifdef CONFIG_PCI
148static inline void pci_dma_burst_advice(struct pci_dev *pdev,
149 enum pci_dma_burst_strategy *strat,
150 unsigned long *strategy_parameter)
151{
152 *strat = PCI_DMA_BURST_INFINITY;
153 *strategy_parameter = ~0UL;
154}
155#endif
156
147static inline void pcibios_add_platform_entries(struct pci_dev *dev) 157static inline void pcibios_add_platform_entries(struct pci_dev *dev)
148{ 158{
149} 159}
diff --git a/include/asm-sparc/system.h b/include/asm-sparc/system.h
index 80cf20cfaee1..898562ebe94c 100644
--- a/include/asm-sparc/system.h
+++ b/include/asm-sparc/system.h
@@ -101,7 +101,7 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
101 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work) 101 * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
102 * XXX WTF is the above comment? Found in late teen 2.4.x. 102 * XXX WTF is the above comment? Found in late teen 2.4.x.
103 */ 103 */
104#define prepare_arch_switch(rq, next) do { \ 104#define prepare_arch_switch(next) do { \
105 __asm__ __volatile__( \ 105 __asm__ __volatile__( \
106 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \ 106 ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
107 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \ 107 "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
@@ -109,8 +109,6 @@ extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
109 "save %sp, -0x40, %sp\n\t" \ 109 "save %sp, -0x40, %sp\n\t" \
110 "restore; restore; restore; restore; restore; restore; restore"); \ 110 "restore; restore; restore; restore; restore; restore; restore"); \
111} while(0) 111} while(0)
112#define finish_arch_switch(rq, next) spin_unlock_irq(&(rq)->lock)
113#define task_running(rq, p) ((rq)->curr == (p))
114 112
115 /* Much care has gone into this code, do not touch it. 113 /* Much care has gone into this code, do not touch it.
116 * 114 *
diff --git a/include/asm-sparc/thread_info.h b/include/asm-sparc/thread_info.h
index 104f03c55416..ff6ccb3d24c6 100644
--- a/include/asm-sparc/thread_info.h
+++ b/include/asm-sparc/thread_info.h
@@ -30,9 +30,9 @@ struct thread_info {
30 struct task_struct *task; /* main task structure */ 30 struct task_struct *task; /* main task structure */
31 struct exec_domain *exec_domain; /* execution domain */ 31 struct exec_domain *exec_domain; /* execution domain */
32 unsigned long flags; /* low level flags */ 32 unsigned long flags; /* low level flags */
33
34 int cpu; /* cpu we're on */ 33 int cpu; /* cpu we're on */
35 int preempt_count; 34 int preempt_count; /* 0 => preemptable,
35 <0 => BUG */
36 int softirq_count; 36 int softirq_count;
37 int hardirq_count; 37 int hardirq_count;
38 38
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 846708403900..58dba518239e 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -167,12 +167,12 @@
167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */ 167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */
168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */ 168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */
169#define __NR_getsockname 150 /* Common */ 169#define __NR_getsockname 150 /* Common */
170/* #define __NR_getmsg 151 SunOS Specific */ 170#define __NR_inotify_init 151 /* Linux specific */
171/* #define __NR_putmsg 152 SunOS Specific */ 171#define __NR_inotify_add_watch 152 /* Linux specific */
172#define __NR_poll 153 /* Common */ 172#define __NR_poll 153 /* Common */
173#define __NR_getdents64 154 /* Linux specific */ 173#define __NR_getdents64 154 /* Linux specific */
174#define __NR_fcntl64 155 /* Linux sparc32 Specific */ 174#define __NR_fcntl64 155 /* Linux sparc32 Specific */
175/* #define __NR_getdirentires 156 SunOS Specific */ 175#define __NR_inotify_rm_watch 156 /* Linux specific */
176#define __NR_statfs 157 /* Common */ 176#define __NR_statfs 157 /* Common */
177#define __NR_fstatfs 158 /* Common */ 177#define __NR_fstatfs 158 /* Common */
178#define __NR_umount 159 /* Common */ 178#define __NR_umount 159 /* Common */
@@ -212,7 +212,7 @@
212#define __NR_epoll_create 193 /* Linux Specific */ 212#define __NR_epoll_create 193 /* Linux Specific */
213#define __NR_epoll_ctl 194 /* Linux Specific */ 213#define __NR_epoll_ctl 194 /* Linux Specific */
214#define __NR_epoll_wait 195 /* Linux Specific */ 214#define __NR_epoll_wait 195 /* Linux Specific */
215/* #define __NR_ulimit 196 Linux Specific */ 215#define __NR_ioprio_set 196 /* Linux Specific */
216#define __NR_getppid 197 /* Linux Specific */ 216#define __NR_getppid 197 /* Linux Specific */
217#define __NR_sigaction 198 /* Linux Specific */ 217#define __NR_sigaction 198 /* Linux Specific */
218#define __NR_sgetmask 199 /* Linux Specific */ 218#define __NR_sgetmask 199 /* Linux Specific */
@@ -234,7 +234,7 @@
234#define __NR_ipc 215 /* Linux Specific */ 234#define __NR_ipc 215 /* Linux Specific */
235#define __NR_sigreturn 216 /* Linux Specific */ 235#define __NR_sigreturn 216 /* Linux Specific */
236#define __NR_clone 217 /* Linux Specific */ 236#define __NR_clone 217 /* Linux Specific */
237/* #define __NR_modify_ldt 218 Linux Specific - i386 specific, unused */ 237#define __NR_ioprio_get 218 /* Linux Specific */
238#define __NR_adjtimex 219 /* Linux Specific */ 238#define __NR_adjtimex 219 /* Linux Specific */
239#define __NR_sigprocmask 220 /* Linux Specific */ 239#define __NR_sigprocmask 220 /* Linux Specific */
240#define __NR_create_module 221 /* Linux Specific */ 240#define __NR_create_module 221 /* Linux Specific */
diff --git a/include/asm-sparc64/auxio.h b/include/asm-sparc64/auxio.h
index 5eb01dd47150..81a590a50a1f 100644
--- a/include/asm-sparc64/auxio.h
+++ b/include/asm-sparc64/auxio.h
@@ -75,6 +75,8 @@
75 75
76#ifndef __ASSEMBLY__ 76#ifndef __ASSEMBLY__
77 77
78extern void __iomem *auxio_register;
79
78#define AUXIO_LTE_ON 1 80#define AUXIO_LTE_ON 1
79#define AUXIO_LTE_OFF 0 81#define AUXIO_LTE_OFF 0
80 82
diff --git a/include/asm-sparc64/bitops.h b/include/asm-sparc64/bitops.h
index 9d722dc8cca3..9c5e71970287 100644
--- a/include/asm-sparc64/bitops.h
+++ b/include/asm-sparc64/bitops.h
@@ -20,52 +20,52 @@ extern void change_bit(unsigned long nr, volatile unsigned long *addr);
20 20
21/* "non-atomic" versions... */ 21/* "non-atomic" versions... */
22 22
23static __inline__ void __set_bit(int nr, volatile unsigned long *addr) 23static inline void __set_bit(int nr, volatile unsigned long *addr)
24{ 24{
25 volatile unsigned long *m = addr + (nr >> 6); 25 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
26 26
27 *m |= (1UL << (nr & 63)); 27 *m |= (1UL << (nr & 63));
28} 28}
29 29
30static __inline__ void __clear_bit(int nr, volatile unsigned long *addr) 30static inline void __clear_bit(int nr, volatile unsigned long *addr)
31{ 31{
32 volatile unsigned long *m = addr + (nr >> 6); 32 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
33 33
34 *m &= ~(1UL << (nr & 63)); 34 *m &= ~(1UL << (nr & 63));
35} 35}
36 36
37static __inline__ void __change_bit(int nr, volatile unsigned long *addr) 37static inline void __change_bit(int nr, volatile unsigned long *addr)
38{ 38{
39 volatile unsigned long *m = addr + (nr >> 6); 39 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
40 40
41 *m ^= (1UL << (nr & 63)); 41 *m ^= (1UL << (nr & 63));
42} 42}
43 43
44static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr) 44static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
45{ 45{
46 volatile unsigned long *m = addr + (nr >> 6); 46 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
47 long old = *m; 47 unsigned long old = *m;
48 long mask = (1UL << (nr & 63)); 48 unsigned long mask = (1UL << (nr & 63));
49 49
50 *m = (old | mask); 50 *m = (old | mask);
51 return ((old & mask) != 0); 51 return ((old & mask) != 0);
52} 52}
53 53
54static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr) 54static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
55{ 55{
56 volatile unsigned long *m = addr + (nr >> 6); 56 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
57 long old = *m; 57 unsigned long old = *m;
58 long mask = (1UL << (nr & 63)); 58 unsigned long mask = (1UL << (nr & 63));
59 59
60 *m = (old & ~mask); 60 *m = (old & ~mask);
61 return ((old & mask) != 0); 61 return ((old & mask) != 0);
62} 62}
63 63
64static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr) 64static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
65{ 65{
66 volatile unsigned long *m = addr + (nr >> 6); 66 unsigned long *m = ((unsigned long *)addr) + (nr >> 6);
67 long old = *m; 67 unsigned long old = *m;
68 long mask = (1UL << (nr & 63)); 68 unsigned long mask = (1UL << (nr & 63));
69 69
70 *m = (old ^ mask); 70 *m = (old ^ mask);
71 return ((old & mask) != 0); 71 return ((old & mask) != 0);
@@ -79,13 +79,13 @@ static __inline__ int __test_and_change_bit(int nr, volatile unsigned long *addr
79#define smp_mb__after_clear_bit() barrier() 79#define smp_mb__after_clear_bit() barrier()
80#endif 80#endif
81 81
82static __inline__ int test_bit(int nr, __const__ volatile unsigned long *addr) 82static inline int test_bit(int nr, __const__ volatile unsigned long *addr)
83{ 83{
84 return (1UL & ((addr)[nr >> 6] >> (nr & 63))) != 0UL; 84 return (1UL & (addr[nr >> 6] >> (nr & 63))) != 0UL;
85} 85}
86 86
87/* The easy/cheese version for now. */ 87/* The easy/cheese version for now. */
88static __inline__ unsigned long ffz(unsigned long word) 88static inline unsigned long ffz(unsigned long word)
89{ 89{
90 unsigned long result; 90 unsigned long result;
91 91
@@ -103,7 +103,7 @@ static __inline__ unsigned long ffz(unsigned long word)
103 * 103 *
104 * Undefined if no bit exists, so code should check against 0 first. 104 * Undefined if no bit exists, so code should check against 0 first.
105 */ 105 */
106static __inline__ unsigned long __ffs(unsigned long word) 106static inline unsigned long __ffs(unsigned long word)
107{ 107{
108 unsigned long result = 0; 108 unsigned long result = 0;
109 109
@@ -144,7 +144,7 @@ static inline int sched_find_first_bit(unsigned long *b)
144 * the libc and compiler builtin ffs routines, therefore 144 * the libc and compiler builtin ffs routines, therefore
145 * differs in spirit from the above ffz (man ffs). 145 * differs in spirit from the above ffz (man ffs).
146 */ 146 */
147static __inline__ int ffs(int x) 147static inline int ffs(int x)
148{ 148{
149 if (!x) 149 if (!x)
150 return 0; 150 return 0;
@@ -158,7 +158,7 @@ static __inline__ int ffs(int x)
158 158
159#ifdef ULTRA_HAS_POPULATION_COUNT 159#ifdef ULTRA_HAS_POPULATION_COUNT
160 160
161static __inline__ unsigned int hweight64(unsigned long w) 161static inline unsigned int hweight64(unsigned long w)
162{ 162{
163 unsigned int res; 163 unsigned int res;
164 164
@@ -166,7 +166,7 @@ static __inline__ unsigned int hweight64(unsigned long w)
166 return res; 166 return res;
167} 167}
168 168
169static __inline__ unsigned int hweight32(unsigned int w) 169static inline unsigned int hweight32(unsigned int w)
170{ 170{
171 unsigned int res; 171 unsigned int res;
172 172
@@ -174,7 +174,7 @@ static __inline__ unsigned int hweight32(unsigned int w)
174 return res; 174 return res;
175} 175}
176 176
177static __inline__ unsigned int hweight16(unsigned int w) 177static inline unsigned int hweight16(unsigned int w)
178{ 178{
179 unsigned int res; 179 unsigned int res;
180 180
@@ -182,7 +182,7 @@ static __inline__ unsigned int hweight16(unsigned int w)
182 return res; 182 return res;
183} 183}
184 184
185static __inline__ unsigned int hweight8(unsigned int w) 185static inline unsigned int hweight8(unsigned int w)
186{ 186{
187 unsigned int res; 187 unsigned int res;
188 188
@@ -236,7 +236,7 @@ extern unsigned long find_next_zero_bit(const unsigned long *,
236#define test_and_clear_le_bit(nr,addr) \ 236#define test_and_clear_le_bit(nr,addr) \
237 test_and_clear_bit((nr) ^ 0x38, (addr)) 237 test_and_clear_bit((nr) ^ 0x38, (addr))
238 238
239static __inline__ int test_le_bit(int nr, __const__ unsigned long * addr) 239static inline int test_le_bit(int nr, __const__ unsigned long * addr)
240{ 240{
241 int mask; 241 int mask;
242 __const__ unsigned char *ADDR = (__const__ unsigned char *) addr; 242 __const__ unsigned char *ADDR = (__const__ unsigned char *) addr;
diff --git a/include/asm-sparc64/compat.h b/include/asm-sparc64/compat.h
index 22f58055b8ab..b59122dd176d 100644
--- a/include/asm-sparc64/compat.h
+++ b/include/asm-sparc64/compat.h
@@ -25,6 +25,7 @@ typedef s32 compat_daddr_t;
25typedef u32 compat_caddr_t; 25typedef u32 compat_caddr_t;
26typedef __kernel_fsid_t compat_fsid_t; 26typedef __kernel_fsid_t compat_fsid_t;
27typedef s32 compat_key_t; 27typedef s32 compat_key_t;
28typedef s32 compat_timer_t;
28 29
29typedef s32 compat_int_t; 30typedef s32 compat_int_t;
30typedef s32 compat_long_t; 31typedef s32 compat_long_t;
diff --git a/include/asm-sparc64/emergency-restart.h b/include/asm-sparc64/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-sparc64/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h
index e071b4b4edfd..49d49a285943 100644
--- a/include/asm-sparc64/floppy.h
+++ b/include/asm-sparc64/floppy.h
@@ -159,7 +159,7 @@ static void sun_82077_fd_outb(unsigned char value, unsigned long port)
159 * underruns. If non-zero, doing_pdma encodes the direction of 159 * underruns. If non-zero, doing_pdma encodes the direction of
160 * the transfer for debugging. 1=read 2=write 160 * the transfer for debugging. 1=read 2=write
161 */ 161 */
162char *pdma_vaddr; 162unsigned char *pdma_vaddr;
163unsigned long pdma_size; 163unsigned long pdma_size;
164volatile int doing_pdma = 0; 164volatile int doing_pdma = 0;
165 165
@@ -209,8 +209,7 @@ static void sun_fd_enable_dma(void)
209 pdma_areasize = pdma_size; 209 pdma_areasize = pdma_size;
210} 210}
211 211
212/* Our low-level entry point in arch/sparc/kernel/entry.S */ 212extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *);
213extern irqreturn_t floppy_hardint(int irq, void *unused, struct pt_regs *regs);
214 213
215static int sun_fd_request_irq(void) 214static int sun_fd_request_irq(void)
216{ 215{
@@ -220,8 +219,8 @@ static int sun_fd_request_irq(void)
220 if(!once) { 219 if(!once) {
221 once = 1; 220 once = 1;
222 221
223 error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, 222 error = request_irq(FLOPPY_IRQ, sparc_floppy_irq,
224 SA_INTERRUPT, "floppy", NULL); 223 SA_INTERRUPT, "floppy", NULL);
225 224
226 return ((error == 0) ? 0 : -1); 225 return ((error == 0) ? 0 : -1);
227 } 226 }
@@ -615,7 +614,7 @@ static unsigned long __init sun_floppy_init(void)
615 struct linux_ebus *ebus; 614 struct linux_ebus *ebus;
616 struct linux_ebus_device *edev = NULL; 615 struct linux_ebus_device *edev = NULL;
617 unsigned long config = 0; 616 unsigned long config = 0;
618 unsigned long auxio_reg; 617 void __iomem *auxio_reg;
619 618
620 for_each_ebus(ebus) { 619 for_each_ebus(ebus) {
621 for_each_ebusdev(edev, ebus) { 620 for_each_ebusdev(edev, ebus) {
@@ -642,7 +641,7 @@ static unsigned long __init sun_floppy_init(void)
642 /* Make sure the high density bit is set, some systems 641 /* Make sure the high density bit is set, some systems
643 * (most notably Ultra5/Ultra10) come up with it clear. 642 * (most notably Ultra5/Ultra10) come up with it clear.
644 */ 643 */
645 auxio_reg = edev->resource[2].start; 644 auxio_reg = (void __iomem *) edev->resource[2].start;
646 writel(readl(auxio_reg)|0x2, auxio_reg); 645 writel(readl(auxio_reg)|0x2, auxio_reg);
647 646
648 sun_pci_ebus_dev = ebus->self; 647 sun_pci_ebus_dev = ebus->self;
@@ -650,7 +649,8 @@ static unsigned long __init sun_floppy_init(void)
650 spin_lock_init(&sun_pci_fd_ebus_dma.lock); 649 spin_lock_init(&sun_pci_fd_ebus_dma.lock);
651 650
652 /* XXX ioremap */ 651 /* XXX ioremap */
653 sun_pci_fd_ebus_dma.regs = edev->resource[1].start; 652 sun_pci_fd_ebus_dma.regs = (void __iomem *)
653 edev->resource[1].start;
654 if (!sun_pci_fd_ebus_dma.regs) 654 if (!sun_pci_fd_ebus_dma.regs)
655 return 0; 655 return 0;
656 656
diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h
index 3aef0ca67750..8b70edcb80dc 100644
--- a/include/asm-sparc64/irq.h
+++ b/include/asm-sparc64/irq.h
@@ -16,10 +16,22 @@
16#include <asm/pil.h> 16#include <asm/pil.h>
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18 18
19struct ino_bucket;
20
21#define MAX_IRQ_DESC_ACTION 4
22
23struct irq_desc {
24 void (*pre_handler)(struct ino_bucket *, void *, void *);
25 void *pre_handler_arg1;
26 void *pre_handler_arg2;
27 u32 action_active_mask;
28 struct irqaction action[MAX_IRQ_DESC_ACTION];
29};
30
19/* You should not mess with this directly. That's the job of irq.c. 31/* You should not mess with this directly. That's the job of irq.c.
20 * 32 *
21 * If you make changes here, please update hand coded assembler of 33 * If you make changes here, please update hand coded assembler of
22 * SBUS/floppy interrupt handler in entry.S -DaveM 34 * the vectored interrupt trap handler in entry.S -DaveM
23 * 35 *
24 * This is currently one DCACHE line, two buckets per L2 cache 36 * This is currently one DCACHE line, two buckets per L2 cache
25 * line. Keep this in mind please. 37 * line. Keep this in mind please.
@@ -42,24 +54,11 @@ struct ino_bucket {
42 /* Miscellaneous flags. */ 54 /* Miscellaneous flags. */
43/*0x06*/unsigned char flags; 55/*0x06*/unsigned char flags;
44 56
45 /* This is used to deal with IBF_DMA_SYNC on 57 /* Currently unused. */
46 * Sabre systems. 58/*0x07*/unsigned char __pad;
47 */ 59
48/*0x07*/unsigned char synctab_ent; 60 /* Reference to IRQ descriptor for this bucket. */
49 61/*0x08*/struct irq_desc *irq_info;
50 /* Reference to handler for this IRQ. If this is
51 * non-NULL this means it is active and should be
52 * serviced. Else the pending member is set to one
53 * and later registry of the interrupt checks for
54 * this condition.
55 *
56 * Normally this is just an irq_action structure.
57 * But, on PCI, if multiple interrupt sources behind
58 * a bridge have multiple interrupt sources that share
59 * the same INO bucket, this points to an array of
60 * pointers to four IRQ action structures.
61 */
62/*0x08*/void *irq_info;
63 62
64 /* Sun5 Interrupt Clear Register. */ 63 /* Sun5 Interrupt Clear Register. */
65/*0x10*/unsigned long iclr; 64/*0x10*/unsigned long iclr;
@@ -69,12 +68,6 @@ struct ino_bucket {
69 68
70}; 69};
71 70
72#ifdef CONFIG_PCI
73extern unsigned long pci_dma_wsync;
74extern unsigned long dma_sync_reg_table[256];
75extern unsigned char dma_sync_reg_table_entry;
76#endif
77
78/* IMAP/ICLR register defines */ 71/* IMAP/ICLR register defines */
79#define IMAP_VALID 0x80000000 /* IRQ Enabled */ 72#define IMAP_VALID 0x80000000 /* IRQ Enabled */
80#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */ 73#define IMAP_TID_UPA 0x7c000000 /* UPA TargetID */
@@ -90,11 +83,9 @@ extern unsigned char dma_sync_reg_table_entry;
90#define ICLR_PENDING 0x00000003 /* Pending state */ 83#define ICLR_PENDING 0x00000003 /* Pending state */
91 84
92/* Only 8-bits are available, be careful. -DaveM */ 85/* Only 8-bits are available, be careful. -DaveM */
93#define IBF_DMA_SYNC 0x01 /* DMA synchronization behind PCI bridge needed. */ 86#define IBF_PCI 0x02 /* PSYCHO/SABRE/SCHIZO PCI interrupt. */
94#define IBF_PCI 0x02 /* Indicates PSYCHO/SABRE/SCHIZO PCI interrupt. */ 87#define IBF_ACTIVE 0x04 /* Interrupt is active and has a handler.*/
95#define IBF_ACTIVE 0x04 /* This interrupt is active and has a handler. */ 88#define IBF_INPROGRESS 0x10 /* IRQ is being serviced. */
96#define IBF_MULTI 0x08 /* On PCI, indicates shared bucket. */
97#define IBF_INPROGRESS 0x10 /* IRQ is being serviced. */
98 89
99#define NUM_IVECS (IMAP_INR + 1) 90#define NUM_IVECS (IMAP_INR + 1)
100extern struct ino_bucket ivector_table[NUM_IVECS]; 91extern struct ino_bucket ivector_table[NUM_IVECS];
@@ -122,11 +113,6 @@ extern void enable_irq(unsigned int);
122extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); 113extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap);
123extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); 114extern unsigned int sbus_build_irq(void *sbus, unsigned int ino);
124 115
125extern int request_fast_irq(unsigned int irq,
126 irqreturn_t (*handler)(int, void *, struct pt_regs *),
127 unsigned long flags, __const__ char *devname,
128 void *dev_id);
129
130static __inline__ void set_softint(unsigned long bits) 116static __inline__ void set_softint(unsigned long bits)
131{ 117{
132 __asm__ __volatile__("wr %0, 0x0, %%set_softint" 118 __asm__ __volatile__("wr %0, 0x0, %%set_softint"
diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h
index f70d3dad01f9..6321f5a0198d 100644
--- a/include/asm-sparc64/kdebug.h
+++ b/include/asm-sparc64/kdebug.h
@@ -16,7 +16,7 @@ struct die_args {
16}; 16};
17 17
18/* Note - you should never unregister because that can race with NMIs. 18/* Note - you should never unregister because that can race with NMIs.
19 * If you really want to do it first unregister - then synchronize_kernel 19 * If you really want to do it first unregister - then synchronize_sched
20 * - then free. 20 * - then free.
21 */ 21 */
22int register_die_notifier(struct notifier_block *nb); 22int register_die_notifier(struct notifier_block *nb);
diff --git a/include/asm-sparc64/param.h b/include/asm-sparc64/param.h
index 6a12f3ac0359..a1cd4974630b 100644
--- a/include/asm-sparc64/param.h
+++ b/include/asm-sparc64/param.h
@@ -1,9 +1,10 @@
1/* $Id: param.h,v 1.2 2000/10/30 21:01:41 davem Exp $ */
2#ifndef _ASMSPARC64_PARAM_H 1#ifndef _ASMSPARC64_PARAM_H
3#define _ASMSPARC64_PARAM_H 2#define _ASMSPARC64_PARAM_H
4 3
4#include <linux/config.h>
5
5#ifdef __KERNEL__ 6#ifdef __KERNEL__
6# define HZ 1000 /* Internal kernel timer frequency */ 7# define HZ CONFIG_HZ /* Internal kernel timer frequency */
7# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 8# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
8# define CLOCKS_PER_SEC (USER_HZ) 9# define CLOCKS_PER_SEC (USER_HZ)
9#endif 10#endif
diff --git a/include/asm-sparc64/parport.h b/include/asm-sparc64/parport.h
index b7e635544cec..56b5197d7898 100644
--- a/include/asm-sparc64/parport.h
+++ b/include/asm-sparc64/parport.h
@@ -27,12 +27,12 @@ static struct sparc_ebus_info {
27 27
28static __inline__ void enable_dma(unsigned int dmanr) 28static __inline__ void enable_dma(unsigned int dmanr)
29{ 29{
30 ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1);
31
30 if (ebus_dma_request(&sparc_ebus_dmas[dmanr].info, 32 if (ebus_dma_request(&sparc_ebus_dmas[dmanr].info,
31 sparc_ebus_dmas[dmanr].addr, 33 sparc_ebus_dmas[dmanr].addr,
32 sparc_ebus_dmas[dmanr].count)) 34 sparc_ebus_dmas[dmanr].count))
33 BUG(); 35 BUG();
34
35 ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1);
36} 36}
37 37
38static __inline__ void disable_dma(unsigned int dmanr) 38static __inline__ void disable_dma(unsigned int dmanr)
diff --git a/include/asm-sparc64/pbm.h b/include/asm-sparc64/pbm.h
index 4c15610a2bac..38bbbccb4068 100644
--- a/include/asm-sparc64/pbm.h
+++ b/include/asm-sparc64/pbm.h
@@ -145,6 +145,9 @@ struct pci_pbm_info {
145 /* Physical address base of PBM registers. */ 145 /* Physical address base of PBM registers. */
146 unsigned long pbm_regs; 146 unsigned long pbm_regs;
147 147
148 /* Physical address of DMA sync register, if any. */
149 unsigned long sync_reg;
150
148 /* Opaque 32-bit system bus Port ID. */ 151 /* Opaque 32-bit system bus Port ID. */
149 u32 portid; 152 u32 portid;
150 153
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h
index 2a0c85cd1c11..a4ab0ec7143a 100644
--- a/include/asm-sparc64/pci.h
+++ b/include/asm-sparc64/pci.h
@@ -23,7 +23,7 @@ static inline void pcibios_set_master(struct pci_dev *dev)
23 /* No special bus mastering setup handling */ 23 /* No special bus mastering setup handling */
24} 24}
25 25
26static inline void pcibios_penalize_isa_irq(int irq) 26static inline void pcibios_penalize_isa_irq(int irq, int active)
27{ 27{
28 /* We don't do dynamic PCI IRQ allocation */ 28 /* We don't do dynamic PCI IRQ allocation */
29} 29}
@@ -220,6 +220,25 @@ static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
220 return (dma_addr == PCI_DMA_ERROR_CODE); 220 return (dma_addr == PCI_DMA_ERROR_CODE);
221} 221}
222 222
223#ifdef CONFIG_PCI
224static inline void pci_dma_burst_advice(struct pci_dev *pdev,
225 enum pci_dma_burst_strategy *strat,
226 unsigned long *strategy_parameter)
227{
228 unsigned long cacheline_size;
229 u8 byte;
230
231 pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &byte);
232 if (byte == 0)
233 cacheline_size = 1024;
234 else
235 cacheline_size = (int) byte * 4;
236
237 *strat = PCI_DMA_BURST_BOUNDARY;
238 *strategy_parameter = cacheline_size;
239}
240#endif
241
223/* Return the index of the PCI controller for device PDEV. */ 242/* Return the index of the PCI controller for device PDEV. */
224 243
225extern int pci_domain_nr(struct pci_bus *bus); 244extern int pci_domain_nr(struct pci_bus *bus);
diff --git a/include/asm-sparc64/ptrace.h b/include/asm-sparc64/ptrace.h
index 2d2b5a113d24..6194f771e9fc 100644
--- a/include/asm-sparc64/ptrace.h
+++ b/include/asm-sparc64/ptrace.h
@@ -94,8 +94,9 @@ struct sparc_trapf {
94#define STACKFRAME32_SZ sizeof(struct sparc_stackf32) 94#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
95 95
96#ifdef __KERNEL__ 96#ifdef __KERNEL__
97#define force_successful_syscall_return() \ 97#define force_successful_syscall_return() \
98 set_thread_flag(TIF_SYSCALL_SUCCESS) 98do { current_thread_info()->syscall_noerror = 1; \
99} while (0)
99#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV)) 100#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
100#define instruction_pointer(regs) ((regs)->tpc) 101#define instruction_pointer(regs) ((regs)->tpc)
101#ifdef CONFIG_SMP 102#ifdef CONFIG_SMP
diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h
index bf2ae90ed3df..4568ee4022df 100644
--- a/include/asm-sparc64/rwsem.h
+++ b/include/asm-sparc64/rwsem.h
@@ -46,53 +46,14 @@ extern void __up_read(struct rw_semaphore *sem);
46extern void __up_write(struct rw_semaphore *sem); 46extern void __up_write(struct rw_semaphore *sem);
47extern void __downgrade_write(struct rw_semaphore *sem); 47extern void __downgrade_write(struct rw_semaphore *sem);
48 48
49static __inline__ int rwsem_atomic_update(int delta, struct rw_semaphore *sem) 49static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
50{ 50{
51 int tmp = delta; 51 return atomic_add_return(delta, (atomic_t *)(&sem->count));
52
53 __asm__ __volatile__(
54 "1:\tlduw [%2], %%g1\n\t"
55 "add %%g1, %1, %%g7\n\t"
56 "cas [%2], %%g1, %%g7\n\t"
57 "cmp %%g1, %%g7\n\t"
58 "bne,pn %%icc, 1b\n\t"
59 " membar #StoreLoad | #StoreStore\n\t"
60 "mov %%g7, %0\n\t"
61 : "=&r" (tmp)
62 : "0" (tmp), "r" (sem)
63 : "g1", "g7", "memory", "cc");
64
65 return tmp + delta;
66}
67
68#define rwsem_atomic_add rwsem_atomic_update
69
70static __inline__ __u16 rwsem_cmpxchgw(struct rw_semaphore *sem, __u16 __old, __u16 __new)
71{
72 u32 old = (sem->count & 0xffff0000) | (u32) __old;
73 u32 new = (old & 0xffff0000) | (u32) __new;
74 u32 prev;
75
76again:
77 __asm__ __volatile__("cas [%2], %3, %0\n\t"
78 "membar #StoreLoad | #StoreStore"
79 : "=&r" (prev)
80 : "0" (new), "r" (sem), "r" (old)
81 : "memory");
82
83 /* To give the same semantics as x86 cmpxchgw, keep trying
84 * if only the upper 16-bits changed.
85 */
86 if (prev != old &&
87 ((prev & 0xffff) == (old & 0xffff)))
88 goto again;
89
90 return prev & 0xffff;
91} 52}
92 53
93static __inline__ signed long rwsem_cmpxchg(struct rw_semaphore *sem, signed long old, signed long new) 54static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
94{ 55{
95 return cmpxchg(&sem->count,old,new); 56 atomic_add(delta, (atomic_t *)(&sem->count));
96} 57}
97 58
98#endif /* __KERNEL__ */ 59#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/seccomp.h b/include/asm-sparc64/seccomp.h
new file mode 100644
index 000000000000..7fcd9968192b
--- /dev/null
+++ b/include/asm-sparc64/seccomp.h
@@ -0,0 +1,21 @@
1#ifndef _ASM_SECCOMP_H
2
3#include <linux/thread_info.h> /* already defines TIF_32BIT */
4
5#ifndef TIF_32BIT
6#error "unexpected TIF_32BIT on sparc64"
7#endif
8
9#include <linux/unistd.h>
10
11#define __NR_seccomp_read __NR_read
12#define __NR_seccomp_write __NR_write
13#define __NR_seccomp_exit __NR_exit
14#define __NR_seccomp_sigreturn __NR_rt_sigreturn
15
16#define __NR_seccomp_read_32 __NR_read
17#define __NR_seccomp_write_32 __NR_write
18#define __NR_seccomp_exit_32 __NR_exit
19#define __NR_seccomp_sigreturn_32 __NR_sigreturn
20
21#endif /* _ASM_SECCOMP_H */
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index becdf1bc5924..e3059bb4a465 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -162,21 +162,6 @@ struct sigstack {
162#define MINSIGSTKSZ 4096 162#define MINSIGSTKSZ 4096
163#define SIGSTKSZ 16384 163#define SIGSTKSZ 16384
164 164
165#ifdef __KERNEL__
166/*
167 * DJHR
168 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
169 * interrupt handler's irq structure should be statically allocated
170 * by the request_irq routine.
171 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
172 * of interrupt usage and that sucks. Also without a flag like this
173 * it may be possible for the free_irq routine to attempt to free
174 * statically allocated data.. which is NOT GOOD.
175 *
176 */
177#define SA_STATIC_ALLOC 0x80
178#endif
179
180#include <asm-generic/signal.h> 165#include <asm-generic/signal.h>
181 166
182struct __new_sigaction { 167struct __new_sigaction {
diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h
index db7581bdb531..9cb93a5c2b4f 100644
--- a/include/asm-sparc64/spinlock.h
+++ b/include/asm-sparc64/spinlock.h
@@ -52,12 +52,14 @@ static inline void _raw_spin_lock(spinlock_t *lock)
52 52
53 __asm__ __volatile__( 53 __asm__ __volatile__(
54"1: ldstub [%1], %0\n" 54"1: ldstub [%1], %0\n"
55" membar #StoreLoad | #StoreStore\n"
55" brnz,pn %0, 2f\n" 56" brnz,pn %0, 2f\n"
56" membar #StoreLoad | #StoreStore\n" 57" nop\n"
57" .subsection 2\n" 58" .subsection 2\n"
58"2: ldub [%1], %0\n" 59"2: ldub [%1], %0\n"
60" membar #LoadLoad\n"
59" brnz,pt %0, 2b\n" 61" brnz,pt %0, 2b\n"
60" membar #LoadLoad\n" 62" nop\n"
61" ba,a,pt %%xcc, 1b\n" 63" ba,a,pt %%xcc, 1b\n"
62" .previous" 64" .previous"
63 : "=&r" (tmp) 65 : "=&r" (tmp)
@@ -95,16 +97,18 @@ static inline void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags)
95 97
96 __asm__ __volatile__( 98 __asm__ __volatile__(
97"1: ldstub [%2], %0\n" 99"1: ldstub [%2], %0\n"
98" brnz,pn %0, 2f\n"
99" membar #StoreLoad | #StoreStore\n" 100" membar #StoreLoad | #StoreStore\n"
101" brnz,pn %0, 2f\n"
102" nop\n"
100" .subsection 2\n" 103" .subsection 2\n"
101"2: rdpr %%pil, %1\n" 104"2: rdpr %%pil, %1\n"
102" wrpr %3, %%pil\n" 105" wrpr %3, %%pil\n"
103"3: ldub [%2], %0\n" 106"3: ldub [%2], %0\n"
104" brnz,pt %0, 3b\n"
105" membar #LoadLoad\n" 107" membar #LoadLoad\n"
108" brnz,pt %0, 3b\n"
109" nop\n"
106" ba,pt %%xcc, 1b\n" 110" ba,pt %%xcc, 1b\n"
107" wrpr %1, %%pil\n" 111" wrpr %1, %%pil\n"
108" .previous" 112" .previous"
109 : "=&r" (tmp1), "=&r" (tmp2) 113 : "=&r" (tmp1), "=&r" (tmp2)
110 : "r"(lock), "r"(flags) 114 : "r"(lock), "r"(flags)
@@ -162,12 +166,14 @@ static void inline __read_lock(rwlock_t *lock)
162"4: add %0, 1, %1\n" 166"4: add %0, 1, %1\n"
163" cas [%2], %0, %1\n" 167" cas [%2], %0, %1\n"
164" cmp %0, %1\n" 168" cmp %0, %1\n"
169" membar #StoreLoad | #StoreStore\n"
165" bne,pn %%icc, 1b\n" 170" bne,pn %%icc, 1b\n"
166" membar #StoreLoad | #StoreStore\n" 171" nop\n"
167" .subsection 2\n" 172" .subsection 2\n"
168"2: ldsw [%2], %0\n" 173"2: ldsw [%2], %0\n"
174" membar #LoadLoad\n"
169" brlz,pt %0, 2b\n" 175" brlz,pt %0, 2b\n"
170" membar #LoadLoad\n" 176" nop\n"
171" ba,a,pt %%xcc, 4b\n" 177" ba,a,pt %%xcc, 4b\n"
172" .previous" 178" .previous"
173 : "=&r" (tmp1), "=&r" (tmp2) 179 : "=&r" (tmp1), "=&r" (tmp2)
@@ -204,12 +210,14 @@ static void inline __write_lock(rwlock_t *lock)
204"4: or %0, %3, %1\n" 210"4: or %0, %3, %1\n"
205" cas [%2], %0, %1\n" 211" cas [%2], %0, %1\n"
206" cmp %0, %1\n" 212" cmp %0, %1\n"
213" membar #StoreLoad | #StoreStore\n"
207" bne,pn %%icc, 1b\n" 214" bne,pn %%icc, 1b\n"
208" membar #StoreLoad | #StoreStore\n" 215" nop\n"
209" .subsection 2\n" 216" .subsection 2\n"
210"2: lduw [%2], %0\n" 217"2: lduw [%2], %0\n"
218" membar #LoadLoad\n"
211" brnz,pt %0, 2b\n" 219" brnz,pt %0, 2b\n"
212" membar #LoadLoad\n" 220" nop\n"
213" ba,a,pt %%xcc, 4b\n" 221" ba,a,pt %%xcc, 4b\n"
214" .previous" 222" .previous"
215 : "=&r" (tmp1), "=&r" (tmp2) 223 : "=&r" (tmp1), "=&r" (tmp2)
@@ -240,8 +248,9 @@ static int inline __write_trylock(rwlock_t *lock)
240" or %0, %4, %1\n" 248" or %0, %4, %1\n"
241" cas [%3], %0, %1\n" 249" cas [%3], %0, %1\n"
242" cmp %0, %1\n" 250" cmp %0, %1\n"
251" membar #StoreLoad | #StoreStore\n"
243" bne,pn %%icc, 1b\n" 252" bne,pn %%icc, 1b\n"
244" membar #StoreLoad | #StoreStore\n" 253" nop\n"
245" mov 1, %2\n" 254" mov 1, %2\n"
246"2:" 255"2:"
247 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result) 256 : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result)
diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h
index 9d7613eea812..962638c9d122 100644
--- a/include/asm-sparc64/spitfire.h
+++ b/include/asm-sparc64/spitfire.h
@@ -56,52 +56,6 @@ extern void cheetah_enable_pcache(void);
56 SPITFIRE_HIGHEST_LOCKED_TLBENT : \ 56 SPITFIRE_HIGHEST_LOCKED_TLBENT : \
57 CHEETAH_HIGHEST_LOCKED_TLBENT) 57 CHEETAH_HIGHEST_LOCKED_TLBENT)
58 58
59static __inline__ unsigned long spitfire_get_isfsr(void)
60{
61 unsigned long ret;
62
63 __asm__ __volatile__("ldxa [%1] %2, %0"
64 : "=r" (ret)
65 : "r" (TLB_SFSR), "i" (ASI_IMMU));
66 return ret;
67}
68
69static __inline__ unsigned long spitfire_get_dsfsr(void)
70{
71 unsigned long ret;
72
73 __asm__ __volatile__("ldxa [%1] %2, %0"
74 : "=r" (ret)
75 : "r" (TLB_SFSR), "i" (ASI_DMMU));
76 return ret;
77}
78
79static __inline__ unsigned long spitfire_get_sfar(void)
80{
81 unsigned long ret;
82
83 __asm__ __volatile__("ldxa [%1] %2, %0"
84 : "=r" (ret)
85 : "r" (DMMU_SFAR), "i" (ASI_DMMU));
86 return ret;
87}
88
89static __inline__ void spitfire_put_isfsr(unsigned long sfsr)
90{
91 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
92 "membar #Sync"
93 : /* no outputs */
94 : "r" (sfsr), "r" (TLB_SFSR), "i" (ASI_IMMU));
95}
96
97static __inline__ void spitfire_put_dsfsr(unsigned long sfsr)
98{
99 __asm__ __volatile__("stxa %0, [%1] %2\n\t"
100 "membar #Sync"
101 : /* no outputs */
102 : "r" (sfsr), "r" (TLB_SFSR), "i" (ASI_DMMU));
103}
104
105/* The data cache is write through, so this just invalidates the 59/* The data cache is write through, so this just invalidates the
106 * specified line. 60 * specified line.
107 */ 61 */
@@ -111,7 +65,6 @@ static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long
111 "membar #Sync" 65 "membar #Sync"
112 : /* No outputs */ 66 : /* No outputs */
113 : "r" (tag), "r" (addr), "i" (ASI_DCACHE_TAG)); 67 : "r" (tag), "r" (addr), "i" (ASI_DCACHE_TAG));
114 __asm__ __volatile__ ("membar #Sync" : : : "memory");
115} 68}
116 69
117/* The instruction cache lines are flushed with this, but note that 70/* The instruction cache lines are flushed with this, but note that
@@ -194,90 +147,6 @@ static __inline__ void spitfire_put_itlb_data(int entry, unsigned long data)
194 "i" (ASI_ITLB_DATA_ACCESS)); 147 "i" (ASI_ITLB_DATA_ACCESS));
195} 148}
196 149
197/* Spitfire hardware assisted TLB flushes. */
198
199/* Context level flushes. */
200static __inline__ void spitfire_flush_dtlb_primary_context(void)
201{
202 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
203 "membar #Sync"
204 : /* No outputs */
205 : "r" (0x40), "i" (ASI_DMMU_DEMAP));
206}
207
208static __inline__ void spitfire_flush_itlb_primary_context(void)
209{
210 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
211 "membar #Sync"
212 : /* No outputs */
213 : "r" (0x40), "i" (ASI_IMMU_DEMAP));
214}
215
216static __inline__ void spitfire_flush_dtlb_secondary_context(void)
217{
218 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
219 "membar #Sync"
220 : /* No outputs */
221 : "r" (0x50), "i" (ASI_DMMU_DEMAP));
222}
223
224static __inline__ void spitfire_flush_itlb_secondary_context(void)
225{
226 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
227 "membar #Sync"
228 : /* No outputs */
229 : "r" (0x50), "i" (ASI_IMMU_DEMAP));
230}
231
232static __inline__ void spitfire_flush_dtlb_nucleus_context(void)
233{
234 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
235 "membar #Sync"
236 : /* No outputs */
237 : "r" (0x60), "i" (ASI_DMMU_DEMAP));
238}
239
240static __inline__ void spitfire_flush_itlb_nucleus_context(void)
241{
242 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
243 "membar #Sync"
244 : /* No outputs */
245 : "r" (0x60), "i" (ASI_IMMU_DEMAP));
246}
247
248/* Page level flushes. */
249static __inline__ void spitfire_flush_dtlb_primary_page(unsigned long page)
250{
251 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
252 "membar #Sync"
253 : /* No outputs */
254 : "r" (page), "i" (ASI_DMMU_DEMAP));
255}
256
257static __inline__ void spitfire_flush_itlb_primary_page(unsigned long page)
258{
259 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
260 "membar #Sync"
261 : /* No outputs */
262 : "r" (page), "i" (ASI_IMMU_DEMAP));
263}
264
265static __inline__ void spitfire_flush_dtlb_secondary_page(unsigned long page)
266{
267 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
268 "membar #Sync"
269 : /* No outputs */
270 : "r" (page | 0x10), "i" (ASI_DMMU_DEMAP));
271}
272
273static __inline__ void spitfire_flush_itlb_secondary_page(unsigned long page)
274{
275 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
276 "membar #Sync"
277 : /* No outputs */
278 : "r" (page | 0x10), "i" (ASI_IMMU_DEMAP));
279}
280
281static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page) 150static __inline__ void spitfire_flush_dtlb_nucleus_page(unsigned long page)
282{ 151{
283 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t" 152 __asm__ __volatile__("stxa %%g0, [%0] %1\n\t"
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index fd12ca386f48..ee4bdfc6b88f 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -139,19 +139,13 @@ extern void __flushw_user(void);
139#define flush_user_windows flushw_user 139#define flush_user_windows flushw_user
140#define flush_register_windows flushw_all 140#define flush_register_windows flushw_all
141 141
142#define prepare_arch_switch(rq, next) \ 142/* Don't hold the runqueue lock over context switch */
143do { spin_lock(&(next)->switch_lock); \ 143#define __ARCH_WANT_UNLOCKED_CTXSW
144 spin_unlock(&(rq)->lock); \ 144#define prepare_arch_switch(next) \
145do { \
145 flushw_all(); \ 146 flushw_all(); \
146} while (0) 147} while (0)
147 148
148#define finish_arch_switch(rq, prev) \
149do { spin_unlock_irq(&(prev)->switch_lock); \
150} while (0)
151
152#define task_running(rq, p) \
153 ((rq)->curr == (p) || spin_is_locked(&(p)->switch_lock))
154
155 /* See what happens when you design the chip correctly? 149 /* See what happens when you design the chip correctly?
156 * 150 *
157 * We tell gcc we clobber all non-fixed-usage registers except 151 * We tell gcc we clobber all non-fixed-usage registers except
@@ -196,24 +190,23 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
196 "wrpr %%g1, %%cwp\n\t" \ 190 "wrpr %%g1, %%cwp\n\t" \
197 "ldx [%%g6 + %3], %%o6\n\t" \ 191 "ldx [%%g6 + %3], %%o6\n\t" \
198 "ldub [%%g6 + %2], %%o5\n\t" \ 192 "ldub [%%g6 + %2], %%o5\n\t" \
199 "ldx [%%g6 + %4], %%o7\n\t" \ 193 "ldub [%%g6 + %4], %%o7\n\t" \
200 "mov %%g6, %%l2\n\t" \ 194 "mov %%g6, %%l2\n\t" \
201 "wrpr %%o5, 0x0, %%wstate\n\t" \ 195 "wrpr %%o5, 0x0, %%wstate\n\t" \
202 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ 196 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
203 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ 197 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
204 "wrpr %%g0, 0x94, %%pstate\n\t" \ 198 "wrpr %%g0, 0x94, %%pstate\n\t" \
205 "mov %%l2, %%g6\n\t" \ 199 "mov %%l2, %%g6\n\t" \
206 "ldx [%%g6 + %7], %%g4\n\t" \ 200 "ldx [%%g6 + %6], %%g4\n\t" \
207 "wrpr %%g0, 0x96, %%pstate\n\t" \ 201 "wrpr %%g0, 0x96, %%pstate\n\t" \
208 "andcc %%o7, %6, %%g0\n\t" \ 202 "brz,pt %%o7, 1f\n\t" \
209 "beq,pt %%icc, 1f\n\t" \
210 " mov %%g7, %0\n\t" \ 203 " mov %%g7, %0\n\t" \
211 "b,a ret_from_syscall\n\t" \ 204 "b,a ret_from_syscall\n\t" \
212 "1:\n\t" \ 205 "1:\n\t" \
213 : "=&r" (last) \ 206 : "=&r" (last) \
214 : "0" (next->thread_info), \ 207 : "0" (next->thread_info), \
215 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_FLAGS), "i" (TI_CWP), \ 208 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
216 "i" (_TIF_NEWCHILD), "i" (TI_TASK) \ 209 "i" (TI_CWP), "i" (TI_TASK) \
217 : "cc", \ 210 : "cc", \
218 "g1", "g2", "g3", "g7", \ 211 "g1", "g2", "g3", "g7", \
219 "l2", "l3", "l4", "l5", "l6", "l7", \ 212 "l2", "l3", "l4", "l5", "l6", "l7", \
diff --git a/include/asm-sparc64/termios.h b/include/asm-sparc64/termios.h
index 8effce0da087..9777a9cca88a 100644
--- a/include/asm-sparc64/termios.h
+++ b/include/asm-sparc64/termios.h
@@ -100,16 +100,17 @@ struct winsize {
100#define user_termio_to_kernel_termios(termios, termio) \ 100#define user_termio_to_kernel_termios(termios, termio) \
101({ \ 101({ \
102 unsigned short tmp; \ 102 unsigned short tmp; \
103 get_user(tmp, &(termio)->c_iflag); \ 103 int err; \
104 err = get_user(tmp, &(termio)->c_iflag); \
104 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ 105 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
105 get_user(tmp, &(termio)->c_oflag); \ 106 err |= get_user(tmp, &(termio)->c_oflag); \
106 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ 107 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
107 get_user(tmp, &(termio)->c_cflag); \ 108 err |= get_user(tmp, &(termio)->c_cflag); \
108 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ 109 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
109 get_user(tmp, &(termio)->c_lflag); \ 110 err |= get_user(tmp, &(termio)->c_lflag); \
110 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ 111 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
111 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ 112 err |= copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
112 0; \ 113 err; \
113}) 114})
114 115
115/* 116/*
@@ -119,53 +120,56 @@ struct winsize {
119 */ 120 */
120#define kernel_termios_to_user_termio(termio, termios) \ 121#define kernel_termios_to_user_termio(termio, termios) \
121({ \ 122({ \
122 put_user((termios)->c_iflag, &(termio)->c_iflag); \ 123 int err; \
123 put_user((termios)->c_oflag, &(termio)->c_oflag); \ 124 err = put_user((termios)->c_iflag, &(termio)->c_iflag); \
124 put_user((termios)->c_cflag, &(termio)->c_cflag); \ 125 err |= put_user((termios)->c_oflag, &(termio)->c_oflag); \
125 put_user((termios)->c_lflag, &(termio)->c_lflag); \ 126 err |= put_user((termios)->c_cflag, &(termio)->c_cflag); \
126 put_user((termios)->c_line, &(termio)->c_line); \ 127 err |= put_user((termios)->c_lflag, &(termio)->c_lflag); \
127 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ 128 err |= put_user((termios)->c_line, &(termio)->c_line); \
129 err |= copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
128 if (!((termios)->c_lflag & ICANON)) { \ 130 if (!((termios)->c_lflag & ICANON)) { \
129 put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \ 131 err |= put_user((termios)->c_cc[VMIN], &(termio)->c_cc[_VMIN]); \
130 put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \ 132 err |= put_user((termios)->c_cc[VTIME], &(termio)->c_cc[_VTIME]); \
131 } \ 133 } \
132 0; \ 134 err; \
133}) 135})
134 136
135#define user_termios_to_kernel_termios(k, u) \ 137#define user_termios_to_kernel_termios(k, u) \
136({ \ 138({ \
137 get_user((k)->c_iflag, &(u)->c_iflag); \ 139 int err; \
138 get_user((k)->c_oflag, &(u)->c_oflag); \ 140 err = get_user((k)->c_iflag, &(u)->c_iflag); \
139 get_user((k)->c_cflag, &(u)->c_cflag); \ 141 err |= get_user((k)->c_oflag, &(u)->c_oflag); \
140 get_user((k)->c_lflag, &(u)->c_lflag); \ 142 err |= get_user((k)->c_cflag, &(u)->c_cflag); \
141 get_user((k)->c_line, &(u)->c_line); \ 143 err |= get_user((k)->c_lflag, &(u)->c_lflag); \
142 copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \ 144 err |= get_user((k)->c_line, &(u)->c_line); \
145 err |= copy_from_user((k)->c_cc, (u)->c_cc, NCCS); \
143 if((k)->c_lflag & ICANON) { \ 146 if((k)->c_lflag & ICANON) { \
144 get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 147 err |= get_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
145 get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 148 err |= get_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
146 } else { \ 149 } else { \
147 get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 150 err |= get_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
148 get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 151 err |= get_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
149 } \ 152 } \
150 0; \ 153 err; \
151}) 154})
152 155
153#define kernel_termios_to_user_termios(u, k) \ 156#define kernel_termios_to_user_termios(u, k) \
154({ \ 157({ \
155 put_user((k)->c_iflag, &(u)->c_iflag); \ 158 int err; \
156 put_user((k)->c_oflag, &(u)->c_oflag); \ 159 err = put_user((k)->c_iflag, &(u)->c_iflag); \
157 put_user((k)->c_cflag, &(u)->c_cflag); \ 160 err |= put_user((k)->c_oflag, &(u)->c_oflag); \
158 put_user((k)->c_lflag, &(u)->c_lflag); \ 161 err |= put_user((k)->c_cflag, &(u)->c_cflag); \
159 put_user((k)->c_line, &(u)->c_line); \ 162 err |= put_user((k)->c_lflag, &(u)->c_lflag); \
160 copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \ 163 err |= put_user((k)->c_line, &(u)->c_line); \
164 err |= copy_to_user((u)->c_cc, (k)->c_cc, NCCS); \
161 if(!((k)->c_lflag & ICANON)) { \ 165 if(!((k)->c_lflag & ICANON)) { \
162 put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \ 166 err |= put_user((k)->c_cc[VMIN], &(u)->c_cc[_VMIN]); \
163 put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \ 167 err |= put_user((k)->c_cc[VTIME], &(u)->c_cc[_VTIME]); \
164 } else { \ 168 } else { \
165 put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \ 169 err |= put_user((k)->c_cc[VEOF], &(u)->c_cc[VEOF]); \
166 put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \ 170 err |= put_user((k)->c_cc[VEOL], &(u)->c_cc[VEOL]); \
167 } \ 171 } \
168 0; \ 172 err; \
169}) 173})
170 174
171#endif /* __KERNEL__ */ 175#endif /* __KERNEL__ */
diff --git a/include/asm-sparc64/thread_info.h b/include/asm-sparc64/thread_info.h
index 517caaba1c87..c94d8b3991bd 100644
--- a/include/asm-sparc64/thread_info.h
+++ b/include/asm-sparc64/thread_info.h
@@ -46,8 +46,10 @@ struct thread_info {
46 unsigned long fault_address; 46 unsigned long fault_address;
47 struct pt_regs *kregs; 47 struct pt_regs *kregs;
48 struct exec_domain *exec_domain; 48 struct exec_domain *exec_domain;
49 int preempt_count; 49 int preempt_count; /* 0 => preemptable, <0 => BUG */
50 int __pad; 50 __u8 new_child;
51 __u8 syscall_noerror;
52 __u16 __pad;
51 53
52 unsigned long *utraps; 54 unsigned long *utraps;
53 55
@@ -66,6 +68,9 @@ struct thread_info {
66 68
67 struct restart_block restart_block; 69 struct restart_block restart_block;
68 70
71 struct pt_regs *kern_una_regs;
72 unsigned int kern_una_insn;
73
69 unsigned long fpregs[0] __attribute__ ((aligned(64))); 74 unsigned long fpregs[0] __attribute__ ((aligned(64)));
70}; 75};
71 76
@@ -87,6 +92,8 @@ struct thread_info {
87#define TI_KREGS 0x00000028 92#define TI_KREGS 0x00000028
88#define TI_EXEC_DOMAIN 0x00000030 93#define TI_EXEC_DOMAIN 0x00000030
89#define TI_PRE_COUNT 0x00000038 94#define TI_PRE_COUNT 0x00000038
95#define TI_NEW_CHILD 0x0000003c
96#define TI_SYS_NOERROR 0x0000003d
90#define TI_UTRAPS 0x00000040 97#define TI_UTRAPS 0x00000040
91#define TI_REG_WINDOW 0x00000048 98#define TI_REG_WINDOW 0x00000048
92#define TI_RWIN_SPTRS 0x000003c8 99#define TI_RWIN_SPTRS 0x000003c8
@@ -99,6 +106,8 @@ struct thread_info {
99#define TI_PCR 0x00000490 106#define TI_PCR 0x00000490
100#define TI_CEE_STUFF 0x00000498 107#define TI_CEE_STUFF 0x00000498
101#define TI_RESTART_BLOCK 0x000004a0 108#define TI_RESTART_BLOCK 0x000004a0
109#define TI_KUNA_REGS 0x000004c8
110#define TI_KUNA_INSN 0x000004d0
102#define TI_FPREGS 0x00000500 111#define TI_FPREGS 0x00000500
103 112
104/* We embed this in the uppermost byte of thread_info->flags */ 113/* We embed this in the uppermost byte of thread_info->flags */
@@ -219,16 +228,17 @@ register struct thread_info *current_thread_info_reg asm("g6");
219#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */ 228#define TIF_UNALIGNED 5 /* allowed to do unaligned accesses */
220#define TIF_NEWSIGNALS 6 /* wants new-style signals */ 229#define TIF_NEWSIGNALS 6 /* wants new-style signals */
221#define TIF_32BIT 7 /* 32-bit binary */ 230#define TIF_32BIT 7 /* 32-bit binary */
222#define TIF_NEWCHILD 8 /* just-spawned child process */ 231/* flag bit 8 is available */
223/* TIF_* value 9 is available */ 232#define TIF_SECCOMP 9 /* secure computing */
224#define TIF_POLLING_NRFLAG 10 233#define TIF_SYSCALL_AUDIT 10 /* syscall auditing active */
225#define TIF_SYSCALL_SUCCESS 11 234/* flag bit 11 is available */
226/* NOTE: Thread flags >= 12 should be ones we have no interest 235/* NOTE: Thread flags >= 12 should be ones we have no interest
227 * in using in assembly, else we can't use the mask as 236 * in using in assembly, else we can't use the mask as
228 * an immediate value in instructions such as andcc. 237 * an immediate value in instructions such as andcc.
229 */ 238 */
230#define TIF_ABI_PENDING 12 239#define TIF_ABI_PENDING 12
231#define TIF_MEMDIE 13 240#define TIF_MEMDIE 13
241#define TIF_POLLING_NRFLAG 14
232 242
233#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 243#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
234#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 244#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -238,10 +248,10 @@ register struct thread_info *current_thread_info_reg asm("g6");
238#define _TIF_UNALIGNED (1<<TIF_UNALIGNED) 248#define _TIF_UNALIGNED (1<<TIF_UNALIGNED)
239#define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS) 249#define _TIF_NEWSIGNALS (1<<TIF_NEWSIGNALS)
240#define _TIF_32BIT (1<<TIF_32BIT) 250#define _TIF_32BIT (1<<TIF_32BIT)
241#define _TIF_NEWCHILD (1<<TIF_NEWCHILD) 251#define _TIF_SECCOMP (1<<TIF_SECCOMP)
242#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 252#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
243#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING) 253#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
244#define _TIF_SYSCALL_SUCCESS (1<<TIF_SYSCALL_SUCCESS) 254#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
245 255
246#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \ 256#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
247 (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \ 257 (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | \
diff --git a/include/asm-sparc64/timer.h b/include/asm-sparc64/timer.h
index ba33a2b6b7bd..edc8e08c3a39 100644
--- a/include/asm-sparc64/timer.h
+++ b/include/asm-sparc64/timer.h
@@ -9,49 +9,8 @@
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11 11
12/* How timers work:
13 *
14 * On uniprocessors we just use counter zero for the system wide
15 * ticker, this performs thread scheduling, clock book keeping,
16 * and runs timer based events. Previously we used the Ultra
17 * %tick interrupt for this purpose.
18 *
19 * On multiprocessors we pick one cpu as the master level 10 tick
20 * processor. Here this counter zero tick handles clock book
21 * keeping and timer events only. Each Ultra has it's level
22 * 14 %tick interrupt set to fire off as well, even the master
23 * tick cpu runs this locally. This ticker performs thread
24 * scheduling, system/user tick counting for the current thread,
25 * and also profiling if enabled.
26 */
27
28#include <linux/config.h> 12#include <linux/config.h>
29 13
30/* Two timers, traditionally steered to PIL's 10 and 14 respectively.
31 * But since INO packets are used on sun5, we could use any PIL level
32 * we like, however for now we use the normal ones.
33 *
34 * The 'reg' and 'interrupts' properties for these live in nodes named
35 * 'counter-timer'. The first of three 'reg' properties describe where
36 * the sun5_timer registers are. The other two I have no idea. (XXX)
37 */
38struct sun5_timer {
39 u64 count0;
40 u64 limit0;
41 u64 count1;
42 u64 limit1;
43};
44
45#define SUN5_LIMIT_ENABLE 0x80000000
46#define SUN5_LIMIT_TOZERO 0x40000000
47#define SUN5_LIMIT_ZRESTART 0x20000000
48#define SUN5_LIMIT_CMASK 0x1fffffff
49
50/* Given a HZ value, set the limit register to so that the timer IRQ
51 * gets delivered that often.
52 */
53#define SUN5_HZ_TO_LIMIT(__hz) (1000000/(__hz))
54
55struct sparc64_tick_ops { 14struct sparc64_tick_ops {
56 void (*init_tick)(unsigned long); 15 void (*init_tick)(unsigned long);
57 unsigned long (*get_tick)(void); 16 unsigned long (*get_tick)(void);
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index 5b8dcf5786a5..51ec2879b881 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -167,12 +167,12 @@
167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */ 167#define __NR_pciconfig_read 148 /* ENOSYS under SunOS */
168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */ 168#define __NR_pciconfig_write 149 /* ENOSYS under SunOS */
169#define __NR_getsockname 150 /* Common */ 169#define __NR_getsockname 150 /* Common */
170/* #define __NR_getmsg 151 SunOS Specific */ 170#define __NR_inotify_init 151 /* Linux specific */
171/* #define __NR_putmsg 152 SunOS Specific */ 171#define __NR_inotify_add_watch 152 /* Linux specific */
172#define __NR_poll 153 /* Common */ 172#define __NR_poll 153 /* Common */
173#define __NR_getdents64 154 /* Linux specific */ 173#define __NR_getdents64 154 /* Linux specific */
174/* #define __NR_fcntl64 155 Linux sparc32 Specific */ 174/* #define __NR_fcntl64 155 Linux sparc32 Specific */
175/* #define __NR_getdirentries 156 SunOS Specific */ 175#define __NR_inotify_rm_watch 156 /* Linux specific */
176#define __NR_statfs 157 /* Common */ 176#define __NR_statfs 157 /* Common */
177#define __NR_fstatfs 158 /* Common */ 177#define __NR_fstatfs 158 /* Common */
178#define __NR_umount 159 /* Common */ 178#define __NR_umount 159 /* Common */
@@ -212,7 +212,7 @@
212#define __NR_epoll_create 193 /* Linux Specific */ 212#define __NR_epoll_create 193 /* Linux Specific */
213#define __NR_epoll_ctl 194 /* Linux Specific */ 213#define __NR_epoll_ctl 194 /* Linux Specific */
214#define __NR_epoll_wait 195 /* Linux Specific */ 214#define __NR_epoll_wait 195 /* Linux Specific */
215/* #define __NR_ulimit 196 Linux Specific */ 215#define __NR_ioprio_set 196 /* Linux Specific */
216#define __NR_getppid 197 /* Linux Specific */ 216#define __NR_getppid 197 /* Linux Specific */
217#define __NR_sigaction 198 /* Linux Specific */ 217#define __NR_sigaction 198 /* Linux Specific */
218#define __NR_sgetmask 199 /* Linux Specific */ 218#define __NR_sgetmask 199 /* Linux Specific */
@@ -234,7 +234,7 @@
234#define __NR_ipc 215 /* Linux Specific */ 234#define __NR_ipc 215 /* Linux Specific */
235#define __NR_sigreturn 216 /* Linux Specific */ 235#define __NR_sigreturn 216 /* Linux Specific */
236#define __NR_clone 217 /* Linux Specific */ 236#define __NR_clone 217 /* Linux Specific */
237/* #define __NR_modify_ldt 218 Linux Specific - i386 specific, unused */ 237#define __NR_ioprio_get 218 /* Linux Specific */
238#define __NR_adjtimex 219 /* Linux Specific */ 238#define __NR_adjtimex 219 /* Linux Specific */
239#define __NR_sigprocmask 220 /* Linux Specific */ 239#define __NR_sigprocmask 220 /* Linux Specific */
240#define __NR_create_module 221 /* Linux Specific */ 240#define __NR_create_module 221 /* Linux Specific */
diff --git a/include/asm-um/emergency-restart.h b/include/asm-um/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-um/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-um/ldt.h b/include/asm-um/ldt.h
new file mode 100644
index 000000000000..e908439d338a
--- /dev/null
+++ b/include/asm-um/ldt.h
@@ -0,0 +1,5 @@
1#ifndef __UM_LDT_H
2#define __UM_LDT_H
3
4#include "asm/arch/ldt.h"
5#endif
diff --git a/include/asm-um/mmu_context.h b/include/asm-um/mmu_context.h
index 89bff310b7a9..095bb627b96a 100644
--- a/include/asm-um/mmu_context.h
+++ b/include/asm-um/mmu_context.h
@@ -7,19 +7,23 @@
7#define __UM_MMU_CONTEXT_H 7#define __UM_MMU_CONTEXT_H
8 8
9#include "linux/sched.h" 9#include "linux/sched.h"
10#include "linux/config.h"
10#include "choose-mode.h" 11#include "choose-mode.h"
12#include "um_mmu.h"
11 13
12#define get_mmu_context(task) do ; while(0) 14#define get_mmu_context(task) do ; while(0)
13#define activate_context(tsk) do ; while(0) 15#define activate_context(tsk) do ; while(0)
14 16
15#define deactivate_mm(tsk,mm) do { } while (0) 17#define deactivate_mm(tsk,mm) do { } while (0)
16 18
19extern void force_flush_all(void);
20
17static inline void activate_mm(struct mm_struct *old, struct mm_struct *new) 21static inline void activate_mm(struct mm_struct *old, struct mm_struct *new)
18{ 22{
23 if (old != new)
24 force_flush_all();
19} 25}
20 26
21extern void switch_mm_skas(int mm_fd);
22
23static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, 27static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
24 struct task_struct *tsk) 28 struct task_struct *tsk)
25{ 29{
@@ -30,7 +34,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
30 cpu_set(cpu, next->cpu_vm_mask); 34 cpu_set(cpu, next->cpu_vm_mask);
31 if(next != &init_mm) 35 if(next != &init_mm)
32 CHOOSE_MODE((void) 0, 36 CHOOSE_MODE((void) 0,
33 switch_mm_skas(next->context.skas.mm_fd)); 37 switch_mm_skas(&next->context.skas.id));
34 } 38 }
35} 39}
36 40
diff --git a/include/asm-um/page.h b/include/asm-um/page.h
index 5afee8a8cdf3..f58aedadeb4e 100644
--- a/include/asm-um/page.h
+++ b/include/asm-um/page.h
@@ -104,8 +104,8 @@ extern void *to_virt(unsigned long phys);
104 * casting is the right thing, but 32-bit UML can't have 64-bit virtual 104 * casting is the right thing, but 32-bit UML can't have 64-bit virtual
105 * addresses 105 * addresses
106 */ 106 */
107#define __pa(virt) to_phys((void *) (unsigned long) virt) 107#define __pa(virt) to_phys((void *) (unsigned long) (virt))
108#define __va(phys) to_virt((unsigned long) phys) 108#define __va(phys) to_virt((unsigned long) (phys))
109 109
110#define page_to_pfn(page) ((page) - mem_map) 110#define page_to_pfn(page) ((page) - mem_map)
111#define pfn_to_page(pfn) (mem_map + (pfn)) 111#define pfn_to_page(pfn) (mem_map + (pfn))
diff --git a/include/asm-um/ptrace-i386.h b/include/asm-um/ptrace-i386.h
index 04222f35c43e..fe882b9d917e 100644
--- a/include/asm-um/ptrace-i386.h
+++ b/include/asm-um/ptrace-i386.h
@@ -32,6 +32,10 @@
32#define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r) 32#define PT_REGS_SYSCALL_RET(r) PT_REGS_EAX(r)
33#define PT_FIX_EXEC_STACK(sp) do ; while(0) 33#define PT_FIX_EXEC_STACK(sp) do ; while(0)
34 34
35/* Cope with a conditional i386 definition. */
36#undef profile_pc
37#define profile_pc(regs) PT_REGS_IP(regs)
38
35#define user_mode(r) UPT_IS_USER(&(r)->regs) 39#define user_mode(r) UPT_IS_USER(&(r)->regs)
36 40
37#endif 41#endif
diff --git a/include/asm-um/thread_info.h b/include/asm-um/thread_info.h
index 1feaaf148ef1..97267f059ef5 100644
--- a/include/asm-um/thread_info.h
+++ b/include/asm-um/thread_info.h
@@ -17,7 +17,7 @@ struct thread_info {
17 struct exec_domain *exec_domain; /* execution domain */ 17 struct exec_domain *exec_domain; /* execution domain */
18 unsigned long flags; /* low level flags */ 18 unsigned long flags; /* low level flags */
19 __u32 cpu; /* current CPU */ 19 __u32 cpu; /* current CPU */
20 __s32 preempt_count; /* 0 => preemptable, 20 int preempt_count; /* 0 => preemptable,
21 <0 => BUG */ 21 <0 => BUG */
22 mm_segment_t addr_limit; /* thread address space: 22 mm_segment_t addr_limit; /* thread address space:
23 0-0xBFFFFFFF for user 23 0-0xBFFFFFFF for user
diff --git a/include/asm-um/vm86.h b/include/asm-um/vm86.h
new file mode 100644
index 000000000000..7801f82de1f4
--- /dev/null
+++ b/include/asm-um/vm86.h
@@ -0,0 +1,6 @@
1#ifndef __UM_VM86_H
2#define __UM_VM86_H
3
4#include "asm/arch/vm86.h"
5
6#endif
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index 7c4ecaf5151c..0e5c2f210872 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/bitops.h -- Bit operations 2 * include/asm-v850/bitops.h -- Bit operations
3 * 3 *
4 * Copyright (C) 2001,02,03,04 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org>
6 * Copyright (C) 1992 Linus Torvalds. 6 * Copyright (C) 1992 Linus Torvalds.
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
@@ -157,7 +157,7 @@ extern __inline__ int __test_bit (int nr, const void *addr)
157#define find_first_zero_bit(addr, size) \ 157#define find_first_zero_bit(addr, size) \
158 find_next_zero_bit ((addr), (size), 0) 158 find_next_zero_bit ((addr), (size), 0)
159 159
160extern __inline__ int find_next_zero_bit (void *addr, int size, int offset) 160extern __inline__ int find_next_zero_bit(const void *addr, int size, int offset)
161{ 161{
162 unsigned long *p = ((unsigned long *) addr) + (offset >> 5); 162 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
163 unsigned long result = offset & ~31UL; 163 unsigned long result = offset & ~31UL;
diff --git a/include/asm-v850/cache.h b/include/asm-v850/cache.h
index 027f8c9090cd..cbf9096e8517 100644
--- a/include/asm-v850/cache.h
+++ b/include/asm-v850/cache.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/cache.h -- Cache operations 2 * include/asm-v850/cache.h -- Cache operations
3 * 3 *
4 * Copyright (C) 2001 NEC Corporation 4 * Copyright (C) 2001,05 NEC Corporation
5 * Copyright (C) 2001 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -20,6 +20,9 @@
20#ifndef L1_CACHE_BYTES 20#ifndef L1_CACHE_BYTES
21/* This processor has no cache, so just choose an arbitrary value. */ 21/* This processor has no cache, so just choose an arbitrary value. */
22#define L1_CACHE_BYTES 16 22#define L1_CACHE_BYTES 16
23#define L1_CACHE_SHIFT 4
23#endif 24#endif
24 25
26#define L1_CACHE_SHIFT_MAX L1_CACHE_SHIFT
27
25#endif /* __V850_CACHE_H__ */ 28#endif /* __V850_CACHE_H__ */
diff --git a/include/asm-v850/checksum.h b/include/asm-v850/checksum.h
index d3aedb7bfc5c..4df5e71098f9 100644
--- a/include/asm-v850/checksum.h
+++ b/include/asm-v850/checksum.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/checksum.h -- Checksum ops 2 * include/asm-v850/checksum.h -- Checksum ops
3 * 3 *
4 * Copyright (C) 2001 NEC Corporation 4 * Copyright (C) 2001,2005 NEC Corporation
5 * Copyright (C) 2001 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,2005 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -36,8 +36,8 @@ extern unsigned int csum_partial (const unsigned char * buff, int len,
36 * here even more important to align src and dst on a 32-bit (or even 36 * here even more important to align src and dst on a 32-bit (or even
37 * better 64-bit) boundary 37 * better 64-bit) boundary
38 */ 38 */
39extern unsigned csum_partial_copy (const char *src, char *dst, int len, 39extern unsigned csum_partial_copy (const unsigned char *src,
40 unsigned sum); 40 unsigned char *dst, int len, unsigned sum);
41 41
42 42
43/* 43/*
@@ -46,7 +46,8 @@ extern unsigned csum_partial_copy (const char *src, char *dst, int len,
46 * here even more important to align src and dst on a 32-bit (or even 46 * here even more important to align src and dst on a 32-bit (or even
47 * better 64-bit) boundary 47 * better 64-bit) boundary
48 */ 48 */
49extern unsigned csum_partial_copy_from_user (const char *src, char *dst, 49extern unsigned csum_partial_copy_from_user (const unsigned char *src,
50 unsigned char *dst,
50 int len, unsigned sum, 51 int len, unsigned sum,
51 int *csum_err); 52 int *csum_err);
52 53
diff --git a/include/asm-v850/emergency-restart.h b/include/asm-v850/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-v850/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-v850/io.h b/include/asm-v850/io.h
index bb5efd1b4b7d..cc364fcbec10 100644
--- a/include/asm-v850/io.h
+++ b/include/asm-v850/io.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/io.h -- Misc I/O operations 2 * include/asm-v850/io.h -- Misc I/O operations
3 * 3 *
4 * Copyright (C) 2001,02,03,04 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,04,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03,04 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,04,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -27,12 +27,12 @@
27#define readw_relaxed(a) readw(a) 27#define readw_relaxed(a) readw(a)
28#define readl_relaxed(a) readl(a) 28#define readl_relaxed(a) readl(a)
29 29
30#define writeb(b, addr) \ 30#define writeb(val, addr) \
31 (void)((*(volatile unsigned char *) (addr)) = (b)) 31 (void)((*(volatile unsigned char *) (addr)) = (val))
32#define writew(b, addr) \ 32#define writew(val, addr) \
33 (void)((*(volatile unsigned short *) (addr)) = (b)) 33 (void)((*(volatile unsigned short *) (addr)) = (val))
34#define writel(b, addr) \ 34#define writel(val, addr) \
35 (void)((*(volatile unsigned int *) (addr)) = (b)) 35 (void)((*(volatile unsigned int *) (addr)) = (val))
36 36
37#define __raw_readb readb 37#define __raw_readb readb
38#define __raw_readw readw 38#define __raw_readw readw
@@ -96,11 +96,22 @@ outsl (unsigned long port, const void *src, unsigned long count)
96 outl (*p++, port); 96 outl (*p++, port);
97} 97}
98 98
99#define iounmap(addr) ((void)0) 99
100#define ioremap(physaddr, size) (physaddr) 100/* Some places try to pass in an loff_t for PHYSADDR (?!), so we cast it to
101#define ioremap_nocache(physaddr, size) (physaddr) 101 long before casting it to a pointer to avoid compiler warnings. */
102#define ioremap_writethrough(physaddr, size) (physaddr) 102#define ioremap(physaddr, size) ((void __iomem *)(unsigned long)(physaddr))
103#define ioremap_fullcache(physaddr, size) (physaddr) 103#define iounmap(addr) ((void)0)
104
105#define ioremap_nocache(physaddr, size) ioremap (physaddr, size)
106#define ioremap_writethrough(physaddr, size) ioremap (physaddr, size)
107#define ioremap_fullcache(physaddr, size) ioremap (physaddr, size)
108
109#define ioread8(addr) readb (addr)
110#define ioread16(addr) readw (addr)
111#define ioread32(addr) readl (addr)
112#define iowrite8(val, addr) writeb (val, addr)
113#define iowrite16(val, addr) writew (val, addr)
114#define iowrite32(val, addr) writel (val, addr)
104 115
105#define mmiowb() 116#define mmiowb()
106 117
diff --git a/include/asm-v850/mmu.h b/include/asm-v850/mmu.h
index e30a52becfd6..267768c66ef6 100644
--- a/include/asm-v850/mmu.h
+++ b/include/asm-v850/mmu.h
@@ -1,22 +1,11 @@
1/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ 1/* Copyright (C) 2002, 2005, David McCullough <davidm@snapgear.com> */
2 2
3#ifndef __V850_MMU_H__ 3#ifndef __V850_MMU_H__
4#define __V850_MMU_H__ 4#define __V850_MMU_H__
5 5
6struct mm_rblock_struct {
7 int size;
8 int refcount;
9 void *kblock;
10};
11
12struct mm_tblock_struct {
13 struct mm_rblock_struct *rblock;
14 struct mm_tblock_struct *next;
15};
16
17typedef struct { 6typedef struct {
18 struct mm_tblock_struct tblock; 7 struct vm_list_struct *vmlist;
19 unsigned long end_brk; 8 unsigned long end_brk;
20} mm_context_t; 9} mm_context_t;
21 10
22#endif /* __V850_MMU_H__ */ 11#endif /* __V850_MMU_H__ */
diff --git a/include/asm-v850/page.h b/include/asm-v850/page.h
index 06085b0c043e..d6091622935d 100644
--- a/include/asm-v850/page.h
+++ b/include/asm-v850/page.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/page.h -- VM ops 2 * include/asm-v850/page.h -- VM ops
3 * 3 *
4 * Copyright (C) 2001,02,03 NEC Electronics Corporation 4 * Copyright (C) 2001,02,03,05 NEC Electronics Corporation
5 * Copyright (C) 2001,02,03 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,03,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -132,6 +132,7 @@ extern __inline__ int get_order (unsigned long size)
132 132
133#define pfn_to_page(pfn) virt_to_page (pfn_to_virt (pfn)) 133#define pfn_to_page(pfn) virt_to_page (pfn_to_virt (pfn))
134#define page_to_pfn(page) virt_to_pfn (page_to_virt (page)) 134#define page_to_pfn(page) virt_to_pfn (page_to_virt (page))
135#define pfn_valid(pfn) ((pfn) < max_mapnr)
135 136
136#define virt_addr_valid(kaddr) \ 137#define virt_addr_valid(kaddr) \
137 (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr) 138 (((void *)(kaddr) >= (void *)PAGE_OFFSET) && MAP_NR (kaddr) < max_mapnr)
diff --git a/include/asm-v850/pci.h b/include/asm-v850/pci.h
index e41941447b49..4581826e1cac 100644
--- a/include/asm-v850/pci.h
+++ b/include/asm-v850/pci.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * include/asm-v850/pci.h -- PCI support 2 * include/asm-v850/pci.h -- PCI support
3 * 3 *
4 * Copyright (C) 2001,02 NEC Corporation 4 * Copyright (C) 2001,02,05 NEC Corporation
5 * Copyright (C) 2001,02 Miles Bader <miles@gnu.org> 5 * Copyright (C) 2001,02,05 Miles Bader <miles@gnu.org>
6 * 6 *
7 * This file is subject to the terms and conditions of the GNU General 7 * This file is subject to the terms and conditions of the GNU General
8 * Public License. See the file COPYING in the main directory of this 8 * Public License. See the file COPYING in the main directory of this
@@ -48,12 +48,12 @@ pci_unmap_single (struct pci_dev *pdev, dma_addr_t dma_addr, size_t size,
48 perform a pci_dma_sync_for_device, and then the device again owns 48 perform a pci_dma_sync_for_device, and then the device again owns
49 the buffer. */ 49 the buffer. */
50extern void 50extern void
51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 51pci_dma_sync_single_for_cpu (struct pci_dev *dev, dma_addr_t dma_addr,
52 int dir); 52 size_t size, int dir);
53 53
54extern void 54extern void
55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr, size_t size, 55pci_dma_sync_single_for_device (struct pci_dev *dev, dma_addr_t dma_addr,
56 int dir); 56 size_t size, int dir);
57 57
58 58
59/* Do multiple DMA mappings at once. */ 59/* Do multiple DMA mappings at once. */
@@ -65,6 +65,28 @@ extern void
65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len, 65pci_unmap_sg (struct pci_dev *pdev, struct scatterlist *sg, int sg_len,
66 int dir); 66 int dir);
67 67
68/* SG-list versions of pci_dma_sync functions. */
69extern void
70pci_dma_sync_sg_for_cpu (struct pci_dev *dev,
71 struct scatterlist *sg, int sg_len,
72 int dir);
73extern void
74pci_dma_sync_sg_for_device (struct pci_dev *dev,
75 struct scatterlist *sg, int sg_len,
76 int dir);
77
78#define pci_map_page(dev, page, offs, size, dir) \
79 pci_map_single(dev, (page_address(page) + (offs)), size, dir)
80#define pci_unmap_page(dev,addr,sz,dir) \
81 pci_unmap_single(dev, addr, sz, dir)
82
83/* Test for pci_map_single or pci_map_page having generated an error. */
84static inline int
85pci_dma_mapping_error (dma_addr_t dma_addr)
86{
87 return dma_addr == 0;
88}
89
68/* Allocate and map kernel buffer using consistent mode DMA for PCI 90/* Allocate and map kernel buffer using consistent mode DMA for PCI
69 device. Returns non-NULL cpu-view pointer to the buffer if 91 device. Returns non-NULL cpu-view pointer to the buffer if
70 successful and sets *DMA_ADDR to the pci side dma address as well, 92 successful and sets *DMA_ADDR to the pci side dma address as well,
@@ -81,6 +103,19 @@ extern void
81pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr, 103pci_free_consistent (struct pci_dev *pdev, size_t size, void *cpu_addr,
82 dma_addr_t dma_addr); 104 dma_addr_t dma_addr);
83 105
106#ifdef CONFIG_PCI
107static inline void pci_dma_burst_advice(struct pci_dev *pdev,
108 enum pci_dma_burst_strategy *strat,
109 unsigned long *strategy_parameter)
110{
111 *strat = PCI_DMA_BURST_INFINITY;
112 *strategy_parameter = ~0UL;
113}
114#endif
115
116extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
117extern void pci_iounmap (struct pci_dev *dev, void __iomem *addr);
118
84static inline void pcibios_add_platform_entries(struct pci_dev *dev) 119static inline void pcibios_add_platform_entries(struct pci_dev *dev)
85{ 120{
86} 121}
diff --git a/include/asm-v850/pgtable.h b/include/asm-v850/pgtable.h
index 76e380e481e9..3cf8775ce85f 100644
--- a/include/asm-v850/pgtable.h
+++ b/include/asm-v850/pgtable.h
@@ -23,6 +23,8 @@
23#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) }) 23#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
24#define __swp_entry_to_pte(x) ((pte_t) { (x).val }) 24#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
25 25
26static inline int pte_file (pte_t pte) { return 0; }
27
26 28
27/* These mean nothing to !CONFIG_MMU. */ 29/* These mean nothing to !CONFIG_MMU. */
28#define PAGE_NONE __pgprot(0) 30#define PAGE_NONE __pgprot(0)
diff --git a/include/asm-v850/thread_info.h b/include/asm-v850/thread_info.h
index e2ef44593752..e4cfad94a553 100644
--- a/include/asm-v850/thread_info.h
+++ b/include/asm-v850/thread_info.h
@@ -30,7 +30,8 @@ struct thread_info {
30 struct exec_domain *exec_domain; /* execution domain */ 30 struct exec_domain *exec_domain; /* execution domain */
31 unsigned long flags; /* low level flags */ 31 unsigned long flags; /* low level flags */
32 int cpu; /* cpu we're on */ 32 int cpu; /* cpu we're on */
33 int preempt_count; 33 int preempt_count; /* 0 => preemptable,
34 <0 => BUG */
34 struct restart_block restart_block; 35 struct restart_block restart_block;
35}; 36};
36 37
diff --git a/include/asm-v850/v850e2_cache.h b/include/asm-v850/v850e2_cache.h
index 61acda1023e8..87edf0d311d5 100644
--- a/include/asm-v850/v850e2_cache.h
+++ b/include/asm-v850/v850e2_cache.h
@@ -2,8 +2,8 @@
2 * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2 2 * include/asm-v850/v850e2_cache_cache.h -- Cache control for V850E2
3 * cache memories 3 * cache memories
4 * 4 *
5 * Copyright (C) 2003 NEC Electronics Corporation 5 * Copyright (C) 2003,05 NEC Electronics Corporation
6 * Copyright (C) 2003 Miles Bader <miles@gnu.org> 6 * Copyright (C) 2003,05 Miles Bader <miles@gnu.org>
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General 8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file COPYING in the main directory of this 9 * Public License. See the file COPYING in the main directory of this
@@ -69,6 +69,7 @@
69 69
70/* For <asm/cache.h> */ 70/* For <asm/cache.h> */
71#define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE 71#define L1_CACHE_BYTES V850E2_CACHE_LINE_SIZE
72#define L1_CACHE_SHIFT V850E2_CACHE_LINE_SIZE_BITS
72 73
73 74
74#endif /* __V850_V850E2_CACHE_H__ */ 75#endif /* __V850_V850E2_CACHE_H__ */
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index a6b41b892062..dc8c981af27f 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -28,6 +28,8 @@
28 28
29#ifdef __KERNEL__ 29#ifdef __KERNEL__
30 30
31#include <acpi/pdc_intel.h>
32
31#define COMPILER_DEPENDENT_INT64 long long 33#define COMPILER_DEPENDENT_INT64 long long
32#define COMPILER_DEPENDENT_UINT64 unsigned long long 34#define COMPILER_DEPENDENT_UINT64 unsigned long long
33 35
@@ -99,12 +101,6 @@ __acpi_release_global_lock (unsigned int *lock)
99 :"=r"(n_hi), "=r"(n_lo) \ 101 :"=r"(n_hi), "=r"(n_lo) \
100 :"0"(n_hi), "1"(n_lo)) 102 :"0"(n_hi), "1"(n_lo))
101 103
102/*
103 * Refer Intel ACPI _PDC support document for bit definitions
104 */
105#define ACPI_PDC_EST_CAPABILITY_SMP 0xa
106#define ACPI_PDC_EST_CAPABILITY_MSR 0x1
107
108#ifdef CONFIG_ACPI_BOOT 104#ifdef CONFIG_ACPI_BOOT
109extern int acpi_lapic; 105extern int acpi_lapic;
110extern int acpi_ioapic; 106extern int acpi_ioapic;
diff --git a/include/asm-x86_64/apic.h b/include/asm-x86_64/apic.h
index e4b1017b8b2b..16ec82e16b21 100644
--- a/include/asm-x86_64/apic.h
+++ b/include/asm-x86_64/apic.h
@@ -77,7 +77,7 @@ static inline void ack_APIC_irq(void)
77extern int get_maxlvt (void); 77extern int get_maxlvt (void);
78extern void clear_local_APIC (void); 78extern void clear_local_APIC (void);
79extern void connect_bsp_APIC (void); 79extern void connect_bsp_APIC (void);
80extern void disconnect_bsp_APIC (void); 80extern void disconnect_bsp_APIC (int virt_wire_setup);
81extern void disable_local_APIC (void); 81extern void disable_local_APIC (void);
82extern int verify_local_APIC (void); 82extern int verify_local_APIC (void);
83extern void cache_APIC_registers (void); 83extern void cache_APIC_registers (void);
diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86_64/apicdef.h
index bfebdb690654..9388062c4f6e 100644
--- a/include/asm-x86_64/apicdef.h
+++ b/include/asm-x86_64/apicdef.h
@@ -94,7 +94,7 @@
94#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8)) 94#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8))
95#define APIC_MODE_FIXED 0x0 95#define APIC_MODE_FIXED 0x0
96#define APIC_MODE_NMI 0x4 96#define APIC_MODE_NMI 0x4
97#define APIC_MODE_EXINT 0x7 97#define APIC_MODE_EXTINT 0x7
98#define APIC_LVT1 0x360 98#define APIC_LVT1 0x360
99#define APIC_LVTERR 0x370 99#define APIC_LVTERR 0x370
100#define APIC_TMICT 0x380 100#define APIC_TMICT 0x380
diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86_64/bitops.h
index 5dd7727c756b..05a0d374404b 100644
--- a/include/asm-x86_64/bitops.h
+++ b/include/asm-x86_64/bitops.h
@@ -348,8 +348,7 @@ static inline int sched_find_first_bit(const unsigned long *b)
348 return __ffs(b[0]); 348 return __ffs(b[0]);
349 if (b[1]) 349 if (b[1])
350 return __ffs(b[1]) + 64; 350 return __ffs(b[1]) + 64;
351 if (b[2]) 351 return __ffs(b[2]) + 128;
352 return __ffs(b[2]) + 128;
353} 352}
354 353
355/** 354/**
@@ -411,8 +410,6 @@ static __inline__ int ffs(int x)
411/* find last set bit */ 410/* find last set bit */
412#define fls(x) generic_fls(x) 411#define fls(x) generic_fls(x)
413 412
414#define ARCH_HAS_ATOMIC_UNSIGNED 1
415
416#endif /* __KERNEL__ */ 413#endif /* __KERNEL__ */
417 414
418#endif /* _X86_64_BITOPS_H */ 415#endif /* _X86_64_BITOPS_H */
diff --git a/include/asm-x86_64/bug.h b/include/asm-x86_64/bug.h
index 3d2a666a5dd5..eed785667289 100644
--- a/include/asm-x86_64/bug.h
+++ b/include/asm-x86_64/bug.h
@@ -8,17 +8,24 @@
8 * this frame. 8 * this frame.
9 */ 9 */
10struct bug_frame { 10struct bug_frame {
11 unsigned char ud2[2]; 11 unsigned char ud2[2];
12 unsigned char mov;
12 /* should use 32bit offset instead, but the assembler doesn't 13 /* should use 32bit offset instead, but the assembler doesn't
13 like it */ 14 like it */
14 char *filename; 15 char *filename;
16 unsigned char ret;
15 unsigned short line; 17 unsigned short line;
16} __attribute__((packed)); 18} __attribute__((packed));
17 19
18#ifdef CONFIG_BUG 20#ifdef CONFIG_BUG
19#define HAVE_ARCH_BUG 21#define HAVE_ARCH_BUG
20#define BUG() \ 22/* We turn the bug frame into valid instructions to not confuse
21 asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \ 23 the disassembler. Thanks to Jan Beulich & Suresh Siddha
24 for nice instruction selection.
25 The magic numbers generate mov $64bitimm,%eax ; ret $offset. */
26#define BUG() \
27 asm volatile( \
28 "ud2 ; .byte 0xa3 ; .quad %c1 ; .byte 0xc2 ; .short %c0" :: \
22 "i"(__LINE__), "i" (__stringify(__FILE__))) 29 "i"(__LINE__), "i" (__stringify(__FILE__)))
23void out_of_line_bug(void); 30void out_of_line_bug(void);
24#else 31#else
diff --git a/include/asm-x86_64/desc.h b/include/asm-x86_64/desc.h
index 6aefb9c0280d..c89b58bebee2 100644
--- a/include/asm-x86_64/desc.h
+++ b/include/asm-x86_64/desc.h
@@ -75,6 +75,7 @@ struct desc_ptr {
75 */ 75 */
76extern struct desc_struct default_ldt[]; 76extern struct desc_struct default_ldt[];
77extern struct gate_struct idt_table[]; 77extern struct gate_struct idt_table[];
78extern struct desc_ptr cpu_gdt_descr[];
78 79
79static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist) 80static inline void _set_gate(void *adr, unsigned type, unsigned long func, unsigned dpl, unsigned ist)
80{ 81{
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h
index 8e94edf0b984..e682edc24a68 100644
--- a/include/asm-x86_64/e820.h
+++ b/include/asm-x86_64/e820.h
@@ -51,6 +51,8 @@ extern int e820_mapped(unsigned long start, unsigned long end, unsigned type);
51 51
52extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end); 52extern void e820_bootmem_free(pg_data_t *pgdat, unsigned long start,unsigned long end);
53extern void e820_setup_gap(void); 53extern void e820_setup_gap(void);
54extern unsigned long e820_hole_size(unsigned long start_pfn,
55 unsigned long end_pfn);
54 56
55extern void __init parse_memopt(char *p, char **end); 57extern void __init parse_memopt(char *p, char **end);
56 58
diff --git a/include/asm-x86_64/emergency-restart.h b/include/asm-x86_64/emergency-restart.h
new file mode 100644
index 000000000000..680c39563345
--- /dev/null
+++ b/include/asm-x86_64/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4extern void machine_emergency_restart(void);
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86_64/ia32.h
index c0a7717923ed..6efa00fe4e7b 100644
--- a/include/asm-x86_64/ia32.h
+++ b/include/asm-x86_64/ia32.h
@@ -94,7 +94,7 @@ typedef struct compat_siginfo{
94 94
95 /* POSIX.1b timers */ 95 /* POSIX.1b timers */
96 struct { 96 struct {
97 int _tid; /* timer id */ 97 compat_timer_t _tid; /* timer id */
98 int _overrun; /* overrun count */ 98 int _overrun; /* overrun count */
99 compat_sigval_t _sigval; /* same as below */ 99 compat_sigval_t _sigval; /* same as below */
100 int _sys_private; /* not to be passed to user */ 100 int _sys_private; /* not to be passed to user */
diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86_64/ia32_unistd.h
index f3b7111cf33d..d5166ec3868d 100644
--- a/include/asm-x86_64/ia32_unistd.h
+++ b/include/asm-x86_64/ia32_unistd.h
@@ -294,7 +294,12 @@
294#define __NR_ia32_add_key 286 294#define __NR_ia32_add_key 286
295#define __NR_ia32_request_key 287 295#define __NR_ia32_request_key 287
296#define __NR_ia32_keyctl 288 296#define __NR_ia32_keyctl 288
297#define __NR_ia32_ioprio_set 289
298#define __NR_ia32_ioprio_get 290
299#define __NR_ia32_inotify_init 291
300#define __NR_ia32_inotify_add_watch 292
301#define __NR_ia32_inotify_rm_watch 293
297 302
298#define IA32_NR_syscalls 290 /* must be > than biggest syscall! */ 303#define IA32_NR_syscalls 294 /* must be > than biggest syscall! */
299 304
300#endif /* _ASM_X86_64_IA32_UNISTD_H_ */ 305#endif /* _ASM_X86_64_IA32_UNISTD_H_ */
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h
index 94202703fae2..37fc3f149a5a 100644
--- a/include/asm-x86_64/io.h
+++ b/include/asm-x86_64/io.h
@@ -124,12 +124,7 @@ extern inline void * phys_to_virt(unsigned long address)
124/* 124/*
125 * Change "struct page" to physical address. 125 * Change "struct page" to physical address.
126 */ 126 */
127#ifdef CONFIG_DISCONTIGMEM
128#include <asm/mmzone.h>
129#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT) 127#define page_to_phys(page) ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
130#else
131#define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT)
132#endif
133 128
134#include <asm-generic/iomap.h> 129#include <asm-generic/iomap.h>
135 130
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h
index 32573749004c..a8babd2bbe84 100644
--- a/include/asm-x86_64/io_apic.h
+++ b/include/asm-x86_64/io_apic.h
@@ -217,4 +217,6 @@ extern int assign_irq_vector(int irq);
217 217
218void enable_NMI_through_LVT0 (void * dummy); 218void enable_NMI_through_LVT0 (void * dummy);
219 219
220extern spinlock_t i8259A_lock;
221
220#endif 222#endif
diff --git a/include/asm-x86_64/ipi.h b/include/asm-x86_64/ipi.h
index d1841847ed89..5e166b9d3bde 100644
--- a/include/asm-x86_64/ipi.h
+++ b/include/asm-x86_64/ipi.h
@@ -82,30 +82,27 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
82 */ 82 */
83 local_irq_save(flags); 83 local_irq_save(flags);
84 84
85 for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) { 85 for_each_cpu_mask(query_cpu, mask) {
86 if (cpu_isset(query_cpu, mask)) { 86 /*
87 87 * Wait for idle.
88 /* 88 */
89 * Wait for idle. 89 apic_wait_icr_idle();
90 */ 90
91 apic_wait_icr_idle(); 91 /*
92 92 * prepare target chip field
93 /* 93 */
94 * prepare target chip field 94 cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]);
95 */ 95 apic_write_around(APIC_ICR2, cfg);
96 cfg = __prepare_ICR2(x86_cpu_to_apicid[query_cpu]); 96
97 apic_write_around(APIC_ICR2, cfg); 97 /*
98 98 * program the ICR
99 /* 99 */
100 * program the ICR 100 cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL);
101 */ 101
102 cfg = __prepare_ICR(0, vector, APIC_DEST_PHYSICAL); 102 /*
103 103 * Send the IPI. The write to APIC_ICR fires this off.
104 /* 104 */
105 * Send the IPI. The write to APIC_ICR fires this off. 105 apic_write_around(APIC_ICR, cfg);
106 */
107 apic_write_around(APIC_ICR, cfg);
108 }
109 } 106 }
110 local_irq_restore(flags); 107 local_irq_restore(flags);
111} 108}
diff --git a/include/asm-x86_64/irq.h b/include/asm-x86_64/irq.h
index 3af50b3c3b05..4482657777bb 100644
--- a/include/asm-x86_64/irq.h
+++ b/include/asm-x86_64/irq.h
@@ -52,4 +52,11 @@ struct irqaction;
52struct pt_regs; 52struct pt_regs;
53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *); 53int handle_IRQ_event(unsigned int, struct pt_regs *, struct irqaction *);
54 54
55#ifdef CONFIG_HOTPLUG_CPU
56#include <linux/cpumask.h>
57extern void fixup_irqs(cpumask_t map);
58#endif
59
60#define __ARCH_HAS_DO_SOFTIRQ 1
61
55#endif /* _ASM_IRQ_H */ 62#endif /* _ASM_IRQ_H */
diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86_64/kdebug.h
index 6277f75cbb4b..b90341994d80 100644
--- a/include/asm-x86_64/kdebug.h
+++ b/include/asm-x86_64/kdebug.h
@@ -14,7 +14,7 @@ struct die_args {
14}; 14};
15 15
16/* Note - you should never unregister because that can race with NMIs. 16/* Note - you should never unregister because that can race with NMIs.
17 If you really want to do it first unregister - then synchronize_kernel - then free. 17 If you really want to do it first unregister - then synchronize_sched - then free.
18 */ 18 */
19int register_die_notifier(struct notifier_block *nb); 19int register_die_notifier(struct notifier_block *nb);
20extern struct notifier_block *die_chain; 20extern struct notifier_block *die_chain;
diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86_64/kexec.h
new file mode 100644
index 000000000000..42d2ff15c592
--- /dev/null
+++ b/include/asm-x86_64/kexec.h
@@ -0,0 +1,33 @@
1#ifndef _X86_64_KEXEC_H
2#define _X86_64_KEXEC_H
3
4#include <asm/page.h>
5#include <asm/proto.h>
6
7/*
8 * KEXEC_SOURCE_MEMORY_LIMIT maximum page get_free_page can return.
9 * I.e. Maximum page that is mapped directly into kernel memory,
10 * and kmap is not required.
11 *
12 * So far x86_64 is limited to 40 physical address bits.
13 */
14
15/* Maximum physical address we can use pages from */
16#define KEXEC_SOURCE_MEMORY_LIMIT (0xFFFFFFFFFFUL)
17/* Maximum address we can reach in physical address mode */
18#define KEXEC_DESTINATION_MEMORY_LIMIT (0xFFFFFFFFFFUL)
19/* Maximum address we can use for the control pages */
20#define KEXEC_CONTROL_MEMORY_LIMIT (0xFFFFFFFFFFUL)
21
22/* Allocate one page for the pdp and the second for the code */
23#define KEXEC_CONTROL_CODE_SIZE (4096UL + 4096UL)
24
25/* The native architecture */
26#define KEXEC_ARCH KEXEC_ARCH_X86_64
27
28#define MAX_NOTE_BYTES 1024
29typedef u32 note_buf_t[MAX_NOTE_BYTES/4];
30
31extern note_buf_t crash_notes[];
32
33#endif /* _X86_64_KEXEC_H */
diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86_64/kprobes.h
index bfea52d516f8..6d6d883fdf6d 100644
--- a/include/asm-x86_64/kprobes.h
+++ b/include/asm-x86_64/kprobes.h
@@ -38,6 +38,9 @@ typedef u8 kprobe_opcode_t;
38 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR))) 38 : (((unsigned long)current_thread_info()) + THREAD_SIZE - (ADDR)))
39 39
40#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 40#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
41#define ARCH_SUPPORTS_KRETPROBES
42
43void kretprobe_trampoline(void);
41 44
42/* Architecture specific copy of original instruction*/ 45/* Architecture specific copy of original instruction*/
43struct arch_specific_insn { 46struct arch_specific_insn {
diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86_64/mmzone.h
index d95b7c240831..768413751b34 100644
--- a/include/asm-x86_64/mmzone.h
+++ b/include/asm-x86_64/mmzone.h
@@ -6,7 +6,7 @@
6 6
7#include <linux/config.h> 7#include <linux/config.h>
8 8
9#ifdef CONFIG_DISCONTIGMEM 9#ifdef CONFIG_NUMA
10 10
11#define VIRTUAL_BUG_ON(x) 11#define VIRTUAL_BUG_ON(x)
12 12
@@ -30,27 +30,23 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
30 return nid; 30 return nid;
31} 31}
32 32
33#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
34
35#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
36#define NODE_DATA(nid) (node_data[nid]) 33#define NODE_DATA(nid) (node_data[nid])
37 34
38#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
39
40#define node_mem_map(nid) (NODE_DATA(nid)->node_mem_map)
41#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn) 35#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
42#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \ 36#define node_end_pfn(nid) (NODE_DATA(nid)->node_start_pfn + \
43 NODE_DATA(nid)->node_spanned_pages) 37 NODE_DATA(nid)->node_spanned_pages)
44 38
45#define local_mapnr(kvaddr) \ 39#ifdef CONFIG_DISCONTIGMEM
46 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) ) 40
41#define pfn_to_nid(pfn) phys_to_nid((unsigned long)(pfn) << PAGE_SHIFT)
42#define kvaddr_to_nid(kaddr) phys_to_nid(__pa(kaddr))
47 43
48/* AK: this currently doesn't deal with invalid addresses. We'll see 44/* AK: this currently doesn't deal with invalid addresses. We'll see
49 if the 2.5 kernel doesn't pass them 45 if the 2.5 kernel doesn't pass them
50 (2.4 used to). */ 46 (2.4 used to). */
51#define pfn_to_page(pfn) ({ \ 47#define pfn_to_page(pfn) ({ \
52 int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT); \ 48 int nid = phys_to_nid(((unsigned long)(pfn)) << PAGE_SHIFT); \
53 ((pfn) - node_start_pfn(nid)) + node_mem_map(nid); \ 49 ((pfn) - node_start_pfn(nid)) + NODE_DATA(nid)->node_mem_map; \
54}) 50})
55 51
56#define page_to_pfn(page) \ 52#define page_to_pfn(page) \
@@ -60,4 +56,8 @@ static inline __attribute__((pure)) int phys_to_nid(unsigned long addr)
60 ({ u8 nid__ = pfn_to_nid(pfn); \ 56 ({ u8 nid__ = pfn_to_nid(pfn); \
61 nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) <= node_end_pfn(nid__); })) 57 nid__ != 0xff && (pfn) >= node_start_pfn(nid__) && (pfn) <= node_end_pfn(nid__); }))
62#endif 58#endif
59
60#define local_mapnr(kvaddr) \
61 ( (__pa(kvaddr) >> PAGE_SHIFT) - node_start_pfn(kvaddr_to_nid(kvaddr)) )
62#endif
63#endif 63#endif
diff --git a/include/asm-x86_64/msr.h b/include/asm-x86_64/msr.h
index 513e52c71821..ba15279a79d0 100644
--- a/include/asm-x86_64/msr.h
+++ b/include/asm-x86_64/msr.h
@@ -57,11 +57,6 @@
57 (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \ 57 (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
58} while(0) 58} while(0)
59 59
60#define rdpmc(counter,low,high) \
61 __asm__ __volatile__("rdpmc" \
62 : "=a" (low), "=d" (high) \
63 : "c" (counter))
64
65#define write_tsc(val1,val2) wrmsr(0x10, val1, val2) 60#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
66 61
67#define rdpmc(counter,low,high) \ 62#define rdpmc(counter,low,high) \
@@ -223,7 +218,7 @@ extern inline unsigned int cpuid_edx(unsigned int op)
223#define MSR_K7_PERFCTR3 0xC0010007 218#define MSR_K7_PERFCTR3 0xC0010007
224#define MSR_K8_TOP_MEM1 0xC001001A 219#define MSR_K8_TOP_MEM1 0xC001001A
225#define MSR_K8_TOP_MEM2 0xC001001D 220#define MSR_K8_TOP_MEM2 0xC001001D
226#define MSR_K8_SYSCFG 0xC0000010 221#define MSR_K8_SYSCFG 0xC0010010
227 222
228/* K6 MSRs */ 223/* K6 MSRs */
229#define MSR_K6_EFER 0xC0000080 224#define MSR_K6_EFER 0xC0000080
diff --git a/include/asm-x86_64/page.h b/include/asm-x86_64/page.h
index 9ce338c3a71e..431318764af6 100644
--- a/include/asm-x86_64/page.h
+++ b/include/asm-x86_64/page.h
@@ -64,12 +64,14 @@ typedef struct { unsigned long pgprot; } pgprot_t;
64#define __pgd(x) ((pgd_t) { (x) } ) 64#define __pgd(x) ((pgd_t) { (x) } )
65#define __pgprot(x) ((pgprot_t) { (x) } ) 65#define __pgprot(x) ((pgprot_t) { (x) } )
66 66
67#define __START_KERNEL 0xffffffff80100000UL 67#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START)
68#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
68#define __START_KERNEL_map 0xffffffff80000000UL 69#define __START_KERNEL_map 0xffffffff80000000UL
69#define __PAGE_OFFSET 0xffff810000000000UL 70#define __PAGE_OFFSET 0xffff810000000000UL
70 71
71#else 72#else
72#define __START_KERNEL 0xffffffff80100000 73#define __PHYSICAL_START CONFIG_PHYSICAL_START
74#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
73#define __START_KERNEL_map 0xffffffff80000000 75#define __START_KERNEL_map 0xffffffff80000000
74#define __PAGE_OFFSET 0xffff810000000000 76#define __PAGE_OFFSET 0xffff810000000000
75#endif /* !__ASSEMBLY__ */ 77#endif /* !__ASSEMBLY__ */
@@ -119,7 +121,9 @@ extern __inline__ int get_order(unsigned long size)
119 __pa(v); }) 121 __pa(v); })
120 122
121#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) 123#define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET))
122#ifndef CONFIG_DISCONTIGMEM 124#define __boot_va(x) __va(x)
125#define __boot_pa(x) __pa(x)
126#ifdef CONFIG_FLATMEM
123#define pfn_to_page(pfn) (mem_map + (pfn)) 127#define pfn_to_page(pfn) (mem_map + (pfn))
124#define page_to_pfn(page) ((unsigned long)((page) - mem_map)) 128#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
125#define pfn_valid(pfn) ((pfn) < max_mapnr) 129#define pfn_valid(pfn) ((pfn) < max_mapnr)
diff --git a/include/asm-x86_64/param.h b/include/asm-x86_64/param.h
index b707f0568c9e..40b11937180d 100644
--- a/include/asm-x86_64/param.h
+++ b/include/asm-x86_64/param.h
@@ -1,9 +1,11 @@
1#include <linux/config.h>
2
1#ifndef _ASMx86_64_PARAM_H 3#ifndef _ASMx86_64_PARAM_H
2#define _ASMx86_64_PARAM_H 4#define _ASMx86_64_PARAM_H
3 5
4#ifdef __KERNEL__ 6#ifdef __KERNEL__
5# define HZ 1000 /* Internal kernel timer frequency */ 7# define HZ CONFIG_HZ /* Internal kernel timer frequency */
6# define USER_HZ 100 /* .. some user interfaces are in "ticks */ 8# define USER_HZ 100 /* .. some user interfaces are in "ticks */
7#define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 9#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
8#endif 10#endif
9 11
diff --git a/include/asm-x86_64/pci.h b/include/asm-x86_64/pci.h
index 8712520ca47f..eeb3088a1c9e 100644
--- a/include/asm-x86_64/pci.h
+++ b/include/asm-x86_64/pci.h
@@ -33,7 +33,7 @@ extern int (*pci_config_read)(int seg, int bus, int dev, int fn, int reg, int le
33extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value); 33extern int (*pci_config_write)(int seg, int bus, int dev, int fn, int reg, int len, u32 value);
34 34
35void pcibios_set_master(struct pci_dev *dev); 35void pcibios_set_master(struct pci_dev *dev);
36void pcibios_penalize_isa_irq(int irq); 36void pcibios_penalize_isa_irq(int irq, int active);
37struct irq_routing_table *pcibios_get_irq_routing_table(void); 37struct irq_routing_table *pcibios_get_irq_routing_table(void);
38int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); 38int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq);
39 39
@@ -123,6 +123,16 @@ pci_dac_dma_sync_single_for_device(struct pci_dev *pdev, dma64_addr_t dma_addr,
123 flush_write_buffers(); 123 flush_write_buffers();
124} 124}
125 125
126#ifdef CONFIG_PCI
127static inline void pci_dma_burst_advice(struct pci_dev *pdev,
128 enum pci_dma_burst_strategy *strat,
129 unsigned long *strategy_parameter)
130{
131 *strat = PCI_DMA_BURST_INFINITY;
132 *strategy_parameter = ~0UL;
133}
134#endif
135
126#define HAVE_PCI_MMAP 136#define HAVE_PCI_MMAP
127extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 137extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
128 enum pci_mmap_state mmap_state, int write_combine); 138 enum pci_mmap_state mmap_state, int write_combine);
diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86_64/percpu.h
index 415d73f3c8ef..9c71855736fb 100644
--- a/include/asm-x86_64/percpu.h
+++ b/include/asm-x86_64/percpu.h
@@ -39,7 +39,7 @@ extern void setup_per_cpu_areas(void);
39#define DEFINE_PER_CPU(type, name) \ 39#define DEFINE_PER_CPU(type, name) \
40 __typeof__(type) per_cpu__##name 40 __typeof__(type) per_cpu__##name
41 41
42#define per_cpu(var, cpu) (*((void)cpu, &per_cpu__##var)) 42#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
43#define __get_cpu_var(var) per_cpu__##var 43#define __get_cpu_var(var) per_cpu__##var
44 44
45#endif /* SMP */ 45#endif /* SMP */
diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86_64/pgtable.h
index 4eec176c3c39..4e167b5ea8f3 100644
--- a/include/asm-x86_64/pgtable.h
+++ b/include/asm-x86_64/pgtable.h
@@ -176,6 +176,8 @@ extern inline void pgd_clear (pgd_t * pgd)
176 (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD) 176 (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD)
177#define __PAGE_KERNEL_LARGE \ 177#define __PAGE_KERNEL_LARGE \
178 (__PAGE_KERNEL | _PAGE_PSE) 178 (__PAGE_KERNEL | _PAGE_PSE)
179#define __PAGE_KERNEL_LARGE_EXEC \
180 (__PAGE_KERNEL_EXEC | _PAGE_PSE)
179 181
180#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL) 182#define MAKE_GLOBAL(x) __pgprot((x) | _PAGE_GLOBAL)
181 183
diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h
index 8b55f139968f..85549e656eeb 100644
--- a/include/asm-x86_64/processor.h
+++ b/include/asm-x86_64/processor.h
@@ -32,7 +32,7 @@
32#define ID_MASK 0x00200000 32#define ID_MASK 0x00200000
33 33
34#define desc_empty(desc) \ 34#define desc_empty(desc) \
35 (!((desc)->a + (desc)->b)) 35 (!((desc)->a | (desc)->b))
36 36
37#define desc_equal(desc1, desc2) \ 37#define desc_equal(desc1, desc2) \
38 (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) 38 (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
@@ -280,6 +280,14 @@ struct thread_struct {
280 set_fs(USER_DS); \ 280 set_fs(USER_DS); \
281} while(0) 281} while(0)
282 282
283#define get_debugreg(var, register) \
284 __asm__("movq %%db" #register ", %0" \
285 :"=r" (var))
286#define set_debugreg(value, register) \
287 __asm__("movq %0,%%db" #register \
288 : /* no output */ \
289 :"r" (value))
290
283struct task_struct; 291struct task_struct;
284struct mm_struct; 292struct mm_struct;
285 293
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h
index f2f073642d62..6c813eb521f3 100644
--- a/include/asm-x86_64/proto.h
+++ b/include/asm-x86_64/proto.h
@@ -15,6 +15,13 @@ extern void pda_init(int);
15extern void early_idt_handler(void); 15extern void early_idt_handler(void);
16 16
17extern void mcheck_init(struct cpuinfo_x86 *c); 17extern void mcheck_init(struct cpuinfo_x86 *c);
18#ifdef CONFIG_MTRR
19extern void mtrr_ap_init(void);
20extern void mtrr_bp_init(void);
21#else
22#define mtrr_ap_init() do {} while (0)
23#define mtrr_bp_init() do {} while (0)
24#endif
18extern void init_memory_mapping(unsigned long start, unsigned long end); 25extern void init_memory_mapping(unsigned long start, unsigned long end);
19 26
20extern void system_call(void); 27extern void system_call(void);
diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h
index 5bbc8d3141c8..ca6f15ff61d4 100644
--- a/include/asm-x86_64/ptrace.h
+++ b/include/asm-x86_64/ptrace.h
@@ -82,6 +82,7 @@ struct pt_regs {
82 82
83#if defined(__KERNEL__) && !defined(__ASSEMBLY__) 83#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
84#define user_mode(regs) (!!((regs)->cs & 3)) 84#define user_mode(regs) (!!((regs)->cs & 3))
85#define user_mode_vm(regs) user_mode(regs)
85#define instruction_pointer(regs) ((regs)->rip) 86#define instruction_pointer(regs) ((regs)->rip)
86extern unsigned long profile_pc(struct pt_regs *regs); 87extern unsigned long profile_pc(struct pt_regs *regs);
87void signal_fault(struct pt_regs *regs, void __user *frame, char *where); 88void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
diff --git a/include/asm-x86_64/serial.h b/include/asm-x86_64/serial.h
index dbab232044cd..dc752eafa681 100644
--- a/include/asm-x86_64/serial.h
+++ b/include/asm-x86_64/serial.h
@@ -22,109 +22,9 @@
22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF 22#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
23#endif 23#endif
24 24
25#ifdef CONFIG_SERIAL_MANY_PORTS 25#define SERIAL_PORT_DFNS \
26#define FOURPORT_FLAGS ASYNC_FOURPORT
27#define ACCENT_FLAGS 0
28#define BOCA_FLAGS 0
29#define HUB6_FLAGS 0
30#endif
31
32#define MCA_COM_FLAGS (STD_COM_FLAGS|ASYNC_BOOT_ONLYMCA)
33
34/*
35 * The following define the access methods for the HUB6 card. All
36 * access is through two ports for all 24 possible chips. The card is
37 * selected through the high 2 bits, the port on that card with the
38 * "middle" 3 bits, and the register on that port with the bottom
39 * 3 bits.
40 *
41 * While the access port and interrupt is configurable, the default
42 * port locations are 0x302 for the port control register, and 0x303
43 * for the data read/write register. Normally, the interrupt is at irq3
44 * but can be anything from 3 to 7 inclusive. Note that using 3 will
45 * require disabling com2.
46 */
47
48#define C_P(card,port) (((card)<<6|(port)<<3) + 1)
49
50#define STD_SERIAL_PORT_DEFNS \
51 /* UART CLK PORT IRQ FLAGS */ \ 26 /* UART CLK PORT IRQ FLAGS */ \
52 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \ 27 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
53 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \ 28 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
54 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ 29 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
55 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ 30 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
56
57
58#ifdef CONFIG_SERIAL_MANY_PORTS
59#define EXTRA_SERIAL_PORT_DEFNS \
60 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
61 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
62 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
63 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
64 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
65 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
66 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
67 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
68 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
69 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
70 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
71 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
72 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
73 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
74 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
75 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
76 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
77 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
78 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
79 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
80 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
81 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
82 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
83 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
84 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
85 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
86 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
87 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
88#else
89#define EXTRA_SERIAL_PORT_DEFNS
90#endif
91
92/* You can have up to four HUB6's in the system, but I've only
93 * included two cards here for a total of twelve ports.
94 */
95#if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
96#define HUB6_SERIAL_PORT_DFNS \
97 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \
98 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \
99 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \
100 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \
101 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \
102 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \
103 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \
104 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \
105 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \
106 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \
107 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \
108 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
109#else
110#define HUB6_SERIAL_PORT_DFNS
111#endif
112
113#ifdef CONFIG_MCA
114#define MCA_SERIAL_PORT_DFNS \
115 { 0, BASE_BAUD, 0x3220, 3, MCA_COM_FLAGS }, \
116 { 0, BASE_BAUD, 0x3228, 3, MCA_COM_FLAGS }, \
117 { 0, BASE_BAUD, 0x4220, 3, MCA_COM_FLAGS }, \
118 { 0, BASE_BAUD, 0x4228, 3, MCA_COM_FLAGS }, \
119 { 0, BASE_BAUD, 0x5220, 3, MCA_COM_FLAGS }, \
120 { 0, BASE_BAUD, 0x5228, 3, MCA_COM_FLAGS },
121#else
122#define MCA_SERIAL_PORT_DFNS
123#endif
124
125#define SERIAL_PORT_DFNS \
126 STD_SERIAL_PORT_DEFNS \
127 EXTRA_SERIAL_PORT_DEFNS \
128 HUB6_SERIAL_PORT_DFNS \
129 MCA_SERIAL_PORT_DFNS
130
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h
index a7425aa5a3b7..de8b57b2b62b 100644
--- a/include/asm-x86_64/smp.h
+++ b/include/asm-x86_64/smp.h
@@ -43,13 +43,15 @@ extern cpumask_t cpu_callout_map;
43extern void smp_alloc_memory(void); 43extern void smp_alloc_memory(void);
44extern volatile unsigned long smp_invalidate_needed; 44extern volatile unsigned long smp_invalidate_needed;
45extern int pic_mode; 45extern int pic_mode;
46extern void lock_ipi_call_lock(void);
47extern void unlock_ipi_call_lock(void);
46extern int smp_num_siblings; 48extern int smp_num_siblings;
47extern void smp_flush_tlb(void);
48extern void smp_message_irq(int cpl, void *dev_id, struct pt_regs *regs);
49extern void smp_send_reschedule(int cpu); 49extern void smp_send_reschedule(int cpu);
50extern void smp_invalidate_rcv(void); /* Process an NMI */
51extern void zap_low_mappings(void); 50extern void zap_low_mappings(void);
52void smp_stop_cpu(void); 51void smp_stop_cpu(void);
52extern int smp_call_function_single(int cpuid, void (*func) (void *info),
53 void *info, int retry, int wait);
54
53extern cpumask_t cpu_sibling_map[NR_CPUS]; 55extern cpumask_t cpu_sibling_map[NR_CPUS];
54extern cpumask_t cpu_core_map[NR_CPUS]; 56extern cpumask_t cpu_core_map[NR_CPUS];
55extern u8 phys_proc_id[NR_CPUS]; 57extern u8 phys_proc_id[NR_CPUS];
@@ -77,6 +79,8 @@ extern __inline int hard_smp_processor_id(void)
77} 79}
78 80
79extern int safe_smp_processor_id(void); 81extern int safe_smp_processor_id(void);
82extern int __cpu_disable(void);
83extern void __cpu_die(unsigned int cpu);
80 84
81#endif /* !ASSEMBLY */ 85#endif /* !ASSEMBLY */
82 86
diff --git a/include/asm-x86_64/sparsemem.h b/include/asm-x86_64/sparsemem.h
new file mode 100644
index 000000000000..dabb16714a71
--- /dev/null
+++ b/include/asm-x86_64/sparsemem.h
@@ -0,0 +1,26 @@
1#ifndef _ASM_X86_64_SPARSEMEM_H
2#define _ASM_X86_64_SPARSEMEM_H 1
3
4#ifdef CONFIG_SPARSEMEM
5
6/*
7 * generic non-linear memory support:
8 *
9 * 1) we will not split memory into more chunks than will fit into the flags
10 * field of the struct page
11 *
12 * SECTION_SIZE_BITS 2^n: size of each section
13 * MAX_PHYSADDR_BITS 2^n: max size of physical address space
14 * MAX_PHYSMEM_BITS 2^n: how much memory we can have in that space
15 *
16 */
17
18#define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
19#define MAX_PHYSADDR_BITS 40
20#define MAX_PHYSMEM_BITS 40
21
22extern int early_pfn_to_nid(unsigned long pfn);
23
24#endif /* CONFIG_SPARSEMEM */
25
26#endif /* _ASM_X86_64_SPARSEMEM_H */
diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86_64/suspend.h
index ec745807feae..bb9f40597d09 100644
--- a/include/asm-x86_64/suspend.h
+++ b/include/asm-x86_64/suspend.h
@@ -16,7 +16,7 @@ arch_prepare_suspend(void)
16struct saved_context { 16struct saved_context {
17 u16 ds, es, fs, gs, ss; 17 u16 ds, es, fs, gs, ss;
18 unsigned long gs_base, gs_kernel_base, fs_base; 18 unsigned long gs_base, gs_kernel_base, fs_base;
19 unsigned long cr0, cr2, cr3, cr4; 19 unsigned long cr0, cr2, cr3, cr4, cr8;
20 u16 gdt_pad; 20 u16 gdt_pad;
21 u16 gdt_limit; 21 u16 gdt_limit;
22 unsigned long gdt_base; 22 unsigned long gdt_base;
diff --git a/include/asm-x86_64/system.h b/include/asm-x86_64/system.h
index 76165736e43a..8606e170a7dc 100644
--- a/include/asm-x86_64/system.h
+++ b/include/asm-x86_64/system.h
@@ -116,12 +116,12 @@ struct alt_instr {
116/* 116/*
117 * Alternative inline assembly with input. 117 * Alternative inline assembly with input.
118 * 118 *
119 * Pecularities: 119 * Peculiarities:
120 * No memory clobber here. 120 * No memory clobber here.
121 * Argument numbers start with 1. 121 * Argument numbers start with 1.
122 * Best is to use constraints that are fixed size (like (%1) ... "r") 122 * Best is to use constraints that are fixed size (like (%1) ... "r")
123 * If you use variable sized constraints like "m" or "g" in the 123 * If you use variable sized constraints like "m" or "g" in the
124 * replacement maake sure to pad to the worst case length. 124 * replacement make sure to pad to the worst case length.
125 */ 125 */
126#define alternative_input(oldinstr, newinstr, feature, input...) \ 126#define alternative_input(oldinstr, newinstr, feature, input...) \
127 asm volatile ("661:\n\t" oldinstr "\n662:\n" \ 127 asm volatile ("661:\n\t" oldinstr "\n662:\n" \
@@ -335,9 +335,6 @@ void cpu_idle_wait(void);
335void disable_hlt(void); 335void disable_hlt(void);
336void enable_hlt(void); 336void enable_hlt(void);
337 337
338#define HAVE_EAT_KEY
339void eat_key(void);
340
341extern unsigned long arch_align_stack(unsigned long sp); 338extern unsigned long arch_align_stack(unsigned long sp);
342 339
343#endif 340#endif
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index f4b3b249639c..08eb6e4f3737 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -29,7 +29,7 @@ struct thread_info {
29 __u32 flags; /* low level flags */ 29 __u32 flags; /* low level flags */
30 __u32 status; /* thread synchronous flags */ 30 __u32 status; /* thread synchronous flags */
31 __u32 cpu; /* current CPU */ 31 __u32 cpu; /* current CPU */
32 int preempt_count; 32 int preempt_count; /* 0 => preemptable, <0 => BUG */
33 33
34 mm_segment_t addr_limit; 34 mm_segment_t addr_limit;
35 struct restart_block restart_block; 35 struct restart_block restart_block;
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index 34f31a18f90b..24ecf6a637cb 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -26,6 +26,9 @@ static inline cycles_t get_cycles (void)
26 26
27extern unsigned int cpu_khz; 27extern unsigned int cpu_khz;
28 28
29extern int read_current_timer(unsigned long *timer_value);
30#define ARCH_HAS_READ_CURRENT_TIMER 1
31
29extern struct vxtime_data vxtime; 32extern struct vxtime_data vxtime;
30 33
31#endif 34#endif
diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86_64/tlbflush.h
index 2e811ac262af..505b0cf906de 100644
--- a/include/asm-x86_64/tlbflush.h
+++ b/include/asm-x86_64/tlbflush.h
@@ -22,16 +22,18 @@
22 */ 22 */
23#define __flush_tlb_global() \ 23#define __flush_tlb_global() \
24 do { \ 24 do { \
25 unsigned long tmpreg; \ 25 unsigned long tmpreg, cr4, cr4_orig; \
26 \ 26 \
27 __asm__ __volatile__( \ 27 __asm__ __volatile__( \
28 "movq %1, %%cr4; # turn off PGE \n" \ 28 "movq %%cr4, %2; # turn off PGE \n" \
29 "movq %2, %1; \n" \
30 "andq %3, %1; \n" \
31 "movq %1, %%cr4; \n" \
29 "movq %%cr3, %0; # flush TLB \n" \ 32 "movq %%cr3, %0; # flush TLB \n" \
30 "movq %0, %%cr3; \n" \ 33 "movq %0, %%cr3; \n" \
31 "movq %2, %%cr4; # turn PGE back on \n" \ 34 "movq %2, %%cr4; # turn PGE back on \n" \
32 : "=&r" (tmpreg) \ 35 : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig) \
33 : "r" (mmu_cr4_features & ~X86_CR4_PGE), \ 36 : "i" (~X86_CR4_PGE) \
34 "r" (mmu_cr4_features) \
35 : "memory"); \ 37 : "memory"); \
36 } while (0) 38 } while (0)
37 39
@@ -54,8 +56,9 @@ extern unsigned long pgkern_mask;
54 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages 56 * - flush_tlb_kernel_range(start, end) flushes a range of kernel pages
55 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables 57 * - flush_tlb_pgtables(mm, start, end) flushes a range of page tables
56 * 58 *
57 * ..but the x86_64 has somewhat limited tlb flushing capabilities, 59 * x86-64 can only flush individual pages or full VMs. For a range flush
58 * and page-granular flushes are available only on i486 and up. 60 * we always do the full VM. Might be worth trying if for a small
61 * range a few INVLPGs in a row are a win.
59 */ 62 */
60 63
61#ifndef CONFIG_SMP 64#ifndef CONFIG_SMP
@@ -113,7 +116,9 @@ static inline void flush_tlb_range(struct vm_area_struct * vma, unsigned long st
113static inline void flush_tlb_pgtables(struct mm_struct *mm, 116static inline void flush_tlb_pgtables(struct mm_struct *mm,
114 unsigned long start, unsigned long end) 117 unsigned long start, unsigned long end)
115{ 118{
116 /* x86_64 does not keep any page table caches in TLB */ 119 /* x86_64 does not keep any page table caches in a software TLB.
120 The CPUs do in their hardware TLBs, but they are handled
121 by the normal TLB flushing algorithms. */
117} 122}
118 123
119#endif /* _X8664_TLBFLUSH_H */ 124#endif /* _X8664_TLBFLUSH_H */
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 67f24e0ea819..c1bc3fad482e 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_DISCONTIGMEM 6#ifdef CONFIG_NUMA
7 7
8#include <asm/mpspec.h> 8#include <asm/mpspec.h>
9#include <asm/bitops.h> 9#include <asm/bitops.h>
@@ -13,8 +13,8 @@
13extern cpumask_t cpu_online_map; 13extern cpumask_t cpu_online_map;
14 14
15extern unsigned char cpu_to_node[]; 15extern unsigned char cpu_to_node[];
16extern unsigned char pci_bus_to_node[];
16extern cpumask_t node_to_cpumask[]; 17extern cpumask_t node_to_cpumask[];
17extern cpumask_t pci_bus_to_cpumask[];
18 18
19#ifdef CONFIG_ACPI_NUMA 19#ifdef CONFIG_ACPI_NUMA
20extern int __node_distance(int, int); 20extern int __node_distance(int, int);
@@ -26,18 +26,9 @@ extern int __node_distance(int, int);
26#define parent_node(node) (node) 26#define parent_node(node) (node)
27#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node])) 27#define node_to_first_cpu(node) (__ffs(node_to_cpumask[node]))
28#define node_to_cpumask(node) (node_to_cpumask[node]) 28#define node_to_cpumask(node) (node_to_cpumask[node])
29#define pcibus_to_node(bus) pci_bus_to_node[(bus)->number]
30#define pcibus_to_cpumask(bus) node_to_cpumask(pcibus_to_node(bus));
29 31
30static inline cpumask_t __pcibus_to_cpumask(int bus)
31{
32 cpumask_t busmask = pci_bus_to_cpumask[bus];
33 cpumask_t online = cpu_online_map;
34 cpumask_t res;
35 cpus_and(res, busmask, online);
36 return res;
37}
38#define pcibus_to_cpumask(bus) __pcibus_to_cpumask(bus->number)
39
40#ifdef CONFIG_NUMA
41/* sched_domains SD_NODE_INIT for x86_64 machines */ 32/* sched_domains SD_NODE_INIT for x86_64 machines */
42#define SD_NODE_INIT (struct sched_domain) { \ 33#define SD_NODE_INIT (struct sched_domain) { \
43 .span = CPU_MASK_NONE, \ 34 .span = CPU_MASK_NONE, \
@@ -48,18 +39,21 @@ static inline cpumask_t __pcibus_to_cpumask(int bus)
48 .busy_factor = 32, \ 39 .busy_factor = 32, \
49 .imbalance_pct = 125, \ 40 .imbalance_pct = 125, \
50 .cache_hot_time = (10*1000000), \ 41 .cache_hot_time = (10*1000000), \
51 .cache_nice_tries = 1, \ 42 .cache_nice_tries = 2, \
43 .busy_idx = 3, \
44 .idle_idx = 2, \
45 .newidle_idx = 0, \
46 .wake_idx = 1, \
47 .forkexec_idx = 1, \
52 .per_cpu_gain = 100, \ 48 .per_cpu_gain = 100, \
53 .flags = SD_LOAD_BALANCE \ 49 .flags = SD_LOAD_BALANCE \
54 | SD_BALANCE_NEWIDLE \ 50 | SD_BALANCE_FORK \
55 | SD_BALANCE_EXEC \ 51 | SD_BALANCE_EXEC \
56 | SD_WAKE_IDLE \
57 | SD_WAKE_BALANCE, \ 52 | SD_WAKE_BALANCE, \
58 .last_balance = jiffies, \ 53 .last_balance = jiffies, \
59 .balance_interval = 1, \ 54 .balance_interval = 1, \
60 .nr_balance_failed = 0, \ 55 .nr_balance_failed = 0, \
61} 56}
62#endif
63 57
64#endif 58#endif
65 59
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 3c9af6fd4332..11ba931cf82f 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -552,7 +552,7 @@ __SYSCALL(__NR_mq_notify, sys_mq_notify)
552#define __NR_mq_getsetattr 245 552#define __NR_mq_getsetattr 245
553__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr) 553__SYSCALL(__NR_mq_getsetattr, sys_mq_getsetattr)
554#define __NR_kexec_load 246 554#define __NR_kexec_load 246
555__SYSCALL(__NR_kexec_load, sys_ni_syscall) 555__SYSCALL(__NR_kexec_load, sys_kexec_load)
556#define __NR_waitid 247 556#define __NR_waitid 247
557__SYSCALL(__NR_waitid, sys_waitid) 557__SYSCALL(__NR_waitid, sys_waitid)
558#define __NR_add_key 248 558#define __NR_add_key 248
@@ -561,8 +561,18 @@ __SYSCALL(__NR_add_key, sys_add_key)
561__SYSCALL(__NR_request_key, sys_request_key) 561__SYSCALL(__NR_request_key, sys_request_key)
562#define __NR_keyctl 250 562#define __NR_keyctl 250
563__SYSCALL(__NR_keyctl, sys_keyctl) 563__SYSCALL(__NR_keyctl, sys_keyctl)
564 564#define __NR_ioprio_set 251
565#define __NR_syscall_max __NR_keyctl 565__SYSCALL(__NR_ioprio_set, sys_ioprio_set)
566#define __NR_ioprio_get 252
567__SYSCALL(__NR_ioprio_get, sys_ioprio_get)
568#define __NR_inotify_init 253
569__SYSCALL(__NR_inotify_init, sys_inotify_init)
570#define __NR_inotify_add_watch 254
571__SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
572#define __NR_inotify_rm_watch 255
573__SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
574
575#define __NR_syscall_max __NR_inotify_rm_watch
566#ifndef __NO_STUBS 576#ifndef __NO_STUBS
567 577
568/* user-visible error numbers are in the range -1 - -4095 */ 578/* user-visible error numbers are in the range -1 - -4095 */
diff --git a/include/asm-xtensa/a.out.h b/include/asm-xtensa/a.out.h
new file mode 100644
index 000000000000..3be701dfe098
--- /dev/null
+++ b/include/asm-xtensa/a.out.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-xtensa/addrspace.h
3 *
4 * Dummy a.out file. Xtensa does not support the a.out format, but the kernel
5 * seems to depend on it.
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_A_OUT_H
15#define _XTENSA_A_OUT_H
16
17/* Note: the kernel needs the a.out definitions, even if only ELF is used. */
18
19#define STACK_TOP TASK_SIZE
20
21struct exec
22{
23 unsigned long a_info;
24 unsigned a_text;
25 unsigned a_data;
26 unsigned a_bss;
27 unsigned a_syms;
28 unsigned a_entry;
29 unsigned a_trsize;
30 unsigned a_drsize;
31};
32
33#endif /* _XTENSA_A_OUT_H */
diff --git a/include/asm-xtensa/atomic.h b/include/asm-xtensa/atomic.h
new file mode 100644
index 000000000000..d72bcb32ba4f
--- /dev/null
+++ b/include/asm-xtensa/atomic.h
@@ -0,0 +1,272 @@
1/*
2 * include/asm-xtensa/atomic.h
3 *
4 * Atomic operations that C can't guarantee us. Useful for resource counting..
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_ATOMIC_H
14#define _XTENSA_ATOMIC_H
15
16#include <linux/config.h>
17#include <linux/stringify.h>
18
19typedef struct { volatile int counter; } atomic_t;
20
21#ifdef __KERNEL__
22#include <asm/processor.h>
23#include <asm/system.h>
24
25#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
26
27/*
28 * This Xtensa implementation assumes that the right mechanism
29 * for exclusion is for locking interrupts to level 1.
30 *
31 * Locking interrupts looks like this:
32 *
33 * rsil a15, 1
34 * <code>
35 * wsr a15, PS
36 * rsync
37 *
38 * Note that a15 is used here because the register allocation
39 * done by the compiler is not guaranteed and a window overflow
40 * may not occur between the rsil and wsr instructions. By using
41 * a15 in the rsil, the machine is guaranteed to be in a state
42 * where no register reference will cause an overflow.
43 */
44
45/**
46 * atomic_read - read atomic variable
47 * @v: pointer of type atomic_t
48 *
49 * Atomically reads the value of @v.
50 */
51#define atomic_read(v) ((v)->counter)
52
53/**
54 * atomic_set - set atomic variable
55 * @v: pointer of type atomic_t
56 * @i: required value
57 *
58 * Atomically sets the value of @v to @i.
59 */
60#define atomic_set(v,i) ((v)->counter = (i))
61
62/**
63 * atomic_add - add integer to atomic variable
64 * @i: integer value to add
65 * @v: pointer of type atomic_t
66 *
67 * Atomically adds @i to @v.
68 */
69extern __inline__ void atomic_add(int i, atomic_t * v)
70{
71 unsigned int vval;
72
73 __asm__ __volatile__(
74 "rsil a15, "__stringify(LOCKLEVEL)"\n\t"
75 "l32i %0, %2, 0 \n\t"
76 "add %0, %0, %1 \n\t"
77 "s32i %0, %2, 0 \n\t"
78 "wsr a15, "__stringify(PS)" \n\t"
79 "rsync \n"
80 : "=&a" (vval)
81 : "a" (i), "a" (v)
82 : "a15", "memory"
83 );
84}
85
86/**
87 * atomic_sub - subtract the atomic variable
88 * @i: integer value to subtract
89 * @v: pointer of type atomic_t
90 *
91 * Atomically subtracts @i from @v.
92 */
93extern __inline__ void atomic_sub(int i, atomic_t *v)
94{
95 unsigned int vval;
96
97 __asm__ __volatile__(
98 "rsil a15, "__stringify(LOCKLEVEL)"\n\t"
99 "l32i %0, %2, 0 \n\t"
100 "sub %0, %0, %1 \n\t"
101 "s32i %0, %2, 0 \n\t"
102 "wsr a15, "__stringify(PS)" \n\t"
103 "rsync \n"
104 : "=&a" (vval)
105 : "a" (i), "a" (v)
106 : "a15", "memory"
107 );
108}
109
110/*
111 * We use atomic_{add|sub}_return to define other functions.
112 */
113
114extern __inline__ int atomic_add_return(int i, atomic_t * v)
115{
116 unsigned int vval;
117
118 __asm__ __volatile__(
119 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
120 "l32i %0, %2, 0 \n\t"
121 "add %0, %0, %1 \n\t"
122 "s32i %0, %2, 0 \n\t"
123 "wsr a15, "__stringify(PS)" \n\t"
124 "rsync \n"
125 : "=&a" (vval)
126 : "a" (i), "a" (v)
127 : "a15", "memory"
128 );
129
130 return vval;
131}
132
133extern __inline__ int atomic_sub_return(int i, atomic_t * v)
134{
135 unsigned int vval;
136
137 __asm__ __volatile__(
138 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
139 "l32i %0, %2, 0 \n\t"
140 "sub %0, %0, %1 \n\t"
141 "s32i %0, %2, 0 \n\t"
142 "wsr a15, "__stringify(PS)" \n\t"
143 "rsync \n"
144 : "=&a" (vval)
145 : "a" (i), "a" (v)
146 : "a15", "memory"
147 );
148
149 return vval;
150}
151
152/**
153 * atomic_sub_and_test - subtract value from variable and test result
154 * @i: integer value to subtract
155 * @v: pointer of type atomic_t
156 *
157 * Atomically subtracts @i from @v and returns
158 * true if the result is zero, or false for all
159 * other cases.
160 */
161#define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0)
162
163/**
164 * atomic_inc - increment atomic variable
165 * @v: pointer of type atomic_t
166 *
167 * Atomically increments @v by 1.
168 */
169#define atomic_inc(v) atomic_add(1,(v))
170
171/**
172 * atomic_inc - increment atomic variable
173 * @v: pointer of type atomic_t
174 *
175 * Atomically increments @v by 1.
176 */
177#define atomic_inc_return(v) atomic_add_return(1,(v))
178
179/**
180 * atomic_dec - decrement atomic variable
181 * @v: pointer of type atomic_t
182 *
183 * Atomically decrements @v by 1.
184 */
185#define atomic_dec(v) atomic_sub(1,(v))
186
187/**
188 * atomic_dec_return - decrement atomic variable
189 * @v: pointer of type atomic_t
190 *
191 * Atomically decrements @v by 1.
192 */
193#define atomic_dec_return(v) atomic_sub_return(1,(v))
194
195/**
196 * atomic_dec_and_test - decrement and test
197 * @v: pointer of type atomic_t
198 *
199 * Atomically decrements @v by 1 and
200 * returns true if the result is 0, or false for all other
201 * cases.
202 */
203#define atomic_dec_and_test(v) (atomic_sub_return(1,(v)) == 0)
204
205/**
206 * atomic_inc_and_test - increment and test
207 * @v: pointer of type atomic_t
208 *
209 * Atomically increments @v by 1
210 * and returns true if the result is zero, or false for all
211 * other cases.
212 */
213#define atomic_inc_and_test(v) (atomic_add_return(1,(v)) == 0)
214
215/**
216 * atomic_add_negative - add and test if negative
217 * @v: pointer of type atomic_t
218 * @i: integer value to add
219 *
220 * Atomically adds @i to @v and returns true
221 * if the result is negative, or false when
222 * result is greater than or equal to zero.
223 */
224#define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0)
225
226
227extern __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
228{
229 unsigned int all_f = -1;
230 unsigned int vval;
231
232 __asm__ __volatile__(
233 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
234 "l32i %0, %2, 0 \n\t"
235 "xor %1, %4, %3 \n\t"
236 "and %0, %0, %4 \n\t"
237 "s32i %0, %2, 0 \n\t"
238 "wsr a15, "__stringify(PS)" \n\t"
239 "rsync \n"
240 : "=&a" (vval), "=a" (mask)
241 : "a" (v), "a" (all_f), "1" (mask)
242 : "a15", "memory"
243 );
244}
245
246extern __inline__ void atomic_set_mask(unsigned int mask, atomic_t *v)
247{
248 unsigned int vval;
249
250 __asm__ __volatile__(
251 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
252 "l32i %0, %2, 0 \n\t"
253 "or %0, %0, %1 \n\t"
254 "s32i %0, %2, 0 \n\t"
255 "wsr a15, "__stringify(PS)" \n\t"
256 "rsync \n"
257 : "=&a" (vval)
258 : "a" (mask), "a" (v)
259 : "a15", "memory"
260 );
261}
262
263/* Atomic operations are already serializing */
264#define smp_mb__before_atomic_dec() barrier()
265#define smp_mb__after_atomic_dec() barrier()
266#define smp_mb__before_atomic_inc() barrier()
267#define smp_mb__after_atomic_inc() barrier()
268
269#endif /* __KERNEL__ */
270
271#endif /* _XTENSA_ATOMIC_H */
272
diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h
new file mode 100644
index 000000000000..d395ef226c32
--- /dev/null
+++ b/include/asm-xtensa/bitops.h
@@ -0,0 +1,446 @@
1/*
2 * include/asm-xtensa/bitops.h
3 *
4 * Atomic operations that C can't guarantee us.Useful for resource counting etc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_BITOPS_H
14#define _XTENSA_BITOPS_H
15
16#ifdef __KERNEL__
17
18#include <asm/processor.h>
19#include <asm/byteorder.h>
20#include <asm/system.h>
21
22#ifdef CONFIG_SMP
23# error SMP not supported on this architecture
24#endif
25
26static __inline__ void set_bit(int nr, volatile void * addr)
27{
28 unsigned long mask = 1 << (nr & 0x1f);
29 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
30 unsigned long flags;
31
32 local_irq_save(flags);
33 *a |= mask;
34 local_irq_restore(flags);
35}
36
37static __inline__ void __set_bit(int nr, volatile unsigned long * addr)
38{
39 unsigned long mask = 1 << (nr & 0x1f);
40 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
41
42 *a |= mask;
43}
44
45static __inline__ void clear_bit(int nr, volatile void * addr)
46{
47 unsigned long mask = 1 << (nr & 0x1f);
48 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
49 unsigned long flags;
50
51 local_irq_save(flags);
52 *a &= ~mask;
53 local_irq_restore(flags);
54}
55
56static __inline__ void __clear_bit(int nr, volatile unsigned long *addr)
57{
58 unsigned long mask = 1 << (nr & 0x1f);
59 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
60
61 *a &= ~mask;
62}
63
64/*
65 * clear_bit() doesn't provide any barrier for the compiler.
66 */
67
68#define smp_mb__before_clear_bit() barrier()
69#define smp_mb__after_clear_bit() barrier()
70
71static __inline__ void change_bit(int nr, volatile void * addr)
72{
73 unsigned long mask = 1 << (nr & 0x1f);
74 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
75 unsigned long flags;
76
77 local_irq_save(flags);
78 *a ^= mask;
79 local_irq_restore(flags);
80}
81
82static __inline__ void __change_bit(int nr, volatile void * addr)
83{
84 unsigned long mask = 1 << (nr & 0x1f);
85 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
86
87 *a ^= mask;
88}
89
90static __inline__ int test_and_set_bit(int nr, volatile void * addr)
91{
92 unsigned long retval;
93 unsigned long mask = 1 << (nr & 0x1f);
94 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
95 unsigned long flags;
96
97 local_irq_save(flags);
98 retval = (mask & *a) != 0;
99 *a |= mask;
100 local_irq_restore(flags);
101
102 return retval;
103}
104
105static __inline__ int __test_and_set_bit(int nr, volatile void * addr)
106{
107 unsigned long retval;
108 unsigned long mask = 1 << (nr & 0x1f);
109 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
110
111 retval = (mask & *a) != 0;
112 *a |= mask;
113
114 return retval;
115}
116
117static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
118{
119 unsigned long retval;
120 unsigned long mask = 1 << (nr & 0x1f);
121 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
122 unsigned long flags;
123
124 local_irq_save(flags);
125 retval = (mask & *a) != 0;
126 *a &= ~mask;
127 local_irq_restore(flags);
128
129 return retval;
130}
131
132static __inline__ int __test_and_clear_bit(int nr, volatile void * addr)
133{
134 unsigned long mask = 1 << (nr & 0x1f);
135 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
136 unsigned long old = *a;
137
138 *a = old & ~mask;
139 return (old & mask) != 0;
140}
141
142static __inline__ int test_and_change_bit(int nr, volatile void * addr)
143{
144 unsigned long retval;
145 unsigned long mask = 1 << (nr & 0x1f);
146 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
147 unsigned long flags;
148
149 local_irq_save(flags);
150
151 retval = (mask & *a) != 0;
152 *a ^= mask;
153 local_irq_restore(flags);
154
155 return retval;
156}
157
158/*
159 * non-atomic version; can be reordered
160 */
161
162static __inline__ int __test_and_change_bit(int nr, volatile void *addr)
163{
164 unsigned long mask = 1 << (nr & 0x1f);
165 unsigned long *a = ((unsigned long *)addr) + (nr >> 5);
166 unsigned long old = *a;
167
168 *a = old ^ mask;
169 return (old & mask) != 0;
170}
171
172static __inline__ int test_bit(int nr, const volatile void *addr)
173{
174 return 1UL & (((const volatile unsigned int *)addr)[nr>>5] >> (nr&31));
175}
176
177#if XCHAL_HAVE_NSAU
178
179static __inline__ int __cntlz (unsigned long x)
180{
181 int lz;
182 asm ("nsau %0, %1" : "=r" (lz) : "r" (x));
183 return 31 - lz;
184}
185
186#else
187
188static __inline__ int __cntlz (unsigned long x)
189{
190 unsigned long sum, x1, x2, x4, x8, x16;
191 x1 = x & 0xAAAAAAAA;
192 x2 = x & 0xCCCCCCCC;
193 x4 = x & 0xF0F0F0F0;
194 x8 = x & 0xFF00FF00;
195 x16 = x & 0xFFFF0000;
196 sum = x2 ? 2 : 0;
197 sum += (x16 != 0) * 16;
198 sum += (x8 != 0) * 8;
199 sum += (x4 != 0) * 4;
200 sum += (x1 != 0);
201
202 return sum;
203}
204
205#endif
206
207/*
208 * ffz: Find first zero in word. Undefined if no zero exists.
209 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
210 */
211
212static __inline__ int ffz(unsigned long x)
213{
214 if ((x = ~x) == 0)
215 return 32;
216 return __cntlz(x & -x);
217}
218
219/*
220 * __ffs: Find first bit set in word. Return 0 for bit 0
221 */
222
223static __inline__ int __ffs(unsigned long x)
224{
225 return __cntlz(x & -x);
226}
227
228/*
229 * ffs: Find first bit set in word. This is defined the same way as
230 * the libc and compiler builtin ffs routines, therefore
231 * differs in spirit from the above ffz (man ffs).
232 */
233
234static __inline__ int ffs(unsigned long x)
235{
236 return __cntlz(x & -x) + 1;
237}
238
239/*
240 * fls: Find last (most-significant) bit set in word.
241 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
242 */
243
244static __inline__ int fls (unsigned int x)
245{
246 return __cntlz(x);
247}
248
249static __inline__ int
250find_next_bit(const unsigned long *addr, int size, int offset)
251{
252 const unsigned long *p = addr + (offset >> 5);
253 unsigned long result = offset & ~31UL;
254 unsigned long tmp;
255
256 if (offset >= size)
257 return size;
258 size -= result;
259 offset &= 31UL;
260 if (offset) {
261 tmp = *p++;
262 tmp &= ~0UL << offset;
263 if (size < 32)
264 goto found_first;
265 if (tmp)
266 goto found_middle;
267 size -= 32;
268 result += 32;
269 }
270 while (size >= 32) {
271 if ((tmp = *p++) != 0)
272 goto found_middle;
273 result += 32;
274 size -= 32;
275 }
276 if (!size)
277 return result;
278 tmp = *p;
279
280found_first:
281 tmp &= ~0UL >> (32 - size);
282 if (tmp == 0UL) /* Are any bits set? */
283 return result + size; /* Nope. */
284found_middle:
285 return result + __ffs(tmp);
286}
287
288/**
289 * find_first_bit - find the first set bit in a memory region
290 * @addr: The address to start the search at
291 * @size: The maximum size to search
292 *
293 * Returns the bit-number of the first set bit, not the number of the byte
294 * containing a bit.
295 */
296
297#define find_first_bit(addr, size) \
298 find_next_bit((addr), (size), 0)
299
300static __inline__ int
301find_next_zero_bit(const unsigned long *addr, int size, int offset)
302{
303 const unsigned long *p = addr + (offset >> 5);
304 unsigned long result = offset & ~31UL;
305 unsigned long tmp;
306
307 if (offset >= size)
308 return size;
309 size -= result;
310 offset &= 31UL;
311 if (offset) {
312 tmp = *p++;
313 tmp |= ~0UL >> (32-offset);
314 if (size < 32)
315 goto found_first;
316 if (~tmp)
317 goto found_middle;
318 size -= 32;
319 result += 32;
320 }
321 while (size & ~31UL) {
322 if (~(tmp = *p++))
323 goto found_middle;
324 result += 32;
325 size -= 32;
326 }
327 if (!size)
328 return result;
329 tmp = *p;
330
331found_first:
332 tmp |= ~0UL << size;
333found_middle:
334 return result + ffz(tmp);
335}
336
337#define find_first_zero_bit(addr, size) \
338 find_next_zero_bit((addr), (size), 0)
339
340#ifdef __XTENSA_EL__
341# define ext2_set_bit(nr,addr) __test_and_set_bit((nr), (addr))
342# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr))
343# define ext2_clear_bit(nr,addr) __test_and_clear_bit((nr), (addr))
344# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr))
345# define ext2_test_bit(nr,addr) test_bit((nr), (addr))
346# define ext2_find_first_zero_bit(addr, size) find_first_zero_bit((addr),(size))
347# define ext2_find_next_zero_bit(addr, size, offset) \
348 find_next_zero_bit((addr), (size), (offset))
349#elif defined(__XTENSA_EB__)
350# define ext2_set_bit(nr,addr) __test_and_set_bit((nr) ^ 0x18, (addr))
351# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr))
352# define ext2_clear_bit(nr,addr) __test_and_clear_bit((nr) ^ 18, (addr))
353# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr))
354# define ext2_test_bit(nr,addr) test_bit((nr) ^ 0x18, (addr))
355# define ext2_find_first_zero_bit(addr, size) \
356 ext2_find_next_zero_bit((addr), (size), 0)
357
358static __inline__ unsigned long ext2_find_next_zero_bit(void *addr, unsigned long size, unsigned long offset)
359{
360 unsigned long *p = ((unsigned long *) addr) + (offset >> 5);
361 unsigned long result = offset & ~31UL;
362 unsigned long tmp;
363
364 if (offset >= size)
365 return size;
366 size -= result;
367 offset &= 31UL;
368 if(offset) {
369 /* We hold the little endian value in tmp, but then the
370 * shift is illegal. So we could keep a big endian value
371 * in tmp, like this:
372 *
373 * tmp = __swab32(*(p++));
374 * tmp |= ~0UL >> (32-offset);
375 *
376 * but this would decrease preformance, so we change the
377 * shift:
378 */
379 tmp = *(p++);
380 tmp |= __swab32(~0UL >> (32-offset));
381 if(size < 32)
382 goto found_first;
383 if(~tmp)
384 goto found_middle;
385 size -= 32;
386 result += 32;
387 }
388 while(size & ~31UL) {
389 if(~(tmp = *(p++)))
390 goto found_middle;
391 result += 32;
392 size -= 32;
393 }
394 if(!size)
395 return result;
396 tmp = *p;
397
398found_first:
399 /* tmp is little endian, so we would have to swab the shift,
400 * see above. But then we have to swab tmp below for ffz, so
401 * we might as well do this here.
402 */
403 return result + ffz(__swab32(tmp) | (~0UL << size));
404found_middle:
405 return result + ffz(__swab32(tmp));
406}
407
408#else
409# error processor byte order undefined!
410#endif
411
412
413#define hweight32(x) generic_hweight32(x)
414#define hweight16(x) generic_hweight16(x)
415#define hweight8(x) generic_hweight8(x)
416
417/*
418 * Find the first bit set in a 140-bit bitmap.
419 * The first 100 bits are unlikely to be set.
420 */
421
422static inline int sched_find_first_bit(const unsigned long *b)
423{
424 if (unlikely(b[0]))
425 return __ffs(b[0]);
426 if (unlikely(b[1]))
427 return __ffs(b[1]) + 32;
428 if (unlikely(b[2]))
429 return __ffs(b[2]) + 64;
430 if (b[3])
431 return __ffs(b[3]) + 96;
432 return __ffs(b[4]) + 128;
433}
434
435
436/* Bitmap functions for the minix filesystem. */
437
438#define minix_test_and_set_bit(nr,addr) test_and_set_bit(nr,addr)
439#define minix_set_bit(nr,addr) set_bit(nr,addr)
440#define minix_test_and_clear_bit(nr,addr) test_and_clear_bit(nr,addr)
441#define minix_test_bit(nr,addr) test_bit(nr,addr)
442#define minix_find_first_zero_bit(addr,size) find_first_zero_bit(addr,size)
443
444#endif /* __KERNEL__ */
445
446#endif /* _XTENSA_BITOPS_H */
diff --git a/include/asm-xtensa/bootparam.h b/include/asm-xtensa/bootparam.h
new file mode 100644
index 000000000000..9983f2c1b7ee
--- /dev/null
+++ b/include/asm-xtensa/bootparam.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-xtensa/bootparam.h
3 *
4 * Definition of the Linux/Xtensa boot parameter structure
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 *
12 * (Concept borrowed from the 68K port)
13 */
14
15#ifndef _XTENSA_BOOTPARAM_H
16#define _XTENSA_BOOTPARAM_H
17
18#define BP_VERSION 0x0001
19
20#define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/
21#define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */
22#define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */
23#define BP_TAG_SERIAL_BAUSRATE 0x1004 /* baud rate of current console. */
24#define BP_TAG_SERIAL_PORT 0x1005 /* serial device of current console */
25
26#define BP_TAG_FIRST 0x7B0B /* first tag with a version number */
27#define BP_TAG_LAST 0x7E0B /* last tag */
28
29#ifndef __ASSEMBLY__
30
31/* All records are aligned to 4 bytes */
32
33typedef struct bp_tag {
34 unsigned short id; /* tag id */
35 unsigned short size; /* size of this record excluding the structure*/
36 unsigned long data[0]; /* data */
37} bp_tag_t;
38
39typedef struct meminfo {
40 unsigned long type;
41 unsigned long start;
42 unsigned long end;
43} meminfo_t;
44
45#define SYSMEM_BANKS_MAX 5
46
47#define MEMORY_TYPE_CONVENTIONAL 0x1000
48#define MEMORY_TYPE_NONE 0x2000
49
50typedef struct sysmem_info {
51 int nr_banks;
52 meminfo_t bank[SYSMEM_BANKS_MAX];
53} sysmem_info_t;
54
55extern sysmem_info_t sysmem;
56
57#endif
58#endif
59
60
61
diff --git a/include/asm-xtensa/bug.h b/include/asm-xtensa/bug.h
new file mode 100644
index 000000000000..56703659b204
--- /dev/null
+++ b/include/asm-xtensa/bug.h
@@ -0,0 +1,41 @@
1/*
2 * include/asm-xtensa/bug.h
3 *
4 * Macros to cause a 'bug' message.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_BUG_H
14#define _XTENSA_BUG_H
15
16#include <linux/stringify.h>
17
18#define ILL __asm__ __volatile__ (".byte 0,0,0\n")
19
20#ifdef CONFIG_KALLSYMS
21# define BUG() do { \
22 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
23 ILL; \
24} while (0)
25#else
26# define BUG() do { \
27 printk("kernel BUG!\n"); \
28 ILL; \
29} while (0)
30#endif
31
32#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
33#define PAGE_BUG(page) do { BUG(); } while (0)
34#define WARN_ON(condition) do { \
35 if (unlikely((condition)!=0)) { \
36 printk ("Warning in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
37 dump_stack(); \
38 } \
39} while (0)
40
41#endif /* _XTENSA_BUG_H */
diff --git a/include/asm-xtensa/bugs.h b/include/asm-xtensa/bugs.h
new file mode 100644
index 000000000000..c42285320133
--- /dev/null
+++ b/include/asm-xtensa/bugs.h
@@ -0,0 +1,22 @@
1/*
2 * include/asm-xtensa/bugs.h
3 *
4 * This is included by init/main.c to check for architecture-dependent bugs.
5 *
6 * Xtensa processors don't have any bugs. :)
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details.
11 */
12
13#ifndef _XTENSA_BUGS_H
14#define _XTENSA_BUGS_H
15
16#include <asm/processor.h>
17
18static void __init check_bugs(void)
19{
20}
21
22#endif /* _XTENSA_BUGS_H */
diff --git a/include/asm-xtensa/byteorder.h b/include/asm-xtensa/byteorder.h
new file mode 100644
index 000000000000..0b1552569aae
--- /dev/null
+++ b/include/asm-xtensa/byteorder.h
@@ -0,0 +1,82 @@
1/*
2 * include/asm-xtensa/byteorder.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_BYTEORDER_H
12#define _XTENSA_BYTEORDER_H
13
14#include <asm/processor.h>
15#include <asm/types.h>
16
17static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
18{
19 __u32 res;
20 /* instruction sequence from Xtensa ISA release 2/2000 */
21 __asm__("ssai 8 \n\t"
22 "srli %0, %1, 16 \n\t"
23 "src %0, %0, %1 \n\t"
24 "src %0, %0, %0 \n\t"
25 "src %0, %1, %0 \n"
26 : "=&a" (res)
27 : "a" (x)
28 );
29 return res;
30}
31
32static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
33{
34 /* Given that 'short' values are signed (i.e., can be negative),
35 * we cannot assume that the upper 16-bits of the register are
36 * zero. We are careful to mask values after shifting.
37 */
38
39 /* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc
40 * inserts an extui instruction after putting this function inline
41 * to ensure that it uses only the least-significant 16 bits of
42 * the result. xt-xcc doesn't use an extui, but assumes the
43 * __asm__ macro follows convention that the upper 16 bits of an
44 * 'unsigned short' result are still zero. This macro doesn't
45 * follow convention; indeed, it leaves garbage in the upport 16
46 * bits of the register.
47
48 * Declaring the temporary variables 'res' and 'tmp' to be 32-bit
49 * types while the return type of the function is a 16-bit type
50 * forces both compilers to insert exactly one extui instruction
51 * (or equivalent) to mask off the upper 16 bits. */
52
53 __u32 res;
54 __u32 tmp;
55
56 __asm__("extui %1, %2, 8, 8\n\t"
57 "slli %0, %2, 8 \n\t"
58 "or %0, %0, %1 \n"
59 : "=&a" (res), "=&a" (tmp)
60 : "a" (x)
61 );
62
63 return res;
64}
65
66#define __arch__swab32(x) ___arch__swab32(x)
67#define __arch__swab16(x) ___arch__swab16(x)
68
69#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
70# define __BYTEORDER_HAS_U64__
71# define __SWAB_64_THRU_32__
72#endif
73
74#ifdef __XTENSA_EL__
75# include <linux/byteorder/little_endian.h>
76#elif defined(__XTENSA_EB__)
77# include <linux/byteorder/big_endian.h>
78#else
79# error processor byte order undefined!
80#endif
81
82#endif /* __ASM_XTENSA_BYTEORDER_H */
diff --git a/include/asm-xtensa/cache.h b/include/asm-xtensa/cache.h
new file mode 100644
index 000000000000..5aae3f12407c
--- /dev/null
+++ b/include/asm-xtensa/cache.h
@@ -0,0 +1,32 @@
1/*
2 * include/asm-xtensa/cacheflush.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 * 2 of the License, or (at your option) any later version.
8 *
9 * (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_CACHE_H
13#define _XTENSA_CACHE_H
14
15#include <xtensa/config/core.h>
16
17#if XCHAL_ICACHE_SIZE > 0
18# if (XCHAL_ICACHE_SIZE % (XCHAL_ICACHE_LINESIZE*XCHAL_ICACHE_WAYS*4)) != 0
19# error cache configuration outside expected/supported range!
20# endif
21#endif
22
23#if XCHAL_DCACHE_SIZE > 0
24# if (XCHAL_DCACHE_SIZE % (XCHAL_DCACHE_LINESIZE*XCHAL_DCACHE_WAYS*4)) != 0
25# error cache configuration outside expected/supported range!
26# endif
27#endif
28
29#define L1_CACHE_SHIFT XCHAL_CACHE_LINEWIDTH_MAX
30#define L1_CACHE_BYTES XCHAL_CACHE_LINESIZE_MAX
31
32#endif /* _XTENSA_CACHE_H */
diff --git a/include/asm-xtensa/cacheflush.h b/include/asm-xtensa/cacheflush.h
new file mode 100644
index 000000000000..44a36e087844
--- /dev/null
+++ b/include/asm-xtensa/cacheflush.h
@@ -0,0 +1,122 @@
1/*
2 * include/asm-xtensa/cacheflush.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CACHEFLUSH_H
12#define _XTENSA_CACHEFLUSH_H
13
14#ifdef __KERNEL__
15
16#include <linux/mm.h>
17#include <asm/processor.h>
18#include <asm/page.h>
19
20/*
21 * flush and invalidate data cache, invalidate instruction cache:
22 *
23 * __flush_invalidate_cache_all()
24 * __flush_invalidate_cache_range(from,sze)
25 *
26 * invalidate data or instruction cache:
27 *
28 * __invalidate_icache_all()
29 * __invalidate_icache_page(adr)
30 * __invalidate_dcache_page(adr)
31 * __invalidate_icache_range(from,size)
32 * __invalidate_dcache_range(from,size)
33 *
34 * flush data cache:
35 *
36 * __flush_dcache_page(adr)
37 *
38 * flush and invalidate data cache:
39 *
40 * __flush_invalidate_dcache_all()
41 * __flush_invalidate_dcache_page(adr)
42 * __flush_invalidate_dcache_range(from,size)
43 */
44
45extern void __flush_invalidate_cache_all(void);
46extern void __flush_invalidate_cache_range(unsigned long, unsigned long);
47extern void __flush_invalidate_dcache_all(void);
48extern void __invalidate_icache_all(void);
49
50extern void __invalidate_dcache_page(unsigned long);
51extern void __invalidate_icache_page(unsigned long);
52extern void __invalidate_icache_range(unsigned long, unsigned long);
53extern void __invalidate_dcache_range(unsigned long, unsigned long);
54
55#if XCHAL_DCACHE_IS_WRITEBACK
56extern void __flush_dcache_page(unsigned long);
57extern void __flush_invalidate_dcache_page(unsigned long);
58extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
59#else
60# define __flush_dcache_page(p) do { } while(0)
61# define __flush_invalidate_dcache_page(p) do { } while(0)
62# define __flush_invalidate_dcache_range(p,s) do { } while(0)
63#endif
64
65/*
66 * We have physically tagged caches - nothing to do here -
67 * unless we have cache aliasing.
68 *
69 * Pages can get remapped. Because this might change the 'color' of that page,
70 * we have to flush the cache before the PTE is changed.
71 * (see also Documentation/cachetlb.txt)
72 */
73
74#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
75
76#define flush_cache_all() __flush_invalidate_cache_all();
77#define flush_cache_mm(mm) __flush_invalidate_cache_all();
78
79#define flush_cache_vmap(start,end) __flush_invalidate_cache_all();
80#define flush_cache_vunmap(start,end) __flush_invalidate_cache_all();
81
82extern void flush_dcache_page(struct page*);
83
84extern void flush_cache_range(struct vm_area_struct*, ulong, ulong);
85extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long);
86
87#else
88
89#define flush_cache_all() do { } while (0)
90#define flush_cache_mm(mm) do { } while (0)
91
92#define flush_cache_vmap(start,end) do { } while (0)
93#define flush_cache_vunmap(start,end) do { } while (0)
94
95#define flush_dcache_page(page) do { } while (0)
96
97#define flush_cache_page(vma,addr,pfn) do { } while (0)
98#define flush_cache_range(vma,start,end) do { } while (0)
99
100#endif
101
102#define flush_icache_range(start,end) \
103 __invalidate_icache_range(start,(end)-(start))
104
105/* This is not required, see Documentation/cachetlb.txt */
106
107#define flush_icache_page(vma,page) do { } while(0)
108
109#define flush_dcache_mmap_lock(mapping) do { } while (0)
110#define flush_dcache_mmap_unlock(mapping) do { } while (0)
111
112
113#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
114 memcpy(dst, src, len)
115
116#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
117 memcpy(dst, src, len)
118
119#endif /* __KERNEL__ */
120
121#endif /* _XTENSA_CACHEFLUSH_H */
122
diff --git a/include/asm-xtensa/checksum.h b/include/asm-xtensa/checksum.h
new file mode 100644
index 000000000000..1a00fad19929
--- /dev/null
+++ b/include/asm-xtensa/checksum.h
@@ -0,0 +1,264 @@
1/*
2 * include/asm-xtensa/checksum.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CHECKSUM_H
12#define _XTENSA_CHECKSUM_H
13
14#include <linux/config.h>
15#include <linux/in6.h>
16#include <xtensa/config/core.h>
17
18/*
19 * computes the checksum of a memory block at buff, length len,
20 * and adds in "sum" (32-bit)
21 *
22 * returns a 32-bit number suitable for feeding into itself
23 * or csum_tcpudp_magic
24 *
25 * this function must be called with even lengths, except
26 * for the last fragment, which may be odd
27 *
28 * it's best to have buff aligned on a 32-bit boundary
29 */
30asmlinkage unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
31
32/*
33 * the same as csum_partial, but copies from src while it
34 * checksums, and handles user-space pointer exceptions correctly, when needed.
35 *
36 * here even more important to align src and dst on a 32-bit (or even
37 * better 64-bit) boundary
38 */
39
40asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, int len, int sum,
41 int *src_err_ptr, int *dst_err_ptr);
42
43/*
44 * Note: when you get a NULL pointer exception here this means someone
45 * passed in an incorrect kernel address to one of these functions.
46 *
47 * If you use these functions directly please don't forget the
48 * verify_area().
49 */
50extern __inline__
51unsigned int csum_partial_copy_nocheck ( const char *src, char *dst,
52 int len, int sum)
53{
54 return csum_partial_copy_generic ( src, dst, len, sum, NULL, NULL);
55}
56
57extern __inline__
58unsigned int csum_partial_copy_from_user ( const char *src, char *dst,
59 int len, int sum, int *err_ptr)
60{
61 return csum_partial_copy_generic ( src, dst, len, sum, err_ptr, NULL);
62}
63
64/*
65 * These are the old (and unsafe) way of doing checksums, a warning message will be
66 * printed if they are used and an exeption occurs.
67 *
68 * these functions should go away after some time.
69 */
70
71#define csum_partial_copy_fromuser csum_partial_copy
72unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
73
74/*
75 * Fold a partial checksum
76 */
77
78static __inline__ unsigned int csum_fold(unsigned int sum)
79{
80 unsigned int __dummy;
81 __asm__("extui %1, %0, 16, 16\n\t"
82 "extui %0 ,%0, 0, 16\n\t"
83 "add %0, %0, %1\n\t"
84 "slli %1, %0, 16\n\t"
85 "add %0, %0, %1\n\t"
86 "extui %0, %0, 16, 16\n\t"
87 "neg %0, %0\n\t"
88 "addi %0, %0, -1\n\t"
89 "extui %0, %0, 0, 16\n\t"
90 : "=r" (sum), "=&r" (__dummy)
91 : "0" (sum));
92 return sum;
93}
94
95/*
96 * This is a version of ip_compute_csum() optimized for IP headers,
97 * which always checksum on 4 octet boundaries.
98 */
99static __inline__ unsigned short ip_fast_csum(unsigned char * iph, unsigned int ihl)
100{
101 unsigned int sum, tmp, endaddr;
102
103 __asm__ __volatile__(
104 "sub %0, %0, %0\n\t"
105#if XCHAL_HAVE_LOOPS
106 "loopgtz %2, 2f\n\t"
107#else
108 "beqz %2, 2f\n\t"
109 "slli %4, %2, 2\n\t"
110 "add %4, %4, %1\n\t"
111 "0:\t"
112#endif
113 "l32i %3, %1, 0\n\t"
114 "add %0, %0, %3\n\t"
115 "bgeu %0, %3, 1f\n\t"
116 "addi %0, %0, 1\n\t"
117 "1:\t"
118 "addi %1, %1, 4\n\t"
119#if !XCHAL_HAVE_LOOPS
120 "blt %1, %4, 0b\n\t"
121#endif
122 "2:\t"
123 /* Since the input registers which are loaded with iph and ihl
124 are modified, we must also specify them as outputs, or gcc
125 will assume they contain their original values. */
126 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr)
127 : "1" (iph), "2" (ihl));
128
129 return csum_fold(sum);
130}
131
132static __inline__ unsigned long csum_tcpudp_nofold(unsigned long saddr,
133 unsigned long daddr,
134 unsigned short len,
135 unsigned short proto,
136 unsigned int sum)
137{
138
139#ifdef __XTENSA_EL__
140 unsigned long len_proto = (ntohs(len)<<16)+proto*256;
141#elif defined(__XTENSA_EB__)
142 unsigned long len_proto = (proto<<16)+len;
143#else
144# error processor byte order undefined!
145#endif
146 __asm__("add %0, %0, %1\n\t"
147 "bgeu %0, %1, 1f\n\t"
148 "addi %0, %0, 1\n\t"
149 "1:\t"
150 "add %0, %0, %2\n\t"
151 "bgeu %0, %2, 1f\n\t"
152 "addi %0, %0, 1\n\t"
153 "1:\t"
154 "add %0, %0, %3\n\t"
155 "bgeu %0, %3, 1f\n\t"
156 "addi %0, %0, 1\n\t"
157 "1:\t"
158 : "=r" (sum), "=r" (len_proto)
159 : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum));
160 return sum;
161}
162
163/*
164 * computes the checksum of the TCP/UDP pseudo-header
165 * returns a 16-bit checksum, already complemented
166 */
167static __inline__ unsigned short int csum_tcpudp_magic(unsigned long saddr,
168 unsigned long daddr,
169 unsigned short len,
170 unsigned short proto,
171 unsigned int sum)
172{
173 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
174}
175
176/*
177 * this routine is used for miscellaneous IP-like checksums, mainly
178 * in icmp.c
179 */
180
181static __inline__ unsigned short ip_compute_csum(unsigned char * buff, int len)
182{
183 return csum_fold (csum_partial(buff, len, 0));
184}
185
186#define _HAVE_ARCH_IPV6_CSUM
187static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr,
188 struct in6_addr *daddr,
189 __u32 len,
190 unsigned short proto,
191 unsigned int sum)
192{
193 unsigned int __dummy;
194 __asm__("l32i %1, %2, 0\n\t"
195 "add %0, %0, %1\n\t"
196 "bgeu %0, %1, 1f\n\t"
197 "addi %0, %0, 1\n\t"
198 "1:\t"
199 "l32i %1, %2, 4\n\t"
200 "add %0, %0, %1\n\t"
201 "bgeu %0, %1, 1f\n\t"
202 "addi %0, %0, 1\n\t"
203 "1:\t"
204 "l32i %1, %2, 8\n\t"
205 "add %0, %0, %1\n\t"
206 "bgeu %0, %1, 1f\n\t"
207 "addi %0, %0, 1\n\t"
208 "1:\t"
209 "l32i %1, %2, 12\n\t"
210 "add %0, %0, %1\n\t"
211 "bgeu %0, %1, 1f\n\t"
212 "addi %0, %0, 1\n\t"
213 "1:\t"
214 "l32i %1, %3, 0\n\t"
215 "add %0, %0, %1\n\t"
216 "bgeu %0, %1, 1f\n\t"
217 "addi %0, %0, 1\n\t"
218 "1:\t"
219 "l32i %1, %3, 4\n\t"
220 "add %0, %0, %1\n\t"
221 "bgeu %0, %1, 1f\n\t"
222 "addi %0, %0, 1\n\t"
223 "1:\t"
224 "l32i %1, %3, 8\n\t"
225 "add %0, %0, %1\n\t"
226 "bgeu %0, %1, 1f\n\t"
227 "addi %0, %0, 1\n\t"
228 "1:\t"
229 "l32i %1, %3, 12\n\t"
230 "add %0, %0, %1\n\t"
231 "bgeu %0, %1, 1f\n\t"
232 "addi %0, %0, 1\n\t"
233 "1:\t"
234 "add %0, %0, %4\n\t"
235 "bgeu %0, %4, 1f\n\t"
236 "addi %0, %0, 1\n\t"
237 "1:\t"
238 "add %0, %0, %5\n\t"
239 "bgeu %0, %5, 1f\n\t"
240 "addi %0, %0, 1\n\t"
241 "1:\t"
242 : "=r" (sum), "=&r" (__dummy)
243 : "r" (saddr), "r" (daddr),
244 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum));
245
246 return csum_fold(sum);
247}
248
249/*
250 * Copy and checksum to user
251 */
252#define HAVE_CSUM_COPY_USER
253static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
254 int len, int sum, int *err_ptr)
255{
256 if (access_ok(VERIFY_WRITE, dst, len))
257 return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
258
259 if (len)
260 *err_ptr = -EFAULT;
261
262 return -1; /* invalid checksum */
263}
264#endif
diff --git a/include/asm-xtensa/coprocessor.h b/include/asm-xtensa/coprocessor.h
new file mode 100644
index 000000000000..a91b96dc0efe
--- /dev/null
+++ b/include/asm-xtensa/coprocessor.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-xtensa/cpextra.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_COPROCESSOR_H
12#define _XTENSA_COPROCESSOR_H
13
14#include <xtensa/config/core.h>
15
16#define XTOFS(last_start,last_size,align) \
17 ((last_start+last_size+align-1) & -align)
18
19#define XTENSA_CP_EXTRA_OFFSET 0
20#define XTENSA_CP_EXTRA_ALIGN XCHAL_EXTRA_SA_ALIGN
21
22#define XTENSA_CPE_CP0_OFFSET \
23 XTOFS(XTENSA_CP_EXTRA_OFFSET, XCHAL_EXTRA_SA_SIZE, XCHAL_CP0_SA_ALIGN)
24#define XTENSA_CPE_CP1_OFFSET \
25 XTOFS(XTENSA_CPE_CP0_OFFSET, XCHAL_CP0_SA_SIZE, XCHAL_CP1_SA_ALIGN)
26#define XTENSA_CPE_CP2_OFFSET \
27 XTOFS(XTENSA_CPE_CP1_OFFSET, XCHAL_CP1_SA_SIZE, XCHAL_CP2_SA_ALIGN)
28#define XTENSA_CPE_CP3_OFFSET \
29 XTOFS(XTENSA_CPE_CP2_OFFSET, XCHAL_CP2_SA_SIZE, XCHAL_CP3_SA_ALIGN)
30#define XTENSA_CPE_CP4_OFFSET \
31 XTOFS(XTENSA_CPE_CP3_OFFSET, XCHAL_CP3_SA_SIZE, XCHAL_CP4_SA_ALIGN)
32#define XTENSA_CPE_CP5_OFFSET \
33 XTOFS(XTENSA_CPE_CP4_OFFSET, XCHAL_CP4_SA_SIZE, XCHAL_CP5_SA_ALIGN)
34#define XTENSA_CPE_CP6_OFFSET \
35 XTOFS(XTENSA_CPE_CP5_OFFSET, XCHAL_CP5_SA_SIZE, XCHAL_CP6_SA_ALIGN)
36#define XTENSA_CPE_CP7_OFFSET \
37 XTOFS(XTENSA_CPE_CP6_OFFSET, XCHAL_CP6_SA_SIZE, XCHAL_CP7_SA_ALIGN)
38#define XTENSA_CP_EXTRA_SIZE \
39 XTOFS(XTENSA_CPE_CP7_OFFSET, XCHAL_CP7_SA_SIZE, 16)
40
41#if XCHAL_CP_NUM > 0
42# ifndef __ASSEMBLY__
43/*
44 * Tasks that own contents of (last user) each coprocessor.
45 * Entries are 0 for not-owned or non-existent coprocessors.
46 * Note: The size of this structure is fixed to 8 bytes in entry.S
47 */
48typedef struct {
49 struct task_struct *owner; /* owner */
50 int offset; /* offset in cpextra space. */
51} coprocessor_info_t;
52# else
53# define COPROCESSOR_INFO_OWNER 0
54# define COPROCESSOR_INFO_OFFSET 4
55# define COPROCESSOR_INFO_SIZE 8
56# endif
57#endif
58
59
60#ifndef __ASSEMBLY__
61# if XCHAL_CP_NUM > 0
62struct task_struct;
63extern void release_coprocessors (struct task_struct*);
64extern void save_coprocessor_registers(void*, int);
65# else
66# define release_coprocessors(task)
67# endif
68#endif
69
70#endif /* _XTENSA_COPROCESSOR_H */
diff --git a/include/asm-xtensa/cpumask.h b/include/asm-xtensa/cpumask.h
new file mode 100644
index 000000000000..ebeede397db3
--- /dev/null
+++ b/include/asm-xtensa/cpumask.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/cpumask.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CPUMASK_H
12#define _XTENSA_CPUMASK_H
13
14#include <asm-generic/cpumask.h>
15
16#endif /* _XTENSA_CPUMASK_H */
diff --git a/include/asm-xtensa/cputime.h b/include/asm-xtensa/cputime.h
new file mode 100644
index 000000000000..a7fb864a50ae
--- /dev/null
+++ b/include/asm-xtensa/cputime.h
@@ -0,0 +1,6 @@
1#ifndef _XTENSA_CPUTIME_H
2#define _XTENSA_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* _XTENSA_CPUTIME_H */
diff --git a/include/asm-xtensa/current.h b/include/asm-xtensa/current.h
new file mode 100644
index 000000000000..8d1eb5d78649
--- /dev/null
+++ b/include/asm-xtensa/current.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-xtensa/current.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CURRENT_H
12#define _XTENSA_CURRENT_H
13
14#ifndef __ASSEMBLY__
15
16#include <linux/thread_info.h>
17
18struct task_struct;
19
20static inline struct task_struct *get_current(void)
21{
22 return current_thread_info()->task;
23}
24
25#define current get_current()
26
27#else
28
29#define CURRENT_SHIFT 13
30
31#define GET_CURRENT(reg,sp) \
32 GET_THREAD_INFO(reg,sp); \
33 l32i reg, reg, TI_TASK \
34
35#endif
36
37
38#endif /* XTENSA_CURRENT_H */
diff --git a/include/asm-xtensa/delay.h b/include/asm-xtensa/delay.h
new file mode 100644
index 000000000000..0a123d53a636
--- /dev/null
+++ b/include/asm-xtensa/delay.h
@@ -0,0 +1,50 @@
1/*
2 * include/asm-xtensa/delay.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 *
10 */
11
12#ifndef _XTENSA_DELAY_H
13#define _XTENSA_DELAY_H
14
15#include <linux/config.h>
16#include <asm/processor.h>
17#include <asm/param.h>
18
19extern unsigned long loops_per_jiffy;
20
21extern __inline__ void __delay(unsigned long loops)
22{
23 /* 2 cycles per loop. */
24 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
25 : "=r" (loops) : "0" (loops));
26}
27
28static __inline__ u32 xtensa_get_ccount(void)
29{
30 u32 ccount;
31 asm volatile ("rsr %0, 234; # CCOUNT\n" : "=r" (ccount));
32 return ccount;
33}
34
35/* For SMP/NUMA systems, change boot_cpu_data to something like
36 * local_cpu_data->... where local_cpu_data points to the current
37 * cpu. */
38
39static __inline__ void udelay (unsigned long usecs)
40{
41 unsigned long start = xtensa_get_ccount();
42 unsigned long cycles = usecs * (loops_per_jiffy / (1000000UL / HZ));
43
44 /* Note: all variables are unsigned (can wrap around)! */
45 while (((unsigned long)xtensa_get_ccount()) - start < cycles)
46 ;
47}
48
49#endif
50
diff --git a/include/asm-xtensa/div64.h b/include/asm-xtensa/div64.h
new file mode 100644
index 000000000000..c4a105776383
--- /dev/null
+++ b/include/asm-xtensa/div64.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-xtensa/div64.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DIV64_H
12#define _XTENSA_DIV64_H
13
14#define do_div(n,base) ({ \
15 int __res = n % ((unsigned int) base); \
16 n /= (unsigned int) base; \
17 __res; })
18
19#endif
diff --git a/include/asm-xtensa/dma-mapping.h b/include/asm-xtensa/dma-mapping.h
new file mode 100644
index 000000000000..e86a206f1209
--- /dev/null
+++ b/include/asm-xtensa/dma-mapping.h
@@ -0,0 +1,182 @@
1/*
2 * include/asm-xtensa/dma_mapping.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DMA_MAPPING_H
12#define _XTENSA_DMA_MAPPING_H
13
14#include <asm/scatterlist.h>
15#include <asm/cache.h>
16#include <asm/io.h>
17#include <linux/mm.h>
18
19/*
20 * DMA-consistent mapping functions.
21 */
22
23extern void *consistent_alloc(int, size_t, dma_addr_t, unsigned long);
24extern void consistent_free(void*, size_t, dma_addr_t);
25extern void consistent_sync(void*, size_t, int);
26
27#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
28#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
29
30void *dma_alloc_coherent(struct device *dev, size_t size,
31 dma_addr_t *dma_handle, int flag);
32
33void dma_free_coherent(struct device *dev, size_t size,
34 void *vaddr, dma_addr_t dma_handle);
35
36static inline dma_addr_t
37dma_map_single(struct device *dev, void *ptr, size_t size,
38 enum dma_data_direction direction)
39{
40 BUG_ON(direction == DMA_NONE);
41 consistent_sync(ptr, size, direction);
42 return virt_to_phys(ptr);
43}
44
45static inline void
46dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
47 enum dma_data_direction direction)
48{
49 BUG_ON(direction == DMA_NONE);
50}
51
52static inline int
53dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
54 enum dma_data_direction direction)
55{
56 int i;
57
58 BUG_ON(direction == DMA_NONE);
59
60 for (i = 0; i < nents; i++, sg++ ) {
61 BUG_ON(!sg->page);
62
63 sg->dma_address = page_to_phys(sg->page) + sg->offset;
64 consistent_sync(page_address(sg->page) + sg->offset,
65 sg->length, direction);
66 }
67
68 return nents;
69}
70
71static inline dma_addr_t
72dma_map_page(struct device *dev, struct page *page, unsigned long offset,
73 size_t size, enum dma_data_direction direction)
74{
75 BUG_ON(direction == DMA_NONE);
76 return (dma_addr_t)(page_to_pfn(page)) * PAGE_SIZE + offset;
77}
78
79static inline void
80dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
81 enum dma_data_direction direction)
82{
83 BUG_ON(direction == DMA_NONE);
84}
85
86
87static inline void
88dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
89 enum dma_data_direction direction)
90{
91 BUG_ON(direction == DMA_NONE);
92}
93
94static inline void
95dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
96 enum dma_data_direction direction)
97{
98 consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
99}
100
101static inline void
102dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
103 enum dma_data_direction direction)
104{
105 consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
106}
107
108static inline void
109dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
110 unsigned long offset, size_t size,
111 enum dma_data_direction direction)
112{
113
114 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
115}
116
117static inline void
118dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
119 unsigned long offset, size_t size,
120 enum dma_data_direction direction)
121{
122
123 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
124}
125static inline void
126dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
127 enum dma_data_direction dir)
128{
129 int i;
130 for (i = 0; i < nelems; i++, sg++)
131 consistent_sync(page_address(sg->page) + sg->offset,
132 sg->length, dir);
133}
134
135static inline void
136dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
137 enum dma_data_direction dir)
138{
139 int i;
140 for (i = 0; i < nelems; i++, sg++)
141 consistent_sync(page_address(sg->page) + sg->offset,
142 sg->length, dir);
143}
144static inline int
145dma_mapping_error(dma_addr_t dma_addr)
146{
147 return 0;
148}
149
150static inline int
151dma_supported(struct device *dev, u64 mask)
152{
153 return 1;
154}
155
156static inline int
157dma_set_mask(struct device *dev, u64 mask)
158{
159 if(!dev->dma_mask || !dma_supported(dev, mask))
160 return -EIO;
161
162 *dev->dma_mask = mask;
163
164 return 0;
165}
166
167static inline int
168dma_get_cache_alignment(void)
169{
170 return L1_CACHE_BYTES;
171}
172
173#define dma_is_consistent(d) (1)
174
175static inline void
176dma_cache_sync(void *vaddr, size_t size,
177 enum dma_data_direction direction)
178{
179 consistent_sync(vaddr, size, direction);
180}
181
182#endif /* _XTENSA_DMA_MAPPING_H */
diff --git a/include/asm-xtensa/dma.h b/include/asm-xtensa/dma.h
new file mode 100644
index 000000000000..1c22b0234586
--- /dev/null
+++ b/include/asm-xtensa/dma.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-xtensa/dma.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DMA_H
12#define _XTENSA_DMA_H
13
14#include <linux/config.h>
15#include <asm/io.h> /* need byte IO */
16#include <xtensa/config/core.h>
17
18/*
19 * This is only to be defined if we have PC-like DMA.
20 * By default this is not true on an Xtensa processor,
21 * however on boards with a PCI bus, such functionality
22 * might be emulated externally.
23 *
24 * NOTE: there still exists driver code that assumes
25 * this is defined, eg. drivers/sound/soundcard.c (as of 2.4).
26 */
27#define MAX_DMA_CHANNELS 8
28
29/*
30 * The maximum virtual address to which DMA transfers
31 * can be performed on this platform.
32 *
33 * NOTE: This is board (platform) specific, not processor-specific!
34 *
35 * NOTE: This assumes DMA transfers can only be performed on
36 * the section of physical memory contiguously mapped in virtual
37 * space for the kernel. For the Xtensa architecture, this
38 * means the maximum possible size of this DMA area is
39 * the size of the statically mapped kernel segment
40 * (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB.
41 *
42 * NOTE: When the entire KSEG area is DMA capable, we substract
43 * one from the max address so that the virt_to_phys() macro
44 * works correctly on the address (otherwise the address
45 * enters another area, and virt_to_phys() may not return
46 * the value desired).
47 */
48#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KSEG_CACHED_SIZE - 1)
49
50/* Reserve and release a DMA channel */
51extern int request_dma(unsigned int dmanr, const char * device_id);
52extern void free_dma(unsigned int dmanr);
53
54#ifdef CONFIG_PCI
55extern int isa_dma_bridge_buggy;
56#else
57#define isa_dma_bridge_buggy (0)
58#endif
59
60
61#endif
diff --git a/include/asm-xtensa/elf.h b/include/asm-xtensa/elf.h
new file mode 100644
index 000000000000..64f1f53874fe
--- /dev/null
+++ b/include/asm-xtensa/elf.h
@@ -0,0 +1,222 @@
1/*
2 * include/asm-xtensa/elf.h
3 *
4 * ELF register definitions
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_ELF_H
14#define _XTENSA_ELF_H
15
16#include <asm/ptrace.h>
17#include <asm/coprocessor.h>
18#include <xtensa/config/core.h>
19
20/* Xtensa processor ELF architecture-magic number */
21
22#define EM_XTENSA 94
23#define EM_XTENSA_OLD 0xABC7
24
25/* ELF register definitions. This is needed for core dump support. */
26
27/*
28 * elf_gregset_t contains the application-level state in the following order:
29 * Processor info: config_version, cpuxy
30 * Processor state: pc, ps, exccause, excvaddr, wb, ws,
31 * lbeg, lend, lcount, sar
32 * GP regs: ar0 - arXX
33 */
34
35typedef unsigned long elf_greg_t;
36
37typedef struct {
38 elf_greg_t xchal_config_id0;
39 elf_greg_t xchal_config_id1;
40 elf_greg_t cpux;
41 elf_greg_t cpuy;
42 elf_greg_t pc;
43 elf_greg_t ps;
44 elf_greg_t exccause;
45 elf_greg_t excvaddr;
46 elf_greg_t windowbase;
47 elf_greg_t windowstart;
48 elf_greg_t lbeg;
49 elf_greg_t lend;
50 elf_greg_t lcount;
51 elf_greg_t sar;
52 elf_greg_t syscall;
53 elf_greg_t ar[XCHAL_NUM_AREGS];
54} xtensa_gregset_t;
55
56#define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
57
58typedef elf_greg_t elf_gregset_t[ELF_NGREG];
59
60/*
61 * Compute the size of the coprocessor and extra state layout (register info)
62 * table (in bytes).
63 * This is actually the maximum size of the table, as opposed to the size,
64 * which is available from the _xtensa_reginfo_table_size global variable.
65 *
66 * (See also arch/xtensa/kernel/coprocessor.S)
67 *
68 */
69
70#ifndef XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM
71# define XTENSA_CPE_LTABLE_SIZE 0
72#else
73# define XTENSA_CPE_SEGMENT(num) (num ? (1+num) : 0)
74# define XTENSA_CPE_LTABLE_ENTRIES \
75 ( XTENSA_CPE_SEGMENT(XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM) \
76 + XTENSA_CPE_SEGMENT(XCHAL_CP0_SA_CONTENTS_LIBDB_NUM) \
77 + XTENSA_CPE_SEGMENT(XCHAL_CP1_SA_CONTENTS_LIBDB_NUM) \
78 + XTENSA_CPE_SEGMENT(XCHAL_CP2_SA_CONTENTS_LIBDB_NUM) \
79 + XTENSA_CPE_SEGMENT(XCHAL_CP3_SA_CONTENTS_LIBDB_NUM) \
80 + XTENSA_CPE_SEGMENT(XCHAL_CP4_SA_CONTENTS_LIBDB_NUM) \
81 + XTENSA_CPE_SEGMENT(XCHAL_CP5_SA_CONTENTS_LIBDB_NUM) \
82 + XTENSA_CPE_SEGMENT(XCHAL_CP6_SA_CONTENTS_LIBDB_NUM) \
83 + XTENSA_CPE_SEGMENT(XCHAL_CP7_SA_CONTENTS_LIBDB_NUM) \
84 + 1 /* final entry */ \
85 )
86# define XTENSA_CPE_LTABLE_SIZE (XTENSA_CPE_LTABLE_ENTRIES * 8)
87#endif
88
89
90/*
91 * Instantiations of the elf_fpregset_t type contain, in most
92 * architectures, the floating point (FPU) register set.
93 * For Xtensa, this type is extended to contain all custom state,
94 * ie. coprocessor and "extra" (non-coprocessor) state (including,
95 * for example, TIE-defined states and register files; as well
96 * as other optional processor state).
97 * This includes FPU state if a floating-point coprocessor happens
98 * to have been configured within the Xtensa processor.
99 *
100 * TOTAL_FPREGS_SIZE is the required size (without rounding)
101 * of elf_fpregset_t. It provides space for the following:
102 *
103 * a) 32-bit mask of active coprocessors for this task (similar
104 * to CPENABLE in single-threaded Xtensa processor systems)
105 *
106 * b) table describing the layout of custom states (ie. of
107 * individual registers, etc) within the save areas
108 *
109 * c) save areas for each coprocessor and for non-coprocessor
110 * ("extra") state
111 *
112 * Note that save areas may require up to 16-byte alignment when
113 * accessed by save/restore sequences. We do not need to ensure
114 * such alignment in an elf_fpregset_t structure because custom
115 * state is not directly loaded/stored into it; rather, save area
116 * contents are copied to elf_fpregset_t from the active save areas
117 * (see 'struct task_struct' definition in processor.h for that)
118 * using memcpy(). But we do allow space for such alignment,
119 * to allow optimizations of layout and copying.
120 */
121
122#define TOTAL_FPREGS_SIZE \
123 (4 + XTENSA_CPE_LTABLE_SIZE + XTENSA_CP_EXTRA_SIZE)
124#define ELF_NFPREG \
125 ((TOTAL_FPREGS_SIZE + sizeof(elf_fpreg_t) - 1) / sizeof(elf_fpreg_t))
126
127typedef unsigned int elf_fpreg_t;
128typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
129
130#define ELF_CORE_COPY_REGS(_eregs, _pregs) \
131 xtensa_elf_core_copy_regs (&_eregs, _pregs);
132
133extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);
134
135/*
136 * This is used to ensure we don't load something for the wrong architecture.
137 */
138
139#define elf_check_arch(x) ( ( (x)->e_machine == EM_XTENSA ) || \
140 ( (x)->e_machine == EM_XTENSA_OLD ) )
141
142/*
143 * These are used to set parameters in the core dumps.
144 */
145
146#ifdef __XTENSA_EL__
147# define ELF_DATA ELFDATA2LSB
148#elif defined(__XTENSA_EB__)
149# define ELF_DATA ELFDATA2MSB
150#else
151# error processor byte order undefined!
152#endif
153
154#define ELF_CLASS ELFCLASS32
155#define ELF_ARCH EM_XTENSA
156
157#define USE_ELF_CORE_DUMP
158#define ELF_EXEC_PAGESIZE PAGE_SIZE
159
160/*
161 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
162 * use of this is to invoke "./ld.so someprog" to test out a new version of
163 * the loader. We need to make sure that it is out of the way of the program
164 * that it will "exec", and that there is sufficient room for the brk.
165 */
166
167#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
168
169/*
170 * This yields a mask that user programs can use to figure out what
171 * instruction set this CPU supports. This could be done in user space,
172 * but it's not easy, and we've already done it here.
173 */
174
175#define ELF_HWCAP (0)
176
177/*
178 * This yields a string that ld.so will use to load implementation
179 * specific libraries for optimization. This is more specific in
180 * intent than poking at uname or /proc/cpuinfo.
181 * For the moment, we have only optimizations for the Intel generations,
182 * but that could change...
183 */
184
185#define ELF_PLATFORM (NULL)
186
187/*
188 * The Xtensa processor ABI says that when the program starts, a2
189 * contains a pointer to a function which might be registered using
190 * `atexit'. This provides a mean for the dynamic linker to call
191 * DT_FINI functions for shared libraries that have been loaded before
192 * the code runs.
193 *
194 * A value of 0 tells we have no such handler.
195 *
196 * We might as well make sure everything else is cleared too (except
197 * for the stack pointer in a1), just to make things more
198 * deterministic. Also, clearing a0 terminates debugger backtraces.
199 */
200
201#define ELF_PLAT_INIT(_r, load_addr) \
202 do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0; _r->areg[3]=0; \
203 _r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
204 _r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
205 _r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
206 } while (0)
207
208#ifdef __KERNEL__
209
210#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX_32BIT)
211
212extern void do_copy_regs (xtensa_gregset_t*, struct pt_regs*,
213 struct task_struct*);
214extern void do_restore_regs (xtensa_gregset_t*, struct pt_regs*,
215 struct task_struct*);
216extern void do_save_fpregs (elf_fpregset_t*, struct pt_regs*,
217 struct task_struct*);
218extern int do_restore_fpregs (elf_fpregset_t*, struct pt_regs*,
219 struct task_struct*);
220
221#endif /* __KERNEL__ */
222#endif /* _XTENSA_ELF_H */
diff --git a/include/asm-xtensa/emergency-restart.h b/include/asm-xtensa/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/include/asm-xtensa/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/include/asm-xtensa/errno.h b/include/asm-xtensa/errno.h
new file mode 100644
index 000000000000..a0f3b96b79b4
--- /dev/null
+++ b/include/asm-xtensa/errno.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/errno.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_ERRNO_H
12#define _XTENSA_ERRNO_H
13
14#include <asm-generic/errno.h>
15
16#endif /* _XTENSA_ERRNO_H */
diff --git a/include/asm-xtensa/fcntl.h b/include/asm-xtensa/fcntl.h
new file mode 100644
index 000000000000..48876bb727d2
--- /dev/null
+++ b/include/asm-xtensa/fcntl.h
@@ -0,0 +1,101 @@
1/*
2 * include/asm-xtensa/fcntl.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1995, 1996, 1997, 1998 by Ralf Baechle
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_FCNTL_H
13#define _XTENSA_FCNTL_H
14
15/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
16 located on an ext2 file system */
17#define O_ACCMODE 0x0003
18#define O_RDONLY 0x0000
19#define O_WRONLY 0x0001
20#define O_RDWR 0x0002
21#define O_APPEND 0x0008
22#define O_SYNC 0x0010
23#define O_NONBLOCK 0x0080
24#define O_CREAT 0x0100 /* not fcntl */
25#define O_TRUNC 0x0200 /* not fcntl */
26#define O_EXCL 0x0400 /* not fcntl */
27#define O_NOCTTY 0x0800 /* not fcntl */
28#define FASYNC 0x1000 /* fcntl, for BSD compatibility */
29#define O_LARGEFILE 0x2000 /* allow large file opens - currently ignored */
30#define O_DIRECT 0x8000 /* direct disk access hint - currently ignored*/
31#define O_DIRECTORY 0x10000 /* must be a directory */
32#define O_NOFOLLOW 0x20000 /* don't follow links */
33#define O_NOATIME 0x100000
34
35#define O_NDELAY O_NONBLOCK
36
37#define F_DUPFD 0 /* dup */
38#define F_GETFD 1 /* get close_on_exec */
39#define F_SETFD 2 /* set/clear close_on_exec */
40#define F_GETFL 3 /* get file->f_flags */
41#define F_SETFL 4 /* set file->f_flags */
42#define F_GETLK 14
43#define F_GETLK64 15
44#define F_SETLK 6
45#define F_SETLKW 7
46#define F_SETLK64 16
47#define F_SETLKW64 17
48
49#define F_SETOWN 24 /* for sockets. */
50#define F_GETOWN 23 /* for sockets. */
51#define F_SETSIG 10 /* for sockets. */
52#define F_GETSIG 11 /* for sockets. */
53
54/* for F_[GET|SET]FL */
55#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
56
57/* for posix fcntl() and lockf() */
58#define F_RDLCK 0
59#define F_WRLCK 1
60#define F_UNLCK 2
61
62/* for old implementation of bsd flock () */
63#define F_EXLCK 4 /* or 3 */
64#define F_SHLCK 8 /* or 4 */
65
66/* for leases */
67#define F_INPROGRESS 16
68
69/* operations for bsd flock(), also used by the kernel implementation */
70#define LOCK_SH 1 /* shared lock */
71#define LOCK_EX 2 /* exclusive lock */
72#define LOCK_NB 4 /* or'd with one of the above to prevent
73 blocking */
74#define LOCK_UN 8 /* remove lock */
75
76#define LOCK_MAND 32 /* This is a mandatory flock ... */
77#define LOCK_READ 64 /* which allows concurrent read operations */
78#define LOCK_WRITE 128 /* which allows concurrent write operations */
79#define LOCK_RW 192 /* which allows concurrent read & write ops */
80
81typedef struct flock {
82 short l_type;
83 short l_whence;
84 __kernel_off_t l_start;
85 __kernel_off_t l_len;
86 long l_sysid;
87 __kernel_pid_t l_pid;
88 long pad[4];
89} flock_t;
90
91struct flock64 {
92 short l_type;
93 short l_whence;
94 __kernel_off_t l_start;
95 __kernel_off_t l_len;
96 pid_t l_pid;
97};
98
99#define F_LINUX_SPECIFIC_BASE 1024
100
101#endif /* _XTENSA_FCNTL_H */
diff --git a/include/asm-xtensa/fixmap.h b/include/asm-xtensa/fixmap.h
new file mode 100644
index 000000000000..4423b8ad4954
--- /dev/null
+++ b/include/asm-xtensa/fixmap.h
@@ -0,0 +1,252 @@
1/*
2 * include/asm-xtensa/fixmap.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_FIXMAP_H
12#define _XTENSA_FIXMAP_H
13
14#include <asm/processor.h>
15
16#ifdef CONFIG_MMU
17
18/*
19 * Here we define all the compile-time virtual addresses.
20 */
21
22#if XCHAL_SEG_MAPPABLE_VADDR != 0
23# error "Current port requires virtual user space starting at 0"
24#endif
25#if XCHAL_SEG_MAPPABLE_SIZE < 0x80000000
26# error "Current port requires at least 0x8000000 bytes for user space"
27#endif
28
29/* Verify instruction/data ram/rom and xlmi don't overlay vmalloc space. */
30
31#define __IN_VMALLOC(addr) \
32 (((addr) >= VMALLOC_START) && ((addr) < VMALLOC_END))
33#define __SPAN_VMALLOC(start,end) \
34 (((start) < VMALLOC_START) && ((end) >= VMALLOC_END))
35#define INSIDE_VMALLOC(start,end) \
36 (__IN_VMALLOC((start)) || __IN_VMALLOC(end) || __SPAN_VMALLOC((start),(end)))
37
38#if XCHAL_NUM_INSTROM
39# if XCHAL_NUM_INSTROM == 1
40# if INSIDE_VMALLOC(XCHAL_INSTROM0_VADDR,XCHAL_INSTROM0_VADDR+XCHAL_INSTROM0_SIZE)
41# error vmalloc range conflicts with instrom0
42# endif
43# endif
44# if XCHAL_NUM_INSTROM == 2
45# if INSIDE_VMALLOC(XCHAL_INSTROM1_VADDR,XCHAL_INSTROM1_VADDR+XCHAL_INSTROM1_SIZE)
46# error vmalloc range conflicts with instrom1
47# endif
48# endif
49#endif
50
51#if XCHAL_NUM_INSTRAM
52# if XCHAL_NUM_INSTRAM == 1
53# if INSIDE_VMALLOC(XCHAL_INSTRAM0_VADDR,XCHAL_INSTRAM0_VADDR+XCHAL_INSTRAM0_SIZE)
54# error vmalloc range conflicts with instram0
55# endif
56# endif
57# if XCHAL_NUM_INSTRAM == 2
58# if INSIDE_VMALLOC(XCHAL_INSTRAM1_VADDR,XCHAL_INSTRAM1_VADDR+XCHAL_INSTRAM1_SIZE)
59# error vmalloc range conflicts with instram1
60# endif
61# endif
62#endif
63
64#if XCHAL_NUM_DATAROM
65# if XCHAL_NUM_DATAROM == 1
66# if INSIDE_VMALLOC(XCHAL_DATAROM0_VADDR,XCHAL_DATAROM0_VADDR+XCHAL_DATAROM0_SIZE)
67# error vmalloc range conflicts with datarom0
68# endif
69# endif
70# if XCHAL_NUM_DATAROM == 2
71# if INSIDE_VMALLOC(XCHAL_DATAROM1_VADDR,XCHAL_DATAROM1_VADDR+XCHAL_DATAROM1_SIZE)
72# error vmalloc range conflicts with datarom1
73# endif
74# endif
75#endif
76
77#if XCHAL_NUM_DATARAM
78# if XCHAL_NUM_DATARAM == 1
79# if INSIDE_VMALLOC(XCHAL_DATARAM0_VADDR,XCHAL_DATARAM0_VADDR+XCHAL_DATARAM0_SIZE)
80# error vmalloc range conflicts with dataram0
81# endif
82# endif
83# if XCHAL_NUM_DATARAM == 2
84# if INSIDE_VMALLOC(XCHAL_DATARAM1_VADDR,XCHAL_DATARAM1_VADDR+XCHAL_DATARAM1_SIZE)
85# error vmalloc range conflicts with dataram1
86# endif
87# endif
88#endif
89
90#if XCHAL_NUM_XLMI
91# if XCHAL_NUM_XLMI == 1
92# if INSIDE_VMALLOC(XCHAL_XLMI0_VADDR,XCHAL_XLMI0_VADDR+XCHAL_XLMI0_SIZE)
93# error vmalloc range conflicts with xlmi0
94# endif
95# endif
96# if XCHAL_NUM_XLMI == 2
97# if INSIDE_VMALLOC(XCHAL_XLMI1_VADDR,XCHAL_XLMI1_VADDR+XCHAL_XLMI1_SIZE)
98# error vmalloc range conflicts with xlmi1
99# endif
100# endif
101#endif
102
103#if (XCHAL_NUM_INSTROM > 2) || \
104 (XCHAL_NUM_INSTRAM > 2) || \
105 (XCHAL_NUM_DATARAM > 2) || \
106 (XCHAL_NUM_DATAROM > 2) || \
107 (XCHAL_NUM_XLMI > 2)
108# error Insufficient checks on vmalloc above for more than 2 devices
109#endif
110
111/*
112 * USER_VM_SIZE does not necessarily equal TASK_SIZE. We bumped
113 * TASK_SIZE down to 0x4000000 to simplify the handling of windowed
114 * call instructions (currently limited to a range of 1 GByte). User
115 * tasks may very well reclaim the VM space from 0x40000000 to
116 * 0x7fffffff in the future, so we do not want the kernel becoming
117 * accustomed to having any of its stuff (e.g., page tables) in this
118 * region. This VM region is no-man's land for now.
119 */
120
121#define USER_VM_START XCHAL_SEG_MAPPABLE_VADDR
122#define USER_VM_SIZE 0x80000000
123
124/* Size of page table: */
125
126#define PGTABLE_SIZE_BITS (32 - XCHAL_MMU_MIN_PTE_PAGE_SIZE + 2)
127#define PGTABLE_SIZE (1L << PGTABLE_SIZE_BITS)
128
129/* All kernel-mappable space: */
130
131#define KERNEL_ALLMAP_START (USER_VM_START + USER_VM_SIZE)
132#define KERNEL_ALLMAP_SIZE (XCHAL_SEG_MAPPABLE_SIZE - KERNEL_ALLMAP_START)
133
134/* Carve out page table at start of kernel-mappable area: */
135
136#if KERNEL_ALLMAP_SIZE < PGTABLE_SIZE
137#error "Gimme some space for page table!"
138#endif
139#define PGTABLE_START KERNEL_ALLMAP_START
140
141/* Remaining kernel-mappable space: */
142
143#define KERNEL_MAPPED_START (KERNEL_ALLMAP_START + PGTABLE_SIZE)
144#define KERNEL_MAPPED_SIZE (KERNEL_ALLMAP_SIZE - PGTABLE_SIZE)
145
146#if KERNEL_MAPPED_SIZE < 0x01000000 /* 16 MB is arbitrary for now */
147# error "Shouldn't the kernel have at least *some* mappable space?"
148#endif
149
150#define MAX_LOW_MEMORY XCHAL_KSEG_CACHED_SIZE
151
152#endif
153
154/*
155 * Some constants used elsewhere, but perhaps only in Xtensa header
156 * files, so maybe we can get rid of some and access compile-time HAL
157 * directly...
158 *
159 * Note: We assume that system RAM is located at the very start of the
160 * kernel segments !!
161 */
162#define KERNEL_VM_LOW XCHAL_KSEG_CACHED_VADDR
163#define KERNEL_VM_HIGH XCHAL_KSEG_BYPASS_VADDR
164#define KERNEL_SPACE XCHAL_KSEG_CACHED_VADDR
165
166/*
167 * Returns the physical/virtual addresses of the kernel space
168 * (works with the cached kernel segment only, which is the
169 * one normally used for kernel operation).
170 */
171
172/* PHYSICAL BYPASS CACHED
173 *
174 * bypass vaddr bypass paddr * cached vaddr
175 * cached vaddr cached paddr bypass vaddr *
176 * bypass paddr * bypass vaddr cached vaddr
177 * cached paddr * bypass vaddr cached vaddr
178 * other * * *
179 */
180
181#define PHYSADDR(a) \
182(((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \
183 && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
184 (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR + XCHAL_KSEG_BYPASS_PADDR : \
185 ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \
186 && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_SIZE) ? \
187 (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR + XCHAL_KSEG_CACHED_PADDR : \
188 (unsigned)(a))
189
190#define BYPASS_ADDR(a) \
191(((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \
192 && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
193 (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_VADDR : \
194 ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \
195 && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \
196 (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_BYPASS_VADDR : \
197 ((unsigned)(a) >= XCHAL_KSEG_CACHED_VADDR \
198 && (unsigned)(a) < XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_CACHED_SIZE)? \
199 (unsigned)(a) - XCHAL_KSEG_CACHED_VADDR+XCHAL_KSEG_BYPASS_VADDR: \
200 (unsigned)(a))
201
202#define CACHED_ADDR(a) \
203(((unsigned)(a) >= XCHAL_KSEG_BYPASS_PADDR \
204 && (unsigned)(a) < XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_BYPASS_SIZE) ? \
205 (unsigned)(a) - XCHAL_KSEG_BYPASS_PADDR + XCHAL_KSEG_CACHED_VADDR : \
206 ((unsigned)(a) >= XCHAL_KSEG_CACHED_PADDR \
207 && (unsigned)(a) < XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_SIZE) ? \
208 (unsigned)(a) - XCHAL_KSEG_CACHED_PADDR + XCHAL_KSEG_CACHED_VADDR : \
209 ((unsigned)(a) >= XCHAL_KSEG_BYPASS_VADDR \
210 && (unsigned)(a) < XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_BYPASS_SIZE) ? \
211 (unsigned)(a) - XCHAL_KSEG_BYPASS_VADDR+XCHAL_KSEG_CACHED_VADDR : \
212 (unsigned)(a))
213
214#define PHYSADDR_IO(a) \
215(((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \
216 && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \
217 (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_PADDR : \
218 ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \
219 && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \
220 (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_PADDR : \
221 (unsigned)(a))
222
223#define BYPASS_ADDR_IO(a) \
224(((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \
225 && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \
226 (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_VADDR : \
227 ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \
228 && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \
229 (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_BYPASS_VADDR : \
230 ((unsigned)(a) >= XCHAL_KIO_CACHED_VADDR \
231 && (unsigned)(a) < XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_CACHED_SIZE) ? \
232 (unsigned)(a) - XCHAL_KIO_CACHED_VADDR + XCHAL_KIO_BYPASS_VADDR : \
233 (unsigned)(a))
234
235#define CACHED_ADDR_IO(a) \
236(((unsigned)(a) >= XCHAL_KIO_BYPASS_PADDR \
237 && (unsigned)(a) < XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_BYPASS_SIZE) ? \
238 (unsigned)(a) - XCHAL_KIO_BYPASS_PADDR + XCHAL_KIO_CACHED_VADDR : \
239 ((unsigned)(a) >= XCHAL_KIO_CACHED_PADDR \
240 && (unsigned)(a) < XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_SIZE) ? \
241 (unsigned)(a) - XCHAL_KIO_CACHED_PADDR + XCHAL_KIO_CACHED_VADDR : \
242 ((unsigned)(a) >= XCHAL_KIO_BYPASS_VADDR \
243 && (unsigned)(a) < XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_BYPASS_SIZE) ? \
244 (unsigned)(a) - XCHAL_KIO_BYPASS_VADDR + XCHAL_KIO_CACHED_VADDR : \
245 (unsigned)(a))
246
247#endif /* _XTENSA_ADDRSPACE_H */
248
249
250
251
252
diff --git a/include/asm-xtensa/hardirq.h b/include/asm-xtensa/hardirq.h
new file mode 100644
index 000000000000..e07c76c36b95
--- /dev/null
+++ b/include/asm-xtensa/hardirq.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-xtensa/hardirq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HARDIRQ_H
12#define _XTENSA_HARDIRQ_H
13
14#include <linux/config.h>
15#include <linux/cache.h>
16#include <asm/irq.h>
17
18/* headers.S is sensitive to the offsets of these fields */
19typedef struct {
20 unsigned int __softirq_pending;
21 unsigned int __syscall_count;
22 struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
23 unsigned int __nmi_count; /* arch dependent */
24} ____cacheline_aligned irq_cpustat_t;
25
26#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
27
28#endif /* _XTENSA_HARDIRQ_H */
diff --git a/include/asm-xtensa/hdreg.h b/include/asm-xtensa/hdreg.h
new file mode 100644
index 000000000000..64b80607b80d
--- /dev/null
+++ b/include/asm-xtensa/hdreg.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/hdreg.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 * Copyright (C) 1994-1996 Linus Torvalds & authors
10 */
11
12#ifndef _XTENSA_HDREG_H
13#define _XTENSA_HDREG_H
14
15typedef unsigned int ide_ioreg_t;
16
17#endif
diff --git a/include/asm-xtensa/highmem.h b/include/asm-xtensa/highmem.h
new file mode 100644
index 000000000000..0a046ca5a687
--- /dev/null
+++ b/include/asm-xtensa/highmem.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/highmem.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HIGHMEM_H
12#define _XTENSA_HIGHMEM_H
13
14extern void flush_cache_kmaps(void);
15
16#endif
17
diff --git a/include/asm-xtensa/hw_irq.h b/include/asm-xtensa/hw_irq.h
new file mode 100644
index 000000000000..ccf436249eaa
--- /dev/null
+++ b/include/asm-xtensa/hw_irq.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-xtensa/hw_irq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HW_IRQ_H
12#define _XTENSA_HW_IRQ_H
13
14static inline void hw_resend_irq(struct hw_interrupt_type *h, unsigned int i)
15{
16}
17
18#endif
diff --git a/include/asm-xtensa/ide.h b/include/asm-xtensa/ide.h
new file mode 100644
index 000000000000..b523cd4a486e
--- /dev/null
+++ b/include/asm-xtensa/ide.h
@@ -0,0 +1,36 @@
1/*
2 * include/asm-xtensa/ide.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1994 - 1996 Linus Torvalds & authors
9 * Copyright (C) 2001 - 2005 Tensilica Inc.
10 */
11
12#ifndef _XTENSA_IDE_H
13#define _XTENSA_IDE_H
14
15#ifdef __KERNEL__
16
17#include <linux/config.h>
18
19#ifndef MAX_HWIFS
20# define MAX_HWIFS 1
21#endif
22
23static __inline__ int ide_default_irq(unsigned long base)
24{
25 /* Unsupported! */
26 return 0;
27}
28
29static __inline__ unsigned long ide_default_io_base(int index)
30{
31 /* Unsupported! */
32 return 0;
33}
34
35#endif /* __KERNEL__ */
36#endif /* _XTENSA_IDE_H */
diff --git a/include/asm-xtensa/io.h b/include/asm-xtensa/io.h
new file mode 100644
index 000000000000..2c471c42ecfc
--- /dev/null
+++ b/include/asm-xtensa/io.h
@@ -0,0 +1,197 @@
1/*
2 * linux/include/asm-xtensa/io.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IO_H
12#define _XTENSA_IO_H
13
14#ifdef __KERNEL__
15#include <linux/config.h>
16#include <asm/byteorder.h>
17
18#include <linux/types.h>
19#include <asm/fixmap.h>
20
21#define _IO_BASE 0
22
23
24/*
25 * swap functions to change byte order from little-endian to big-endian and
26 * vice versa.
27 */
28
29static inline unsigned short _swapw (unsigned short v)
30{
31 return (v << 8) | (v >> 8);
32}
33
34static inline unsigned int _swapl (unsigned int v)
35{
36 return (v << 24) | ((v & 0xff00) << 8) | ((v >> 8) & 0xff00) | (v >> 24);
37}
38
39/*
40 * Change virtual addresses to physical addresses and vv.
41 * These are trivial on the 1:1 Linux/Xtensa mapping
42 */
43
44extern inline unsigned long virt_to_phys(volatile void * address)
45{
46 return PHYSADDR((unsigned long)address);
47}
48
49extern inline void * phys_to_virt(unsigned long address)
50{
51 return (void*) CACHED_ADDR(address);
52}
53
54/*
55 * IO bus memory addresses are also 1:1 with the physical address
56 */
57
58extern inline unsigned long virt_to_bus(volatile void * address)
59{
60 return PHYSADDR((unsigned long)address);
61}
62
63extern inline void * bus_to_virt (unsigned long address)
64{
65 return (void *) CACHED_ADDR(address);
66}
67
68/*
69 * Change "struct page" to physical address.
70 */
71
72extern inline void *ioremap(unsigned long offset, unsigned long size)
73{
74 return (void *) CACHED_ADDR_IO(offset);
75}
76
77extern inline void *ioremap_nocache(unsigned long offset, unsigned long size)
78{
79 return (void *) BYPASS_ADDR_IO(offset);
80}
81
82extern inline void iounmap(void *addr)
83{
84}
85
86/*
87 * Generic I/O
88 */
89
90#define readb(addr) \
91 ({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; })
92#define readw(addr) \
93 ({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; })
94#define readl(addr) \
95 ({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })
96#define writeb(b, addr) (void)((*(volatile unsigned char *)(addr)) = (b))
97#define writew(b, addr) (void)((*(volatile unsigned short *)(addr)) = (b))
98#define writel(b, addr) (void)((*(volatile unsigned int *)(addr)) = (b))
99
100static inline __u8 __raw_readb(const volatile void __iomem *addr)
101{
102 return *(__force volatile __u8 *)(addr);
103}
104static inline __u16 __raw_readw(const volatile void __iomem *addr)
105{
106 return *(__force volatile __u16 *)(addr);
107}
108static inline __u32 __raw_readl(const volatile void __iomem *addr)
109{
110 return *(__force volatile __u32 *)(addr);
111}
112static inline void __raw_writeb(__u8 b, volatile void __iomem *addr)
113{
114 *(__force volatile __u8 *)(addr) = b;
115}
116static inline void __raw_writew(__u16 b, volatile void __iomem *addr)
117{
118 *(__force volatile __u16 *)(addr) = b;
119}
120static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
121{
122 *(__force volatile __u32 *)(addr) = b;
123}
124
125
126
127
128/* These are the definitions for the x86 IO instructions
129 * inb/inw/inl/outb/outw/outl, the "string" versions
130 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
131 * inb_p/inw_p/...
132 * The macros don't do byte-swapping.
133 */
134
135#define inb(port) readb((u8 *)((port)+_IO_BASE))
136#define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)+_IO_BASE))
137#define inw(port) readw((u16 *)((port)+_IO_BASE))
138#define outw(val, port) writew((val),(u16 *)((unsigned long)(port)+_IO_BASE))
139#define inl(port) readl((u32 *)((port)+_IO_BASE))
140#define outl(val, port) writel((val),(u32 *)((unsigned long)(port)))
141
142#define inb_p(port) inb((port))
143#define outb_p(val, port) outb((val), (port))
144#define inw_p(port) inw((port))
145#define outw_p(val, port) outw((val), (port))
146#define inl_p(port) inl((port))
147#define outl_p(val, port) outl((val), (port))
148
149extern void insb (unsigned long port, void *dst, unsigned long count);
150extern void insw (unsigned long port, void *dst, unsigned long count);
151extern void insl (unsigned long port, void *dst, unsigned long count);
152extern void outsb (unsigned long port, const void *src, unsigned long count);
153extern void outsw (unsigned long port, const void *src, unsigned long count);
154extern void outsl (unsigned long port, const void *src, unsigned long count);
155
156#define IO_SPACE_LIMIT ~0
157
158#define memset_io(a,b,c) memset((void *)(a),(b),(c))
159#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
160#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
161
162/* At this point the Xtensa doesn't provide byte swap instructions */
163
164#ifdef __XTENSA_EB__
165# define in_8(addr) (*(u8*)(addr))
166# define in_le16(addr) _swapw(*(u16*)(addr))
167# define in_le32(addr) _swapl(*(u32*)(addr))
168# define out_8(b, addr) *(u8*)(addr) = (b)
169# define out_le16(b, addr) *(u16*)(addr) = _swapw(b)
170# define out_le32(b, addr) *(u32*)(addr) = _swapl(b)
171#elif defined(__XTENSA_EL__)
172# define in_8(addr) (*(u8*)(addr))
173# define in_le16(addr) (*(u16*)(addr))
174# define in_le32(addr) (*(u32*)(addr))
175# define out_8(b, addr) *(u8*)(addr) = (b)
176# define out_le16(b, addr) *(u16*)(addr) = (b)
177# define out_le32(b, addr) *(u32*)(addr) = (b)
178#else
179# error processor byte order undefined!
180#endif
181
182
183/*
184 * * Convert a physical pointer to a virtual kernel pointer for /dev/mem
185 * * access
186 * */
187#define xlate_dev_mem_ptr(p) __va(p)
188
189/*
190 * * Convert a virtual cached pointer to an uncached pointer
191 * */
192#define xlate_dev_kmem_ptr(p) p
193
194
195#endif /* __KERNEL__ */
196
197#endif /* _XTENSA_IO_H */
diff --git a/include/asm-xtensa/ioctl.h b/include/asm-xtensa/ioctl.h
new file mode 100644
index 000000000000..856c605d62b1
--- /dev/null
+++ b/include/asm-xtensa/ioctl.h
@@ -0,0 +1,83 @@
1/*
2 * include/asm-xtensa/ioctl.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 *
10 * Derived from "include/asm-i386/ioctl.h"
11 */
12
13#ifndef _XTENSA_IOCTL_H
14#define _XTENSA_IOCTL_H
15
16
17/* ioctl command encoding: 32 bits total, command in lower 16 bits,
18 * size of the parameter structure in the lower 14 bits of the
19 * upper 16 bits.
20 * Encoding the size of the parameter structure in the ioctl request
21 * is useful for catching programs compiled with old versions
22 * and to avoid overwriting user space outside the user buffer area.
23 * The highest 2 bits are reserved for indicating the ``access mode''.
24 * NOTE: This limits the max parameter size to 16kB -1 !
25 */
26
27/*
28 * The following is for compatibility across the various Linux
29 * platforms. The i386 ioctl numbering scheme doesn't really enforce
30 * a type field. De facto, however, the top 8 bits of the lower 16
31 * bits are indeed used as a type field, so we might just as well make
32 * this explicit here. Please be sure to use the decoding macros
33 * below from now on.
34 */
35#define _IOC_NRBITS 8
36#define _IOC_TYPEBITS 8
37#define _IOC_SIZEBITS 14
38#define _IOC_DIRBITS 2
39
40#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
41#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
42#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
43#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
44
45#define _IOC_NRSHIFT 0
46#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
47#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
48#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
49
50/*
51 * Direction bits.
52 */
53#define _IOC_NONE 0U
54#define _IOC_WRITE 1U
55#define _IOC_READ 2U
56
57#define _IOC(dir,type,nr,size) \
58 (((dir) << _IOC_DIRSHIFT) | \
59 ((type) << _IOC_TYPESHIFT) | \
60 ((nr) << _IOC_NRSHIFT) | \
61 ((size) << _IOC_SIZESHIFT))
62
63/* used to create numbers */
64#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
65#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
66#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
67#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
68
69/* used to decode ioctl numbers.. */
70#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
71#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
72#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
73#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
74
75/* ...and for the drivers/sound files... */
76
77#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
78#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
79#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
80#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
81#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
82
83#endif
diff --git a/include/asm-xtensa/ioctls.h b/include/asm-xtensa/ioctls.h
new file mode 100644
index 000000000000..10c443435c11
--- /dev/null
+++ b/include/asm-xtensa/ioctls.h
@@ -0,0 +1,112 @@
1/*
2 * include/asm-xtensa/ioctl.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 *
10 * Derived from "include/asm-i386/ioctls.h"
11 */
12
13#ifndef _XTENSA_IOCTLS_H
14#define _XTENSA_IOCTLS_H
15
16#include <asm/ioctl.h>
17
18#define FIOCLEX _IO('f', 1)
19#define FIONCLEX _IO('f', 2)
20#define FIOASYNC _IOW('f', 125, int)
21#define FIONBIO _IOW('f', 126, int)
22#define FIONREAD _IOR('f', 127, int)
23#define TIOCINQ FIONREAD
24#define FIOQSIZE _IOR('f', 128, loff_t)
25
26#define TCGETS 0x5401
27#define TCSETS 0x5402
28#define TCSETSW 0x5403
29#define TCSETSF 0x5404
30
31#define TCGETA _IOR('t', 23, struct termio)
32#define TCSETA _IOW('t', 24, struct termio)
33#define TCSETAW _IOW('t', 25, struct termio)
34#define TCSETAF _IOW('t', 28, struct termio)
35
36#define TCSBRK _IO('t', 29)
37#define TCXONC _IO('t', 30)
38#define TCFLSH _IO('t', 31)
39
40#define TIOCSWINSZ _IOW('t', 103, struct winsize)
41#define TIOCGWINSZ _IOR('t', 104, struct winsize)
42#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
43#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
44#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
45
46#define TIOCSPGRP _IOW('t', 118, int)
47#define TIOCGPGRP _IOR('t', 119, int)
48
49#define TIOCEXCL _IO('T', 12)
50#define TIOCNXCL _IO('T', 13)
51#define TIOCSCTTY _IO('T', 14)
52
53#define TIOCSTI _IOW('T', 18, char)
54#define TIOCMGET _IOR('T', 21, unsigned int)
55#define TIOCMBIS _IOW('T', 22, unsigned int)
56#define TIOCMBIC _IOW('T', 23, unsigned int)
57#define TIOCMSET _IOW('T', 24, unsigned int)
58# define TIOCM_LE 0x001
59# define TIOCM_DTR 0x002
60# define TIOCM_RTS 0x004
61# define TIOCM_ST 0x008
62# define TIOCM_SR 0x010
63# define TIOCM_CTS 0x020
64# define TIOCM_CAR 0x040
65# define TIOCM_RNG 0x080
66# define TIOCM_DSR 0x100
67# define TIOCM_CD TIOCM_CAR
68# define TIOCM_RI TIOCM_RNG
69
70#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
71#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
72#define TIOCLINUX _IOW('T', 28, char)
73#define TIOCCONS _IO('T', 29)
74#define TIOCGSERIAL _IOR('T', 30, struct serial_struct)
75#define TIOCSSERIAL _IOW('T', 31, struct serial_struct)
76#define TIOCPKT _IOW('T', 32, int)
77# define TIOCPKT_DATA 0
78# define TIOCPKT_FLUSHREAD 1
79# define TIOCPKT_FLUSHWRITE 2
80# define TIOCPKT_STOP 4
81# define TIOCPKT_START 8
82# define TIOCPKT_NOSTOP 16
83# define TIOCPKT_DOSTOP 32
84
85
86#define TIOCNOTTY _IO('T', 34)
87#define TIOCSETD _IOW('T', 35, int)
88#define TIOCGETD _IOR('T', 36, int)
89#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
90#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
91#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
92#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
93#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
94#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
95#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
96
97#define TIOCSERCONFIG _IO('T', 83)
98#define TIOCSERGWILD _IOR('T', 84, int)
99#define TIOCSERSWILD _IOW('T', 85, int)
100#define TIOCGLCKTRMIOS 0x5456
101#define TIOCSLCKTRMIOS 0x5457
102#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
103#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
104 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
105# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
106#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */
107#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
108
109#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
110#define TIOCGICOUNT _IOR('T', 93, struct async_icount) /* read serial port inline interrupt counts */
111
112#endif /* _XTENSA_IOCTLS_H */
diff --git a/include/asm-xtensa/ipcbuf.h b/include/asm-xtensa/ipcbuf.h
new file mode 100644
index 000000000000..c33aa6a42145
--- /dev/null
+++ b/include/asm-xtensa/ipcbuf.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-xtensa/ipcbuf.h
3 *
4 * The ipc64_perm structure for the Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IPCBUF_H
12#define _XTENSA_IPCBUF_H
13
14/*
15 * Pad space is left for:
16 * - 32-bit mode_t and seq
17 * - 2 miscellaneous 32-bit values
18 *
19 * This file is subject to the terms and conditions of the GNU General
20 * Public License. See the file "COPYING" in the main directory of
21 * this archive for more details.
22 */
23
24struct ipc64_perm
25{
26 __kernel_key_t key;
27 __kernel_uid32_t uid;
28 __kernel_gid32_t gid;
29 __kernel_uid32_t cuid;
30 __kernel_gid32_t cgid;
31 __kernel_mode_t mode;
32 unsigned long seq;
33 unsigned long __unused1;
34 unsigned long __unused2;
35};
36
37#endif /* _XTENSA_IPCBUF_H */
diff --git a/include/asm-xtensa/irq.h b/include/asm-xtensa/irq.h
new file mode 100644
index 000000000000..d984e955938f
--- /dev/null
+++ b/include/asm-xtensa/irq.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-xtensa/irq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IRQ_H
12#define _XTENSA_IRQ_H
13
14#include <linux/config.h>
15#include <asm/platform/hardware.h>
16
17#include <xtensa/config/core.h>
18
19#ifndef PLATFORM_NR_IRQS
20# define PLATFORM_NR_IRQS 0
21#endif
22#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
23#define NR_IRQS (XTENSA_NR_IRQS + PLATFORM_NR_IRQS)
24
25static __inline__ int irq_canonicalize(int irq)
26{
27 return (irq);
28}
29
30struct irqaction;
31#if 0 // FIXME
32extern void disable_irq_nosync(unsigned int);
33extern void disable_irq(unsigned int);
34extern void enable_irq(unsigned int);
35#endif
36
37#endif /* _XTENSA_IRQ_H */
diff --git a/include/asm-xtensa/kmap_types.h b/include/asm-xtensa/kmap_types.h
new file mode 100644
index 000000000000..9e822d2e3bce
--- /dev/null
+++ b/include/asm-xtensa/kmap_types.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-xtensa/kmap_types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_KMAP_TYPES_H
12#define _XTENSA_KMAP_TYPES_H
13
14enum km_type {
15 KM_BOUNCE_READ,
16 KM_SKB_SUNRPC_DATA,
17 KM_SKB_DATA_SOFTIRQ,
18 KM_USER0,
19 KM_USER1,
20 KM_BIO_SRC_IRQ,
21 KM_BIO_DST_IRQ,
22 KM_PTE0,
23 KM_PTE1,
24 KM_IRQ0,
25 KM_IRQ1,
26 KM_SOFTIRQ0,
27 KM_SOFTIRQ1,
28 KM_TYPE_NR
29};
30
31#endif /* _XTENSA_KMAP_TYPES_H */
diff --git a/include/asm-xtensa/linkage.h b/include/asm-xtensa/linkage.h
new file mode 100644
index 000000000000..bf2128a99d79
--- /dev/null
+++ b/include/asm-xtensa/linkage.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/linkage.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_LINKAGE_H
12#define _XTENSA_LINKAGE_H
13
14/* Nothing to do here ... */
15
16#endif /* _XTENSA_LINKAGE_H */
diff --git a/include/asm-xtensa/local.h b/include/asm-xtensa/local.h
new file mode 100644
index 000000000000..48723e550d14
--- /dev/null
+++ b/include/asm-xtensa/local.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/local.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_LOCAL_H
12#define _XTENSA_LOCAL_H
13
14#include <asm-generic/local.h>
15
16#endif /* _XTENSA_LOCAL_H */
diff --git a/include/asm-xtensa/mman.h b/include/asm-xtensa/mman.h
new file mode 100644
index 000000000000..9a95a45df996
--- /dev/null
+++ b/include/asm-xtensa/mman.h
@@ -0,0 +1,80 @@
1/*
2 * include/asm-xtensa/mman.h
3 *
4 * Xtensa Processor memory-manager definitions
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995 by Ralf Baechle
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_MMAN_H
15#define _XTENSA_MMAN_H
16
17/*
18 * Protections are chosen from these bits, OR'd together. The
19 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
20 * without PROT_READ. The only guarantees are that no writing will be
21 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
22 */
23
24#define PROT_NONE 0x0 /* page can not be accessed */
25#define PROT_READ 0x1 /* page can be read */
26#define PROT_WRITE 0x2 /* page can be written */
27#define PROT_EXEC 0x4 /* page can be executed */
28
29#define PROT_SEM 0x10 /* page may be used for atomic ops */
30#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
31#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end fo growsup vma */
32
33/*
34 * Flags for mmap
35 */
36#define MAP_SHARED 0x001 /* Share changes */
37#define MAP_PRIVATE 0x002 /* Changes are private */
38#define MAP_TYPE 0x00f /* Mask for type of mapping */
39#define MAP_FIXED 0x010 /* Interpret addr exactly */
40
41/* not used by linux, but here to make sure we don't clash with ABI defines */
42#define MAP_RENAME 0x020 /* Assign page to file */
43#define MAP_AUTOGROW 0x040 /* File may grow by writing */
44#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
45#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
46
47/* These are linux-specific */
48#define MAP_NORESERVE 0x0400 /* don't check for reservations */
49#define MAP_ANONYMOUS 0x0800 /* don't use a file */
50#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
51#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
52#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
53#define MAP_LOCKED 0x8000 /* pages are locked */
54#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
55#define MAP_NONBLOCK 0x20000 /* do not block on IO */
56
57/*
58 * Flags for msync
59 */
60#define MS_ASYNC 0x0001 /* sync memory asynchronously */
61#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
62#define MS_SYNC 0x0004 /* synchronous memory sync */
63
64/*
65 * Flags for mlockall
66 */
67#define MCL_CURRENT 1 /* lock all current mappings */
68#define MCL_FUTURE 2 /* lock all future mappings */
69
70#define MADV_NORMAL 0x0 /* default page-in behavior */
71#define MADV_RANDOM 0x1 /* page-in minimum required */
72#define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */
73#define MADV_WILLNEED 0x3 /* pre-fault pages */
74#define MADV_DONTNEED 0x4 /* discard these pages */
75
76/* compatibility flags */
77#define MAP_ANON MAP_ANONYMOUS
78#define MAP_FILE 0
79
80#endif /* _XTENSA_MMAN_H */
diff --git a/include/asm-xtensa/mmu.h b/include/asm-xtensa/mmu.h
new file mode 100644
index 000000000000..44c5bb04c55c
--- /dev/null
+++ b/include/asm-xtensa/mmu.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/mmu.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_MMU_H
12#define _XTENSA_MMU_H
13
14/* Default "unsigned long" context */
15typedef unsigned long mm_context_t;
16
17#endif /* _XTENSA_MMU_H */
diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h
new file mode 100644
index 000000000000..1b0801548cd9
--- /dev/null
+++ b/include/asm-xtensa/mmu_context.h
@@ -0,0 +1,330 @@
1/*
2 * include/asm-xtensa/mmu_context.h
3 *
4 * Switch an MMU context.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_MMU_CONTEXT_H
14#define _XTENSA_MMU_CONTEXT_H
15
16#include <linux/config.h>
17#include <linux/stringify.h>
18
19#include <asm/pgtable.h>
20#include <asm/mmu_context.h>
21#include <asm/cacheflush.h>
22#include <asm/tlbflush.h>
23
24/*
25 * Linux was ported to Xtensa assuming all auto-refill ways in set 0
26 * had the same properties (a very likely assumption). Multiple sets
27 * of auto-refill ways will still work properly, but not as optimally
28 * as the Xtensa designer may have assumed.
29 *
30 * We make this case a hard #error, killing the kernel build, to alert
31 * the developer to this condition (which is more likely an error).
32 * You super-duper clever developers can change it to a warning or
33 * remove it altogether if you think you know what you're doing. :)
34 */
35
36#if (XCHAL_HAVE_TLBS != 1)
37# error "Linux must have an MMU!"
38#endif
39
40#if ((XCHAL_ITLB_ARF_WAYS == 0) || (XCHAL_DTLB_ARF_WAYS == 0))
41# error "MMU must have auto-refill ways"
42#endif
43
44#if ((XCHAL_ITLB_ARF_SETS != 1) || (XCHAL_DTLB_ARF_SETS != 1))
45# error Linux may not use all auto-refill ways as efficiently as you think
46#endif
47
48#if (XCHAL_MMU_MAX_PTE_PAGE_SIZE != XCHAL_MMU_MIN_PTE_PAGE_SIZE)
49# error Only one page size allowed!
50#endif
51
52extern unsigned long asid_cache;
53extern pgd_t *current_pgd;
54
55/*
56 * Define the number of entries per auto-refill way in set 0 of both I and D
57 * TLBs. We deal only with set 0 here (an assumption further explained in
58 * assertions.h). Also, define the total number of ARF entries in both TLBs.
59 */
60
61#define ITLB_ENTRIES_PER_ARF_WAY (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES))
62#define DTLB_ENTRIES_PER_ARF_WAY (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES))
63
64#define ITLB_ENTRIES \
65 (ITLB_ENTRIES_PER_ARF_WAY * (XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,WAYS)))
66#define DTLB_ENTRIES \
67 (DTLB_ENTRIES_PER_ARF_WAY * (XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,WAYS)))
68
69
70/*
71 * SMALLEST_NTLB_ENTRIES is the smaller of ITLB_ENTRIES and DTLB_ENTRIES.
72 * In practice, they are probably equal. This macro simplifies function
73 * flush_tlb_range().
74 */
75
76#if (DTLB_ENTRIES < ITLB_ENTRIES)
77# define SMALLEST_NTLB_ENTRIES DTLB_ENTRIES
78#else
79# define SMALLEST_NTLB_ENTRIES ITLB_ENTRIES
80#endif
81
82
83/*
84 * asid_cache tracks only the ASID[USER_RING] field of the RASID special
85 * register, which is the current user-task asid allocation value.
86 * mm->context has the same meaning. When it comes time to write the
87 * asid_cache or mm->context values to the RASID special register, we first
88 * shift the value left by 8, then insert the value.
89 * ASID[0] always contains the kernel's asid value, and we reserve three
90 * other asid values that we never assign to user tasks.
91 */
92
93#define ASID_INC 0x1
94#define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
95
96/*
97 * XCHAL_MMU_ASID_INVALID is a configurable Xtensa processor constant
98 * indicating invalid address space. XCHAL_MMU_ASID_KERNEL is a configurable
99 * Xtensa processor constant indicating the kernel address space. They can
100 * be arbitrary values.
101 *
102 * We identify three more unique, reserved ASID values to use in the unused
103 * ring positions. No other user process will be assigned these reserved
104 * ASID values.
105 *
106 * For example, given that
107 *
108 * XCHAL_MMU_ASID_INVALID == 0
109 * XCHAL_MMU_ASID_KERNEL == 1
110 *
111 * the following maze of #if statements would generate
112 *
113 * ASID_RESERVED_1 == 2
114 * ASID_RESERVED_2 == 3
115 * ASID_RESERVED_3 == 4
116 * ASID_FIRST_NONRESERVED == 5
117 */
118
119#if (XCHAL_MMU_ASID_INVALID != XCHAL_MMU_ASID_KERNEL + 1)
120# define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 1) & ASID_MASK)
121#else
122# define ASID_RESERVED_1 ((XCHAL_MMU_ASID_KERNEL + 2) & ASID_MASK)
123#endif
124
125#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_1 + 1)
126# define ASID_RESERVED_2 ((ASID_RESERVED_1 + 1) & ASID_MASK)
127#else
128# define ASID_RESERVED_2 ((ASID_RESERVED_1 + 2) & ASID_MASK)
129#endif
130
131#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_2 + 1)
132# define ASID_RESERVED_3 ((ASID_RESERVED_2 + 1) & ASID_MASK)
133#else
134# define ASID_RESERVED_3 ((ASID_RESERVED_2 + 2) & ASID_MASK)
135#endif
136
137#if (XCHAL_MMU_ASID_INVALID != ASID_RESERVED_3 + 1)
138# define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 1) & ASID_MASK)
139#else
140# define ASID_FIRST_NONRESERVED ((ASID_RESERVED_3 + 2) & ASID_MASK)
141#endif
142
143#define ASID_ALL_RESERVED ( ((ASID_RESERVED_1) << 24) + \
144 ((ASID_RESERVED_2) << 16) + \
145 ((ASID_RESERVED_3) << 8) + \
146 ((XCHAL_MMU_ASID_KERNEL)) )
147
148
149/*
150 * NO_CONTEXT is the invalid ASID value that we don't ever assign to
151 * any user or kernel context. NO_CONTEXT is a better mnemonic than
152 * XCHAL_MMU_ASID_INVALID, so we use it in code instead.
153 */
154
155#define NO_CONTEXT XCHAL_MMU_ASID_INVALID
156
157#if (KERNEL_RING != 0)
158# error The KERNEL_RING really should be zero.
159#endif
160
161#if (USER_RING >= XCHAL_MMU_RINGS)
162# error USER_RING cannot be greater than the highest numbered ring.
163#endif
164
165#if (USER_RING == KERNEL_RING)
166# error The user and kernel rings really should not be equal.
167#endif
168
169#if (USER_RING == 1)
170#define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \
171 ((ASID_RESERVED_2) << 16) + \
172 (((x) & (ASID_MASK)) << 8) + \
173 ((XCHAL_MMU_ASID_KERNEL)) )
174
175#elif (USER_RING == 2)
176#define ASID_INSERT(x) ( ((ASID_RESERVED_1) << 24) + \
177 (((x) & (ASID_MASK)) << 16) + \
178 ((ASID_RESERVED_2) << 8) + \
179 ((XCHAL_MMU_ASID_KERNEL)) )
180
181#elif (USER_RING == 3)
182#define ASID_INSERT(x) ( (((x) & (ASID_MASK)) << 24) + \
183 ((ASID_RESERVED_1) << 16) + \
184 ((ASID_RESERVED_2) << 8) + \
185 ((XCHAL_MMU_ASID_KERNEL)) )
186
187#else
188#error Goofy value for USER_RING
189
190#endif /* USER_RING == 1 */
191
192
193/*
194 * All unused by hardware upper bits will be considered
195 * as a software asid extension.
196 */
197
198#define ASID_VERSION_MASK ((unsigned long)~(ASID_MASK|(ASID_MASK-1)))
199#define ASID_FIRST_VERSION \
200 ((unsigned long)(~ASID_VERSION_MASK) + 1 + ASID_FIRST_NONRESERVED)
201
202extern inline void set_rasid_register (unsigned long val)
203{
204 __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t"
205 " isync\n" : : "a" (val));
206}
207
208extern inline unsigned long get_rasid_register (void)
209{
210 unsigned long tmp;
211 __asm__ __volatile__ (" rsr %0, "__stringify(RASID)"\n\t" : "=a" (tmp));
212 return tmp;
213}
214
215
216#if ((XCHAL_MMU_ASID_INVALID == 0) && (XCHAL_MMU_ASID_KERNEL == 1))
217
218extern inline void
219get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
220{
221 extern void flush_tlb_all(void);
222 if (! ((asid += ASID_INC) & ASID_MASK) ) {
223 flush_tlb_all(); /* start new asid cycle */
224 if (!asid) /* fix version if needed */
225 asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED;
226 asid += ASID_FIRST_NONRESERVED;
227 }
228 mm->context = asid_cache = asid;
229}
230
231#else
232#warning ASID_{INVALID,KERNEL} values impose non-optimal get_new_mmu_context implementation
233
234/* XCHAL_MMU_ASID_INVALID == 0 and XCHAL_MMU_ASID_KERNEL ==1 are
235 really the best, but if you insist... */
236
237extern inline int validate_asid (unsigned long asid)
238{
239 switch (asid) {
240 case XCHAL_MMU_ASID_INVALID:
241 case XCHAL_MMU_ASID_KERNEL:
242 case ASID_RESERVED_1:
243 case ASID_RESERVED_2:
244 case ASID_RESERVED_3:
245 return 0; /* can't use these values as ASIDs */
246 }
247 return 1; /* valid */
248}
249
250extern inline void
251get_new_mmu_context(struct mm_struct *mm, unsigned long asid)
252{
253 extern void flush_tlb_all(void);
254 while (1) {
255 asid += ASID_INC;
256 if ( ! (asid & ASID_MASK) ) {
257 flush_tlb_all(); /* start new asid cycle */
258 if (!asid) /* fix version if needed */
259 asid = ASID_FIRST_VERSION - ASID_FIRST_NONRESERVED;
260 asid += ASID_FIRST_NONRESERVED;
261 break; /* no need to validate here */
262 }
263 if (validate_asid (asid & ASID_MASK))
264 break;
265 }
266 mm->context = asid_cache = asid;
267}
268
269#endif
270
271
272/*
273 * Initialize the context related info for a new mm_struct
274 * instance.
275 */
276
277extern inline int
278init_new_context(struct task_struct *tsk, struct mm_struct *mm)
279{
280 mm->context = NO_CONTEXT;
281 return 0;
282}
283
284extern inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
285 struct task_struct *tsk)
286{
287 unsigned long asid = asid_cache;
288
289 /* Check if our ASID is of an older version and thus invalid */
290
291 if ((next->context ^ asid) & ASID_VERSION_MASK)
292 get_new_mmu_context(next, asid);
293
294 set_rasid_register (ASID_INSERT(next->context));
295 invalidate_page_directory();
296}
297
298#define deactivate_mm(tsk, mm) do { } while(0)
299
300/*
301 * Destroy context related info for an mm_struct that is about
302 * to be put to rest.
303 */
304extern inline void destroy_context(struct mm_struct *mm)
305{
306 /* Nothing to do. */
307}
308
309/*
310 * After we have set current->mm to a new value, this activates
311 * the context for the new mm so we see the new mappings.
312 */
313extern inline void
314activate_mm(struct mm_struct *prev, struct mm_struct *next)
315{
316 /* Unconditionally get a new ASID. */
317
318 get_new_mmu_context(next, asid_cache);
319 set_rasid_register (ASID_INSERT(next->context));
320 invalidate_page_directory();
321}
322
323
324static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
325{
326 /* Nothing to do. */
327
328}
329
330#endif /* _XTENSA_MMU_CONTEXT_H */
diff --git a/include/asm-xtensa/module.h b/include/asm-xtensa/module.h
new file mode 100644
index 000000000000..ffb25bfdf6a1
--- /dev/null
+++ b/include/asm-xtensa/module.h
@@ -0,0 +1,25 @@
1/*
2 * include/asm-xtensa/module.h
3 *
4 * This file contains the module code specific to the Xtensa architecture.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_MODULE_H
14#define _XTENSA_MODULE_H
15
16struct mod_arch_specific
17{
18 /* Module support is not completely implemented. */
19};
20
21#define Elf_Shdr Elf32_Shdr
22#define Elf_Sym Elf32_Sym
23#define Elf_Ehdr Elf32_Ehdr
24
25#endif /* _XTENSA_MODULE_H */
diff --git a/include/asm-xtensa/msgbuf.h b/include/asm-xtensa/msgbuf.h
new file mode 100644
index 000000000000..693c96755280
--- /dev/null
+++ b/include/asm-xtensa/msgbuf.h
@@ -0,0 +1,48 @@
1/*
2 * include/asm-xtensa/msgbuf.h
3 *
4 * The msqid64_ds structure for the Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Pad space is left for:
9 * - 64-bit time_t to solve y2038 problem
10 * - 2 miscellaneous 32-bit values
11 *
12 * This file is subject to the terms and conditions of the GNU General
13 * Public License. See the file "COPYING" in the main directory of
14 * this archive for more details.
15 */
16
17#ifndef _XTENSA_MSGBUF_H
18#define _XTENSA_MSGBUF_H
19
20struct msqid64_ds {
21 struct ipc64_perm msg_perm;
22#ifdef __XTENSA_EB__
23 unsigned int __unused1;
24 __kernel_time_t msg_stime; /* last msgsnd time */
25 unsigned int __unused2;
26 __kernel_time_t msg_rtime; /* last msgrcv time */
27 unsigned int __unused3;
28 __kernel_time_t msg_ctime; /* last change time */
29#elif defined(__XTENSA_EL__)
30 __kernel_time_t msg_stime; /* last msgsnd time */
31 unsigned int __unused1;
32 __kernel_time_t msg_rtime; /* last msgrcv time */
33 unsigned int __unused2;
34 __kernel_time_t msg_ctime; /* last change time */
35 unsigned int __unused3;
36#else
37# error processor byte order undefined!
38#endif
39 unsigned long msg_cbytes; /* current number of bytes on queue */
40 unsigned long msg_qnum; /* number of messages in queue */
41 unsigned long msg_qbytes; /* max number of bytes on queue */
42 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
43 __kernel_pid_t msg_lrpid; /* last receive pid */
44 unsigned long __unused4;
45 unsigned long __unused5;
46};
47
48#endif /* _XTENSA_MSGBUF_H */
diff --git a/include/asm-xtensa/namei.h b/include/asm-xtensa/namei.h
new file mode 100644
index 000000000000..3fdff039d27d
--- /dev/null
+++ b/include/asm-xtensa/namei.h
@@ -0,0 +1,26 @@
1/*
2 * include/asm-xtensa/namei.h
3 *
4 * Included from linux/fs/namei.c
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_NAMEI_H
14#define _XTENSA_NAMEI_H
15
16#ifdef __KERNEL__
17
18/* This dummy routine maybe changed to something useful
19 * for /usr/gnemul/ emulation stuff.
20 * Look at asm-sparc/namei.h for details.
21 */
22
23#define __emul_prefix() NULL
24
25#endif /* __KERNEL__ */
26#endif /* _XTENSA_NAMEI_H */
diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h
new file mode 100644
index 000000000000..b495e5b5a942
--- /dev/null
+++ b/include/asm-xtensa/page.h
@@ -0,0 +1,133 @@
1/*
2 * linux/include/asm-xtensa/page.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PAGE_H
12#define _XTENSA_PAGE_H
13
14#ifdef __KERNEL__
15
16#include <asm/processor.h>
17#include <linux/config.h>
18
19/*
20 * PAGE_SHIFT determines the page size
21 * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary
22 */
23
24#define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE
25#define PAGE_SIZE (1 << PAGE_SHIFT)
26#define PAGE_MASK (~(PAGE_SIZE-1))
27#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK)
28
29#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS)
30#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
31
32#ifdef __ASSEMBLY__
33
34#define __pgprot(x) (x)
35
36#else
37
38/*
39 * These are used to make use of C type-checking..
40 */
41
42typedef struct { unsigned long pte; } pte_t; /* page table entry */
43typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */
44typedef struct { unsigned long pgprot; } pgprot_t;
45
46#define pte_val(x) ((x).pte)
47#define pgd_val(x) ((x).pgd)
48#define pgprot_val(x) ((x).pgprot)
49
50#define __pte(x) ((pte_t) { (x) } )
51#define __pgd(x) ((pgd_t) { (x) } )
52#define __pgprot(x) ((pgprot_t) { (x) } )
53
54/*
55 * Pure 2^n version of get_order
56 */
57
58extern __inline__ int get_order(unsigned long size)
59{
60 int order;
61#ifndef XCHAL_HAVE_NSU
62 unsigned long x1, x2, x4, x8, x16;
63
64 size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
65 x1 = size & 0xAAAAAAAA;
66 x2 = size & 0xCCCCCCCC;
67 x4 = size & 0xF0F0F0F0;
68 x8 = size & 0xFF00FF00;
69 x16 = size & 0xFFFF0000;
70 order = x2 ? 2 : 0;
71 order += (x16 != 0) * 16;
72 order += (x8 != 0) * 8;
73 order += (x4 != 0) * 4;
74 order += (x1 != 0);
75
76 return order;
77#else
78 size = (size - 1) >> PAGE_SHIFT;
79 asm ("nsau %0, %1" : "=r" (order) : "r" (size));
80 return 32 - order;
81#endif
82}
83
84
85struct page;
86extern void clear_page(void *page);
87extern void copy_page(void *to, void *from);
88
89/*
90 * If we have cache aliasing and writeback caches, we might have to do
91 * some extra work
92 */
93
94#if (DCACHE_WAY_SIZE > PAGE_SIZE)
95void clear_user_page(void *addr, unsigned long vaddr, struct page* page);
96void copy_user_page(void *to,void* from,unsigned long vaddr,struct page* page);
97#else
98# define clear_user_page(page,vaddr,pg) clear_page(page)
99# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
100#endif
101
102/*
103 * This handles the memory map. We handle pages at
104 * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space.
105 * These macros are for conversion of kernel address, not user
106 * addresses.
107 */
108
109#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
110#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
111#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr)
112#ifndef CONFIG_DISCONTIGMEM
113# define pfn_to_page(pfn) (mem_map + (pfn))
114# define page_to_pfn(page) ((unsigned long)((page) - mem_map))
115#else
116# error CONFIG_DISCONTIGMEM not supported
117#endif
118
119#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
120#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
121#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
122#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
123
124#define WANT_PAGE_VIRTUAL
125
126
127#endif /* __ASSEMBLY__ */
128
129#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
130 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
131
132#endif /* __KERNEL__ */
133#endif /* _XTENSA_PAGE_H */
diff --git a/include/asm-xtensa/page.h.n b/include/asm-xtensa/page.h.n
new file mode 100644
index 000000000000..546cc6624f24
--- /dev/null
+++ b/include/asm-xtensa/page.h.n
@@ -0,0 +1,135 @@
1/*
2 * linux/include/asm-xtensa/page.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PAGE_H
12#define _XTENSA_PAGE_H
13
14#ifdef __KERNEL__
15
16#include <asm/processor.h>
17#include <linux/config.h>
18
19/*
20 * PAGE_SHIFT determines the page size
21 * PAGE_ALIGN(x) aligns the pointer to the (next) page boundary
22 */
23#define PAGE_SHIFT XCHAL_MMU_MIN_PTE_PAGE_SIZE
24#define PAGE_SIZE (1 << PAGE_SHIFT)
25#define PAGE_MASK (~(PAGE_SIZE-1))
26#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE - 1) & PAGE_MASK)
27
28#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE / XCHAL_DCACHE_WAYS)
29#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
30
31#ifdef __ASSEMBLY__
32
33#define __pgprot(x) (x)
34
35#else
36
37
38/*
39 * These are used to make use of C type-checking..
40 */
41typedef struct { unsigned long pte; } pte_t; /* page table entry */
42typedef struct { unsigned long pmd; } pmd_t; /* PMD table entry */
43typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */
44typedef struct { unsigned long pgprot; } pgprot_t;
45
46#define pte_val(x) ((x).pte)
47#define pmd_val(x) ((x).pmd)
48#define pgd_val(x) ((x).pgd)
49#define pgprot_val(x) ((x).pgprot)
50
51#define __pte(x) ((pte_t) { (x) } )
52#define __pmd(x) ((pmd_t) { (x) } )
53#define __pgd(x) ((pgd_t) { (x) } )
54#define __pgprot(x) ((pgprot_t) { (x) } )
55
56/*
57 * Pure 2^n version of get_order
58 */
59extern __inline__ int get_order(unsigned long size)
60{
61 int order;
62#ifndef XCHAL_HAVE_NSU
63 unsigned long x1, x2, x4, x8, x16;
64
65 size = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
66 x1 = size & 0xAAAAAAAA;
67 x2 = size & 0xCCCCCCCC;
68 x4 = size & 0xF0F0F0F0;
69 x8 = size & 0xFF00FF00;
70 x16 = size & 0xFFFF0000;
71 order = x2 ? 2 : 0;
72 order += (x16 != 0) * 16;
73 order += (x8 != 0) * 8;
74 order += (x4 != 0) * 4;
75 order += (x1 != 0);
76
77 return order;
78#else
79 size = (size - 1) >> PAGE_SHIFT;
80 asm ("nsau %0, %1" : "=r" (order) : "r" (size));
81 return 32 - order;
82#endif
83}
84
85
86struct page;
87extern void clear_page(void *page);
88extern void copy_page(void *to, void *from);
89
90/*
91 * If we have cache aliasing and writeback caches, we might have to do
92 * some extra work
93 */
94
95#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
96void clear_user_page(void *addr, unsigned long vaddr, struct page* page);
97void copy_user_page(void *to, void* from, unsigned long vaddr, struct page* page);
98#else
99# define clear_user_page(page,vaddr,pg) clear_page(page)
100# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
101#endif
102
103
104/*
105 * This handles the memory map. We handle pages at
106 * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space.
107 * These macros are for conversion of kernel address, not user
108 * addresses.
109 */
110
111#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
112#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
113#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr)
114#ifndef CONFIG_DISCONTIGMEM
115# define pfn_to_page(pfn) (mem_map + (pfn))
116# define page_to_pfn(page) ((unsigned long)((page) - mem_map))
117#else
118# error CONFIG_DISCONTIGMEM not supported
119#endif
120
121#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
122#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
123#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
124#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
125
126#define WANT_PAGE_VIRTUAL
127
128
129#endif /* __ASSEMBLY__ */
130
131#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
132 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
133
134#endif /* __KERNEL__ */
135#endif /* _XTENSA_PAGE_H */
diff --git a/include/asm-xtensa/param.h b/include/asm-xtensa/param.h
new file mode 100644
index 000000000000..c0eec8260b0e
--- /dev/null
+++ b/include/asm-xtensa/param.h
@@ -0,0 +1,34 @@
1/*
2 * include/asm-xtensa/param.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PARAM_H
12#define _XTENSA_PARAM_H
13
14#include <xtensa/config/core.h>
15
16#ifdef __KERNEL__
17# define HZ 100 /* internal timer frequency */
18# define USER_HZ 100 /* for user interfaces in "ticks" */
19# define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */
20#endif
21
22#define EXEC_PAGESIZE (1 << XCHAL_MMU_MIN_PTE_PAGE_SIZE)
23
24#ifndef NGROUPS
25#define NGROUPS 32
26#endif
27
28#ifndef NOGROUP
29#define NOGROUP (-1)
30#endif
31
32#define MAXHOSTNAMELEN 64 /* max length of hostname */
33
34#endif /* _XTENSA_PARAM_H */
diff --git a/include/asm-xtensa/pci-bridge.h b/include/asm-xtensa/pci-bridge.h
new file mode 100644
index 000000000000..00fcbd7c534a
--- /dev/null
+++ b/include/asm-xtensa/pci-bridge.h
@@ -0,0 +1,88 @@
1/*
2 * include/asm-xtensa/pci-bridge.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PCI_BRIDGE_H
12#define _XTENSA_PCI_BRIDGE_H
13
14#ifdef __KERNEL__
15
16struct device_node;
17struct pci_controller;
18
19/*
20 * pciauto_bus_scan() enumerates the pci space.
21 */
22
23extern int pciauto_bus_scan(struct pci_controller *, int);
24
25struct pci_space {
26 unsigned long start;
27 unsigned long end;
28 unsigned long base;
29};
30
31/*
32 * Structure of a PCI controller (host bridge)
33 */
34
35struct pci_controller {
36 int index; /* used for pci_controller_num */
37 struct pci_controller *next;
38 struct pci_bus *bus;
39 void *arch_data;
40
41 int first_busno;
42 int last_busno;
43
44 struct pci_ops *ops;
45 volatile unsigned int *cfg_addr;
46 volatile unsigned char *cfg_data;
47
48 /* Currently, we limit ourselves to 1 IO range and 3 mem
49 * ranges since the common pci_bus structure can't handle more
50 */
51 struct resource io_resource;
52 struct resource mem_resources[3];
53 int mem_resource_count;
54
55 /* Host bridge I/O and Memory space
56 * Used for BAR placement algorithms
57 */
58 struct pci_space io_space;
59 struct pci_space mem_space;
60
61 /* Return the interrupt number fo a device. */
62 int (*map_irq)(struct pci_dev*, u8, u8);
63
64};
65
66static inline void pcibios_init_resource(struct resource *res,
67 unsigned long start, unsigned long end, int flags, char *name)
68{
69 res->start = start;
70 res->end = end;
71 res->flags = flags;
72 res->name = name;
73 res->parent = NULL;
74 res->sibling = NULL;
75 res->child = NULL;
76}
77
78
79/* These are used for config access before all the PCI probing has been done. */
80int early_read_config_byte(struct pci_controller*, int, int, int, u8*);
81int early_read_config_word(struct pci_controller*, int, int, int, u16*);
82int early_read_config_dword(struct pci_controller*, int, int, int, u32*);
83int early_write_config_byte(struct pci_controller*, int, int, int, u8);
84int early_write_config_word(struct pci_controller*, int, int, int, u16);
85int early_write_config_dword(struct pci_controller*, int, int, int, u32);
86
87#endif /* __KERNEL__ */
88#endif /* _XTENSA_PCI_BRIDGE_H */
diff --git a/include/asm-xtensa/pci.h b/include/asm-xtensa/pci.h
new file mode 100644
index 000000000000..6817742301c2
--- /dev/null
+++ b/include/asm-xtensa/pci.h
@@ -0,0 +1,89 @@
1/*
2 * linux/include/asm-xtensa/pci.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PCI_H
12#define _XTENSA_PCI_H
13
14#ifdef __KERNEL__
15
16/* Can be used to override the logic in pci_scan_bus for skipping
17 * already-configured bus numbers - to be used for buggy BIOSes
18 * or architectures with incomplete PCI setup by the loader
19 */
20
21#define pcibios_assign_all_busses() 0
22
23extern struct pci_controller* pcibios_alloc_controller(void);
24
25extern inline void pcibios_set_master(struct pci_dev *dev)
26{
27 /* No special bus mastering setup handling */
28}
29
30extern inline void pcibios_penalize_isa_irq(int irq)
31{
32 /* We don't do dynamic PCI IRQ allocation */
33}
34
35/* Assume some values. (We should revise them, if necessary) */
36
37#define PCIBIOS_MIN_IO 0x2000
38#define PCIBIOS_MIN_MEM 0x10000000
39
40/* Dynamic DMA mapping stuff.
41 * Xtensa has everything mapped statically like x86.
42 */
43
44#include <linux/types.h>
45#include <linux/slab.h>
46#include <asm/scatterlist.h>
47#include <linux/string.h>
48#include <asm/io.h>
49
50struct pci_dev;
51
52/* The PCI address space does equal the physical memory address space.
53 * The networking and block device layers use this boolean for bounce buffer
54 * decisions.
55 */
56
57#define PCI_DMA_BUS_IS_PHYS (1)
58
59/* pci_unmap_{page,single} is a no-op, so */
60#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
61#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
62#define pci_unmap_addr(PTR, ADDR_NAME) (0)
63#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
64#define pci_ubnmap_len(PTR, LEN_NAME) (0)
65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
66
67/* We cannot access memory above 4GB */
68#define pci_dac_dma_supported(pci_dev, mask) (0)
69
70/* Map a range of PCI memory or I/O space for a device into user space */
71int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
72 enum pci_mmap_state mmap_state, int write_combine);
73
74/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
75#define HAVE_PCI_MMAP 1
76
77static inline void pcibios_add_platform_entries(struct pci_dev *dev)
78{
79}
80
81#endif /* __KERNEL__ */
82
83/* Implement the pci_ DMA API in terms of the generic device dma_ one */
84#include <asm-generic/pci-dma-compat.h>
85
86/* Generic PCI */
87#include <asm-generic/pci.h>
88
89#endif /* _XTENSA_PCI_H */
diff --git a/include/asm-xtensa/percpu.h b/include/asm-xtensa/percpu.h
new file mode 100644
index 000000000000..6d2bc2ada9d1
--- /dev/null
+++ b/include/asm-xtensa/percpu.h
@@ -0,0 +1,16 @@
1/*
2 * linux/include/asm-xtensa/percpu.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PERCPU__
12#define _XTENSA_PERCPU__
13
14#include <asm-generic/percpu.h>
15
16#endif /* _XTENSA_PERCPU__ */
diff --git a/include/asm-xtensa/pgalloc.h b/include/asm-xtensa/pgalloc.h
new file mode 100644
index 000000000000..734a8d060395
--- /dev/null
+++ b/include/asm-xtensa/pgalloc.h
@@ -0,0 +1,116 @@
1/*
2 * linux/include/asm-xtensa/pgalloc.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001-2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PGALLOC_H
12#define _XTENSA_PGALLOC_H
13
14#ifdef __KERNEL__
15
16#include <linux/config.h>
17#include <linux/threads.h>
18#include <linux/highmem.h>
19#include <asm/processor.h>
20#include <asm/cacheflush.h>
21
22
23/* Cache aliasing:
24 *
25 * If the cache size for one way is greater than the page size, we have to
26 * deal with cache aliasing. The cache index is wider than the page size:
27 *
28 * |cache |
29 * |pgnum |page| virtual address
30 * |xxxxxX|zzzz|
31 * | | |
32 * \ / | |
33 * trans.| |
34 * / \ | |
35 * |yyyyyY|zzzz| physical address
36 *
37 * When the page number is translated to the physical page address, the lowest
38 * bit(s) (X) that are also part of the cache index are also translated (Y).
39 * If this translation changes this bit (X), the cache index is also afected,
40 * thus resulting in a different cache line than before.
41 * The kernel does not provide a mechanism to ensure that the page color
42 * (represented by this bit) remains the same when allocated or when pages
43 * are remapped. When user pages are mapped into kernel space, the color of
44 * the page might also change.
45 *
46 * We use the address space VMALLOC_END ... VMALLOC_END + DCACHE_WAY_SIZE * 2
47 * to temporarily map a patch so we can match the color.
48 */
49
50#if (DCACHE_WAY_SIZE > PAGE_SIZE)
51# define PAGE_COLOR_MASK (PAGE_MASK & (DCACHE_WAY_SIZE-1))
52# define PAGE_COLOR(a) \
53 (((unsigned long)(a)&PAGE_COLOR_MASK) >> PAGE_SHIFT)
54# define PAGE_COLOR_EQ(a,b) \
55 ((((unsigned long)(a) ^ (unsigned long)(b)) & PAGE_COLOR_MASK) == 0)
56# define PAGE_COLOR_MAP0(v) \
57 (VMALLOC_END + ((unsigned long)(v) & PAGE_COLOR_MASK))
58# define PAGE_COLOR_MAP1(v) \
59 (VMALLOC_END + ((unsigned long)(v) & PAGE_COLOR_MASK) + DCACHE_WAY_SIZE)
60#endif
61
62/*
63 * Allocating and freeing a pmd is trivial: the 1-entry pmd is
64 * inside the pgd, so has no extra memory associated with it.
65 */
66
67#define pgd_free(pgd) free_page((unsigned long)(pgd))
68
69#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
70
71static inline void
72pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp, pte_t *pte)
73{
74 pmd_val(*(pmdp)) = (unsigned long)(pte);
75 __asm__ __volatile__ ("memw; dhwb %0, 0; dsync" :: "a" (pmdp));
76}
77
78static inline void
79pmd_populate(struct mm_struct *mm, pmd_t *pmdp, struct page *page)
80{
81 pmd_val(*(pmdp)) = (unsigned long)page_to_virt(page);
82 __asm__ __volatile__ ("memw; dhwb %0, 0; dsync" :: "a" (pmdp));
83}
84
85
86
87#else
88
89# define pmd_populate_kernel(mm, pmdp, pte) \
90 (pmd_val(*(pmdp)) = (unsigned long)(pte))
91# define pmd_populate(mm, pmdp, page) \
92 (pmd_val(*(pmdp)) = (unsigned long)page_to_virt(page))
93
94#endif
95
96static inline pgd_t*
97pgd_alloc(struct mm_struct *mm)
98{
99 pgd_t *pgd;
100
101 pgd = (pgd_t *)__get_free_pages(GFP_KERNEL|__GFP_ZERO, PGD_ORDER);
102
103 if (likely(pgd != NULL))
104 __flush_dcache_page((unsigned long)pgd);
105
106 return pgd;
107}
108
109extern pte_t* pte_alloc_one_kernel(struct mm_struct* mm, unsigned long addr);
110extern struct page* pte_alloc_one(struct mm_struct* mm, unsigned long addr);
111
112#define pte_free_kernel(pte) free_page((unsigned long)pte)
113#define pte_free(pte) __free_page(pte)
114
115#endif /* __KERNEL__ */
116#endif /* _XTENSA_PGALLOC_H */
diff --git a/include/asm-xtensa/pgtable.h b/include/asm-xtensa/pgtable.h
new file mode 100644
index 000000000000..0bb6416ae266
--- /dev/null
+++ b/include/asm-xtensa/pgtable.h
@@ -0,0 +1,468 @@
1/*
2 * linux/include/asm-xtensa/page.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PGTABLE_H
12#define _XTENSA_PGTABLE_H
13
14#include <asm-generic/pgtable-nopmd.h>
15#include <asm/page.h>
16
17/* Assertions. */
18
19#ifdef CONFIG_MMU
20
21
22#if (XCHAL_MMU_RINGS < 2)
23# error Linux build assumes at least 2 ring levels.
24#endif
25
26#if (XCHAL_MMU_CA_BITS != 4)
27# error We assume exactly four bits for CA.
28#endif
29
30#if (XCHAL_MMU_SR_BITS != 0)
31# error We have no room for SR bits.
32#endif
33
34/*
35 * Use the first min-wired way for mapping page-table pages.
36 * Page coloring requires a second min-wired way.
37 */
38
39#if (XCHAL_DTLB_MINWIRED_SETS == 0)
40# error Need a min-wired way for mapping page-table pages
41#endif
42
43#define DTLB_WAY_PGTABLE XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAY)
44
45#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
46# if XCHAL_DTLB_SET(XCHAL_DTLB_MINWIRED_SET0, WAYS) >= 2
47# define DTLB_WAY_DCACHE_ALIAS0 (DTLB_WAY_PGTABLE + 1)
48# define DTLB_WAY_DCACHE_ALIAS1 (DTLB_WAY_PGTABLE + 2)
49# else
50# error Page coloring requires its own wired dtlb way!
51# endif
52#endif
53
54#endif /* CONFIG_MMU */
55
56/*
57 * We only use two ring levels, user and kernel space.
58 */
59
60#define USER_RING 1 /* user ring level */
61#define KERNEL_RING 0 /* kernel ring level */
62
63/*
64 * The Xtensa architecture port of Linux has a two-level page table system,
65 * i.e. the logical three-level Linux page table layout are folded.
66 * Each task has the following memory page tables:
67 *
68 * PGD table (page directory), ie. 3rd-level page table:
69 * One page (4 kB) of 1024 (PTRS_PER_PGD) pointers to PTE tables
70 * (Architectures that don't have the PMD folded point to the PMD tables)
71 *
72 * The pointer to the PGD table for a given task can be retrieved from
73 * the task structure (struct task_struct*) t, e.g. current():
74 * (t->mm ? t->mm : t->active_mm)->pgd
75 *
76 * PMD tables (page middle-directory), ie. 2nd-level page tables:
77 * Absent for the Xtensa architecture (folded, PTRS_PER_PMD == 1).
78 *
79 * PTE tables (page table entry), ie. 1st-level page tables:
80 * One page (4 kB) of 1024 (PTRS_PER_PTE) PTEs with a special PTE
81 * invalid_pte_table for absent mappings.
82 *
83 * The individual pages are 4 kB big with special pages for the empty_zero_page.
84 */
85#define PGDIR_SHIFT 22
86#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
87#define PGDIR_MASK (~(PGDIR_SIZE-1))
88
89/*
90 * Entries per page directory level: we use two-level, so
91 * we don't really have any PMD directory physically.
92 */
93#define PTRS_PER_PTE 1024
94#define PTRS_PER_PTE_SHIFT 10
95#define PTRS_PER_PMD 1
96#define PTRS_PER_PGD 1024
97#define PGD_ORDER 0
98#define PMD_ORDER 0
99#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
100#define FIRST_USER_ADDRESS XCHAL_SEG_MAPPABLE_VADDR
101#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
102
103/* virtual memory area. We keep a distance to other memory regions to be
104 * on the safe side. We also use this area for cache aliasing.
105 */
106
107// FIXME: virtual memory area must be configuration-dependent
108
109#define VMALLOC_START 0xC0000000
110#define VMALLOC_END 0xC7FF0000
111
112/* Xtensa Linux config PTE layout (when present):
113 * 31-12: PPN
114 * 11-6: Software
115 * 5-4: RING
116 * 3-0: CA
117 *
118 * Similar to the Alpha and MIPS ports, we need to keep track of the ref
119 * and mod bits in software. We have a software "you can read
120 * from this page" bit, and a hardware one which actually lets the
121 * process read from the page. On the same token we have a software
122 * writable bit and the real hardware one which actually lets the
123 * process write to the page.
124 *
125 * See further below for PTE layout for swapped-out pages.
126 */
127
128#define _PAGE_VALID (1<<0) /* hardware: page is accessible */
129#define _PAGE_WRENABLE (1<<1) /* hardware: page is writable */
130
131/* None of these cache modes include MP coherency: */
132#define _PAGE_NO_CACHE (0<<2) /* bypass, non-speculative */
133#if XCHAL_DCACHE_IS_WRITEBACK
134# define _PAGE_WRITEBACK (1<<2) /* write back */
135# define _PAGE_WRITETHRU (2<<2) /* write through */
136#else
137# define _PAGE_WRITEBACK (1<<2) /* assume write through */
138# define _PAGE_WRITETHRU (1<<2)
139#endif
140#define _PAGE_NOALLOC (3<<2) /* don't allocate cache,if not cached */
141#define _CACHE_MASK (3<<2)
142
143#define _PAGE_USER (1<<4) /* user access (ring=1) */
144#define _PAGE_KERNEL (0<<4) /* kernel access (ring=0) */
145
146/* Software */
147#define _PAGE_RW (1<<6) /* software: page writable */
148#define _PAGE_DIRTY (1<<7) /* software: page dirty */
149#define _PAGE_ACCESSED (1<<8) /* software: page accessed (read) */
150#define _PAGE_FILE (1<<9) /* nonlinear file mapping*/
151
152#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _CACHE_MASK | _PAGE_DIRTY)
153#define _PAGE_PRESENT ( _PAGE_VALID | _PAGE_WRITEBACK | _PAGE_ACCESSED)
154
155#ifdef CONFIG_MMU
156
157# define PAGE_NONE __pgprot(_PAGE_PRESENT)
158# define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_RW)
159# define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER)
160# define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER)
161# define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_KERNEL | _PAGE_WRENABLE)
162# define PAGE_INVALID __pgprot(_PAGE_USER)
163
164# if (DCACHE_WAY_SIZE > PAGE_SIZE)
165# define PAGE_DIRECTORY __pgprot(_PAGE_VALID | _PAGE_ACCESSED | _PAGE_KERNEL)
166# else
167# define PAGE_DIRECTORY __pgprot(_PAGE_PRESENT | _PAGE_KERNEL)
168# endif
169
170#else /* no mmu */
171
172# define PAGE_NONE __pgprot(0)
173# define PAGE_SHARED __pgprot(0)
174# define PAGE_COPY __pgprot(0)
175# define PAGE_READONLY __pgprot(0)
176# define PAGE_KERNEL __pgprot(0)
177
178#endif
179
180/*
181 * On certain configurations of Xtensa MMUs (eg. the initial Linux config),
182 * the MMU can't do page protection for execute, and considers that the same as
183 * read. Also, write permissions may imply read permissions.
184 * What follows is the closest we can get by reasonable means..
185 * See linux/mm/mmap.c for protection_map[] array that uses these definitions.
186 */
187#define __P000 PAGE_NONE /* private --- */
188#define __P001 PAGE_READONLY /* private --r */
189#define __P010 PAGE_COPY /* private -w- */
190#define __P011 PAGE_COPY /* private -wr */
191#define __P100 PAGE_READONLY /* private x-- */
192#define __P101 PAGE_READONLY /* private x-r */
193#define __P110 PAGE_COPY /* private xw- */
194#define __P111 PAGE_COPY /* private xwr */
195
196#define __S000 PAGE_NONE /* shared --- */
197#define __S001 PAGE_READONLY /* shared --r */
198#define __S010 PAGE_SHARED /* shared -w- */
199#define __S011 PAGE_SHARED /* shared -wr */
200#define __S100 PAGE_READONLY /* shared x-- */
201#define __S101 PAGE_READONLY /* shared x-r */
202#define __S110 PAGE_SHARED /* shared xw- */
203#define __S111 PAGE_SHARED /* shared xwr */
204
205#ifndef __ASSEMBLY__
206
207#define pte_ERROR(e) \
208 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
209#define pgd_ERROR(e) \
210 printk("%s:%d: bad pgd entry %08lx.\n", __FILE__, __LINE__, pgd_val(e))
211
212extern unsigned long empty_zero_page[1024];
213
214#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
215
216extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)];
217
218/*
219 * The pmd contains the kernel virtual address of the pte page.
220 */
221#define pmd_page_kernel(pmd) ((unsigned long)(pmd_val(pmd) & PAGE_MASK))
222#define pmd_page(pmd) virt_to_page(pmd_val(pmd))
223
224/*
225 * The following only work if pte_present() is true.
226 */
227#define pte_none(pte) (!(pte_val(pte) ^ _PAGE_USER))
228#define pte_present(pte) (pte_val(pte) & _PAGE_VALID)
229#define pte_clear(mm,addr,ptep) \
230 do { update_pte(ptep, __pte(_PAGE_USER)); } while(0)
231
232#define pmd_none(pmd) (!pmd_val(pmd))
233#define pmd_present(pmd) (pmd_val(pmd) & PAGE_MASK)
234#define pmd_clear(pmdp) do { set_pmd(pmdp, __pmd(0)); } while (0)
235#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
236
237/* Note: We use the _PAGE_USER bit to indicate write-protect kernel memory */
238
239static inline int pte_read(pte_t pte) { return pte_val(pte) & _PAGE_USER; }
240static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
241static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
242static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
243static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
244static inline pte_t pte_wrprotect(pte_t pte) { pte_val(pte) &= ~(_PAGE_RW | _PAGE_WRENABLE); return pte; }
245static inline pte_t pte_rdprotect(pte_t pte) { pte_val(pte) &= ~_PAGE_USER; return pte; }
246static inline pte_t pte_mkclean(pte_t pte) { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
247static inline pte_t pte_mkold(pte_t pte) { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
248static inline pte_t pte_mkread(pte_t pte) { pte_val(pte) |= _PAGE_USER; return pte; }
249static inline pte_t pte_mkdirty(pte_t pte) { pte_val(pte) |= _PAGE_DIRTY; return pte; }
250static inline pte_t pte_mkyoung(pte_t pte) { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
251static inline pte_t pte_mkwrite(pte_t pte) { pte_val(pte) |= _PAGE_RW; return pte; }
252
253/*
254 * Conversion functions: convert a page and protection to a page entry,
255 * and a page entry and page directory to the page they refer to.
256 */
257#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
258#define pte_same(a,b) (pte_val(a) == pte_val(b))
259#define pte_page(x) pfn_to_page(pte_pfn(x))
260#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
261#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
262
263extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
264{
265 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
266}
267
268/*
269 * Certain architectures need to do special things when pte's
270 * within a page table are directly modified. Thus, the following
271 * hook is made available.
272 */
273static inline void update_pte(pte_t *ptep, pte_t pteval)
274{
275 *ptep = pteval;
276#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
277 __asm__ __volatile__ ("memw; dhwb %0, 0; dsync" :: "a" (ptep));
278#endif
279}
280
281extern inline void
282set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval)
283{
284 update_pte(ptep, pteval);
285}
286
287
288extern inline void
289set_pmd(pmd_t *pmdp, pmd_t pmdval)
290{
291 *pmdp = pmdval;
292#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
293 __asm__ __volatile__ ("memw; dhwb %0, 0; dsync" :: "a" (pmdp));
294#endif
295}
296
297
298static inline int
299ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
300 pte_t *ptep)
301{
302 pte_t pte = *ptep;
303 if (!pte_young(pte))
304 return 0;
305 update_pte(ptep, pte_mkold(pte));
306 return 1;
307}
308
309static inline int
310ptep_test_and_clear_dirty(struct vm_area_struct *vma, unsigned long addr,
311 pte_t *ptep)
312{
313 pte_t pte = *ptep;
314 if (!pte_dirty(pte))
315 return 0;
316 update_pte(ptep, pte_mkclean(pte));
317 return 1;
318}
319
320static inline pte_t
321ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
322{
323 pte_t pte = *ptep;
324 pte_clear(mm, addr, ptep);
325 return pte;
326}
327
328static inline void
329ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
330{
331 pte_t pte = *ptep;
332 update_pte(ptep, pte_wrprotect(pte));
333}
334
335/* to find an entry in a kernel page-table-directory */
336#define pgd_offset_k(address) pgd_offset(&init_mm, address)
337
338/* to find an entry in a page-table-directory */
339#define pgd_offset(mm,address) ((mm)->pgd + pgd_index(address))
340
341#define pgd_index(address) ((address) >> PGDIR_SHIFT)
342
343/* Find an entry in the second-level page table.. */
344#define pmd_offset(dir,address) ((pmd_t*)(dir))
345
346/* Find an entry in the third-level page table.. */
347#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
348#define pte_offset_kernel(dir,addr) \
349 ((pte_t*) pmd_page_kernel(*(dir)) + pte_index(addr))
350#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
351#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
352
353#define pte_unmap(pte) do { } while (0)
354#define pte_unmap_nested(pte) do { } while (0)
355
356
357/*
358 * Encode and decode a swap entry.
359 * Each PTE in a process VM's page table is either:
360 * "present" -- valid and not swapped out, protection bits are meaningful;
361 * "not present" -- which further subdivides in these two cases:
362 * "none" -- no mapping at all; identified by pte_none(), set by pte_clear(
363 * "swapped out" -- the page is swapped out, and the SWP macros below
364 * are used to store swap file info in the PTE itself.
365 *
366 * In the Xtensa processor MMU, any PTE entries in user space (or anywhere
367 * in virtual memory that can map differently across address spaces)
368 * must have a correct ring value that represents the RASID field that
369 * is changed when switching address spaces. Eg. such PTE entries cannot
370 * be set to ring zero, because that can cause a (global) kernel ASID
371 * entry to be created in the TLBs (even with invalid cache attribute),
372 * potentially causing a multihit exception when going back to another
373 * address space that mapped the same virtual address at another ring.
374 *
375 * SO: we avoid using ring bits (_PAGE_RING_MASK) in "not present" PTEs.
376 * We also avoid using the _PAGE_VALID bit which must be zero for non-present
377 * pages.
378 *
379 * We end up with the following available bits: 1..3 and 7..31.
380 * We don't bother with 1..3 for now (we can use them later if needed),
381 * and chose to allocate 6 bits for SWP_TYPE and the remaining 19 bits
382 * for SWP_OFFSET. At least 5 bits are needed for SWP_TYPE, because it
383 * is currently implemented as an index into swap_info[MAX_SWAPFILES]
384 * and MAX_SWAPFILES is currently defined as 32 in <linux/swap.h>.
385 * However, for some reason all other architectures in the 2.4 kernel
386 * reserve either 6, 7, or 8 bits so I'll not detract from that for now. :)
387 * SWP_OFFSET is an offset into the swap file in page-size units, so
388 * with 4 kB pages, 19 bits supports a maximum swap file size of 2 GB.
389 *
390 * FIXME: 2 GB isn't very big. Other bits can be used to allow
391 * larger swap sizes. In the meantime, it appears relatively easy to get
392 * around the 2 GB limitation by simply using multiple swap files.
393 */
394
395#define __swp_type(entry) (((entry).val >> 7) & 0x3f)
396#define __swp_offset(entry) ((entry).val >> 13)
397#define __swp_entry(type,offs) ((swp_entry_t) {((type) << 7) | ((offs) << 13)})
398#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
399#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
400
401#define PTE_FILE_MAX_BITS 29
402#define pte_to_pgoff(pte) (pte_val(pte) >> 3)
403#define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE })
404
405
406#endif /* !defined (__ASSEMBLY__) */
407
408
409#ifdef __ASSEMBLY__
410
411/* Assembly macro _PGD_INDEX is the same as C pgd_index(unsigned long),
412 * _PGD_OFFSET as C pgd_offset(struct mm_struct*, unsigned long),
413 * _PMD_OFFSET as C pmd_offset(pgd_t*, unsigned long)
414 * _PTE_OFFSET as C pte_offset(pmd_t*, unsigned long)
415 *
416 * Note: We require an additional temporary register which can be the same as
417 * the register that holds the address.
418 *
419 * ((pte_t*) ((unsigned long)(pmd_val(*pmd) & PAGE_MASK)) + pte_index(addr))
420 *
421 */
422#define _PGD_INDEX(rt,rs) extui rt, rs, PGDIR_SHIFT, 32-PGDIR_SHIFT
423#define _PTE_INDEX(rt,rs) extui rt, rs, PAGE_SHIFT, PTRS_PER_PTE_SHIFT
424
425#define _PGD_OFFSET(mm,adr,tmp) l32i mm, mm, MM_PGD; \
426 _PGD_INDEX(tmp, adr); \
427 addx4 mm, tmp, mm
428
429#define _PTE_OFFSET(pmd,adr,tmp) _PTE_INDEX(tmp, adr); \
430 srli pmd, pmd, PAGE_SHIFT; \
431 slli pmd, pmd, PAGE_SHIFT; \
432 addx4 pmd, tmp, pmd
433
434#else
435
436extern void paging_init(void);
437
438#define kern_addr_valid(addr) (1)
439
440extern void update_mmu_cache(struct vm_area_struct * vma,
441 unsigned long address, pte_t pte);
442
443/*
444 * remap a physical address `phys' of size `size' with page protection `prot'
445 * into virtual address `from'
446 */
447#define io_remap_page_range(vma,from,phys,size,prot) \
448 remap_pfn_range(vma, from, (phys) >> PAGE_SHIFT, size, prot)
449
450
451/* No page table caches to init */
452
453#define pgtable_cache_init() do { } while (0)
454
455typedef pte_t *pte_addr_t;
456
457#endif /* !defined (__ASSEMBLY__) */
458
459#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
460#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
461#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
462#define __HAVE_ARCH_PTEP_SET_WRPROTECT
463#define __HAVE_ARCH_PTEP_MKDIRTY
464#define __HAVE_ARCH_PTE_SAME
465
466#include <asm-generic/pgtable.h>
467
468#endif /* _XTENSA_PGTABLE_H */
diff --git a/include/asm-xtensa/platform-iss/hardware.h b/include/asm-xtensa/platform-iss/hardware.h
new file mode 100644
index 000000000000..22240f001803
--- /dev/null
+++ b/include/asm-xtensa/platform-iss/hardware.h
@@ -0,0 +1,29 @@
1/*
2 * include/asm-xtensa/platform-iss/hardware.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 Tensilica Inc.
9 */
10
11/*
12 * This file contains the default configuration of ISS.
13 */
14
15#ifndef __ASM_XTENSA_ISS_HARDWARE
16#define __ASM_XTENSA_ISS_HARDWARE
17
18/*
19 * Memory configuration.
20 */
21
22#define PLATFORM_DEFAULT_MEM_START XSHAL_RAM_PADDR
23#define PLATFORM_DEFAULT_MEM_SIZE XSHAL_RAM_VSIZE
24
25/*
26 * Interrupt configuration.
27 */
28
29#endif /* __ASM_XTENSA_ISS_HARDWARE */
diff --git a/include/asm-xtensa/platform.h b/include/asm-xtensa/platform.h
new file mode 100644
index 000000000000..36163894bc20
--- /dev/null
+++ b/include/asm-xtensa/platform.h
@@ -0,0 +1,92 @@
1/*
2 * include/asm-xtensa/platform.h
3 *
4 * Platform specific functions
5 *
6 * This file is subject to the terms and conditions of the GNU General
7 * Public License. See the file "COPYING" in the main directory of
8 * this archive for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_PLATFORM_H
14#define _XTENSA_PLATFORM_H
15
16#include <linux/config.h>
17#include <linux/types.h>
18#include <linux/pci.h>
19
20#include <asm/bootparam.h>
21
22/*
23 * platform_init is called before the mmu is initialized to give the
24 * platform a early hook-up. bp_tag_t is a list of configuration tags
25 * passed from the boot-loader.
26 */
27extern void platform_init(bp_tag_t*);
28
29/*
30 * platform_setup is called from setup_arch with a pointer to the command-line
31 * string.
32 */
33extern void platform_setup (char **);
34
35/*
36 * platform_init_irq is called from init_IRQ.
37 */
38extern void platform_init_irq (void);
39
40/*
41 * platform_restart is called to restart the system.
42 */
43extern void platform_restart (void);
44
45/*
46 * platform_halt is called to stop the system and halt.
47 */
48extern void platform_halt (void);
49
50/*
51 * platform_power_off is called to stop the system and power it off.
52 */
53extern void platform_power_off (void);
54
55/*
56 * platform_idle is called from the idle function.
57 */
58extern void platform_idle (void);
59
60/*
61 * platform_heartbeat is called every HZ
62 */
63extern void platform_heartbeat (void);
64
65/*
66 * platform_pcibios_init is called to allow the platform to setup the pci bus.
67 */
68extern void platform_pcibios_init (void);
69
70/*
71 * platform_pcibios_fixup allows to modify the PCI configuration.
72 */
73extern int platform_pcibios_fixup (void);
74
75/*
76 * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
77 */
78extern void platform_calibrate_ccount (void);
79
80/*
81 * platform_get_rtc_time returns RTC seconds (returns 0 for no error)
82 */
83extern int platform_get_rtc_time(time_t*);
84
85/*
86 * platform_set_rtc_time set RTC seconds (returns 0 for no error)
87 */
88extern int platform_set_rtc_time(time_t);
89
90
91#endif /* _XTENSA_PLATFORM_H */
92
diff --git a/include/asm-xtensa/poll.h b/include/asm-xtensa/poll.h
new file mode 100644
index 000000000000..dffe447534e0
--- /dev/null
+++ b/include/asm-xtensa/poll.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-xtensa/poll.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_POLL_H
12#define _XTENSA_POLL_H
13
14
15#define POLLIN 0x0001
16#define POLLPRI 0x0002
17#define POLLOUT 0x0004
18
19#define POLLERR 0x0008
20#define POLLHUP 0x0010
21#define POLLNVAL 0x0020
22
23#define POLLRDNORM 0x0040
24#define POLLRDBAND 0x0080
25#define POLLWRNORM POLLOUT
26#define POLLWRBAND 0x0100
27
28#define POLLMSG 0x0400
29#define POLLREMOVE 0x0800
30
31struct pollfd {
32 int fd;
33 short events;
34 short revents;
35};
36
37#endif /* _XTENSA_POLL_H */
diff --git a/include/asm-xtensa/posix_types.h b/include/asm-xtensa/posix_types.h
new file mode 100644
index 000000000000..2c816b0e7762
--- /dev/null
+++ b/include/asm-xtensa/posix_types.h
@@ -0,0 +1,123 @@
1/*
2 * include/asm-xtensa/posix_types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Largely copied from include/asm-ppc/posix_types.h
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_POSIX_TYPES_H
14#define _XTENSA_POSIX_TYPES_H
15
16/*
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
20 */
21
22typedef unsigned long __kernel_ino_t;
23typedef unsigned int __kernel_mode_t;
24typedef unsigned short __kernel_nlink_t;
25typedef long __kernel_off_t;
26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t;
28typedef unsigned int __kernel_uid_t;
29typedef unsigned int __kernel_gid_t;
30typedef unsigned int __kernel_size_t;
31typedef int __kernel_ssize_t;
32typedef long __kernel_ptrdiff_t;
33typedef long __kernel_time_t;
34typedef long __kernel_suseconds_t;
35typedef long __kernel_clock_t;
36typedef int __kernel_timer_t;
37typedef int __kernel_clockid_t;
38typedef int __kernel_daddr_t;
39typedef char * __kernel_caddr_t;
40typedef unsigned short __kernel_uid16_t;
41typedef unsigned short __kernel_gid16_t;
42typedef unsigned int __kernel_uid32_t;
43typedef unsigned int __kernel_gid32_t;
44
45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t;
47typedef unsigned short __kernel_old_dev_t;
48
49#ifdef __GNUC__
50typedef long long __kernel_loff_t;
51#endif
52
53typedef struct {
54 int val[2];
55} __kernel_fsid_t;
56
57#ifndef __GNUC__
58
59#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
62#define __FD_ZERO(set) \
63 ((void) memset ((__ptr_t) (set), 0, sizeof (__kernel_fd_set)))
64
65#else /* __GNUC__ */
66
67#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) \
68 || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 0)
69/* With GNU C, use inline functions instead so args are evaluated only once: */
70
71#undef __FD_SET
72static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
73{
74 unsigned long _tmp = fd / __NFDBITS;
75 unsigned long _rem = fd % __NFDBITS;
76 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
77}
78
79#undef __FD_CLR
80static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
81{
82 unsigned long _tmp = fd / __NFDBITS;
83 unsigned long _rem = fd % __NFDBITS;
84 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
85}
86
87#undef __FD_ISSET
88static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
89{
90 unsigned long _tmp = fd / __NFDBITS;
91 unsigned long _rem = fd % __NFDBITS;
92 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
93}
94
95/*
96 * This will unroll the loop for the normal constant case (8 ints,
97 * for a 256-bit fd_set)
98 */
99#undef __FD_ZERO
100static __inline__ void __FD_ZERO(__kernel_fd_set *p)
101{
102 unsigned int *tmp = (unsigned int *)p->fds_bits;
103 int i;
104
105 if (__builtin_constant_p(__FDSET_LONGS)) {
106 switch (__FDSET_LONGS) {
107 case 8:
108 tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
109 tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
110 return;
111 }
112 }
113 i = __FDSET_LONGS;
114 while (i) {
115 i--;
116 *tmp = 0;
117 tmp++;
118 }
119}
120
121#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
122#endif /* __GNUC__ */
123#endif /* _XTENSA_POSIX_TYPES_H */
diff --git a/include/asm-xtensa/processor.h b/include/asm-xtensa/processor.h
new file mode 100644
index 000000000000..9cab5e4298b9
--- /dev/null
+++ b/include/asm-xtensa/processor.h
@@ -0,0 +1,205 @@
1/*
2 * include/asm-xtensa/processor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PROCESSOR_H
12#define _XTENSA_PROCESSOR_H
13
14#ifdef __ASSEMBLY__
15#define _ASMLANGUAGE
16#endif
17
18#include <xtensa/config/core.h>
19#include <xtensa/config/specreg.h>
20#include <xtensa/config/tie.h>
21#include <xtensa/config/system.h>
22
23#include <asm/ptrace.h>
24#include <asm/types.h>
25#include <asm/coprocessor.h>
26
27/* Assertions. */
28
29#if (XCHAL_HAVE_WINDOWED != 1)
30#error Linux requires the Xtensa Windowed Registers Option.
31#endif
32
33/*
34 * User space process size: 1 GB.
35 * Windowed call ABI requires caller and callee to be located within the same
36 * 1 GB region. The C compiler places trampoline code on the stack for sources
37 * that take the address of a nested C function (a feature used by glibc), so
38 * the 1 GB requirement applies to the stack as well.
39 */
40
41#define TASK_SIZE 0x40000000
42
43/*
44 * General exception cause assigned to debug exceptions. Debug exceptions go
45 * to their own vector, rather than the general exception vectors (user,
46 * kernel, double); and their specific causes are reported via DEBUGCAUSE
47 * rather than EXCCAUSE. However it is sometimes convenient to redirect debug
48 * exceptions to the general exception mechanism. To do this, an otherwise
49 * unused EXCCAUSE value was assigned to debug exceptions for this purpose.
50 */
51
52#define EXCCAUSE_MAPPED_DEBUG 63
53
54/*
55 * We use DEPC also as a flag to distinguish between double and regular
56 * exceptions. For performance reasons, DEPC might contain the value of
57 * EXCCAUSE for regular exceptions, so we use this definition to mark a
58 * valid double exception address.
59 * (Note: We use it in bgeui, so it should be 64, 128, or 256)
60 */
61
62#define VALID_DOUBLE_EXCEPTION_ADDRESS 64
63
64/* LOCKLEVEL defines the interrupt level that masks all
65 * general-purpose interrupts.
66 */
67#define LOCKLEVEL 1
68
69/* WSBITS and WBBITS are the width of the WINDOWSTART and WINDOWBASE
70 * registers
71 */
72#define WSBITS (XCHAL_NUM_AREGS / 4) /* width of WINDOWSTART in bits */
73#define WBBITS (XCHAL_NUM_AREGS_LOG2 - 2) /* width of WINDOWBASE in bits */
74
75#ifndef __ASSEMBLY__
76
77/* Build a valid return address for the specified call winsize.
78 * winsize must be 1 (call4), 2 (call8), or 3 (call12)
79 */
80#define MAKE_RA_FOR_CALL(ra,ws) (((ra) & 0x3fffffff) | (ws) << 30)
81
82/* Convert return address to a valid pc
83 * Note: We assume that the stack pointer is in the same 1GB ranges as the ra
84 */
85#define MAKE_PC_FROM_RA(ra,sp) (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))
86
87typedef struct {
88 unsigned long seg;
89} mm_segment_t;
90
91struct thread_struct {
92
93 /* kernel's return address and stack pointer for context switching */
94 unsigned long ra; /* kernel's a0: return address and window call size */
95 unsigned long sp; /* kernel's a1: stack pointer */
96
97 mm_segment_t current_ds; /* see uaccess.h for example uses */
98
99 /* struct xtensa_cpuinfo info; */
100
101 unsigned long bad_vaddr; /* last user fault */
102 unsigned long bad_uaddr; /* last kernel fault accessing user space */
103 unsigned long error_code;
104
105 unsigned long ibreak[XCHAL_NUM_IBREAK];
106 unsigned long dbreaka[XCHAL_NUM_DBREAK];
107 unsigned long dbreakc[XCHAL_NUM_DBREAK];
108
109 /* Allocate storage for extra state and coprocessor state. */
110 unsigned char cp_save[XTENSA_CP_EXTRA_SIZE]
111 __attribute__ ((aligned(XTENSA_CP_EXTRA_ALIGN)));
112
113 /* Make structure 16 bytes aligned. */
114 int align[0] __attribute__ ((aligned(16)));
115};
116
117
118/*
119 * Default implementation of macro that returns current
120 * instruction pointer ("program counter").
121 */
122#define current_text_addr() ({ __label__ _l; _l: &&_l;})
123
124
125/* This decides where the kernel will search for a free chunk of vm
126 * space during mmap's.
127 */
128#define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
129
130#define INIT_THREAD \
131{ \
132 ra: 0, \
133 sp: sizeof(init_stack) + (long) &init_stack, \
134 current_ds: {0}, \
135 /*info: {0}, */ \
136 bad_vaddr: 0, \
137 bad_uaddr: 0, \
138 error_code: 0, \
139}
140
141
142/*
143 * Do necessary setup to start up a newly executed thread.
144 * Note: We set-up ps as if we did a call4 to the new pc.
145 * set_thread_state in signal.c depends on it.
146 */
147#define USER_PS_VALUE ( (1 << XCHAL_PS_WOE_SHIFT) + \
148 (1 << XCHAL_PS_CALLINC_SHIFT) + \
149 (USER_RING << XCHAL_PS_RING_SHIFT) + \
150 (1 << XCHAL_PS_PROGSTACK_SHIFT) + \
151 (1 << XCHAL_PS_EXCM_SHIFT) )
152
153/* Clearing a0 terminates the backtrace. */
154#define start_thread(regs, new_pc, new_sp) \
155 regs->pc = new_pc; \
156 regs->ps = USER_PS_VALUE; \
157 regs->areg[1] = new_sp; \
158 regs->areg[0] = 0; \
159 regs->wmask = 1; \
160 regs->depc = 0; \
161 regs->windowbase = 0; \
162 regs->windowstart = 1;
163
164/* Forward declaration */
165struct task_struct;
166struct mm_struct;
167
168// FIXME: do we need release_thread for CP??
169/* Free all resources held by a thread. */
170#define release_thread(thread) do { } while(0)
171
172// FIXME: do we need prepare_to_copy (lazy status) for CP??
173/* Prepare to copy thread state - unlazy all lazy status */
174#define prepare_to_copy(tsk) do { } while (0)
175
176/*
177 * create a kernel thread without removing it from tasklists
178 */
179extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
180
181/* Copy and release all segment info associated with a VM */
182
183#define copy_segments(p, mm) do { } while(0)
184#define release_segments(mm) do { } while(0)
185#define forget_segments() do { } while (0)
186
187#define thread_saved_pc(tsk) (xtensa_pt_regs(tsk)->pc)
188
189extern unsigned long get_wchan(struct task_struct *p);
190
191#define KSTK_EIP(tsk) (xtensa_pt_regs(tsk)->pc)
192#define KSTK_ESP(tsk) (xtensa_pt_regs(tsk)->areg[1])
193
194#define cpu_relax() do { } while (0)
195
196/* Special register access. */
197
198#define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v));
199#define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v));
200
201#define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);})
202#define get_sr(sr) ({unsigned int v; RSR(v,sr); v; })
203
204#endif /* __ASSEMBLY__ */
205#endif /* _XTENSA_PROCESSOR_H */
diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h
new file mode 100644
index 000000000000..2848a5ff8349
--- /dev/null
+++ b/include/asm-xtensa/ptrace.h
@@ -0,0 +1,135 @@
1/*
2 * include/asm-xtensa/ptrace.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PTRACE_H
12#define _XTENSA_PTRACE_H
13
14#include <xtensa/config/core.h>
15
16/*
17 * Kernel stack
18 *
19 * +-----------------------+ -------- STACK_SIZE
20 * | register file | |
21 * +-----------------------+ |
22 * | struct pt_regs | |
23 * +-----------------------+ | ------ PT_REGS_OFFSET
24 * double : 16 bytes spill area : | ^
25 * excetion :- - - - - - - - - - - -: | |
26 * frame : struct pt_regs : | |
27 * :- - - - - - - - - - - -: | |
28 * | | | |
29 * | memory stack | | |
30 * | | | |
31 * ~ ~ ~ ~
32 * ~ ~ ~ ~
33 * | | | |
34 * | | | |
35 * +-----------------------+ | | --- STACK_BIAS
36 * | struct task_struct | | | ^
37 * current --> +-----------------------+ | | |
38 * | struct thread_info | | | |
39 * +-----------------------+ --------
40 */
41
42#define KERNEL_STACK_SIZE (2 * PAGE_SIZE)
43
44/* Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */
45
46#define EXC_TABLE_KSTK 0x004 /* Kernel Stack */
47#define EXC_TABLE_DOUBLE_SAVE 0x008 /* Double exception save area for a0 */
48#define EXC_TABLE_FIXUP 0x00c /* Fixup handler */
49#define EXC_TABLE_PARAM 0x010 /* For passing a parameter to fixup */
50#define EXC_TABLE_SYSCALL_SAVE 0x014 /* For fast syscall handler */
51#define EXC_TABLE_FAST_USER 0x100 /* Fast user exception handler */
52#define EXC_TABLE_FAST_KERNEL 0x200 /* Fast kernel exception handler */
53#define EXC_TABLE_DEFAULT 0x300 /* Default C-Handler */
54#define EXC_TABLE_SIZE 0x400
55
56/* Registers used by strace */
57
58#define REG_A_BASE 0xfc000000
59#define REG_AR_BASE 0x04000000
60#define REG_PC 0x14000000
61#define REG_PS 0x080000e6
62#define REG_WB 0x08000048
63#define REG_WS 0x08000049
64#define REG_LBEG 0x08000000
65#define REG_LEND 0x08000001
66#define REG_LCOUNT 0x08000002
67#define REG_SAR 0x08000003
68#define REG_DEPC 0x080000c0
69#define REG_EXCCAUSE 0x080000e8
70#define REG_EXCVADDR 0x080000ee
71#define SYSCALL_NR 0x1
72
73#define AR_REGNO_TO_A_REGNO(ar, wb) (ar - wb*4) & ~(XCHAL_NUM_AREGS - 1)
74
75/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
76
77#define PTRACE_GETREGS 12
78#define PTRACE_SETREGS 13
79#define PTRACE_GETFPREGS 14
80#define PTRACE_SETFPREGS 15
81#define PTRACE_GETFPREGSIZE 18
82
83#ifndef __ASSEMBLY__
84
85/*
86 * This struct defines the way the registers are stored on the
87 * kernel stack during a system call or other kernel entry.
88 */
89struct pt_regs {
90 unsigned long pc; /* 4 */
91 unsigned long ps; /* 8 */
92 unsigned long depc; /* 12 */
93 unsigned long exccause; /* 16 */
94 unsigned long excvaddr; /* 20 */
95 unsigned long debugcause; /* 24 */
96 unsigned long wmask; /* 28 */
97 unsigned long lbeg; /* 32 */
98 unsigned long lend; /* 36 */
99 unsigned long lcount; /* 40 */
100 unsigned long sar; /* 44 */
101 unsigned long windowbase; /* 48 */
102 unsigned long windowstart; /* 52 */
103 unsigned long syscall; /* 56 */
104 int reserved[2]; /* 64 */
105
106 /* Make sure the areg field is 16 bytes aligned. */
107 int align[0] __attribute__ ((aligned(16)));
108
109 /* current register frame.
110 * Note: The ESF for kernel exceptions ends after 16 registers!
111 */
112 unsigned long areg[16]; /* 128 (64) */
113};
114
115#ifdef __KERNEL__
116# define xtensa_pt_regs(tsk) ((struct pt_regs*) \
117 (((long)(tsk)->thread_info + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4)) - 1)
118# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
119# define instruction_pointer(regs) ((regs)->pc)
120extern void show_regs(struct pt_regs *);
121
122# ifndef CONFIG_SMP
123# define profile_pc(regs) instruction_pointer(regs)
124# endif
125#endif /* __KERNEL__ */
126
127#else /* __ASSEMBLY__ */
128
129#ifdef __KERNEL__
130# include <asm/offsets.h>
131#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
132#endif
133
134#endif /* !__ASSEMBLY__ */
135#endif /* _XTENSA_PTRACE_H */
diff --git a/include/asm-xtensa/resource.h b/include/asm-xtensa/resource.h
new file mode 100644
index 000000000000..17b5ab311771
--- /dev/null
+++ b/include/asm-xtensa/resource.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/resource.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_RESOURCE_H
12#define _XTENSA_RESOURCE_H
13
14#include <asm-generic/resource.h>
15
16#endif /* _XTENSA_RESOURCE_H */
diff --git a/include/asm-xtensa/rmap.h b/include/asm-xtensa/rmap.h
new file mode 100644
index 000000000000..649588b7e9ad
--- /dev/null
+++ b/include/asm-xtensa/rmap.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/rmap.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_RMAP_H
12#define _XTENSA_RMAP_H
13
14#include <asm-generic/rmap.h>
15
16#endif
diff --git a/include/asm-xtensa/rwsem.h b/include/asm-xtensa/rwsem.h
new file mode 100644
index 000000000000..3c02b0e033f0
--- /dev/null
+++ b/include/asm-xtensa/rwsem.h
@@ -0,0 +1,175 @@
1/*
2 * include/asm-xtensa/rwsem.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Largely copied from include/asm-ppc/rwsem.h
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_RWSEM_H
14#define _XTENSA_RWSEM_H
15
16#include <linux/list.h>
17#include <linux/spinlock.h>
18#include <asm/atomic.h>
19#include <asm/system.h>
20
21/*
22 * the semaphore definition
23 */
24struct rw_semaphore {
25 signed long count;
26#define RWSEM_UNLOCKED_VALUE 0x00000000
27#define RWSEM_ACTIVE_BIAS 0x00000001
28#define RWSEM_ACTIVE_MASK 0x0000ffff
29#define RWSEM_WAITING_BIAS (-0x00010000)
30#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
31#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
32 spinlock_t wait_lock;
33 struct list_head wait_list;
34#if RWSEM_DEBUG
35 int debug;
36#endif
37};
38
39/*
40 * initialisation
41 */
42#if RWSEM_DEBUG
43#define __RWSEM_DEBUG_INIT , 0
44#else
45#define __RWSEM_DEBUG_INIT /* */
46#endif
47
48#define __RWSEM_INITIALIZER(name) \
49 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
50 LIST_HEAD_INIT((name).wait_list) \
51 __RWSEM_DEBUG_INIT }
52
53#define DECLARE_RWSEM(name) \
54 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
55
56extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
57extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
58extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
59extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
60
61static inline void init_rwsem(struct rw_semaphore *sem)
62{
63 sem->count = RWSEM_UNLOCKED_VALUE;
64 spin_lock_init(&sem->wait_lock);
65 INIT_LIST_HEAD(&sem->wait_list);
66#if RWSEM_DEBUG
67 sem->debug = 0;
68#endif
69}
70
71/*
72 * lock for reading
73 */
74static inline void __down_read(struct rw_semaphore *sem)
75{
76 if (atomic_add_return(1,(atomic_t *)(&sem->count)) > 0)
77 smp_wmb();
78 else
79 rwsem_down_read_failed(sem);
80}
81
82static inline int __down_read_trylock(struct rw_semaphore *sem)
83{
84 int tmp;
85
86 while ((tmp = sem->count) >= 0) {
87 if (tmp == cmpxchg(&sem->count, tmp,
88 tmp + RWSEM_ACTIVE_READ_BIAS)) {
89 smp_wmb();
90 return 1;
91 }
92 }
93 return 0;
94}
95
96/*
97 * lock for writing
98 */
99static inline void __down_write(struct rw_semaphore *sem)
100{
101 int tmp;
102
103 tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS,
104 (atomic_t *)(&sem->count));
105 if (tmp == RWSEM_ACTIVE_WRITE_BIAS)
106 smp_wmb();
107 else
108 rwsem_down_write_failed(sem);
109}
110
111static inline int __down_write_trylock(struct rw_semaphore *sem)
112{
113 int tmp;
114
115 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
116 RWSEM_ACTIVE_WRITE_BIAS);
117 smp_wmb();
118 return tmp == RWSEM_UNLOCKED_VALUE;
119}
120
121/*
122 * unlock after reading
123 */
124static inline void __up_read(struct rw_semaphore *sem)
125{
126 int tmp;
127
128 smp_wmb();
129 tmp = atomic_sub_return(1,(atomic_t *)(&sem->count));
130 if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)
131 rwsem_wake(sem);
132}
133
134/*
135 * unlock after writing
136 */
137static inline void __up_write(struct rw_semaphore *sem)
138{
139 smp_wmb();
140 if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
141 (atomic_t *)(&sem->count)) < 0)
142 rwsem_wake(sem);
143}
144
145/*
146 * implement atomic add functionality
147 */
148static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
149{
150 atomic_add(delta, (atomic_t *)(&sem->count));
151}
152
153/*
154 * downgrade write lock to read lock
155 */
156static inline void __downgrade_write(struct rw_semaphore *sem)
157{
158 int tmp;
159
160 smp_wmb();
161 tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count));
162 if (tmp < 0)
163 rwsem_downgrade_wake(sem);
164}
165
166/*
167 * implement exchange and add functionality
168 */
169static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
170{
171 smp_mb();
172 return atomic_add_return(delta, (atomic_t *)(&sem->count));
173}
174
175#endif /* _XTENSA_RWSEM_XADD_H */
diff --git a/include/asm-xtensa/scatterlist.h b/include/asm-xtensa/scatterlist.h
new file mode 100644
index 000000000000..38a2b9acd658
--- /dev/null
+++ b/include/asm-xtensa/scatterlist.h
@@ -0,0 +1,34 @@
1/*
2 * include/asm-xtensa/scatterlist.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SCATTERLIST_H
12#define _XTENSA_SCATTERLIST_H
13
14struct scatterlist {
15 struct page *page;
16 unsigned int offset;
17 dma_addr_t dma_address;
18 unsigned int length;
19};
20
21/*
22 * These macros should be used after a pci_map_sg call has been done
23 * to get bus addresses of each of the SG entries and their lengths.
24 * You should only work with the number of sg entries pci_map_sg
25 * returns, or alternatively stop on the first sg_dma_len(sg) which
26 * is 0.
27 */
28#define sg_dma_address(sg) ((sg)->dma_address)
29#define sg_dma_len(sg) ((sg)->length)
30
31
32#define ISA_DMA_THRESHOLD (~0UL)
33
34#endif /* _XTENSA_SCATTERLIST_H */
diff --git a/include/asm-xtensa/sections.h b/include/asm-xtensa/sections.h
new file mode 100644
index 000000000000..40b5191b55a2
--- /dev/null
+++ b/include/asm-xtensa/sections.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/sections.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SECTIONS_H
12#define _XTENSA_SECTIONS_H
13
14#include <asm-generic/sections.h>
15
16#endif /* _XTENSA_SECTIONS_H */
diff --git a/include/asm-xtensa/segment.h b/include/asm-xtensa/segment.h
new file mode 100644
index 000000000000..a2eb547a1a75
--- /dev/null
+++ b/include/asm-xtensa/segment.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/segment.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SEGMENT_H
12#define _XTENSA_SEGMENT_H
13
14#include <asm/uaccess.h>
15
16#endif /* _XTENSA_SEGEMENT_H */
diff --git a/include/asm-xtensa/semaphore.h b/include/asm-xtensa/semaphore.h
new file mode 100644
index 000000000000..c8a7574a9a57
--- /dev/null
+++ b/include/asm-xtensa/semaphore.h
@@ -0,0 +1,129 @@
1/*
2 * linux/include/asm-xtensa/semaphore.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SEMAPHORE_H
12#define _XTENSA_SEMAPHORE_H
13
14#include <asm/atomic.h>
15#include <asm/system.h>
16#include <linux/wait.h>
17#include <linux/rwsem.h>
18
19struct semaphore {
20 atomic_t count;
21 int sleepers;
22 wait_queue_head_t wait;
23#if WAITQUEUE_DEBUG
24 long __magic;
25#endif
26};
27
28#if WAITQUEUE_DEBUG
29# define __SEM_DEBUG_INIT(name) \
30 , (int)&(name).__magic
31#else
32# define __SEM_DEBUG_INIT(name)
33#endif
34
35#define __SEMAPHORE_INITIALIZER(name,count) \
36 { ATOMIC_INIT(count), \
37 0, \
38 __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
39 __SEM_DEBUG_INIT(name) }
40
41#define __MUTEX_INITIALIZER(name) \
42 __SEMAPHORE_INITIALIZER(name, 1)
43
44#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
45 struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)
46
47#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
48#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
49
50extern inline void sema_init (struct semaphore *sem, int val)
51{
52/*
53 * *sem = (struct semaphore)__SEMAPHORE_INITIALIZER((*sem),val);
54 *
55 * i'd rather use the more flexible initialization above, but sadly
56 * GCC 2.7.2.3 emits a bogus warning. EGCS doesnt. Oh well.
57 */
58 atomic_set(&sem->count, val);
59 init_waitqueue_head(&sem->wait);
60#if WAITQUEUE_DEBUG
61 sem->__magic = (int)&sem->__magic;
62#endif
63}
64
65static inline void init_MUTEX (struct semaphore *sem)
66{
67 sema_init(sem, 1);
68}
69
70static inline void init_MUTEX_LOCKED (struct semaphore *sem)
71{
72 sema_init(sem, 0);
73}
74
75asmlinkage void __down(struct semaphore * sem);
76asmlinkage int __down_interruptible(struct semaphore * sem);
77asmlinkage int __down_trylock(struct semaphore * sem);
78asmlinkage void __up(struct semaphore * sem);
79
80extern spinlock_t semaphore_wake_lock;
81
82extern __inline__ void down(struct semaphore * sem)
83{
84#if WAITQUEUE_DEBUG
85 CHECK_MAGIC(sem->__magic);
86#endif
87
88 if (atomic_sub_return(1, &sem->count) < 0)
89 __down(sem);
90}
91
92extern __inline__ int down_interruptible(struct semaphore * sem)
93{
94 int ret = 0;
95#if WAITQUEUE_DEBUG
96 CHECK_MAGIC(sem->__magic);
97#endif
98
99 if (atomic_sub_return(1, &sem->count) < 0)
100 ret = __down_interruptible(sem);
101 return ret;
102}
103
104extern __inline__ int down_trylock(struct semaphore * sem)
105{
106 int ret = 0;
107#if WAITQUEUE_DEBUG
108 CHECK_MAGIC(sem->__magic);
109#endif
110
111 if (atomic_sub_return(1, &sem->count) < 0)
112 ret = __down_trylock(sem);
113 return ret;
114}
115
116/*
117 * Note! This is subtle. We jump to wake people up only if
118 * the semaphore was negative (== somebody was waiting on it).
119 */
120extern __inline__ void up(struct semaphore * sem)
121{
122#if WAITQUEUE_DEBUG
123 CHECK_MAGIC(sem->__magic);
124#endif
125 if (atomic_add_return(1, &sem->count) <= 0)
126 __up(sem);
127}
128
129#endif /* _XTENSA_SEMAPHORE_H */
diff --git a/include/asm-xtensa/sembuf.h b/include/asm-xtensa/sembuf.h
new file mode 100644
index 000000000000..2d26c47666fe
--- /dev/null
+++ b/include/asm-xtensa/sembuf.h
@@ -0,0 +1,44 @@
1/*
2 * include/asm-xtensa/sembuf.h
3 *
4 * The semid64_ds structure for Xtensa architecture.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 *
12 * Note extra padding because this structure is passed back and forth
13 * between kernel and user space.
14 *
15 * Pad space is left for:
16 * - 64-bit time_t to solve y2038 problem
17 * - 2 miscellaneous 32-bit values
18 *
19 */
20
21#ifndef _XTENSA_SEMBUF_H
22#define _XTENSA_SEMBUF_H
23
24#include <asm/byteorder.h>
25
26struct semid64_ds {
27 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
28#if XCHAL_HAVE_LE
29 __kernel_time_t sem_otime; /* last semop time */
30 unsigned long __unused1;
31 __kernel_time_t sem_ctime; /* last change time */
32 unsigned long __unused2;
33#else
34 unsigned long __unused1;
35 __kernel_time_t sem_otime; /* last semop time */
36 unsigned long __unused2;
37 __kernel_time_t sem_ctime; /* last change time */
38#endif
39 unsigned long sem_nsems; /* no. of semaphores in array */
40 unsigned long __unused3;
41 unsigned long __unused4;
42};
43
44#endif /* __ASM_XTENSA_SEMBUF_H */
diff --git a/include/asm-xtensa/serial.h b/include/asm-xtensa/serial.h
new file mode 100644
index 000000000000..ec04114fcf0b
--- /dev/null
+++ b/include/asm-xtensa/serial.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-xtensa/serial.h
3 *
4 * Configuration details for 8250, 16450, 16550, etc. serial ports
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_SERIAL_H
14#define _XTENSA_SERIAL_H
15
16#include <asm/platform/serial.h>
17
18#endif /* _XTENSA_SERIAL_H */
diff --git a/include/asm-xtensa/setup.h b/include/asm-xtensa/setup.h
new file mode 100644
index 000000000000..e3636520d8cc
--- /dev/null
+++ b/include/asm-xtensa/setup.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/setup.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SETUP_H
12#define _XTENSA_SETUP_H
13
14#define COMMAND_LINE_SIZE 256
15
16#endif
diff --git a/include/asm-xtensa/shmbuf.h b/include/asm-xtensa/shmbuf.h
new file mode 100644
index 000000000000..a30b81a4b933
--- /dev/null
+++ b/include/asm-xtensa/shmbuf.h
@@ -0,0 +1,50 @@
1/*
2 * include/asm-xtensa/shmbuf.h
3 *
4 * The shmid64_ds structure for Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Pad space is left for:
9 * - 64-bit time_t to solve y2038 problem
10 * - 2 miscellaneous 32-bit values
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file "COPYING" in the main directory of this archive
14 * for more details.
15 *
16 * Copyright (C) 2001 - 2005 Tensilica Inc.
17 */
18
19#ifndef _XTENSA_SHMBUF_H
20#define _XTENSA_SHMBUF_H
21
22struct shmid64_ds {
23 struct ipc64_perm shm_perm; /* operation perms */
24 size_t shm_segsz; /* size of segment (bytes) */
25 __kernel_time_t shm_atime; /* last attach time */
26 unsigned long __unused1;
27 __kernel_time_t shm_dtime; /* last detach time */
28 unsigned long __unused2;
29 __kernel_time_t shm_ctime; /* last change time */
30 unsigned long __unused3;
31 __kernel_pid_t shm_cpid; /* pid of creator */
32 __kernel_pid_t shm_lpid; /* pid of last operator */
33 unsigned long shm_nattch; /* no. of current attaches */
34 unsigned long __unused4;
35 unsigned long __unused5;
36};
37
38struct shminfo64 {
39 unsigned long shmmax;
40 unsigned long shmmin;
41 unsigned long shmmni;
42 unsigned long shmseg;
43 unsigned long shmall;
44 unsigned long __unused1;
45 unsigned long __unused2;
46 unsigned long __unused3;
47 unsigned long __unused4;
48};
49
50#endif /* _XTENSA_SHMBUF_H */
diff --git a/include/asm-xtensa/shmparam.h b/include/asm-xtensa/shmparam.h
new file mode 100644
index 000000000000..d3b65bfa71c3
--- /dev/null
+++ b/include/asm-xtensa/shmparam.h
@@ -0,0 +1,23 @@
1/*
2 * include/asm-xtensa/shmparam.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 */
8
9#ifndef _XTENSA_SHMPARAM_H
10#define _XTENSA_SHMPARAM_H
11
12#include <asm/processor.h>
13
14/*
15 * Xtensa can have variable size caches, and if
16 * the size of single way is larger than the page size,
17 * then we have to start worrying about cache aliasing
18 * problems.
19 */
20
21#define SHMLBA ((PAGE_SIZE > DCACHE_WAY_SIZE)? PAGE_SIZE : DCACHE_WAY_SIZE)
22
23#endif /* _XTENSA_SHMPARAM_H */
diff --git a/include/asm-xtensa/sigcontext.h b/include/asm-xtensa/sigcontext.h
new file mode 100644
index 000000000000..a75177291418
--- /dev/null
+++ b/include/asm-xtensa/sigcontext.h
@@ -0,0 +1,44 @@
1/*
2 * include/asm-xtensa/sigcontext.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2003 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SIGCONTEXT_H
12#define _XTENSA_SIGCONTEXT_H
13
14#define _ASMLANGUAGE
15#include <asm/processor.h>
16#include <asm/coprocessor.h>
17
18
19struct _cpstate {
20 unsigned char _cpstate[XTENSA_CP_EXTRA_SIZE];
21} __attribute__ ((aligned (XTENSA_CP_EXTRA_ALIGN)));
22
23
24struct sigcontext {
25 unsigned long oldmask;
26
27 /* CPU registers */
28 unsigned long sc_pc;
29 unsigned long sc_ps;
30 unsigned long sc_wmask;
31 unsigned long sc_windowbase;
32 unsigned long sc_windowstart;
33 unsigned long sc_lbeg;
34 unsigned long sc_lend;
35 unsigned long sc_lcount;
36 unsigned long sc_sar;
37 unsigned long sc_depc;
38 unsigned long sc_dareg0;
39 unsigned long sc_treg[4];
40 unsigned long sc_areg[XCHAL_NUM_AREGS];
41 struct _cpstate *sc_cpstate;
42};
43
44#endif /* __ASM_XTENSA_SIGCONTEXT_H */
diff --git a/include/asm-xtensa/siginfo.h b/include/asm-xtensa/siginfo.h
new file mode 100644
index 000000000000..44f0ae77b539
--- /dev/null
+++ b/include/asm-xtensa/siginfo.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/processor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SIGINFO_H
12#define _XTENSA_SIGINFO_H
13
14#include <asm-generic/siginfo.h>
15
16#endif /* _XTENSA_SIGINFO_H */
diff --git a/include/asm-xtensa/signal.h b/include/asm-xtensa/signal.h
new file mode 100644
index 000000000000..5d6fc9cdf58d
--- /dev/null
+++ b/include/asm-xtensa/signal.h
@@ -0,0 +1,187 @@
1/*
2 * include/asm-xtensa/signal.h
3 *
4 * Swiped from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_SIGNAL_H
14#define _XTENSA_SIGNAL_H
15
16
17#define _NSIG 64
18#define _NSIG_BPW 32
19#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
20
21#ifndef __ASSEMBLY__
22
23#include <linux/types.h>
24
25/* Avoid too many header ordering problems. */
26struct siginfo;
27typedef unsigned long old_sigset_t; /* at least 32 bits */
28typedef struct {
29 unsigned long sig[_NSIG_WORDS];
30} sigset_t;
31
32#endif
33
34#define SIGHUP 1
35#define SIGINT 2
36#define SIGQUIT 3
37#define SIGILL 4
38#define SIGTRAP 5
39#define SIGABRT 6
40#define SIGIOT 6
41#define SIGBUS 7
42#define SIGFPE 8
43#define SIGKILL 9
44#define SIGUSR1 10
45#define SIGSEGV 11
46#define SIGUSR2 12
47#define SIGPIPE 13
48#define SIGALRM 14
49#define SIGTERM 15
50#define SIGSTKFLT 16
51#define SIGCHLD 17
52#define SIGCONT 18
53#define SIGSTOP 19
54#define SIGTSTP 20
55#define SIGTTIN 21
56#define SIGTTOU 22
57#define SIGURG 23
58#define SIGXCPU 24
59#define SIGXFSZ 25
60#define SIGVTALRM 26
61#define SIGPROF 27
62#define SIGWINCH 28
63#define SIGIO 29
64#define SIGPOLL SIGIO
65/* #define SIGLOST 29 */
66#define SIGPWR 30
67#define SIGSYS 31
68#define SIGUNUSED 31
69
70/* These should not be considered constants from userland. */
71#define SIGRTMIN 32
72#define SIGRTMAX (_NSIG-1)
73
74/*
75 * SA_FLAGS values:
76 *
77 * SA_ONSTACK indicates that a registered stack_t will be used.
78 * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
79 * SA_RESTART flag to get restarting signals (which were the default long ago)
80 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
81 * SA_RESETHAND clears the handler when the signal is delivered.
82 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
83 * SA_NODEFER prevents the current signal from being masked in the handler.
84 *
85 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
86 * Unix names RESETHAND and NODEFER respectively.
87 */
88#define SA_NOCLDSTOP 0x00000001
89#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
90#define SA_SIGINFO 0x00000004
91#define SA_ONSTACK 0x08000000
92#define SA_RESTART 0x10000000
93#define SA_NODEFER 0x40000000
94#define SA_RESETHAND 0x80000000
95
96#define SA_NOMASK SA_NODEFER
97#define SA_ONESHOT SA_RESETHAND
98#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
99
100#define SA_RESTORER 0x04000000
101
102/*
103 * sigaltstack controls
104 */
105#define SS_ONSTACK 1
106#define SS_DISABLE 2
107
108#define MINSIGSTKSZ 2048
109#define SIGSTKSZ 8192
110
111#ifndef __ASSEMBLY__
112#ifdef __KERNEL__
113
114/*
115 * These values of sa_flags are used only by the kernel as part of the
116 * irq handling routines.
117 *
118 * SA_INTERRUPT is also used by the irq handling routines.
119 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
120 */
121#define SA_PROBE SA_ONESHOT
122#define SA_SAMPLE_RANDOM SA_RESTART
123#define SA_SHIRQ 0x04000000
124#endif
125
126#define SIG_BLOCK 0 /* for blocking signals */
127#define SIG_UNBLOCK 1 /* for unblocking signals */
128#define SIG_SETMASK 2 /* for setting the signal mask */
129
130/* Type of a signal handler. */
131typedef void (*__sighandler_t)(int);
132
133#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
134#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
135#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
136
137#ifdef __KERNEL__
138struct old_sigaction {
139 __sighandler_t sa_handler;
140 old_sigset_t sa_mask;
141 unsigned long sa_flags;
142 void (*sa_restorer)(void);
143};
144
145struct sigaction {
146 __sighandler_t sa_handler;
147 unsigned long sa_flags;
148 void (*sa_restorer)(void);
149 sigset_t sa_mask; /* mask last for extensibility */
150};
151
152struct k_sigaction {
153 struct sigaction sa;
154};
155
156#else
157
158/* Here we must cater to libcs that poke about in kernel headers. */
159
160struct sigaction {
161 union {
162 __sighandler_t _sa_handler;
163 void (*_sa_sigaction)(int, struct siginfo *, void *);
164 } _u;
165 sigset_t sa_mask;
166 unsigned long sa_flags;
167 void (*sa_restorer)(void);
168};
169
170#define sa_handler _u._sa_handler
171#define sa_sigaction _u._sa_sigaction
172
173#endif /* __KERNEL__ */
174
175typedef struct sigaltstack {
176 void *ss_sp;
177 int ss_flags;
178 size_t ss_size;
179} stack_t;
180
181#ifdef __KERNEL__
182#include <asm/sigcontext.h>
183#define ptrace_signal_deliver(regs, cookie) do { } while (0)
184
185#endif /* __KERNEL__ */
186#endif /* __ASSEMBLY__ */
187#endif /* _XTENSA_SIGNAL_H */
diff --git a/include/asm-xtensa/smp.h b/include/asm-xtensa/smp.h
new file mode 100644
index 000000000000..83c569e3bdbd
--- /dev/null
+++ b/include/asm-xtensa/smp.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-xtensa/smp.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SMP_H
12#define _XTENSA_SMP_H
13
14extern struct xtensa_cpuinfo boot_cpu_data;
15
16#define cpu_data (&boot_cpu_data)
17#define current_cpu_data boot_cpu_data
18
19struct xtensa_cpuinfo {
20 unsigned long *pgd_cache;
21 unsigned long *pte_cache;
22 unsigned long pgtable_cache_sz;
23};
24
25#define cpu_logical_map(cpu) (cpu)
26
27#endif /* _XTENSA_SMP_H */
diff --git a/include/asm-xtensa/socket.h b/include/asm-xtensa/socket.h
new file mode 100644
index 000000000000..daccd05a14cd
--- /dev/null
+++ b/include/asm-xtensa/socket.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-xtensa/socket.h
3 *
4 * Copied from i386.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _XTENSA_SOCKET_H
12#define _XTENSA_SOCKET_H
13
14#include <asm/sockios.h>
15
16/* For setsockoptions(2) */
17#define SOL_SOCKET 1
18
19#define SO_DEBUG 1
20#define SO_REUSEADDR 2
21#define SO_TYPE 3
22#define SO_ERROR 4
23#define SO_DONTROUTE 5
24#define SO_BROADCAST 6
25#define SO_SNDBUF 7
26#define SO_RCVBUF 8
27#define SO_KEEPALIVE 9
28#define SO_OOBINLINE 10
29#define SO_NO_CHECK 11
30#define SO_PRIORITY 12
31#define SO_LINGER 13
32#define SO_BSDCOMPAT 14
33/* To add :#define SO_REUSEPORT 15 */
34#define SO_PASSCRED 16
35#define SO_PEERCRED 17
36#define SO_RCVLOWAT 18
37#define SO_SNDLOWAT 19
38#define SO_RCVTIMEO 20
39#define SO_SNDTIMEO 21
40
41/* Security levels - as per NRL IPv6 - don't actually do anything */
42
43#define SO_SECURITY_AUTHENTICATION 22
44#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
45#define SO_SECURITY_ENCRYPTION_NETWORK 24
46
47#define SO_BINDTODEVICE 25
48
49/* Socket filtering */
50
51#define SO_ATTACH_FILTER 26
52#define SO_DETACH_FILTER 27
53
54#define SO_PEERNAME 28
55#define SO_TIMESTAMP 29
56#define SCM_TIMESTAMP SO_TIMESTAMP
57
58#define SO_ACCEPTCONN 30
59#define SO_PEERSEC 31
60
61#endif /* _XTENSA_SOCKET_H */
diff --git a/include/asm-xtensa/sockios.h b/include/asm-xtensa/sockios.h
new file mode 100644
index 000000000000..20d2ba10ecd1
--- /dev/null
+++ b/include/asm-xtensa/sockios.h
@@ -0,0 +1,30 @@
1/*
2 * include/asm-xtensa/sockios.h
3 *
4 * Socket-level I/O control calls. Copied from MIPS.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995 by Ralf Baechle
11 * Copyright (C) 2001 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_SOCKIOS_H
15#define _XTENSA_SOCKIOS_H
16
17#include <asm/ioctl.h>
18
19/* Socket-level I/O control calls. */
20
21#define FIOGETOWN _IOR('f', 123, int)
22#define FIOSETOWN _IOW('f', 124, int)
23
24#define SIOCATMARK _IOR('s', 7, int)
25#define SIOCSPGRP _IOW('s', 8, pid_t)
26#define SIOCGPGRP _IOR('s', 9, pid_t)
27
28#define SIOCGSTAMP 0x8906 /* Get stamp - linux-specific */
29
30#endif /* _XTENSA_SOCKIOS_H */
diff --git a/include/asm-xtensa/spinlock.h b/include/asm-xtensa/spinlock.h
new file mode 100644
index 000000000000..8ff23649581b
--- /dev/null
+++ b/include/asm-xtensa/spinlock.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/spinlock.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SPINLOCK_H
12#define _XTENSA_SPINLOCK_H
13
14#include <linux/spinlock.h>
15
16#endif /* _XTENSA_SPINLOCK_H */
diff --git a/include/asm-xtensa/stat.h b/include/asm-xtensa/stat.h
new file mode 100644
index 000000000000..2f4662ff6c3a
--- /dev/null
+++ b/include/asm-xtensa/stat.h
@@ -0,0 +1,105 @@
1/*
2 * include/asm-xtensa/stat.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_STAT_H
12#define _XTENSA_STAT_H
13
14#include <linux/types.h>
15
16struct __old_kernel_stat {
17 unsigned short st_dev;
18 unsigned short st_ino;
19 unsigned short st_mode;
20 unsigned short st_nlink;
21 unsigned short st_uid;
22 unsigned short st_gid;
23 unsigned short st_rdev;
24 unsigned long st_size;
25 unsigned long st_atime;
26 unsigned long st_mtime;
27 unsigned long st_ctime;
28};
29
30#define STAT_HAVE_NSEC 1
31
32struct stat {
33 unsigned short st_dev;
34 unsigned short __pad1;
35 unsigned long st_ino;
36 unsigned short st_mode;
37 unsigned short st_nlink;
38 unsigned short st_uid;
39 unsigned short st_gid;
40 unsigned short st_rdev;
41 unsigned short __pad2;
42 unsigned long st_size;
43 unsigned long st_blksize;
44 unsigned long st_blocks;
45 unsigned long st_atime;
46 unsigned long st_atime_nsec;
47 unsigned long st_mtime;
48 unsigned long st_mtime_nsec;
49 unsigned long st_ctime;
50 unsigned long st_ctime_nsec;
51 unsigned long __unused4;
52 unsigned long __unused5;
53};
54
55/* This matches struct stat64 in glibc-2.2.3. */
56
57struct stat64 {
58#ifdef __XTENSA_EL__
59 unsigned short st_dev; /* Device */
60 unsigned char __pad0[10];
61#else
62 unsigned char __pad0[6];
63 unsigned short st_dev;
64 unsigned char __pad1[2];
65#endif
66
67#define STAT64_HAS_BROKEN_ST_INO 1
68 unsigned long __st_ino; /* 32bit file serial number. */
69
70 unsigned int st_mode; /* File mode. */
71 unsigned int st_nlink; /* Link count. */
72 unsigned int st_uid; /* User ID of the file's owner. */
73 unsigned int st_gid; /* Group ID of the file's group. */
74
75#ifdef __XTENSA_EL__
76 unsigned short st_rdev; /* Device number, if device. */
77 unsigned char __pad3[10];
78#else
79 unsigned char __pad2[6];
80 unsigned short st_rdev;
81 unsigned char __pad3[2];
82#endif
83
84 long long int st_size; /* Size of file, in bytes. */
85 long int st_blksize; /* Optimal block size for I/O. */
86
87#ifdef __XTENSA_EL__
88 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
89 unsigned long __pad4;
90#else
91 unsigned long __pad4;
92 unsigned long st_blocks;
93#endif
94
95 unsigned long __pad5;
96 long int st_atime; /* Time of last access. */
97 unsigned long st_atime_nsec;
98 long int st_mtime; /* Time of last modification. */
99 unsigned long st_mtime_nsec;
100 long int st_ctime; /* Time of last status change. */
101 unsigned long st_ctime_nsec;
102 unsigned long long int st_ino; /* File serial number. */
103};
104
105#endif /* _XTENSA_STAT_H */
diff --git a/include/asm-xtensa/statfs.h b/include/asm-xtensa/statfs.h
new file mode 100644
index 000000000000..9c3d1a213136
--- /dev/null
+++ b/include/asm-xtensa/statfs.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/statfs.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_STATFS_H
12#define _XTENSA_STATFS_H
13
14#include <asm-generic/statfs.h>
15
16#endif /* _XTENSA_STATFS_H */
17
diff --git a/include/asm-xtensa/string.h b/include/asm-xtensa/string.h
new file mode 100644
index 000000000000..3f81b27d9809
--- /dev/null
+++ b/include/asm-xtensa/string.h
@@ -0,0 +1,124 @@
1/*
2 * include/asm-xtensa/string.h
3 *
4 * These trivial string functions are considered part of the public domain.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13/* We should optimize these. See arch/xtensa/lib/strncpy_user.S */
14
15#ifndef _XTENSA_STRING_H
16#define _XTENSA_STRING_H
17
18#define __HAVE_ARCH_STRCPY
19extern __inline__ char *strcpy(char *__dest, const char *__src)
20{
21 register char *__xdest = __dest;
22 unsigned long __dummy;
23
24 __asm__ __volatile__("1:\n\t"
25 "l8ui %2, %1, 0\n\t"
26 "s8i %2, %0, 0\n\t"
27 "addi %1, %1, 1\n\t"
28 "addi %0, %0, 1\n\t"
29 "bnez %2, 1b\n\t"
30 : "=r" (__dest), "=r" (__src), "=&r" (__dummy)
31 : "0" (__dest), "1" (__src)
32 : "memory");
33
34 return __xdest;
35}
36
37#define __HAVE_ARCH_STRNCPY
38extern __inline__ char *strncpy(char *__dest, const char *__src, size_t __n)
39{
40 register char *__xdest = __dest;
41 unsigned long __dummy;
42
43 if (__n == 0)
44 return __xdest;
45
46 __asm__ __volatile__(
47 "1:\n\t"
48 "l8ui %2, %1, 0\n\t"
49 "s8i %2, %0, 0\n\t"
50 "addi %1, %1, 1\n\t"
51 "addi %0, %0, 1\n\t"
52 "beqz %2, 2f\n\t"
53 "bne %1, %5, 1b\n"
54 "2:"
55 : "=r" (__dest), "=r" (__src), "=&r" (__dummy)
56 : "0" (__dest), "1" (__src), "r" (__src+__n)
57 : "memory");
58
59 return __xdest;
60}
61
62#define __HAVE_ARCH_STRCMP
63extern __inline__ int strcmp(const char *__cs, const char *__ct)
64{
65 register int __res;
66 unsigned long __dummy;
67
68 __asm__ __volatile__(
69 "1:\n\t"
70 "l8ui %3, %1, 0\n\t"
71 "addi %1, %1, 1\n\t"
72 "l8ui %2, %0, 0\n\t"
73 "addi %0, %0, 1\n\t"
74 "beqz %2, 2f\n\t"
75 "beq %2, %3, 1b\n"
76 "2:\n\t"
77 "sub %2, %3, %2"
78 : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
79 : "0" (__cs), "1" (__ct));
80
81 return __res;
82}
83
84#define __HAVE_ARCH_STRNCMP
85extern __inline__ int strncmp(const char *__cs, const char *__ct, size_t __n)
86{
87 register int __res;
88 unsigned long __dummy;
89
90 __asm__ __volatile__(
91 "mov %2, %3\n"
92 "1:\n\t"
93 "beq %0, %6, 2f\n\t"
94 "l8ui %3, %1, 0\n\t"
95 "addi %1, %1, 1\n\t"
96 "l8ui %2, %0, 0\n\t"
97 "addi %0, %0, 1\n\t"
98 "beqz %2, 2f\n\t"
99 "beqz %3, 2f\n\t"
100 "beq %2, %3, 1b\n"
101 "2:\n\t"
102 "sub %2, %3, %2"
103 : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
104 : "0" (__cs), "1" (__ct), "r" (__cs+__n));
105
106 return __res;
107}
108
109#define __HAVE_ARCH_MEMSET
110extern void *memset(void *__s, int __c, size_t __count);
111
112#define __HAVE_ARCH_MEMCPY
113extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
114
115#define __HAVE_ARCH_MEMMOVE
116extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
117
118/* Don't build bcopy at all ... */
119#define __HAVE_ARCH_BCOPY
120
121#define __HAVE_ARCH_MEMSCAN
122#define memscan memchr
123
124#endif /* _XTENSA_STRING_H */
diff --git a/include/asm-xtensa/system.h b/include/asm-xtensa/system.h
new file mode 100644
index 000000000000..690fe325e671
--- /dev/null
+++ b/include/asm-xtensa/system.h
@@ -0,0 +1,252 @@
1/*
2 * include/asm-xtensa/system.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SYSTEM_H
12#define _XTENSA_SYSTEM_H
13
14#include <linux/config.h>
15#include <linux/stringify.h>
16
17#include <asm/processor.h>
18
19/* interrupt control */
20
21#define local_save_flags(x) \
22 __asm__ __volatile__ ("rsr %0,"__stringify(PS) : "=a" (x));
23#define local_irq_restore(x) do { \
24 __asm__ __volatile__ ("wsr %0, "__stringify(PS)" ; rsync" \
25 :: "a" (x) : "memory"); } while(0);
26#define local_irq_save(x) do { \
27 __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL) \
28 : "=a" (x) :: "memory");} while(0);
29
30static inline void local_irq_disable(void)
31{
32 unsigned long flags;
33 __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL)
34 : "=a" (flags) :: "memory");
35}
36static inline void local_irq_enable(void)
37{
38 unsigned long flags;
39 __asm__ __volatile__ ("rsil %0, 0" : "=a" (flags) :: "memory");
40
41}
42
43static inline int irqs_disabled(void)
44{
45 unsigned long flags;
46 local_save_flags(flags);
47 return flags & 0xf;
48}
49
50#define RSR_CPENABLE(x) do { \
51 __asm__ __volatile__("rsr %0," __stringify(CPENABLE) : "=a" (x)); \
52 } while(0);
53#define WSR_CPENABLE(x) do { \
54 __asm__ __volatile__("wsr %0," __stringify(CPENABLE)";rsync" \
55 :: "a" (x));} while(0);
56
57#define clear_cpenable() __clear_cpenable()
58
59extern __inline__ void __clear_cpenable(void)
60{
61#if XCHAL_HAVE_CP
62 unsigned long i = 0;
63 WSR_CPENABLE(i);
64#endif
65}
66
67extern __inline__ void enable_coprocessor(int i)
68{
69#if XCHAL_HAVE_CP
70 int cp;
71 RSR_CPENABLE(cp);
72 cp |= 1 << i;
73 WSR_CPENABLE(cp);
74#endif
75}
76
77extern __inline__ void disable_coprocessor(int i)
78{
79#if XCHAL_HAVE_CP
80 int cp;
81 RSR_CPENABLE(cp);
82 cp &= ~(1 << i);
83 WSR_CPENABLE(cp);
84#endif
85}
86
87#define smp_read_barrier_depends() do { } while(0)
88#define read_barrier_depends() do { } while(0)
89
90#define mb() barrier()
91#define rmb() mb()
92#define wmb() mb()
93
94#ifdef CONFIG_SMP
95#error smp_* not defined
96#else
97#define smp_mb() barrier()
98#define smp_rmb() barrier()
99#define smp_wmb() barrier()
100#endif
101
102#define set_mb(var, value) do { var = value; mb(); } while (0)
103#define set_wmb(var, value) do { var = value; wmb(); } while (0)
104
105#if !defined (__ASSEMBLY__)
106
107/* * switch_to(n) should switch tasks to task nr n, first
108 * checking that n isn't the current task, in which case it does nothing.
109 */
110extern void *_switch_to(void *last, void *next);
111
112#endif /* __ASSEMBLY__ */
113
114#define prepare_to_switch() do { } while(0)
115
116#define switch_to(prev,next,last) \
117do { \
118 clear_cpenable(); \
119 (last) = _switch_to(prev, next); \
120} while(0)
121
122/*
123 * cmpxchg
124 */
125
126extern __inline__ unsigned long
127__cmpxchg_u32(volatile int *p, int old, int new)
128{
129 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
130 "l32i %0, %1, 0 \n\t"
131 "bne %0, %2, 1f \n\t"
132 "s32i %3, %1, 0 \n\t"
133 "1: \n\t"
134 "wsr a15, "__stringify(PS)" \n\t"
135 "rsync \n\t"
136 : "=&a" (old)
137 : "a" (p), "a" (old), "r" (new)
138 : "a15", "memory");
139 return old;
140}
141/* This function doesn't exist, so you'll get a linker error
142 * if something tries to do an invalid cmpxchg(). */
143
144extern void __cmpxchg_called_with_bad_pointer(void);
145
146static __inline__ unsigned long
147__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
148{
149 switch (size) {
150 case 4: return __cmpxchg_u32(ptr, old, new);
151 default: __cmpxchg_called_with_bad_pointer();
152 return old;
153 }
154}
155
156#define cmpxchg(ptr,o,n) \
157 ({ __typeof__(*(ptr)) _o_ = (o); \
158 __typeof__(*(ptr)) _n_ = (n); \
159 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
160 (unsigned long)_n_, sizeof (*(ptr))); \
161 })
162
163
164
165
166/*
167 * xchg_u32
168 *
169 * Note that a15 is used here because the register allocation
170 * done by the compiler is not guaranteed and a window overflow
171 * may not occur between the rsil and wsr instructions. By using
172 * a15 in the rsil, the machine is guaranteed to be in a state
173 * where no register reference will cause an overflow.
174 */
175
176extern __inline__ unsigned long xchg_u32(volatile int * m, unsigned long val)
177{
178 unsigned long tmp;
179 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
180 "l32i %0, %1, 0 \n\t"
181 "s32i %2, %1, 0 \n\t"
182 "wsr a15, "__stringify(PS)" \n\t"
183 "rsync \n\t"
184 : "=&a" (tmp)
185 : "a" (m), "a" (val)
186 : "a15", "memory");
187 return tmp;
188}
189
190#define tas(ptr) (xchg((ptr),1))
191
192#if ( __XCC__ == 1 )
193
194/* xt-xcc processes __inline__ differently than xt-gcc and decides to
195 * insert an out-of-line copy of function __xchg. This presents the
196 * unresolved symbol at link time of __xchg_called_with_bad_pointer,
197 * even though such a function would never be called at run-time.
198 * xt-gcc always inlines __xchg, and optimizes away the undefined
199 * bad_pointer function.
200 */
201
202#define xchg(ptr,x) xchg_u32(ptr,x)
203
204#else /* assume xt-gcc */
205
206#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
207
208/*
209 * This only works if the compiler isn't horribly bad at optimizing.
210 * gcc-2.5.8 reportedly can't handle this, but I define that one to
211 * be dead anyway.
212 */
213
214extern void __xchg_called_with_bad_pointer(void);
215
216static __inline__ unsigned long
217__xchg(unsigned long x, volatile void * ptr, int size)
218{
219 switch (size) {
220 case 4:
221 return xchg_u32(ptr, x);
222 }
223 __xchg_called_with_bad_pointer();
224 return x;
225}
226
227#endif
228
229extern void set_except_vector(int n, void *addr);
230
231static inline void spill_registers(void)
232{
233 unsigned int a0, ps;
234
235 __asm__ __volatile__ (
236 "movi a14," __stringify (PS_EXCM_MASK) " | 1\n\t"
237 "mov a12, a0\n\t"
238 "rsr a13," __stringify(SAR) "\n\t"
239 "xsr a14," __stringify(PS) "\n\t"
240 "movi a0, _spill_registers\n\t"
241 "rsync\n\t"
242 "callx0 a0\n\t"
243 "mov a0, a12\n\t"
244 "wsr a13," __stringify(SAR) "\n\t"
245 "wsr a14," __stringify(PS) "\n\t"
246 :: "a" (&a0), "a" (&ps)
247 : "a2", "a3", "a12", "a13", "a14", "a15", "memory");
248}
249
250#define arch_align_stack(x) (x)
251
252#endif /* _XTENSA_SYSTEM_H */
diff --git a/include/asm-xtensa/termbits.h b/include/asm-xtensa/termbits.h
new file mode 100644
index 000000000000..c780593ff5f9
--- /dev/null
+++ b/include/asm-xtensa/termbits.h
@@ -0,0 +1,194 @@
1/*
2 * include/asm-xtensa/termbits.h
3 *
4 * Copied from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_TERMBITS_H
14#define _XTENSA_TERMBITS_H
15
16
17#include <linux/posix_types.h>
18
19typedef unsigned char cc_t;
20typedef unsigned int speed_t;
21typedef unsigned int tcflag_t;
22
23#define NCCS 19
24struct termios {
25 tcflag_t c_iflag; /* input mode flags */
26 tcflag_t c_oflag; /* output mode flags */
27 tcflag_t c_cflag; /* control mode flags */
28 tcflag_t c_lflag; /* local mode flags */
29 cc_t c_line; /* line discipline */
30 cc_t c_cc[NCCS]; /* control characters */
31};
32
33/* c_cc characters */
34
35#define VINTR 0
36#define VQUIT 1
37#define VERASE 2
38#define VKILL 3
39#define VEOF 4
40#define VTIME 5
41#define VMIN 6
42#define VSWTC 7
43#define VSTART 8
44#define VSTOP 9
45#define VSUSP 10
46#define VEOL 11
47#define VREPRINT 12
48#define VDISCARD 13
49#define VWERASE 14
50#define VLNEXT 15
51#define VEOL2 16
52
53/* c_iflag bits */
54
55#define IGNBRK 0000001
56#define BRKINT 0000002
57#define IGNPAR 0000004
58#define PARMRK 0000010
59#define INPCK 0000020
60#define ISTRIP 0000040
61#define INLCR 0000100
62#define IGNCR 0000200
63#define ICRNL 0000400
64#define IUCLC 0001000
65#define IXON 0002000
66#define IXANY 0004000
67#define IXOFF 0010000
68#define IMAXBEL 0020000
69#define IUTF8 0040000
70
71/* c_oflag bits */
72
73#define OPOST 0000001
74#define OLCUC 0000002
75#define ONLCR 0000004
76#define OCRNL 0000010
77#define ONOCR 0000020
78#define ONLRET 0000040
79#define OFILL 0000100
80#define OFDEL 0000200
81#define NLDLY 0000400
82#define NL0 0000000
83#define NL1 0000400
84#define CRDLY 0003000
85#define CR0 0000000
86#define CR1 0001000
87#define CR2 0002000
88#define CR3 0003000
89#define TABDLY 0014000
90#define TAB0 0000000
91#define TAB1 0004000
92#define TAB2 0010000
93#define TAB3 0014000
94#define XTABS 0014000
95#define BSDLY 0020000
96#define BS0 0000000
97#define BS1 0020000
98#define VTDLY 0040000
99#define VT0 0000000
100#define VT1 0040000
101#define FFDLY 0100000
102#define FF0 0000000
103#define FF1 0100000
104
105/* c_cflag bit meaning */
106
107#define CBAUD 0010017
108#define B0 0000000 /* hang up */
109#define B50 0000001
110#define B75 0000002
111#define B110 0000003
112#define B134 0000004
113#define B150 0000005
114#define B200 0000006
115#define B300 0000007
116#define B600 0000010
117#define B1200 0000011
118#define B1800 0000012
119#define B2400 0000013
120#define B4800 0000014
121#define B9600 0000015
122#define B19200 0000016
123#define B38400 0000017
124#define EXTA B19200
125#define EXTB B38400
126#define CSIZE 0000060
127#define CS5 0000000
128#define CS6 0000020
129#define CS7 0000040
130#define CS8 0000060
131#define CSTOPB 0000100
132#define CREAD 0000200
133#define PARENB 0000400
134#define PARODD 0001000
135#define HUPCL 0002000
136#define CLOCAL 0004000
137#define CBAUDEX 0010000
138#define B57600 0010001
139#define B115200 0010002
140#define B230400 0010003
141#define B460800 0010004
142#define B500000 0010005
143#define B576000 0010006
144#define B921600 0010007
145#define B1000000 0010010
146#define B1152000 0010011
147#define B1500000 0010012
148#define B2000000 0010013
149#define B2500000 0010014
150#define B3000000 0010015
151#define B3500000 0010016
152#define B4000000 0010017
153#define CIBAUD 002003600000 /* input baud rate (not used) */
154#define CMSPAR 010000000000 /* mark or space (stick) parity */
155#define CRTSCTS 020000000000 /* flow control */
156
157/* c_lflag bits */
158
159#define ISIG 0000001
160#define ICANON 0000002
161#define XCASE 0000004
162#define ECHO 0000010
163#define ECHOE 0000020
164#define ECHOK 0000040
165#define ECHONL 0000100
166#define NOFLSH 0000200
167#define TOSTOP 0000400
168#define ECHOCTL 0001000
169#define ECHOPRT 0002000
170#define ECHOKE 0004000
171#define FLUSHO 0010000
172#define PENDIN 0040000
173#define IEXTEN 0100000
174
175/* tcflow() and TCXONC use these */
176
177#define TCOOFF 0
178#define TCOON 1
179#define TCIOFF 2
180#define TCION 3
181
182/* tcflush() and TCFLSH use these */
183
184#define TCIFLUSH 0
185#define TCOFLUSH 1
186#define TCIOFLUSH 2
187
188/* tcsetattr uses these */
189
190#define TCSANOW 0
191#define TCSADRAIN 1
192#define TCSAFLUSH 2
193
194#endif /* _XTENSA_TERMBITS_H */
diff --git a/include/asm-xtensa/termios.h b/include/asm-xtensa/termios.h
new file mode 100644
index 000000000000..83c6aed1d115
--- /dev/null
+++ b/include/asm-xtensa/termios.h
@@ -0,0 +1,122 @@
1/*
2 * include/asm-xtensa/termios.h
3 *
4 * Copied from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_TERMIOS_H
14#define _XTENSA_TERMIOS_H
15
16#include <asm/termbits.h>
17#include <asm/ioctls.h>
18
19struct winsize {
20 unsigned short ws_row;
21 unsigned short ws_col;
22 unsigned short ws_xpixel;
23 unsigned short ws_ypixel;
24};
25
26#define NCC 8
27struct termio {
28 unsigned short c_iflag; /* input mode flags */
29 unsigned short c_oflag; /* output mode flags */
30 unsigned short c_cflag; /* control mode flags */
31 unsigned short c_lflag; /* local mode flags */
32 unsigned char c_line; /* line discipline */
33 unsigned char c_cc[NCC]; /* control characters */
34};
35
36/* Modem lines */
37
38#define TIOCM_LE 0x001
39#define TIOCM_DTR 0x002
40#define TIOCM_RTS 0x004
41#define TIOCM_ST 0x008
42#define TIOCM_SR 0x010
43#define TIOCM_CTS 0x020
44#define TIOCM_CAR 0x040
45#define TIOCM_RNG 0x080
46#define TIOCM_DSR 0x100
47#define TIOCM_CD TIOCM_CAR
48#define TIOCM_RI TIOCM_RNG
49#define TIOCM_OUT1 0x2000
50#define TIOCM_OUT2 0x4000
51#define TIOCM_LOOP 0x8000
52
53/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
54
55/* Line disciplines */
56
57#define N_TTY 0
58#define N_SLIP 1
59#define N_MOUSE 2
60#define N_PPP 3
61#define N_STRIP 4
62#define N_AX25 5
63#define N_X25 6 /* X.25 async */
64#define N_6PACK 7
65#define N_MASC 8 /* Reserved for Mobitex module <kaz@cafe.net> */
66#define N_R3964 9 /* Reserved for Simatic R3964 module */
67#define N_PROFIBUS_FDL 10 /* Reserved for Profibus <Dave@mvhi.com> */
68#define N_IRDA 11 /* Linux IR - http://irda.sourceforge.net/ */
69#define N_SMSBLOCK 12 /* SMS block mode - for talking to GSM data cards about SMS messages */
70#define N_HDLC 13 /* synchronous HDLC */
71#define N_SYNC_PPP 14
72#define N_HCI 15 /* Bluetooth HCI UART */
73
74#ifdef __KERNEL__
75
76/* intr=^C quit=^\ erase=del kill=^U
77 eof=^D vtime=\0 vmin=\1 sxtc=\0
78 start=^Q stop=^S susp=^Z eol=\0
79 reprint=^R discard=^U werase=^W lnext=^V
80 eol2=\0
81*/
82#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
83
84/*
85 * Translate a "termio" structure into a "termios". Ugh.
86 */
87
88#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
89 unsigned short __tmp; \
90 get_user(__tmp,&(termio)->x); \
91 *(unsigned short *) &(termios)->x = __tmp; \
92}
93
94#define user_termio_to_kernel_termios(termios, termio) \
95({ \
96 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
97 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
98 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
99 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
100 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
101})
102
103/*
104 * Translate a "termios" structure into a "termio". Ugh.
105 */
106
107#define kernel_termios_to_user_termio(termio, termios) \
108({ \
109 put_user((termios)->c_iflag, &(termio)->c_iflag); \
110 put_user((termios)->c_oflag, &(termio)->c_oflag); \
111 put_user((termios)->c_cflag, &(termio)->c_cflag); \
112 put_user((termios)->c_lflag, &(termio)->c_lflag); \
113 put_user((termios)->c_line, &(termio)->c_line); \
114 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
115})
116
117#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios))
118#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios))
119
120#endif /* __KERNEL__ */
121
122#endif /* _XTENSA_TERMIOS_H */
diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h
new file mode 100644
index 000000000000..af208d41fd82
--- /dev/null
+++ b/include/asm-xtensa/thread_info.h
@@ -0,0 +1,146 @@
1/*
2 * include/asm-xtensa/thread_info.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_THREAD_INFO_H
12#define _XTENSA_THREAD_INFO_H
13
14#ifdef __KERNEL__
15
16#ifndef __ASSEMBLY__
17# include <asm/processor.h>
18#endif
19
20/*
21 * low level task data that entry.S needs immediate access to
22 * - this struct should fit entirely inside of one cache line
23 * - this struct shares the supervisor stack pages
24 * - if the contents of this structure are changed, the assembly constants
25 * must also be changed
26 */
27
28#ifndef __ASSEMBLY__
29
30struct thread_info {
31 struct task_struct *task; /* main task structure */
32 struct exec_domain *exec_domain; /* execution domain */
33 unsigned long flags; /* low level flags */
34 unsigned long status; /* thread-synchronous flags */
35 __u32 cpu; /* current CPU */
36 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
37
38 mm_segment_t addr_limit; /* thread address space */
39 struct restart_block restart_block;
40
41
42};
43
44#else /* !__ASSEMBLY__ */
45
46/* offsets into the thread_info struct for assembly code access */
47#define TI_TASK 0x00000000
48#define TI_EXEC_DOMAIN 0x00000004
49#define TI_FLAGS 0x00000008
50#define TI_STATUS 0x0000000C
51#define TI_CPU 0x00000010
52#define TI_PRE_COUNT 0x00000014
53#define TI_ADDR_LIMIT 0x00000018
54#define TI_RESTART_BLOCK 0x000001C
55
56#endif
57
58#define PREEMPT_ACTIVE 0x10000000
59
60/*
61 * macros/functions for gaining access to the thread information structure
62 *
63 * preempt_count needs to be 1 initially, until the scheduler is functional.
64 */
65
66#ifndef __ASSEMBLY__
67
68#define INIT_THREAD_INFO(tsk) \
69{ \
70 .task = &tsk, \
71 .exec_domain = &default_exec_domain, \
72 .flags = 0, \
73 .cpu = 0, \
74 .preempt_count = 1, \
75 .addr_limit = KERNEL_DS, \
76 .restart_block = { \
77 .fn = do_no_restart_syscall, \
78 }, \
79}
80
81#define init_thread_info (init_thread_union.thread_info)
82#define init_stack (init_thread_union.stack)
83
84/* how to get the thread information struct from C */
85static inline struct thread_info *current_thread_info(void)
86{
87 struct thread_info *ti;
88 __asm__("extui %0,a1,0,13\n\t"
89 "xor %0, a1, %0" : "=&r" (ti) : );
90 return ti;
91}
92
93/* thread information allocation */
94#define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
95#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
96#define get_thread_info(ti) get_task_struct((ti)->task)
97#define put_thread_info(ti) put_task_struct((ti)->task)
98
99#else /* !__ASSEMBLY__ */
100
101/* how to get the thread information struct from ASM */
102#define GET_THREAD_INFO(reg,sp) \
103 extui reg, sp, 0, 13; \
104 xor reg, sp, reg
105#endif
106
107
108/*
109 * thread information flags
110 * - these are process state flags that various assembly files may need to access
111 * - pending work-to-be-done flags are in LSW
112 * - other flags in MSW
113 */
114#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
115#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */
116#define TIF_SIGPENDING 2 /* signal pending */
117#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
118#define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */
119#define TIF_IRET 5 /* return with iret */
120#define TIF_MEMDIE 6
121#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
122
123#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
124#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
125#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
126#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
127#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
128#define _TIF_IRET (1<<TIF_IRET)
129#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
130
131#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
132#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
133
134/*
135 * Thread-synchronous status.
136 *
137 * This is different from the flags in that nobody else
138 * ever touches our thread-synchronous status, so we don't
139 * have to worry about atomic accesses.
140 */
141#define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */
142
143#define THREAD_SIZE 8192 //(2*PAGE_SIZE)
144
145#endif /* __KERNEL__ */
146#endif /* _XTENSA_THREAD_INFO */
diff --git a/include/asm-xtensa/timex.h b/include/asm-xtensa/timex.h
new file mode 100644
index 000000000000..d14a3755a12b
--- /dev/null
+++ b/include/asm-xtensa/timex.h
@@ -0,0 +1,94 @@
1/*
2 * include/asm-xtensa/timex.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TIMEX_H
12#define _XTENSA_TIMEX_H
13
14#ifdef __KERNEL__
15
16#include <asm/processor.h>
17#include <linux/stringify.h>
18
19#if XCHAL_INT_LEVEL(XCHAL_TIMER0_INTERRUPT) == 1
20# define LINUX_TIMER 0
21#elif XCHAL_INT_LEVEL(XCHAL_TIMER1_INTERRUPT) == 1
22# define LINUX_TIMER 1
23#elif XCHAL_INT_LEVEL(XCHAL_TIMER2_INTERRUPT) == 1
24# define LINUX_TIMER 2
25#else
26# error "Bad timer number for Linux configurations!"
27#endif
28
29#define LINUX_TIMER_INT XCHAL_TIMER_INTERRUPT(LINUX_TIMER)
30#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT)
31
32#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */
33#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */
34#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \
35 (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \
36 << (SHIFT_SCALE-SHIFT_HZ)) / HZ)
37
38#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
39extern unsigned long ccount_per_jiffy;
40extern unsigned long ccount_nsec;
41#define CCOUNT_PER_JIFFY ccount_per_jiffy
42#define CCOUNT_NSEC ccount_nsec
43#else
44#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
45#define CCOUNT_NSEC (1000000000UL / CONFIG_XTENSA_CPU_CLOCK)
46#endif
47
48
49typedef unsigned long long cycles_t;
50
51/*
52 * Only used for SMP.
53 */
54
55extern cycles_t cacheflush_time;
56
57#define get_cycles() (0)
58
59
60/*
61 * Register access.
62 */
63
64#define WSR_CCOUNT(r) __asm__("wsr %0,"__stringify(CCOUNT) :: "a" (r))
65#define RSR_CCOUNT(r) __asm__("rsr %0,"__stringify(CCOUNT) : "=a" (r))
66#define WSR_CCOMPARE(x,r) __asm__("wsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) :: "a"(r))
67#define RSR_CCOMPARE(x,r) __asm__("rsr %0,"__stringify(CCOMPARE_0)"+"__stringify(x) : "=a"(r))
68
69static inline unsigned long get_ccount (void)
70{
71 unsigned long ccount;
72 RSR_CCOUNT(ccount);
73 return ccount;
74}
75
76static inline void set_ccount (unsigned long ccount)
77{
78 WSR_CCOUNT(ccount);
79}
80
81static inline unsigned long get_linux_timer (void)
82{
83 unsigned ccompare;
84 RSR_CCOMPARE(LINUX_TIMER, ccompare);
85 return ccompare;
86}
87
88static inline void set_linux_timer (unsigned long ccompare)
89{
90 WSR_CCOMPARE(LINUX_TIMER, ccompare);
91}
92
93#endif /* __KERNEL__ */
94#endif /* _XTENSA_TIMEX_H */
diff --git a/include/asm-xtensa/tlb.h b/include/asm-xtensa/tlb.h
new file mode 100644
index 000000000000..4562b2dcfbc0
--- /dev/null
+++ b/include/asm-xtensa/tlb.h
@@ -0,0 +1,25 @@
1/*
2 * include/asm-xtensa/tlb.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TLB_H
12#define _XTENSA_TLB_H
13
14#define tlb_start_vma(tlb,vma) do { } while (0)
15#define tlb_end_vma(tlb,vma) do { } while (0)
16#define __tlb_remove_tlb_entry(tlb,pte,addr) do { } while (0)
17
18#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
19
20#include <asm-generic/tlb.h>
21#include <asm/page.h>
22
23#define __pte_free_tlb(tlb,pte) pte_free(pte)
24
25#endif /* _XTENSA_TLB_H */
diff --git a/include/asm-xtensa/tlbflush.h b/include/asm-xtensa/tlbflush.h
new file mode 100644
index 000000000000..23bfe9db45f5
--- /dev/null
+++ b/include/asm-xtensa/tlbflush.h
@@ -0,0 +1,200 @@
1/*
2 * include/asm-xtensa/tlbflush.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TLBFLUSH_H
12#define _XTENSA_TLBFLUSH_H
13
14#define DEBUG_TLB
15
16#ifdef __KERNEL__
17
18#include <asm/processor.h>
19#include <linux/stringify.h>
20
21/* TLB flushing:
22 *
23 * - flush_tlb_all() flushes all processes TLB entries
24 * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
25 * - flush_tlb_page(mm, vmaddr) flushes a single page
26 * - flush_tlb_range(mm, start, end) flushes a range of pages
27 */
28
29extern void flush_tlb_all(void);
30extern void flush_tlb_mm(struct mm_struct*);
31extern void flush_tlb_page(struct vm_area_struct*,unsigned long);
32extern void flush_tlb_range(struct vm_area_struct*,unsigned long,unsigned long);
33
34#define flush_tlb_kernel_range(start,end) flush_tlb_all()
35
36
37/* This is calld in munmap when we have freed up some page-table pages.
38 * We don't need to do anything here, there's nothing special about our
39 * page-table pages.
40 */
41
42extern inline void flush_tlb_pgtables(struct mm_struct *mm,
43 unsigned long start, unsigned long end)
44{
45}
46
47/* TLB operations. */
48
49#define ITLB_WAYS_LOG2 XCHAL_ITLB_WAY_BITS
50#define DTLB_WAYS_LOG2 XCHAL_DTLB_WAY_BITS
51#define ITLB_PROBE_SUCCESS (1 << ITLB_WAYS_LOG2)
52#define DTLB_PROBE_SUCCESS (1 << DTLB_WAYS_LOG2)
53
54extern inline unsigned long itlb_probe(unsigned long addr)
55{
56 unsigned long tmp;
57 __asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
58 return tmp;
59}
60
61extern inline unsigned long dtlb_probe(unsigned long addr)
62{
63 unsigned long tmp;
64 __asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
65 return tmp;
66}
67
68extern inline void invalidate_itlb_entry (unsigned long probe)
69{
70 __asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe));
71}
72
73extern inline void invalidate_dtlb_entry (unsigned long probe)
74{
75 __asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe));
76}
77
78/* Use the .._no_isync functions with caution. Generally, these are
79 * handy for bulk invalidates followed by a single 'isync'. The
80 * caller must follow up with an 'isync', which can be relatively
81 * expensive on some Xtensa implementations.
82 */
83extern inline void invalidate_itlb_entry_no_isync (unsigned entry)
84{
85 /* Caller must follow up with 'isync'. */
86 __asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) );
87}
88
89extern inline void invalidate_dtlb_entry_no_isync (unsigned entry)
90{
91 /* Caller must follow up with 'isync'. */
92 __asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) );
93}
94
95extern inline void set_itlbcfg_register (unsigned long val)
96{
97 __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t"
98 : : "a" (val));
99}
100
101extern inline void set_dtlbcfg_register (unsigned long val)
102{
103 __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t"
104 : : "a" (val));
105}
106
107extern inline void set_ptevaddr_register (unsigned long val)
108{
109 __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n"
110 : : "a" (val));
111}
112
113extern inline unsigned long read_ptevaddr_register (void)
114{
115 unsigned long tmp;
116 __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp));
117 return tmp;
118}
119
120extern inline void write_dtlb_entry (pte_t entry, int way)
121{
122 __asm__ __volatile__("wdtlb %1, %0; dsync\n\t"
123 : : "r" (way), "r" (entry) );
124}
125
126extern inline void write_itlb_entry (pte_t entry, int way)
127{
128 __asm__ __volatile__("witlb %1, %0; isync\n\t"
129 : : "r" (way), "r" (entry) );
130}
131
132extern inline void invalidate_page_directory (void)
133{
134 invalidate_dtlb_entry (DTLB_WAY_PGTABLE);
135}
136
137extern inline void invalidate_itlb_mapping (unsigned address)
138{
139 unsigned long tlb_entry;
140 while ((tlb_entry = itlb_probe (address)) & ITLB_PROBE_SUCCESS)
141 invalidate_itlb_entry (tlb_entry);
142}
143
144extern inline void invalidate_dtlb_mapping (unsigned address)
145{
146 unsigned long tlb_entry;
147 while ((tlb_entry = dtlb_probe (address)) & DTLB_PROBE_SUCCESS)
148 invalidate_dtlb_entry (tlb_entry);
149}
150
151#define check_pgt_cache() do { } while (0)
152
153
154#ifdef DEBUG_TLB
155
156/* DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa
157 * ISA and exist only for test purposes..
158 * You may find it helpful for MMU debugging, however.
159 *
160 * 'at' is the unmodified input register
161 * 'as' is the output register, as follows (specific to the Linux config):
162 *
163 * as[31..12] contain the virtual address
164 * as[11..08] are meaningless
165 * as[07..00] contain the asid
166 */
167
168extern inline unsigned long read_dtlb_virtual (int way)
169{
170 unsigned long tmp;
171 __asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
172 return tmp;
173}
174
175extern inline unsigned long read_dtlb_translation (int way)
176{
177 unsigned long tmp;
178 __asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
179 return tmp;
180}
181
182extern inline unsigned long read_itlb_virtual (int way)
183{
184 unsigned long tmp;
185 __asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
186 return tmp;
187}
188
189extern inline unsigned long read_itlb_translation (int way)
190{
191 unsigned long tmp;
192 __asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
193 return tmp;
194}
195
196#endif /* DEBUG_TLB */
197
198
199#endif /* __KERNEL__ */
200#endif /* _XTENSA_PGALLOC_H */
diff --git a/include/asm-xtensa/topology.h b/include/asm-xtensa/topology.h
new file mode 100644
index 000000000000..7309e38a0ccb
--- /dev/null
+++ b/include/asm-xtensa/topology.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/topology.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TOPOLOGY_H
12#define _XTENSA_TOPOLOGY_H
13
14#include <asm-generic/topology.h>
15
16#endif /* _XTENSA_TOPOLOGY_H */
diff --git a/include/asm-xtensa/types.h b/include/asm-xtensa/types.h
new file mode 100644
index 000000000000..ebac00469852
--- /dev/null
+++ b/include/asm-xtensa/types.h
@@ -0,0 +1,66 @@
1/*
2 * include/asm-xtensa/types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TYPES_H
12#define _XTENSA_TYPES_H
13
14#ifndef __ASSEMBLY__
15
16typedef unsigned short umode_t;
17
18/*
19 * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
20 * header files exported to user space
21 */
22
23typedef __signed__ char __s8;
24typedef unsigned char __u8;
25
26typedef __signed__ short __s16;
27typedef unsigned short __u16;
28
29typedef __signed__ int __s32;
30typedef unsigned int __u32;
31
32#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
33typedef __signed__ long long __s64;
34typedef unsigned long long __u64;
35#endif
36
37/*
38 * These aren't exported outside the kernel to avoid name space clashes
39 */
40#ifdef __KERNEL__
41
42typedef __signed__ char s8;
43typedef unsigned char u8;
44
45typedef __signed__ short s16;
46typedef unsigned short u16;
47
48typedef __signed__ int s32;
49typedef unsigned int u32;
50
51typedef __signed__ long long s64;
52typedef unsigned long long u64;
53
54
55#define BITS_PER_LONG 32
56
57/* Dma addresses are 32-bits wide. */
58
59typedef u32 dma_addr_t;
60
61typedef unsigned int kmem_bufctl_t;
62
63#endif /* __KERNEL__ */
64#endif
65
66#endif /* _XTENSA_TYPES_H */
diff --git a/include/asm-xtensa/uaccess.h b/include/asm-xtensa/uaccess.h
new file mode 100644
index 000000000000..35576b25c7b2
--- /dev/null
+++ b/include/asm-xtensa/uaccess.h
@@ -0,0 +1,532 @@
1/*
2 * include/asm-xtensa/uaccess.h
3 *
4 * User space memory access functions
5 *
6 * These routines provide basic accessing functions to the user memory
7 * space for the kernel. This header file provides fuctions such as:
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 *
13 * Copyright (C) 2001 - 2005 Tensilica Inc.
14 */
15
16#ifndef _XTENSA_UACCESS_H
17#define _XTENSA_UACCESS_H
18
19#include <linux/errno.h>
20
21#define VERIFY_READ 0
22#define VERIFY_WRITE 1
23
24#ifdef __ASSEMBLY__
25
26#define _ASMLANGUAGE
27#include <asm/current.h>
28#include <asm/offsets.h>
29#include <asm/processor.h>
30
31/*
32 * These assembly macros mirror the C macros that follow below. They
33 * should always have identical functionality. See
34 * arch/xtensa/kernel/sys.S for usage.
35 */
36
37#define KERNEL_DS 0
38#define USER_DS 1
39
40#define get_ds (KERNEL_DS)
41
42/*
43 * get_fs reads current->thread.current_ds into a register.
44 * On Entry:
45 * <ad> anything
46 * <sp> stack
47 * On Exit:
48 * <ad> contains current->thread.current_ds
49 */
50 .macro get_fs ad, sp
51 GET_CURRENT(\ad,\sp)
52 l32i \ad, \ad, THREAD_CURRENT_DS
53 .endm
54
55/*
56 * set_fs sets current->thread.current_ds to some value.
57 * On Entry:
58 * <at> anything (temp register)
59 * <av> value to write
60 * <sp> stack
61 * On Exit:
62 * <at> destroyed (actually, current)
63 * <av> preserved, value to write
64 */
65 .macro set_fs at, av, sp
66 GET_CURRENT(\at,\sp)
67 s32i \av, \at, THREAD_CURRENT_DS
68 .endm
69
70/*
71 * kernel_ok determines whether we should bypass addr/size checking.
72 * See the equivalent C-macro version below for clarity.
73 * On success, kernel_ok branches to a label indicated by parameter
74 * <success>. This implies that the macro falls through to the next
75 * insruction on an error.
76 *
77 * Note that while this macro can be used independently, we designed
78 * in for optimal use in the access_ok macro below (i.e., we fall
79 * through on error).
80 *
81 * On Entry:
82 * <at> anything (temp register)
83 * <success> label to branch to on success; implies
84 * fall-through macro on error
85 * <sp> stack pointer
86 * On Exit:
87 * <at> destroyed (actually, current->thread.current_ds)
88 */
89
90#if ((KERNEL_DS != 0) || (USER_DS == 0))
91# error Assembly macro kernel_ok fails
92#endif
93 .macro kernel_ok at, sp, success
94 get_fs \at, \sp
95 beqz \at, \success
96 .endm
97
98/*
99 * user_ok determines whether the access to user-space memory is allowed.
100 * See the equivalent C-macro version below for clarity.
101 *
102 * On error, user_ok branches to a label indicated by parameter
103 * <error>. This implies that the macro falls through to the next
104 * instruction on success.
105 *
106 * Note that while this macro can be used independently, we designed
107 * in for optimal use in the access_ok macro below (i.e., we fall
108 * through on success).
109 *
110 * On Entry:
111 * <aa> register containing memory address
112 * <as> register containing memory size
113 * <at> temp register
114 * <error> label to branch to on error; implies fall-through
115 * macro on success
116 * On Exit:
117 * <aa> preserved
118 * <as> preserved
119 * <at> destroyed (actually, (TASK_SIZE + 1 - size))
120 */
121 .macro user_ok aa, as, at, error
122 movi \at, (TASK_SIZE+1)
123 bgeu \as, \at, \error
124 sub \at, \at, \as
125 bgeu \aa, \at, \error
126 .endm
127
128/*
129 * access_ok determines whether a memory access is allowed. See the
130 * equivalent C-macro version below for clarity.
131 *
132 * On error, access_ok branches to a label indicated by parameter
133 * <error>. This implies that the macro falls through to the next
134 * instruction on success.
135 *
136 * Note that we assume success is the common case, and we optimize the
137 * branch fall-through case on success.
138 *
139 * On Entry:
140 * <aa> register containing memory address
141 * <as> register containing memory size
142 * <at> temp register
143 * <sp>
144 * <error> label to branch to on error; implies fall-through
145 * macro on success
146 * On Exit:
147 * <aa> preserved
148 * <as> preserved
149 * <at> destroyed
150 */
151 .macro access_ok aa, as, at, sp, error
152 kernel_ok \at, \sp, .Laccess_ok_\@
153 user_ok \aa, \as, \at, \error
154.Laccess_ok_\@:
155 .endm
156
157/*
158 * verify_area determines whether a memory access is allowed. It's
159 * mostly an unnecessary wrapper for access_ok, but we provide it as a
160 * duplicate of the verify_area() C inline function below. See the
161 * equivalent C version below for clarity.
162 *
163 * On error, verify_area branches to a label indicated by parameter
164 * <error>. This implies that the macro falls through to the next
165 * instruction on success.
166 *
167 * Note that we assume success is the common case, and we optimize the
168 * branch fall-through case on success.
169 *
170 * On Entry:
171 * <aa> register containing memory address
172 * <as> register containing memory size
173 * <at> temp register
174 * <error> label to branch to on error; implies fall-through
175 * macro on success
176 * On Exit:
177 * <aa> preserved
178 * <as> preserved
179 * <at> destroyed
180 */
181 .macro verify_area aa, as, at, sp, error
182 access_ok \at, \aa, \as, \sp, \error
183 .endm
184
185
186#else /* __ASSEMBLY__ not defined */
187
188#include <linux/sched.h>
189#include <asm/types.h>
190
191/*
192 * The fs value determines whether argument validity checking should
193 * be performed or not. If get_fs() == USER_DS, checking is
194 * performed, with get_fs() == KERNEL_DS, checking is bypassed.
195 *
196 * For historical reasons (Data Segment Register?), these macros are
197 * grossly misnamed.
198 */
199
200#define KERNEL_DS ((mm_segment_t) { 0 })
201#define USER_DS ((mm_segment_t) { 1 })
202
203#define get_ds() (KERNEL_DS)
204#define get_fs() (current->thread.current_ds)
205#define set_fs(val) (current->thread.current_ds = (val))
206
207#define segment_eq(a,b) ((a).seg == (b).seg)
208
209#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
210#define __user_ok(addr,size) (((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))
211#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
212#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
213
214extern inline int verify_area(int type, const void * addr, unsigned long size)
215{
216 return access_ok(type,addr,size) ? 0 : -EFAULT;
217}
218
219/*
220 * These are the main single-value transfer routines. They
221 * automatically use the right size if we just have the right pointer
222 * type.
223 *
224 * This gets kind of ugly. We want to return _two_ values in
225 * "get_user()" and yet we don't want to do any pointers, because that
226 * is too much of a performance impact. Thus we have a few rather ugly
227 * macros here, and hide all the uglyness from the user.
228 *
229 * Careful to not
230 * (a) re-use the arguments for side effects (sizeof is ok)
231 * (b) require any knowledge of processes at this stage
232 */
233#define put_user(x,ptr) __put_user_check((x),(ptr),sizeof(*(ptr)))
234#define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr)))
235
236/*
237 * The "__xxx" versions of the user access functions are versions that
238 * do not verify the address space, that must have been done previously
239 * with a separate "access_ok()" call (this is used when we do multiple
240 * accesses to the same area of user memory).
241 */
242#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
243#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
244
245
246extern long __put_user_bad(void);
247
248#define __put_user_nocheck(x,ptr,size) \
249({ \
250 long __pu_err; \
251 __put_user_size((x),(ptr),(size),__pu_err); \
252 __pu_err; \
253})
254
255#define __put_user_check(x,ptr,size) \
256({ \
257 long __pu_err = -EFAULT; \
258 __typeof__(*(ptr)) *__pu_addr = (ptr); \
259 if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
260 __put_user_size((x),__pu_addr,(size),__pu_err); \
261 __pu_err; \
262})
263
264#define __put_user_size(x,ptr,size,retval) \
265do { \
266 retval = 0; \
267 switch (size) { \
268 case 1: __put_user_asm(x,ptr,retval,1,"s8i"); break; \
269 case 2: __put_user_asm(x,ptr,retval,2,"s16i"); break; \
270 case 4: __put_user_asm(x,ptr,retval,4,"s32i"); break; \
271 case 8: { \
272 __typeof__(*ptr) __v64 = x; \
273 retval = __copy_to_user(ptr,&__v64,8); \
274 break; \
275 } \
276 default: __put_user_bad(); \
277 } \
278} while (0)
279
280
281/*
282 * Consider a case of a user single load/store would cause both an
283 * unaligned exception and an MMU-related exception (unaligned
284 * exceptions happen first):
285 *
286 * User code passes a bad variable ptr to a system call.
287 * Kernel tries to access the variable.
288 * Unaligned exception occurs.
289 * Unaligned exception handler tries to make aligned accesses.
290 * Double exception occurs for MMU-related cause (e.g., page not mapped).
291 * do_page_fault() thinks the fault address belongs to the kernel, not the
292 * user, and panics.
293 *
294 * The kernel currently prohibits user unaligned accesses. We use the
295 * __check_align_* macros to check for unaligned addresses before
296 * accessing user space so we don't crash the kernel. Both
297 * __put_user_asm and __get_user_asm use these alignment macros, so
298 * macro-specific labels such as 0f, 1f, %0, %2, and %3 must stay in
299 * sync.
300 */
301
302#define __check_align_1 ""
303
304#define __check_align_2 \
305 " _bbci.l %2, 0, 1f \n" \
306 " movi %0, %3 \n" \
307 " _j 2f \n"
308
309#define __check_align_4 \
310 " _bbsi.l %2, 0, 0f \n" \
311 " _bbci.l %2, 1, 1f \n" \
312 "0: movi %0, %3 \n" \
313 " _j 2f \n"
314
315
316/*
317 * We don't tell gcc that we are accessing memory, but this is OK
318 * because we do not write to any memory gcc knows about, so there
319 * are no aliasing issues.
320 *
321 * WARNING: If you modify this macro at all, verify that the
322 * __check_align_* macros still work.
323 */
324#define __put_user_asm(x, addr, err, align, insn) \
325 __asm__ __volatile__( \
326 __check_align_##align \
327 "1: "insn" %1, %2, 0 \n" \
328 "2: \n" \
329 " .section .fixup,\"ax\" \n" \
330 " .align 4 \n" \
331 "4: \n" \
332 " .long 2b \n" \
333 "5: \n" \
334 " l32r %2, 4b \n" \
335 " movi %0, %3 \n" \
336 " jx %2 \n" \
337 " .previous \n" \
338 " .section __ex_table,\"a\" \n" \
339 " .long 1b, 5b \n" \
340 " .previous" \
341 :"=r" (err) \
342 :"r" ((int)(x)), "r" (addr), "i" (-EFAULT), "0" (err))
343
344#define __get_user_nocheck(x,ptr,size) \
345({ \
346 long __gu_err, __gu_val; \
347 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
348 (x) = (__typeof__(*(ptr)))__gu_val; \
349 __gu_err; \
350})
351
352#define __get_user_check(x,ptr,size) \
353({ \
354 long __gu_err = -EFAULT, __gu_val = 0; \
355 const __typeof__(*(ptr)) *__gu_addr = (ptr); \
356 if (access_ok(VERIFY_READ,__gu_addr,size)) \
357 __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
358 (x) = (__typeof__(*(ptr)))__gu_val; \
359 __gu_err; \
360})
361
362extern long __get_user_bad(void);
363
364#define __get_user_size(x,ptr,size,retval) \
365do { \
366 retval = 0; \
367 switch (size) { \
368 case 1: __get_user_asm(x,ptr,retval,1,"l8ui"); break; \
369 case 2: __get_user_asm(x,ptr,retval,2,"l16ui"); break; \
370 case 4: __get_user_asm(x,ptr,retval,4,"l32i"); break; \
371 case 8: retval = __copy_from_user(&x,ptr,8); break; \
372 default: (x) = __get_user_bad(); \
373 } \
374} while (0)
375
376
377/*
378 * WARNING: If you modify this macro at all, verify that the
379 * __check_align_* macros still work.
380 */
381#define __get_user_asm(x, addr, err, align, insn) \
382 __asm__ __volatile__( \
383 __check_align_##align \
384 "1: "insn" %1, %2, 0 \n" \
385 "2: \n" \
386 " .section .fixup,\"ax\" \n" \
387 " .align 4 \n" \
388 "4: \n" \
389 " .long 2b \n" \
390 "5: \n" \
391 " l32r %2, 4b \n" \
392 " movi %1, 0 \n" \
393 " movi %0, %3 \n" \
394 " jx %2 \n" \
395 " .previous \n" \
396 " .section __ex_table,\"a\" \n" \
397 " .long 1b, 5b \n" \
398 " .previous" \
399 :"=r" (err), "=r" (x) \
400 :"r" (addr), "i" (-EFAULT), "0" (err))
401
402
403/*
404 * Copy to/from user space
405 */
406
407/*
408 * We use a generic, arbitrary-sized copy subroutine. The Xtensa
409 * architecture would cause heavy code bloat if we tried to inline
410 * these functions and provide __constant_copy_* equivalents like the
411 * i386 versions. __xtensa_copy_user is quite efficient. See the
412 * .fixup section of __xtensa_copy_user for a discussion on the
413 * X_zeroing equivalents for Xtensa.
414 */
415
416extern unsigned __xtensa_copy_user(void *to, const void *from, unsigned n);
417#define __copy_user(to,from,size) __xtensa_copy_user(to,from,size)
418
419
420static inline unsigned long
421__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
422{
423 return __copy_user(to,from,n);
424}
425
426static inline unsigned long
427__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
428{
429 return __copy_user(to,from,n);
430}
431
432static inline unsigned long
433__generic_copy_to_user(void *to, const void *from, unsigned long n)
434{
435 prefetch(from);
436 if (access_ok(VERIFY_WRITE, to, n))
437 return __copy_user(to,from,n);
438 return n;
439}
440
441static inline unsigned long
442__generic_copy_from_user(void *to, const void *from, unsigned long n)
443{
444 prefetchw(to);
445 if (access_ok(VERIFY_READ, from, n))
446 return __copy_user(to,from,n);
447 else
448 memset(to, 0, n);
449 return n;
450}
451
452#define copy_to_user(to,from,n) __generic_copy_to_user((to),(from),(n))
453#define copy_from_user(to,from,n) __generic_copy_from_user((to),(from),(n))
454#define __copy_to_user(to,from,n) __generic_copy_to_user_nocheck((to),(from),(n))
455#define __copy_from_user(to,from,n) __generic_copy_from_user_nocheck((to),(from),(n))
456#define __copy_to_user_inatomic __copy_to_user
457#define __copy_from_user_inatomic __copy_from_user
458
459
460/*
461 * We need to return the number of bytes not cleared. Our memset()
462 * returns zero if a problem occurs while accessing user-space memory.
463 * In that event, return no memory cleared. Otherwise, zero for
464 * success.
465 */
466
467extern inline unsigned long
468__xtensa_clear_user(void *addr, unsigned long size)
469{
470 if ( ! memset(addr, 0, size) )
471 return size;
472 return 0;
473}
474
475extern inline unsigned long
476clear_user(void *addr, unsigned long size)
477{
478 if (access_ok(VERIFY_WRITE, addr, size))
479 return __xtensa_clear_user(addr, size);
480 return size ? -EFAULT : 0;
481}
482
483#define __clear_user __xtensa_clear_user
484
485
486extern long __strncpy_user(char *, const char *, long);
487#define __strncpy_from_user __strncpy_user
488
489extern inline long
490strncpy_from_user(char *dst, const char *src, long count)
491{
492 if (access_ok(VERIFY_READ, src, 1))
493 return __strncpy_from_user(dst, src, count);
494 return -EFAULT;
495}
496
497
498#define strlen_user(str) strnlen_user((str), TASK_SIZE - 1)
499
500/*
501 * Return the size of a string (including the ending 0!)
502 */
503extern long __strnlen_user(const char *, long);
504
505extern inline long strnlen_user(const char *str, long len)
506{
507 unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1;
508
509 if ((unsigned long)str > top)
510 return 0;
511 return __strnlen_user(str, len);
512}
513
514
515struct exception_table_entry
516{
517 unsigned long insn, fixup;
518};
519
520/* Returns 0 if exception not found and fixup.unit otherwise. */
521
522extern unsigned long search_exception_table(unsigned long addr);
523extern void sort_exception_table(void);
524
525/* Returns the new pc */
526#define fixup_exception(map_reg, fixup_unit, pc) \
527({ \
528 fixup_unit; \
529})
530
531#endif /* __ASSEMBLY__ */
532#endif /* _XTENSA_UACCESS_H */
diff --git a/include/asm-xtensa/ucontext.h b/include/asm-xtensa/ucontext.h
new file mode 100644
index 000000000000..94c94ed3e00a
--- /dev/null
+++ b/include/asm-xtensa/ucontext.h
@@ -0,0 +1,22 @@
1/*
2 * include/asm-xtensa/ucontext.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_UCONTEXT_H
12#define _XTENSA_UCONTEXT_H
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _XTENSA_UCONTEXT_H */
diff --git a/include/asm-xtensa/unaligned.h b/include/asm-xtensa/unaligned.h
new file mode 100644
index 000000000000..28220890d0a6
--- /dev/null
+++ b/include/asm-xtensa/unaligned.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-xtensa/unaligned.h
3 *
4 * Xtensa doesn't handle unaligned accesses efficiently.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_UNALIGNED_H
14#define _XTENSA_UNALIGNED_H
15
16#include <linux/string.h>
17
18/* Use memmove here, so gcc does not insert a __builtin_memcpy. */
19
20#define get_unaligned(ptr) \
21 ({ __typeof__(*(ptr)) __tmp; memmove(&__tmp, (ptr), sizeof(*(ptr))); __tmp; })
22
23#define put_unaligned(val, ptr) \
24 ({ __typeof__(*(ptr)) __tmp = (val); \
25 memmove((ptr), &__tmp, sizeof(*(ptr))); \
26 (void)0; })
27
28#endif /* _XTENSA_UNALIGNED_H */
diff --git a/include/asm-xtensa/unistd.h b/include/asm-xtensa/unistd.h
new file mode 100644
index 000000000000..6b39d6609d9c
--- /dev/null
+++ b/include/asm-xtensa/unistd.h
@@ -0,0 +1,439 @@
1/*
2 * include/asm-xtensa/unistd.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_UNISTD_H
12#define _XTENSA_UNISTD_H
13
14#include <linux/linkage.h>
15
16#define __NR_spill 0
17#define __NR_exit 1
18#define __NR_read 3
19#define __NR_write 4
20#define __NR_open 5
21#define __NR_close 6
22#define __NR_creat 8
23#define __NR_link 9
24#define __NR_unlink 10
25#define __NR_execve 11
26#define __NR_chdir 12
27#define __NR_mknod 14
28#define __NR_chmod 15
29#define __NR_lchown 16
30#define __NR_break 17
31#define __NR_lseek 19
32#define __NR_getpid 20
33#define __NR_mount 21
34#define __NR_setuid 23
35#define __NR_getuid 24
36#define __NR_ptrace 26
37#define __NR_utime 30
38#define __NR_stty 31
39#define __NR_gtty 32
40#define __NR_access 33
41#define __NR_ftime 35
42#define __NR_sync 36
43#define __NR_kill 37
44#define __NR_rename 38
45#define __NR_mkdir 39
46#define __NR_rmdir 40
47#define __NR_dup 41
48#define __NR_pipe 42
49#define __NR_times 43
50#define __NR_prof 44
51#define __NR_brk 45
52#define __NR_setgid 46
53#define __NR_getgid 47
54#define __NR_signal 48
55#define __NR_geteuid 49
56#define __NR_getegid 50
57#define __NR_acct 51
58#define __NR_lock 53
59#define __NR_ioctl 54
60#define __NR_fcntl 55
61#define __NR_setpgid 57
62#define __NR_ulimit 58
63#define __NR_umask 60
64#define __NR_chroot 61
65#define __NR_ustat 62
66#define __NR_dup2 63
67#define __NR_getppid 64
68#define __NR_setsid 66
69#define __NR_sigaction 67
70#define __NR_setreuid 70
71#define __NR_setregid 71
72#define __NR_sigsuspend 72
73#define __NR_sigpending 73
74#define __NR_sethostname 74
75#define __NR_setrlimit 75
76#define __NR_getrlimit 76 /* Back compatible 2Gig limited rlimit */
77#define __NR_getrusage 77
78#define __NR_gettimeofday 78
79#define __NR_settimeofday 79
80#define __NR_getgroups 80
81#define __NR_setgroups 81
82#define __NR_select 82
83#define __NR_symlink 83
84#define __NR_readlink 85
85#define __NR_uselib 86
86#define __NR_swapon 87
87#define __NR_reboot 88
88#define __NR_munmap 91
89#define __NR_truncate 92
90#define __NR_ftruncate 93
91#define __NR_fchmod 94
92#define __NR_fchown 95
93#define __NR_getpriority 96
94#define __NR_setpriority 97
95#define __NR_profil 98
96#define __NR_statfs 99
97#define __NR_fstatfs 100
98#define __NR_ioperm 101
99#define __NR_syslog 103
100#define __NR_setitimer 104
101#define __NR_getitimer 105
102#define __NR_stat 106
103#define __NR_lstat 107
104#define __NR_fstat 108
105#define __NR_iopl 110
106#define __NR_vhangup 111
107#define __NR_idle 112
108#define __NR_wait4 114
109#define __NR_swapoff 115
110#define __NR_sysinfo 116
111#define __NR_fsync 118
112#define __NR_sigreturn 119
113#define __NR_clone 120
114#define __NR_setdomainname 121
115#define __NR_uname 122
116#define __NR_modify_ldt 123
117#define __NR_adjtimex 124
118#define __NR_mprotect 125
119#define __NR_create_module 127
120#define __NR_init_module 128
121#define __NR_delete_module 129
122#define __NR_quotactl 131
123#define __NR_getpgid 132
124#define __NR_fchdir 133
125#define __NR_bdflush 134
126#define __NR_sysfs 135
127#define __NR_personality 136
128#define __NR_setfsuid 138
129#define __NR_setfsgid 139
130#define __NR__llseek 140
131#define __NR_getdents 141
132#define __NR__newselect 142
133#define __NR_flock 143
134#define __NR_msync 144
135#define __NR_readv 145
136#define __NR_writev 146
137#define __NR_cacheflush 147
138#define __NR_cachectl 148
139#define __NR_sysxtensa 149
140#define __NR_sysdummy 150
141#define __NR_getsid 151
142#define __NR_fdatasync 152
143#define __NR__sysctl 153
144#define __NR_mlock 154
145#define __NR_munlock 155
146#define __NR_mlockall 156
147#define __NR_munlockall 157
148#define __NR_sched_setparam 158
149#define __NR_sched_getparam 159
150#define __NR_sched_setscheduler 160
151#define __NR_sched_getscheduler 161
152#define __NR_sched_yield 162
153#define __NR_sched_get_priority_max 163
154#define __NR_sched_get_priority_min 164
155#define __NR_sched_rr_get_interval 165
156#define __NR_nanosleep 166
157#define __NR_mremap 167
158#define __NR_accept 168
159#define __NR_bind 169
160#define __NR_connect 170
161#define __NR_getpeername 171
162#define __NR_getsockname 172
163#define __NR_getsockopt 173
164#define __NR_listen 174
165#define __NR_recv 175
166#define __NR_recvfrom 176
167#define __NR_recvmsg 177
168#define __NR_send 178
169#define __NR_sendmsg 179
170#define __NR_sendto 180
171#define __NR_setsockopt 181
172#define __NR_shutdown 182
173#define __NR_socket 183
174#define __NR_socketpair 184
175#define __NR_setresuid 185
176#define __NR_getresuid 186
177#define __NR_query_module 187
178#define __NR_poll 188
179#define __NR_nfsservctl 189
180#define __NR_setresgid 190
181#define __NR_getresgid 191
182#define __NR_prctl 192
183#define __NR_rt_sigreturn 193
184#define __NR_rt_sigaction 194
185#define __NR_rt_sigprocmask 195
186#define __NR_rt_sigpending 196
187#define __NR_rt_sigtimedwait 197
188#define __NR_rt_sigqueueinfo 198
189#define __NR_rt_sigsuspend 199
190#define __NR_pread 200
191#define __NR_pwrite 201
192#define __NR_chown 202
193#define __NR_getcwd 203
194#define __NR_capget 204
195#define __NR_capset 205
196#define __NR_sigaltstack 206
197#define __NR_sendfile 207
198#define __NR_mmap2 210
199#define __NR_truncate64 211
200#define __NR_ftruncate64 212
201#define __NR_stat64 213
202#define __NR_lstat64 214
203#define __NR_fstat64 215
204#define __NR_pivot_root 216
205#define __NR_mincore 217
206#define __NR_madvise 218
207#define __NR_getdents64 219
208
209/* Keep this last; should always equal the last valid call number. */
210#define __NR_Linux_syscalls 220
211
212/* user-visible error numbers are in the range -1 - -125: see
213 * <asm-xtensa/errno.h> */
214
215#define SYSXTENSA_RESERVED 0 /* don't use this */
216#define SYSXTENSA_ATOMIC_SET 1 /* set variable */
217#define SYSXTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */
218#define SYSXTENSA_ATOMIC_ADD 3 /* add to memory */
219#define SYSXTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
220
221#define SYSXTENSA_COUNT 5 /* count of syscall0 functions*/
222
223#ifdef __KERNEL__
224#define __syscall_return(type, res) return ((type)(res))
225#else
226#define __syscall_return(type, res) \
227do { \
228 if ((unsigned long)(res) >= (unsigned long)(-125)) { \
229 /* Avoid using "res" which is declared to be in register r2; \
230 * errno might expand to a function call and clobber it. */ \
231 int __err = -(res); \
232 errno = __err; \
233 res = -1; \
234 } \
235 return (type) (res); \
236} while (0)
237#endif
238
239
240/* Tensilica's xt-xcc compiler is much more agressive at code
241 * optimization than gcc. Multiple __asm__ statements are
242 * insufficient for xt-xcc because subsequent optimization passes
243 * (beyond the front-end that knows of __asm__ statements and other
244 * such GNU Extensions to C) can modify the register selection for
245 * containment of C variables.
246 *
247 * xt-xcc cannot modify the contents of a single __asm__ statement, so
248 * we create single-asm versions of the syscall macros that are
249 * suitable and optimal for both xt-xcc and gcc.
250 *
251 * Linux takes system-call arguments in registers. The following
252 * design is optimized for user-land apps (e.g., glibc) which
253 * typically have a function wrapper around the "syscall" assembly
254 * instruction. It satisfies the Xtensa ABI while minizing argument
255 * shifting.
256 *
257 * The Xtensa ABI and software conventions require the system-call
258 * number in a2. If an argument exists in a2, we move it to the next
259 * available register. Note that for improved efficiency, we do NOT
260 * shift all parameters down one register to maintain the original
261 * order.
262 *
263 * At best case (zero arguments), we just write the syscall number to
264 * a2. At worst case (1 to 6 arguments), we move the argument in a2
265 * to the next available register, then write the syscall number to
266 * a2.
267 *
268 * For clarity, the following truth table enumerates all possibilities.
269 *
270 * arguments syscall number arg0, arg1, arg2, arg3, arg4, arg5
271 * --------- -------------- ----------------------------------
272 * 0 a2
273 * 1 a2 a3
274 * 2 a2 a4, a3
275 * 3 a2 a5, a3, a4
276 * 4 a2 a6, a3, a4, a5
277 * 5 a2 a7, a3, a4, a5, a6
278 * 6 a2 a8, a3, a4, a5, a6, a7
279 */
280
281#define _syscall0(type,name) \
282type name(void) \
283{ \
284long __res; \
285__asm__ __volatile__ ( \
286 " movi a2, %1 \n" \
287 " syscall \n" \
288 " mov %0, a2 \n" \
289 : "=a" (__res) \
290 : "i" (__NR_##name) \
291 : "a2" \
292 ); \
293__syscall_return(type,__res); \
294}
295
296#define _syscall1(type,name,type0,arg0) \
297type name(type0 arg0) \
298{ \
299long __res; \
300__asm__ __volatile__ ( \
301 " mov a3, %2 \n" \
302 " movi a2, %1 \n" \
303 " syscall \n" \
304 " mov %0, a2 \n" \
305 : "=a" (__res) \
306 : "i" (__NR_##name), "a" (arg0) \
307 : "a2", "a3" \
308 ); \
309__syscall_return(type,__res); \
310}
311
312#define _syscall2(type,name,type0,arg0,type1,arg1) \
313type name(type0 arg0,type1 arg1) \
314{ \
315long __res; \
316__asm__ __volatile__ ( \
317 " mov a4, %2 \n" \
318 " mov a3, %3 \n" \
319 " movi a2, %1 \n" \
320 " syscall \n" \
321 " mov %0, a2 \n" \
322 : "=a" (__res) \
323 : "i" (__NR_##name), "a" (arg0), "a" (arg1) \
324 : "a2", "a3", "a4" \
325 ); \
326__syscall_return(type,__res); \
327}
328
329#define _syscall3(type,name,type0,arg0,type1,arg1,type2,arg2) \
330type name(type0 arg0,type1 arg1,type2 arg2) \
331{ \
332long __res; \
333__asm__ __volatile__ ( \
334 " mov a5, %2 \n" \
335 " mov a4, %4 \n" \
336 " mov a3, %3 \n" \
337 " movi a2, %1 \n" \
338 " syscall \n" \
339 " mov %0, a2 \n" \
340 : "=a" (__res) \
341 : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2) \
342 : "a2", "a3", "a4", "a5" \
343 ); \
344__syscall_return(type,__res); \
345}
346
347#define _syscall4(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3) \
348type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3) \
349{ \
350long __res; \
351__asm__ __volatile__ ( \
352 " mov a6, %2 \n" \
353 " mov a5, %5 \n" \
354 " mov a4, %4 \n" \
355 " mov a3, %3 \n" \
356 " movi a2, %1 \n" \
357 " syscall \n" \
358 " mov %0, a2 \n" \
359 : "=a" (__res) \
360 : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), "a" (arg3) \
361 : "a2", "a3", "a4", "a5", "a6" \
362 ); \
363__syscall_return(type,__res); \
364}
365
366/* Note that we save and restore the a7 frame pointer.
367 * Including a7 in the clobber list doesn't do what you'd expect.
368 */
369#define _syscall5(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
370type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3,type4 arg4) \
371{ \
372long __res; \
373__asm__ __volatile__ ( \
374 " mov a9, a7 \n" \
375 " mov a7, %2 \n" \
376 " mov a6, %6 \n" \
377 " mov a5, %5 \n" \
378 " mov a4, %4 \n" \
379 " mov a3, %3 \n" \
380 " movi a2, %1 \n" \
381 " syscall \n" \
382 " mov a7, a9 \n" \
383 " mov %0, a2 \n" \
384 : "=a" (__res) \
385 : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), \
386 "a" (arg3), "a" (arg4) \
387 : "a2", "a3", "a4", "a5", "a6", "a9" \
388 ); \
389__syscall_return(type,__res); \
390}
391
392/* Note that we save and restore the a7 frame pointer.
393 * Including a7 in the clobber list doesn't do what you'd expect.
394 */
395#define _syscall6(type,name,type0,arg0,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
396type name(type0 arg0,type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
397{ \
398long __res; \
399__asm__ __volatile__ ( \
400 " mov a9, a7 \n" \
401 " mov a8, %2 \n" \
402 " mov a7, %7 \n" \
403 " mov a6, %6 \n" \
404 " mov a5, %5 \n" \
405 " mov a4, %4 \n" \
406 " mov a3, %3 \n" \
407 " movi a2, %1 \n" \
408 " syscall \n" \
409 " mov a7, a9 \n" \
410 " mov %0, a2 \n" \
411 : "=a" (__res) \
412 : "i" (__NR_##name), "a" (arg0), "a" (arg1), "a" (arg2), \
413 "a" (arg3), "a" (arg4), "a" (arg5) \
414 : "a2", "a3", "a4", "a5", "a6", "a8", "a9" \
415 ); \
416__syscall_return(type,__res); \
417}
418
419
420#ifdef __KERNEL_SYSCALLS__
421static __inline__ _syscall3(int,execve,const char*,file,char**,argv,char**,envp)
422#endif
423
424/*
425 * "Conditional" syscalls
426 *
427 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
428 * but it doesn't work on all toolchains, so we just do it by hand
429 */
430#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
431
432#ifdef __KERNEL__
433#define __ARCH_WANT_STAT64
434#define __ARCH_WANT_SYS_UTIME
435#define __ARCH_WANT_SYS_LLSEEK
436#define __ARCH_WANT_SYS_RT_SIGACTION
437#endif
438
439#endif /* _XTENSA_UNISTD_H */
diff --git a/include/asm-xtensa/user.h b/include/asm-xtensa/user.h
new file mode 100644
index 000000000000..2c3ed23354a8
--- /dev/null
+++ b/include/asm-xtensa/user.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-xtensa/user.h
3 *
4 * Xtensa Processor version.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_USER_H
14#define _XTENSA_USER_H
15
16/* This file usually defines a 'struct user' structure. However, it it only
17 * used for a.out file, which are not supported on Xtensa.
18 */
19
20#endif /* _XTENSA_USER_H */
diff --git a/include/asm-xtensa/vga.h b/include/asm-xtensa/vga.h
new file mode 100644
index 000000000000..23d82f6acb57
--- /dev/null
+++ b/include/asm-xtensa/vga.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-xtensa/vga.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_VGA_H
12#define _XTENSA_VGA_H
13
14#define VGA_MAP_MEM(x) (unsigned long)phys_to_virt(x)
15
16#define vga_readb(x) (*(x))
17#define vga_writeb(x,y) (*(y) = (x))
18
19#endif
diff --git a/include/asm-xtensa/xor.h b/include/asm-xtensa/xor.h
new file mode 100644
index 000000000000..e7b1f083991d
--- /dev/null
+++ b/include/asm-xtensa/xor.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/xor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_XOR_H
12#define _XTENSA_XOR_H
13
14#include <asm-generic/xor.h>
15
16#endif
diff --git a/include/asm-xtensa/xtensa/cacheasm.h b/include/asm-xtensa/xtensa/cacheasm.h
new file mode 100644
index 000000000000..0cdbb0bf180e
--- /dev/null
+++ b/include/asm-xtensa/xtensa/cacheasm.h
@@ -0,0 +1,708 @@
1#ifndef XTENSA_CACHEASM_H
2#define XTENSA_CACHEASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/cacheasm.h -- assembler-specific cache
8 * related definitions that depend on CORE configuration.
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/coreasm.h>
19
20
21/*
22 * This header file defines assembler macros of the form:
23 * <x>cache_<func>
24 * where <x> is 'i' or 'd' for instruction and data caches,
25 * and <func> indicates the function of the macro.
26 *
27 * The following functions <func> are defined,
28 * and apply only to the specified cache (I or D):
29 *
30 * reset
31 * Resets the cache.
32 *
33 * sync
34 * Makes sure any previous cache instructions have been completed;
35 * ie. makes sure any previous cache control operations
36 * have had full effect and been synchronized to memory.
37 * Eg. any invalidate completed [so as not to generate a hit],
38 * any writebacks or other pipelined writes written to memory, etc.
39 *
40 * invalidate_line (single cache line)
41 * invalidate_region (specified memory range)
42 * invalidate_all (entire cache)
43 * Invalidates all cache entries that cache
44 * data from the specified memory range.
45 * NOTE: locked entries are not invalidated.
46 *
47 * writeback_line (single cache line)
48 * writeback_region (specified memory range)
49 * writeback_all (entire cache)
50 * Writes back to memory all dirty cache entries
51 * that cache data from the specified memory range,
52 * and marks these entries as clean.
53 * NOTE: on some future implementations, this might
54 * also invalidate.
55 * NOTE: locked entries are written back, but never invalidated.
56 * NOTE: instruction caches never implement writeback.
57 *
58 * writeback_inv_line (single cache line)
59 * writeback_inv_region (specified memory range)
60 * writeback_inv_all (entire cache)
61 * Writes back to memory all dirty cache entries
62 * that cache data from the specified memory range,
63 * and invalidates these entries (including all clean
64 * cache entries that cache data from that range).
65 * NOTE: locked entries are written back but not invalidated.
66 * NOTE: instruction caches never implement writeback.
67 *
68 * lock_line (single cache line)
69 * lock_region (specified memory range)
70 * Prefetch and lock the specified memory range into cache.
71 * NOTE: if any part of the specified memory range cannot
72 * be locked, a ??? exception occurs. These macros don't
73 * do anything special (yet anyway) to handle this situation.
74 *
75 * unlock_line (single cache line)
76 * unlock_region (specified memory range)
77 * unlock_all (entire cache)
78 * Unlock cache entries that cache the specified memory range.
79 * Entries not already locked are unaffected.
80 */
81
82
83
84/*************************** GENERIC -- ALL CACHES ***************************/
85
86
87/*
88 * The following macros assume the following cache size/parameter limits
89 * in the current Xtensa core implementation:
90 * cache size: 1024 bytes minimum
91 * line size: 16 - 64 bytes
92 * way count: 1 - 4
93 *
94 * Minimum entries per way (ie. per associativity) = 1024 / 64 / 4 = 4
95 * Hence the assumption that each loop can execute four cache instructions.
96 *
97 * Correspondingly, the offset range of instructions is assumed able to cover
98 * four lines, ie. offsets {0,1,2,3} * line_size are assumed valid for
99 * both hit and indexed cache instructions. Ie. these offsets are all
100 * valid: 0, 16, 32, 48, 64, 96, 128, 192 (for line sizes 16, 32, 64).
101 * This is true of all original cache instructions
102 * (dhi, ihi, dhwb, dhwbi, dii, iii) which have offsets
103 * of 0 to 1020 in multiples of 4 (ie. 8 bits shifted by 2).
104 * This is also true of subsequent cache instructions
105 * (dhu, ihu, diu, iiu, diwb, diwbi, dpfl, ipfl) which have offsets
106 * of 0 to 240 in multiples of 16 (ie. 4 bits shifted by 4).
107 *
108 * (Maximum cache size, currently 32k, doesn't affect the following macros.
109 * Cache ways > MMU min page size cause aliasing but that's another matter.)
110 */
111
112
113
114/*
115 * Macro to apply an 'indexed' cache instruction to the entire cache.
116 *
117 * Parameters:
118 * cainst instruction/ that takes an address register parameter
119 * and an offset parameter (in range 0 .. 3*linesize).
120 * size size of cache in bytes
121 * linesize size of cache line in bytes
122 * assoc_or1 number of associativities (ways/sets) in cache
123 * if all sets affected by cainst,
124 * or 1 if only one set (or not all sets) of the cache
125 * is affected by cainst (eg. DIWB or DIWBI [not yet ISA defined]).
126 * aa, ab unique address registers (temporaries)
127 */
128
129 .macro cache_index_all cainst, size, linesize, assoc_or1, aa, ab
130
131 // Sanity-check on cache parameters:
132 .ifne (\size % (\linesize * \assoc_or1 * 4))
133 .err // cache configuration outside expected/supported range!
134 .endif
135
136 // \size byte cache, \linesize byte lines, \assoc_or1 way(s) affected by each \cainst.
137 movi \aa, (\size / (\linesize * \assoc_or1 * 4))
138 // Possible improvement: need only loop if \aa > 1 ;
139 // however that particular condition is highly unlikely.
140 movi \ab, 0 // to iterate over cache
141 floop \aa, cachex\@
142 \cainst \ab, 0*\linesize
143 \cainst \ab, 1*\linesize
144 \cainst \ab, 2*\linesize
145 \cainst \ab, 3*\linesize
146 addi \ab, \ab, 4*\linesize // move to next line
147 floopend \aa, cachex\@
148
149 .endm
150
151
152/*
153 * Macro to apply a 'hit' cache instruction to a memory region,
154 * ie. to any cache entries that cache a specified portion (region) of memory.
155 * Takes care of the unaligned cases, ie. may apply to one
156 * more cache line than $asize / lineSize if $aaddr is not aligned.
157 *
158 *
159 * Parameters are:
160 * cainst instruction/macro that takes an address register parameter
161 * and an offset parameter (currently always zero)
162 * and generates a cache instruction (eg. "dhi", "dhwb", "ihi", etc.)
163 * linesize_log2 log2(size of cache line in bytes)
164 * addr register containing start address of region (clobbered)
165 * asize register containing size of the region in bytes (clobbered)
166 * askew unique register used as temporary
167 *
168 * !?!?! 2DO: optimization: iterate max(cache_size and \asize) / linesize
169 */
170
171 .macro cache_hit_region cainst, linesize_log2, addr, asize, askew
172
173 // Make \asize the number of iterations:
174 extui \askew, \addr, 0, \linesize_log2 // get unalignment amount of \addr
175 add \asize, \asize, \askew // ... and add it to \asize
176 addi \asize, \asize, (1 << \linesize_log2) - 1 // round up!
177 srli \asize, \asize, \linesize_log2
178
179 // Iterate over region:
180 floopnez \asize, cacheh\@
181 \cainst \addr, 0
182 addi \addr, \addr, (1 << \linesize_log2) // move to next line
183 floopend \asize, cacheh\@
184
185 .endm
186
187
188
189
190
191/*************************** INSTRUCTION CACHE ***************************/
192
193
194/*
195 * Reset/initialize the instruction cache by simply invalidating it:
196 * (need to unlock first also, if cache locking implemented):
197 *
198 * Parameters:
199 * aa, ab unique address registers (temporaries)
200 */
201 .macro icache_reset aa, ab
202 icache_unlock_all \aa, \ab
203 icache_invalidate_all \aa, \ab
204 .endm
205
206
207/*
208 * Synchronize after an instruction cache operation,
209 * to be sure everything is in sync with memory as to be
210 * expected following any previous instruction cache control operations.
211 *
212 * Parameters are:
213 * ar an address register (temporary) (currently unused, but may be used in future)
214 */
215 .macro icache_sync ar
216#if XCHAL_ICACHE_SIZE > 0
217 isync
218#endif
219 .endm
220
221
222
223/*
224 * Invalidate a single line of the instruction cache.
225 * Parameters are:
226 * ar address register that contains (virtual) address to invalidate
227 * (may get clobbered in a future implementation, but not currently)
228 * offset (optional) offset to add to \ar to compute effective address to invalidate
229 * (note: some number of lsbits are ignored)
230 */
231 .macro icache_invalidate_line ar, offset
232#if XCHAL_ICACHE_SIZE > 0
233 ihi \ar, \offset // invalidate icache line
234 /*
235 * NOTE: in some version of the silicon [!!!SHOULD HAVE BEEN DOCUMENTED!!!]
236 * 'ihi' doesn't work, so it had been replaced with 'iii'
237 * (which would just invalidate more than it should,
238 * which should be okay other than the performance hit
239 * because cache locking did not exist in that version,
240 * unless user somehow relies on something being cached).
241 * [WHAT VERSION IS IT!!?!?
242 * IS THERE ANY WAY TO TEST FOR THAT HERE, TO OUTPUT 'III' ONLY IF NEEDED!?!?].
243 *
244 * iii \ar, \offset
245 */
246 icache_sync \ar
247#endif
248 .endm
249
250
251
252
253/*
254 * Invalidate instruction cache entries that cache a specified portion of memory.
255 * Parameters are:
256 * astart start address (register gets clobbered)
257 * asize size of the region in bytes (register gets clobbered)
258 * ac unique register used as temporary
259 */
260 .macro icache_invalidate_region astart, asize, ac
261#if XCHAL_ICACHE_SIZE > 0
262 // Instruction cache region invalidation:
263 cache_hit_region ihi, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
264 icache_sync \ac
265 // End of instruction cache region invalidation
266#endif
267 .endm
268
269
270
271/*
272 * Invalidate entire instruction cache.
273 *
274 * Parameters:
275 * aa, ab unique address registers (temporaries)
276 */
277 .macro icache_invalidate_all aa, ab
278#if XCHAL_ICACHE_SIZE > 0
279 // Instruction cache invalidation:
280 cache_index_all iii, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, XCHAL_ICACHE_WAYS, \aa, \ab
281 icache_sync \aa
282 // End of instruction cache invalidation
283#endif
284 .endm
285
286
287
288/*
289 * Lock (prefetch & lock) a single line of the instruction cache.
290 *
291 * Parameters are:
292 * ar address register that contains (virtual) address to lock
293 * (may get clobbered in a future implementation, but not currently)
294 * offset offset to add to \ar to compute effective address to lock
295 * (note: some number of lsbits are ignored)
296 */
297 .macro icache_lock_line ar, offset
298#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
299 ipfl \ar, \offset /* prefetch and lock icache line */
300 icache_sync \ar
301#endif
302 .endm
303
304
305
306/*
307 * Lock (prefetch & lock) a specified portion of memory into the instruction cache.
308 * Parameters are:
309 * astart start address (register gets clobbered)
310 * asize size of the region in bytes (register gets clobbered)
311 * ac unique register used as temporary
312 */
313 .macro icache_lock_region astart, asize, ac
314#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
315 // Instruction cache region lock:
316 cache_hit_region ipfl, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
317 icache_sync \ac
318 // End of instruction cache region lock
319#endif
320 .endm
321
322
323
324/*
325 * Unlock a single line of the instruction cache.
326 *
327 * Parameters are:
328 * ar address register that contains (virtual) address to unlock
329 * (may get clobbered in a future implementation, but not currently)
330 * offset offset to add to \ar to compute effective address to unlock
331 * (note: some number of lsbits are ignored)
332 */
333 .macro icache_unlock_line ar, offset
334#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
335 ihu \ar, \offset /* unlock icache line */
336 icache_sync \ar
337#endif
338 .endm
339
340
341
342/*
343 * Unlock a specified portion of memory from the instruction cache.
344 * Parameters are:
345 * astart start address (register gets clobbered)
346 * asize size of the region in bytes (register gets clobbered)
347 * ac unique register used as temporary
348 */
349 .macro icache_unlock_region astart, asize, ac
350#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
351 // Instruction cache region unlock:
352 cache_hit_region ihu, XCHAL_ICACHE_LINEWIDTH, \astart, \asize, \ac
353 icache_sync \ac
354 // End of instruction cache region unlock
355#endif
356 .endm
357
358
359
360/*
361 * Unlock entire instruction cache.
362 *
363 * Parameters:
364 * aa, ab unique address registers (temporaries)
365 */
366 .macro icache_unlock_all aa, ab
367#if XCHAL_ICACHE_SIZE > 0 && XCHAL_ICACHE_LINE_LOCKABLE
368 // Instruction cache unlock:
369 cache_index_all iiu, XCHAL_ICACHE_SIZE, XCHAL_ICACHE_LINESIZE, 1, \aa, \ab
370 icache_sync \aa
371 // End of instruction cache unlock
372#endif
373 .endm
374
375
376
377
378
379/*************************** DATA CACHE ***************************/
380
381
382
383/*
384 * Reset/initialize the data cache by simply invalidating it
385 * (need to unlock first also, if cache locking implemented):
386 *
387 * Parameters:
388 * aa, ab unique address registers (temporaries)
389 */
390 .macro dcache_reset aa, ab
391 dcache_unlock_all \aa, \ab
392 dcache_invalidate_all \aa, \ab
393 .endm
394
395
396
397
398/*
399 * Synchronize after a data cache operation,
400 * to be sure everything is in sync with memory as to be
401 * expected following any previous data cache control operations.
402 *
403 * Parameters are:
404 * ar an address register (temporary) (currently unused, but may be used in future)
405 */
406 .macro dcache_sync ar
407#if XCHAL_DCACHE_SIZE > 0
408 // This previous sequence errs on the conservative side (too much so); a DSYNC should be sufficient:
409 //memw // synchronize data cache changes relative to subsequent memory accesses
410 //isync // be conservative and ISYNC as well (just to be sure)
411
412 dsync
413#endif
414 .endm
415
416
417
418/*
419 * Synchronize after a data store operation,
420 * to be sure the stored data is completely off the processor
421 * (and assuming there is no buffering outside the processor,
422 * that the data is in memory). This may be required to
423 * ensure that the processor's write buffers are emptied.
424 * A MEMW followed by a read guarantees this, by definition.
425 * We also try to make sure the read itself completes.
426 *
427 * Parameters are:
428 * ar an address register (temporary)
429 */
430 .macro write_sync ar
431 memw // ensure previous memory accesses are complete prior to subsequent memory accesses
432 l32i \ar, sp, 0 // completing this read ensures any previous write has completed, because of MEMW
433 //slot
434 add \ar, \ar, \ar // use the result of the read to help ensure the read completes (in future architectures)
435 .endm
436
437
438/*
439 * Invalidate a single line of the data cache.
440 * Parameters are:
441 * ar address register that contains (virtual) address to invalidate
442 * (may get clobbered in a future implementation, but not currently)
443 * offset (optional) offset to add to \ar to compute effective address to invalidate
444 * (note: some number of lsbits are ignored)
445 */
446 .macro dcache_invalidate_line ar, offset
447#if XCHAL_DCACHE_SIZE > 0
448 dhi \ar, \offset
449 dcache_sync \ar
450#endif
451 .endm
452
453
454
455
456
457/*
458 * Invalidate data cache entries that cache a specified portion of memory.
459 * Parameters are:
460 * astart start address (register gets clobbered)
461 * asize size of the region in bytes (register gets clobbered)
462 * ac unique register used as temporary
463 */
464 .macro dcache_invalidate_region astart, asize, ac
465#if XCHAL_DCACHE_SIZE > 0
466 // Data cache region invalidation:
467 cache_hit_region dhi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
468 dcache_sync \ac
469 // End of data cache region invalidation
470#endif
471 .endm
472
473
474
475#if 0
476/*
477 * This is a work-around for a bug in SiChip1 (???).
478 * There should be a proper mechanism for not outputting
479 * these instructions when not needed.
480 * To enable work-around, uncomment this and replace 'dii'
481 * with 'dii_s1' everywhere, eg. in dcache_invalidate_all
482 * macro below.
483 */
484 .macro dii_s1 ar, offset
485 dii \ar, \offset
486 or \ar, \ar, \ar
487 or \ar, \ar, \ar
488 or \ar, \ar, \ar
489 or \ar, \ar, \ar
490 .endm
491#endif
492
493
494/*
495 * Invalidate entire data cache.
496 *
497 * Parameters:
498 * aa, ab unique address registers (temporaries)
499 */
500 .macro dcache_invalidate_all aa, ab
501#if XCHAL_DCACHE_SIZE > 0
502 // Data cache invalidation:
503 cache_index_all dii, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, XCHAL_DCACHE_WAYS, \aa, \ab
504 dcache_sync \aa
505 // End of data cache invalidation
506#endif
507 .endm
508
509
510
511/*
512 * Writeback a single line of the data cache.
513 * Parameters are:
514 * ar address register that contains (virtual) address to writeback
515 * (may get clobbered in a future implementation, but not currently)
516 * offset offset to add to \ar to compute effective address to writeback
517 * (note: some number of lsbits are ignored)
518 */
519 .macro dcache_writeback_line ar, offset
520#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
521 dhwb \ar, \offset
522 dcache_sync \ar
523#endif
524 .endm
525
526
527
528/*
529 * Writeback dirty data cache entries that cache a specified portion of memory.
530 * Parameters are:
531 * astart start address (register gets clobbered)
532 * asize size of the region in bytes (register gets clobbered)
533 * ac unique register used as temporary
534 */
535 .macro dcache_writeback_region astart, asize, ac
536#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
537 // Data cache region writeback:
538 cache_hit_region dhwb, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
539 dcache_sync \ac
540 // End of data cache region writeback
541#endif
542 .endm
543
544
545
546/*
547 * Writeback entire data cache.
548 * Parameters:
549 * aa, ab unique address registers (temporaries)
550 */
551 .macro dcache_writeback_all aa, ab
552#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_IS_WRITEBACK
553 // Data cache writeback:
554 cache_index_all diwb, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
555 dcache_sync \aa
556 // End of data cache writeback
557#endif
558 .endm
559
560
561
562/*
563 * Writeback and invalidate a single line of the data cache.
564 * Parameters are:
565 * ar address register that contains (virtual) address to writeback and invalidate
566 * (may get clobbered in a future implementation, but not currently)
567 * offset offset to add to \ar to compute effective address to writeback and invalidate
568 * (note: some number of lsbits are ignored)
569 */
570 .macro dcache_writeback_inv_line ar, offset
571#if XCHAL_DCACHE_SIZE > 0
572 dhwbi \ar, \offset /* writeback and invalidate dcache line */
573 dcache_sync \ar
574#endif
575 .endm
576
577
578
579/*
580 * Writeback and invalidate data cache entries that cache a specified portion of memory.
581 * Parameters are:
582 * astart start address (register gets clobbered)
583 * asize size of the region in bytes (register gets clobbered)
584 * ac unique register used as temporary
585 */
586 .macro dcache_writeback_inv_region astart, asize, ac
587#if XCHAL_DCACHE_SIZE > 0
588 // Data cache region writeback and invalidate:
589 cache_hit_region dhwbi, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
590 dcache_sync \ac
591 // End of data cache region writeback and invalidate
592#endif
593 .endm
594
595
596
597/*
598 * Writeback and invalidate entire data cache.
599 * Parameters:
600 * aa, ab unique address registers (temporaries)
601 */
602 .macro dcache_writeback_inv_all aa, ab
603#if XCHAL_DCACHE_SIZE > 0
604 // Data cache writeback and invalidate:
605#if XCHAL_DCACHE_IS_WRITEBACK
606 cache_index_all diwbi, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
607 dcache_sync \aa
608#else /*writeback*/
609 // Data cache does not support writeback, so just invalidate: */
610 dcache_invalidate_all \aa, \ab
611#endif /*writeback*/
612 // End of data cache writeback and invalidate
613#endif
614 .endm
615
616
617
618
619/*
620 * Lock (prefetch & lock) a single line of the data cache.
621 *
622 * Parameters are:
623 * ar address register that contains (virtual) address to lock
624 * (may get clobbered in a future implementation, but not currently)
625 * offset offset to add to \ar to compute effective address to lock
626 * (note: some number of lsbits are ignored)
627 */
628 .macro dcache_lock_line ar, offset
629#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
630 dpfl \ar, \offset /* prefetch and lock dcache line */
631 dcache_sync \ar
632#endif
633 .endm
634
635
636
637/*
638 * Lock (prefetch & lock) a specified portion of memory into the data cache.
639 * Parameters are:
640 * astart start address (register gets clobbered)
641 * asize size of the region in bytes (register gets clobbered)
642 * ac unique register used as temporary
643 */
644 .macro dcache_lock_region astart, asize, ac
645#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
646 // Data cache region lock:
647 cache_hit_region dpfl, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
648 dcache_sync \ac
649 // End of data cache region lock
650#endif
651 .endm
652
653
654
655/*
656 * Unlock a single line of the data cache.
657 *
658 * Parameters are:
659 * ar address register that contains (virtual) address to unlock
660 * (may get clobbered in a future implementation, but not currently)
661 * offset offset to add to \ar to compute effective address to unlock
662 * (note: some number of lsbits are ignored)
663 */
664 .macro dcache_unlock_line ar, offset
665#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
666 dhu \ar, \offset /* unlock dcache line */
667 dcache_sync \ar
668#endif
669 .endm
670
671
672
673/*
674 * Unlock a specified portion of memory from the data cache.
675 * Parameters are:
676 * astart start address (register gets clobbered)
677 * asize size of the region in bytes (register gets clobbered)
678 * ac unique register used as temporary
679 */
680 .macro dcache_unlock_region astart, asize, ac
681#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
682 // Data cache region unlock:
683 cache_hit_region dhu, XCHAL_DCACHE_LINEWIDTH, \astart, \asize, \ac
684 dcache_sync \ac
685 // End of data cache region unlock
686#endif
687 .endm
688
689
690
691/*
692 * Unlock entire data cache.
693 *
694 * Parameters:
695 * aa, ab unique address registers (temporaries)
696 */
697 .macro dcache_unlock_all aa, ab
698#if XCHAL_DCACHE_SIZE > 0 && XCHAL_DCACHE_LINE_LOCKABLE
699 // Data cache unlock:
700 cache_index_all diu, XCHAL_DCACHE_SIZE, XCHAL_DCACHE_LINESIZE, 1, \aa, \ab
701 dcache_sync \aa
702 // End of data cache unlock
703#endif
704 .endm
705
706
707#endif /*XTENSA_CACHEASM_H*/
708
diff --git a/include/asm-xtensa/xtensa/cacheattrasm.h b/include/asm-xtensa/xtensa/cacheattrasm.h
new file mode 100644
index 000000000000..1c3e117b3592
--- /dev/null
+++ b/include/asm-xtensa/xtensa/cacheattrasm.h
@@ -0,0 +1,432 @@
1#ifndef XTENSA_CACHEATTRASM_H
2#define XTENSA_CACHEATTRASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/cacheattrasm.h -- assembler-specific
8 * CACHEATTR register related definitions that depend on CORE
9 * configuration.
10 *
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
13 * for more details.
14 *
15 * Copyright (C) 2002 Tensilica Inc.
16 */
17
18
19#include <xtensa/coreasm.h>
20
21
22/*
23 * This header file defines assembler macros of the form:
24 * <x>cacheattr_<func>
25 * where:
26 * <x> is 'i', 'd' or absent for instruction, data
27 * or both caches; and
28 * <func> indicates the function of the macro.
29 *
30 * The following functions are defined:
31 *
32 * icacheattr_get
33 * Reads I-cache CACHEATTR into a2 (clobbers a3-a5).
34 *
35 * dcacheattr_get
36 * Reads D-cache CACHEATTR into a2 (clobbers a3-a5).
37 * (Note: for configs with a real CACHEATTR register, the
38 * above two macros are identical.)
39 *
40 * cacheattr_set
41 * Writes both I-cache and D-cache CACHEATTRs from a2 (a3-a8 clobbered).
42 * Works even when changing one's own code's attributes.
43 *
44 * icacheattr_is_enabled label
45 * Branches to \label if I-cache appears to have been enabled
46 * (eg. if CACHEATTR contains a cache-enabled attribute).
47 * (clobbers a2-a5,SAR)
48 *
49 * dcacheattr_is_enabled label
50 * Branches to \label if D-cache appears to have been enabled
51 * (eg. if CACHEATTR contains a cache-enabled attribute).
52 * (clobbers a2-a5,SAR)
53 *
54 * cacheattr_is_enabled label
55 * Branches to \label if either I-cache or D-cache appears to have been enabled
56 * (eg. if CACHEATTR contains a cache-enabled attribute).
57 * (clobbers a2-a5,SAR)
58 *
59 * The following macros are only defined under certain conditions:
60 *
61 * icacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR)
62 * Writes I-cache CACHEATTR from a2 (a3-a8 clobbered).
63 *
64 * dcacheattr_set (if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR)
65 * Writes D-cache CACHEATTR from a2 (a3-a8 clobbered).
66 */
67
68
69
70/*************************** GENERIC -- ALL CACHES ***************************/
71
72/*
73 * _cacheattr_get
74 *
75 * (Internal macro.)
76 * Returns value of CACHEATTR register (or closest equivalent) in a2.
77 *
78 * Entry:
79 * (none)
80 * Exit:
81 * a2 value read from CACHEATTR
82 * a3-a5 clobbered (temporaries)
83 */
84 .macro _cacheattr_get tlb
85#if XCHAL_HAVE_CACHEATTR
86 rsr a2, CACHEATTR
87#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
88 // We have a config that "mimics" CACHEATTR using a simplified
89 // "MMU" composed of a single statically-mapped way.
90 // DTLB and ITLB are independent, so there's no single
91 // cache attribute that can describe both. So for now
92 // just return the DTLB state.
93 movi a5, 0xE0000000
94 movi a2, 0
95 movi a3, 0
961: add a3, a3, a5 // next segment
97 r&tlb&1 a4, a3 // get PPN+CA of segment at 0xE0000000, 0xC0000000, ..., 0
98 dsync // interlock???
99 slli a2, a2, 4
100 extui a4, a4, 0, 4 // extract CA
101 or a2, a2, a4
102 bnez a3, 1b
103#else
104 // This macro isn't applicable to arbitrary MMU configurations.
105 // Just return zero.
106 movi a2, 0
107#endif
108 .endm
109
110 .macro icacheattr_get
111 _cacheattr_get itlb
112 .endm
113
114 .macro dcacheattr_get
115 _cacheattr_get dtlb
116 .endm
117
118
119#define XCHAL_CACHEATTR_ALL_BYPASS 0x22222222 /* default (powerup/reset) value of CACHEATTR, all BYPASS
120 mode (ie. disabled/bypassed caches) */
121
122#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
123
124#define XCHAL_FCA_ENAMASK 0x001A /* bitmap of fetch attributes that require enabled icache */
125#define XCHAL_LCA_ENAMASK 0x0003 /* bitmap of load attributes that require enabled dcache */
126#define XCHAL_SCA_ENAMASK 0x0003 /* bitmap of store attributes that require enabled dcache */
127#define XCHAL_LSCA_ENAMASK (XCHAL_LCA_ENAMASK|XCHAL_SCA_ENAMASK) /* l/s attrs requiring enabled dcache */
128#define XCHAL_ALLCA_ENAMASK (XCHAL_FCA_ENAMASK|XCHAL_LSCA_ENAMASK) /* all attrs requiring enabled caches */
129
130/*
131 * _cacheattr_is_enabled
132 *
133 * (Internal macro.)
134 * Branches to \label if CACHEATTR in a2 indicates an enabled
135 * cache, using mask in a3.
136 *
137 * Parameters:
138 * label where to branch to if cache is enabled
139 * Entry:
140 * a2 contains CACHEATTR value used to determine whether
141 * caches are enabled
142 * a3 16-bit constant where each bit correspond to
143 * one of the 16 possible CA values (in a CACHEATTR mask);
144 * CA values that indicate the cache is enabled
145 * have their corresponding bit set in this mask
146 * (eg. use XCHAL_xCA_ENAMASK , above)
147 * Exit:
148 * a2,a4,a5 clobbered
149 * SAR clobbered
150 */
151 .macro _cacheattr_is_enabled label
152 movi a4, 8 // loop 8 times
153.Lcaife\@:
154 extui a5, a2, 0, 4 // get CA nibble
155 ssr a5 // index into mask according to CA...
156 srl a5, a3 // ...and get CA's mask bit in a5 bit 0
157 bbsi.l a5, 0, \label // if CA indicates cache enabled, jump to label
158 srli a2, a2, 4 // next nibble
159 addi a4, a4, -1
160 bnez a4, .Lcaife\@ // loop for each nibble
161 .endm
162
163#else /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
164 .macro _cacheattr_is_enabled label
165 j \label // macro not applicable, assume caches always enabled
166 .endm
167#endif /* XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
168
169
170
171/*
172 * icacheattr_is_enabled
173 *
174 * Branches to \label if I-cache is enabled.
175 *
176 * Parameters:
177 * label where to branch to if icache is enabled
178 * Entry:
179 * (none)
180 * Exit:
181 * a2-a5, SAR clobbered (temporaries)
182 */
183 .macro icacheattr_is_enabled label
184#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
185 icacheattr_get
186 movi a3, XCHAL_FCA_ENAMASK
187#endif
188 _cacheattr_is_enabled \label
189 .endm
190
191/*
192 * dcacheattr_is_enabled
193 *
194 * Branches to \label if D-cache is enabled.
195 *
196 * Parameters:
197 * label where to branch to if dcache is enabled
198 * Entry:
199 * (none)
200 * Exit:
201 * a2-a5, SAR clobbered (temporaries)
202 */
203 .macro dcacheattr_is_enabled label
204#if XCHAL_HAVE_CACHEATTR || XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
205 dcacheattr_get
206 movi a3, XCHAL_LSCA_ENAMASK
207#endif
208 _cacheattr_is_enabled \label
209 .endm
210
211/*
212 * cacheattr_is_enabled
213 *
214 * Branches to \label if either I-cache or D-cache is enabled.
215 *
216 * Parameters:
217 * label where to branch to if a cache is enabled
218 * Entry:
219 * (none)
220 * Exit:
221 * a2-a5, SAR clobbered (temporaries)
222 */
223 .macro cacheattr_is_enabled label
224#if XCHAL_HAVE_CACHEATTR
225 rsr a2, CACHEATTR
226 movi a3, XCHAL_ALLCA_ENAMASK
227#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
228 icacheattr_get
229 movi a3, XCHAL_FCA_ENAMASK
230 _cacheattr_is_enabled \label
231 dcacheattr_get
232 movi a3, XCHAL_LSCA_ENAMASK
233#endif
234 _cacheattr_is_enabled \label
235 .endm
236
237
238
239/*
240 * The ISA does not have a defined way to change the
241 * instruction cache attributes of the running code,
242 * ie. of the memory area that encloses the current PC.
243 * However, each micro-architecture (or class of
244 * configurations within a micro-architecture)
245 * provides a way to deal with this issue.
246 *
247 * Here are a few macros used to implement the relevant
248 * approach taken.
249 */
250
251#if XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
252 // We have a config that "mimics" CACHEATTR using a simplified
253 // "MMU" composed of a single statically-mapped way.
254
255/*
256 * icacheattr_set
257 *
258 * Entry:
259 * a2 cacheattr value to set
260 * Exit:
261 * a2 unchanged
262 * a3-a8 clobbered (temporaries)
263 */
264 .macro icacheattr_set
265
266 movi a5, 0xE0000000 // mask of upper 3 bits
267 movi a6, 3f // PC where ITLB is set
268 movi a3, 0 // start at region 0 (0 .. 7)
269 and a6, a6, a5 // upper 3 bits of local PC area
270 mov a7, a2 // copy a2 so it doesn't get clobbered
271 j 3f
272
273# if XCHAL_HAVE_XLT_CACHEATTR
274 // Can do translations, use generic method:
2751: sub a6, a3, a5 // address of some other segment
276 ritlb1 a8, a6 // save its PPN+CA
277 dsync // interlock??
278 witlb a4, a6 // make it translate to this code area
279 movi a6, 5f // where to jump into it
280 isync
281 sub a6, a6, a5 // adjust jump address within that other segment
282 jx a6
283
284 // Note that in the following code snippet, which runs at a different virtual
285 // address than it is assembled for, we avoid using literals (eg. via movi/l32r)
286 // just in case literals end up in a different 512 MB segment, and we avoid
287 // instructions that rely on the current PC being what is expected.
288 //
289 .align 4
290 _j 6f // this is at label '5' minus 4 bytes
291 .align 4
2925: witlb a4, a3 // we're in other segment, now can write previous segment's CA
293 isync
294 add a6, a6, a5 // back to previous segment
295 addi a6, a6, -4 // next jump label
296 jx a6
297
2986: sub a6, a3, a5 // address of some other segment
299 witlb a8, a6 // restore PPN+CA of other segment
300 mov a6, a3 // restore a6
301 isync
302# else /* XCHAL_HAVE_XLT_CACHEATTR */
303 // Use micro-architecture specific method.
304 // The following 4-instruction sequence is aligned such that
305 // it all fits within a single I-cache line. Sixteen byte
306 // alignment is sufficient for this (using XCHAL_ICACHE_LINESIZE
307 // actually causes problems because that can be greater than
308 // the alignment of the reset vector, where this macro is often
309 // invoked, which would cause the linker to align the reset
310 // vector code away from the reset vector!!).
311 .align 16 /*XCHAL_ICACHE_LINESIZE*/
3121: _witlb a4, a3 // write wired PTE (CA, no PPN) of 512MB segment to ITLB
313 _isync
314 nop
315 nop
316# endif /* XCHAL_HAVE_XLT_CACHEATTR */
317 beq a3, a5, 4f // done?
318
319 // Note that in the WITLB loop, we don't do any load/stores
320 // (may not be an issue here, but it is important in the DTLB case).
3212: srli a7, a7, 4 // next CA
322 sub a3, a3, a5 // next segment (add 0x20000000)
3233:
324# if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */
325 ritlb1 a8, a3 // get current PPN+CA of segment
326 dsync // interlock???
327 extui a4, a7, 0, 4 // extract CA to set
328 srli a8, a8, 4 // clear CA but keep PPN ...
329 slli a8, a8, 4 // ...
330 add a4, a4, a8 // combine new CA with PPN to preserve
331# else
332 extui a4, a7, 0, 4 // extract CA
333# endif
334 beq a3, a6, 1b // current PC's region? if so, do it in a safe way
335 witlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to ITLB
336 bne a3, a5, 2b
337 isync // make sure all ifetch changes take effect
3384:
339 .endm // icacheattr_set
340
341
342/*
343 * dcacheattr_set
344 *
345 * Entry:
346 * a2 cacheattr value to set
347 * Exit:
348 * a2 unchanged
349 * a3-a8 clobbered (temporaries)
350 */
351
352 .macro dcacheattr_set
353
354 movi a5, 0xE0000000 // mask of upper 3 bits
355 movi a3, 0 // start at region 0 (0 .. 7)
356 mov a7, a2 // copy a2 so it doesn't get clobbered
357 j 3f
358 // Note that in the WDTLB loop, we don't do any load/stores
359 // (including implicit l32r via movi) because it isn't safe.
3602: srli a7, a7, 4 // next CA
361 sub a3, a3, a5 // next segment (add 0x20000000)
3623:
363# if XCHAL_HAVE_XLT_CACHEATTR /* if have translation, preserve it */
364 rdtlb1 a8, a3 // get current PPN+CA of segment
365 dsync // interlock???
366 extui a4, a7, 0, 4 // extract CA to set
367 srli a8, a8, 4 // clear CA but keep PPN ...
368 slli a8, a8, 4 // ...
369 add a4, a4, a8 // combine new CA with PPN to preserve
370# else
371 extui a4, a7, 0, 4 // extract CA to set
372# endif
373 wdtlb a4, a3 // write wired PTE (CA [+PPN]) of 512MB segment to DTLB
374 bne a3, a5, 2b
375 dsync // make sure all data path changes take effect
376 .endm // dcacheattr_set
377
378#endif /* XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR */
379
380
381
382/*
383 * cacheattr_set
384 *
385 * Macro that sets the current CACHEATTR safely
386 * (both i and d) according to the current contents of a2.
387 * It works even when changing the cache attributes of
388 * the currently running code.
389 *
390 * Entry:
391 * a2 cacheattr value to set
392 * Exit:
393 * a2 unchanged
394 * a3-a8 clobbered (temporaries)
395 */
396 .macro cacheattr_set
397
398#if XCHAL_HAVE_CACHEATTR
399# if XCHAL_ICACHE_LINESIZE < 4
400 // No i-cache, so can always safely write to CACHEATTR:
401 wsr a2, CACHEATTR
402# else
403 // The Athens micro-architecture, when using the old
404 // exception architecture option (ie. with the CACHEATTR register)
405 // allows changing the cache attributes of the running code
406 // using the following exact sequence aligned to be within
407 // an instruction cache line. (NOTE: using XCHAL_ICACHE_LINESIZE
408 // alignment actually causes problems because that can be greater
409 // than the alignment of the reset vector, where this macro is often
410 // invoked, which would cause the linker to align the reset
411 // vector code away from the reset vector!!).
412 j 1f
413 .align 16 /*XCHAL_ICACHE_LINESIZE*/ // align to within an I-cache line
4141: _wsr a2, CACHEATTR
415 _isync
416 nop
417 nop
418# endif
419#elif XCHAL_HAVE_MIMIC_CACHEATTR || XCHAL_HAVE_XLT_CACHEATTR
420 // DTLB and ITLB are independent, but to keep semantics
421 // of this macro we simply write to both.
422 icacheattr_set
423 dcacheattr_set
424#else
425 // This macro isn't applicable to arbitrary MMU configurations.
426 // Do nothing in this case.
427#endif
428 .endm
429
430
431#endif /*XTENSA_CACHEATTRASM_H*/
432
diff --git a/include/asm-xtensa/xtensa/config-linux_be/core.h b/include/asm-xtensa/xtensa/config-linux_be/core.h
new file mode 100644
index 000000000000..d54fe5eb1064
--- /dev/null
+++ b/include/asm-xtensa/xtensa/config-linux_be/core.h
@@ -0,0 +1,1270 @@
1/*
2 * xtensa/config/core.h -- HAL definitions that are dependent on CORE configuration
3 *
4 * This header file is sometimes referred to as the "compile-time HAL" or CHAL.
5 * It was generated for a specific Xtensa processor configuration.
6 *
7 * Source for configuration-independent binaries (which link in a
8 * configuration-specific HAL library) must NEVER include this file.
9 * It is perfectly normal, however, for the HAL source itself to include this file.
10 */
11
12/*
13 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of version 2.1 of the GNU Lesser General Public
17 * License as published by the Free Software Foundation.
18 *
19 * This program is distributed in the hope that it would be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 * Further, this software is distributed without any warranty that it is
24 * free of the rightful claim of any third person regarding infringement
25 * or the like. Any license provided herein, whether implied or
26 * otherwise, applies only to this software file. Patent licenses, if
27 * any, provided herein do not apply to combinations of this program with
28 * other software, or any other product whatsoever.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this program; if not, write the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
33 * USA.
34 */
35
36
37#ifndef XTENSA_CONFIG_CORE_H
38#define XTENSA_CONFIG_CORE_H
39
40#include <xtensa/hal.h>
41
42
43/*----------------------------------------------------------------------
44 GENERAL
45 ----------------------------------------------------------------------*/
46
47/*
48 * Separators for macros that expand into arrays.
49 * These can be predefined by files that #include this one,
50 * when different separators are required.
51 */
52/* Element separator for macros that expand into 1-dimensional arrays: */
53#ifndef XCHAL_SEP
54#define XCHAL_SEP ,
55#endif
56/* Array separator for macros that expand into 2-dimensional arrays: */
57#ifndef XCHAL_SEP2
58#define XCHAL_SEP2 },{
59#endif
60
61
62/*----------------------------------------------------------------------
63 ENDIANNESS
64 ----------------------------------------------------------------------*/
65
66#define XCHAL_HAVE_BE 1
67#define XCHAL_HAVE_LE 0
68#define XCHAL_MEMORY_ORDER XTHAL_BIGENDIAN
69
70
71/*----------------------------------------------------------------------
72 REGISTER WINDOWS
73 ----------------------------------------------------------------------*/
74
75#define XCHAL_HAVE_WINDOWED 1 /* 1 if windowed registers option configured, 0 otherwise */
76#define XCHAL_NUM_AREGS 64 /* number of physical address regs */
77#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */
78
79
80/*----------------------------------------------------------------------
81 ADDRESS ALIGNMENT
82 ----------------------------------------------------------------------*/
83
84/* These apply to a selected set of core load and store instructions only (see ISA): */
85#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* 1 if unaligned loads cause an exception, 0 otherwise */
86#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* 1 if unaligned stores cause an exception, 0 otherwise */
87
88
89/*----------------------------------------------------------------------
90 INTERRUPTS
91 ----------------------------------------------------------------------*/
92
93#define XCHAL_HAVE_INTERRUPTS 1 /* 1 if interrupt option configured, 0 otherwise */
94#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* 1 if high-priority interrupt option configured, 0 otherwise */
95#define XCHAL_HAVE_HIGHLEVEL_INTERRUPTS XCHAL_HAVE_HIGHPRI_INTERRUPTS
96#define XCHAL_HAVE_NMI 0 /* 1 if NMI option configured, 0 otherwise */
97#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
98#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* number of bits to hold an interrupt number: roundup(log2(number of interrupts)) */
99#define XCHAL_NUM_EXTINTERRUPTS 10 /* number of external interrupts */
100#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels (not including level zero!) */
101#define XCHAL_NUM_LOWPRI_LEVELS 1 /* number of low-priority interrupt levels (always 1) */
102#define XCHAL_FIRST_HIGHPRI_LEVEL (XCHAL_NUM_LOWPRI_LEVELS+1) /* level of first high-priority interrupt (always 2) */
103#define XCHAL_EXCM_LEVEL 1 /* level of interrupts masked by PS.EXCM (XEA2 only; always 1 in T10xx);
104 for XEA1, where there is no PS.EXCM, this is always 1;
105 interrupts at levels FIRST_HIGHPRI <= n <= EXCM_LEVEL, if any,
106 are termed "medium priority" interrupts (post T10xx only) */
107/* Note: 1 <= LOWPRI_LEVELS <= EXCM_LEVEL < DEBUGLEVEL <= NUM_INTLEVELS < NMILEVEL <= 15 */
108
109/* Masks of interrupts at each interrupt level: */
110#define XCHAL_INTLEVEL0_MASK 0x00000000
111#define XCHAL_INTLEVEL1_MASK 0x000064F9
112#define XCHAL_INTLEVEL2_MASK 0x00008902
113#define XCHAL_INTLEVEL3_MASK 0x00011204
114#define XCHAL_INTLEVEL4_MASK 0x00000000
115#define XCHAL_INTLEVEL5_MASK 0x00000000
116#define XCHAL_INTLEVEL6_MASK 0x00000000
117#define XCHAL_INTLEVEL7_MASK 0x00000000
118#define XCHAL_INTLEVEL8_MASK 0x00000000
119#define XCHAL_INTLEVEL9_MASK 0x00000000
120#define XCHAL_INTLEVEL10_MASK 0x00000000
121#define XCHAL_INTLEVEL11_MASK 0x00000000
122#define XCHAL_INTLEVEL12_MASK 0x00000000
123#define XCHAL_INTLEVEL13_MASK 0x00000000
124#define XCHAL_INTLEVEL14_MASK 0x00000000
125#define XCHAL_INTLEVEL15_MASK 0x00000000
126/* As an array of entries (eg. for C constant arrays): */
127#define XCHAL_INTLEVEL_MASKS 0x00000000 XCHAL_SEP \
128 0x000064F9 XCHAL_SEP \
129 0x00008902 XCHAL_SEP \
130 0x00011204 XCHAL_SEP \
131 0x00000000 XCHAL_SEP \
132 0x00000000 XCHAL_SEP \
133 0x00000000 XCHAL_SEP \
134 0x00000000 XCHAL_SEP \
135 0x00000000 XCHAL_SEP \
136 0x00000000 XCHAL_SEP \
137 0x00000000 XCHAL_SEP \
138 0x00000000 XCHAL_SEP \
139 0x00000000 XCHAL_SEP \
140 0x00000000 XCHAL_SEP \
141 0x00000000 XCHAL_SEP \
142 0x00000000
143
144/* Masks of interrupts at each range 1..n of interrupt levels: */
145#define XCHAL_INTLEVEL0_ANDBELOW_MASK 0x00000000
146#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9
147#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB
148#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF
149#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF
150#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF
151#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF
152#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF
153#define XCHAL_INTLEVEL8_ANDBELOW_MASK 0x0001FFFF
154#define XCHAL_INTLEVEL9_ANDBELOW_MASK 0x0001FFFF
155#define XCHAL_INTLEVEL10_ANDBELOW_MASK 0x0001FFFF
156#define XCHAL_INTLEVEL11_ANDBELOW_MASK 0x0001FFFF
157#define XCHAL_INTLEVEL12_ANDBELOW_MASK 0x0001FFFF
158#define XCHAL_INTLEVEL13_ANDBELOW_MASK 0x0001FFFF
159#define XCHAL_INTLEVEL14_ANDBELOW_MASK 0x0001FFFF
160#define XCHAL_INTLEVEL15_ANDBELOW_MASK 0x0001FFFF
161#define XCHAL_LOWPRI_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all low-priority interrupts */
162#define XCHAL_EXCM_MASK XCHAL_INTLEVEL1_ANDBELOW_MASK /* mask of all interrupts masked by PS.EXCM (or CEXCM) */
163/* As an array of entries (eg. for C constant arrays): */
164#define XCHAL_INTLEVEL_ANDBELOW_MASKS 0x00000000 XCHAL_SEP \
165 0x000064F9 XCHAL_SEP \
166 0x0000EDFB XCHAL_SEP \
167 0x0001FFFF XCHAL_SEP \
168 0x0001FFFF XCHAL_SEP \
169 0x0001FFFF XCHAL_SEP \
170 0x0001FFFF XCHAL_SEP \
171 0x0001FFFF XCHAL_SEP \
172 0x0001FFFF XCHAL_SEP \
173 0x0001FFFF XCHAL_SEP \
174 0x0001FFFF XCHAL_SEP \
175 0x0001FFFF XCHAL_SEP \
176 0x0001FFFF XCHAL_SEP \
177 0x0001FFFF XCHAL_SEP \
178 0x0001FFFF XCHAL_SEP \
179 0x0001FFFF
180
181/* Interrupt numbers for each interrupt level at which only one interrupt was configured: */
182/*#define XCHAL_INTLEVEL1_NUM ...more than one interrupt at this level...*/
183/*#define XCHAL_INTLEVEL2_NUM ...more than one interrupt at this level...*/
184/*#define XCHAL_INTLEVEL3_NUM ...more than one interrupt at this level...*/
185
186/* Level of each interrupt: */
187#define XCHAL_INT0_LEVEL 1
188#define XCHAL_INT1_LEVEL 2
189#define XCHAL_INT2_LEVEL 3
190#define XCHAL_INT3_LEVEL 1
191#define XCHAL_INT4_LEVEL 1
192#define XCHAL_INT5_LEVEL 1
193#define XCHAL_INT6_LEVEL 1
194#define XCHAL_INT7_LEVEL 1
195#define XCHAL_INT8_LEVEL 2
196#define XCHAL_INT9_LEVEL 3
197#define XCHAL_INT10_LEVEL 1
198#define XCHAL_INT11_LEVEL 2
199#define XCHAL_INT12_LEVEL 3
200#define XCHAL_INT13_LEVEL 1
201#define XCHAL_INT14_LEVEL 1
202#define XCHAL_INT15_LEVEL 2
203#define XCHAL_INT16_LEVEL 3
204#define XCHAL_INT17_LEVEL 0
205#define XCHAL_INT18_LEVEL 0
206#define XCHAL_INT19_LEVEL 0
207#define XCHAL_INT20_LEVEL 0
208#define XCHAL_INT21_LEVEL 0
209#define XCHAL_INT22_LEVEL 0
210#define XCHAL_INT23_LEVEL 0
211#define XCHAL_INT24_LEVEL 0
212#define XCHAL_INT25_LEVEL 0
213#define XCHAL_INT26_LEVEL 0
214#define XCHAL_INT27_LEVEL 0
215#define XCHAL_INT28_LEVEL 0
216#define XCHAL_INT29_LEVEL 0
217#define XCHAL_INT30_LEVEL 0
218#define XCHAL_INT31_LEVEL 0
219/* As an array of entries (eg. for C constant arrays): */
220#define XCHAL_INT_LEVELS 1 XCHAL_SEP \
221 2 XCHAL_SEP \
222 3 XCHAL_SEP \
223 1 XCHAL_SEP \
224 1 XCHAL_SEP \
225 1 XCHAL_SEP \
226 1 XCHAL_SEP \
227 1 XCHAL_SEP \
228 2 XCHAL_SEP \
229 3 XCHAL_SEP \
230 1 XCHAL_SEP \
231 2 XCHAL_SEP \
232 3 XCHAL_SEP \
233 1 XCHAL_SEP \
234 1 XCHAL_SEP \
235 2 XCHAL_SEP \
236 3 XCHAL_SEP \
237 0 XCHAL_SEP \
238 0 XCHAL_SEP \
239 0 XCHAL_SEP \
240 0 XCHAL_SEP \
241 0 XCHAL_SEP \
242 0 XCHAL_SEP \
243 0 XCHAL_SEP \
244 0 XCHAL_SEP \
245 0 XCHAL_SEP \
246 0 XCHAL_SEP \
247 0 XCHAL_SEP \
248 0 XCHAL_SEP \
249 0 XCHAL_SEP \
250 0 XCHAL_SEP \
251 0
252
253/* Type of each interrupt: */
254#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
255#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
256#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
257#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
258#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
259#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
260#define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
261#define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE
262#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE
263#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE
264#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER
265#define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER
266#define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER
267#define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE
268#define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE
269#define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE
270#define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE
271#define XCHAL_INT17_TYPE XTHAL_INTTYPE_UNCONFIGURED
272#define XCHAL_INT18_TYPE XTHAL_INTTYPE_UNCONFIGURED
273#define XCHAL_INT19_TYPE XTHAL_INTTYPE_UNCONFIGURED
274#define XCHAL_INT20_TYPE XTHAL_INTTYPE_UNCONFIGURED
275#define XCHAL_INT21_TYPE XTHAL_INTTYPE_UNCONFIGURED
276#define XCHAL_INT22_TYPE XTHAL_INTTYPE_UNCONFIGURED
277#define XCHAL_INT23_TYPE XTHAL_INTTYPE_UNCONFIGURED
278#define XCHAL_INT24_TYPE XTHAL_INTTYPE_UNCONFIGURED
279#define XCHAL_INT25_TYPE XTHAL_INTTYPE_UNCONFIGURED
280#define XCHAL_INT26_TYPE XTHAL_INTTYPE_UNCONFIGURED
281#define XCHAL_INT27_TYPE XTHAL_INTTYPE_UNCONFIGURED
282#define XCHAL_INT28_TYPE XTHAL_INTTYPE_UNCONFIGURED
283#define XCHAL_INT29_TYPE XTHAL_INTTYPE_UNCONFIGURED
284#define XCHAL_INT30_TYPE XTHAL_INTTYPE_UNCONFIGURED
285#define XCHAL_INT31_TYPE XTHAL_INTTYPE_UNCONFIGURED
286/* As an array of entries (eg. for C constant arrays): */
287#define XCHAL_INT_TYPES XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
288 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
289 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
290 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
291 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
292 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
293 XTHAL_INTTYPE_EXTERN_LEVEL XCHAL_SEP \
294 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
295 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
296 XTHAL_INTTYPE_EXTERN_EDGE XCHAL_SEP \
297 XTHAL_INTTYPE_TIMER XCHAL_SEP \
298 XTHAL_INTTYPE_TIMER XCHAL_SEP \
299 XTHAL_INTTYPE_TIMER XCHAL_SEP \
300 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
301 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
302 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
303 XTHAL_INTTYPE_SOFTWARE XCHAL_SEP \
304 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
305 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
306 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
307 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
308 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
309 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
310 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
311 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
312 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
313 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
314 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
315 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
316 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
317 XTHAL_INTTYPE_UNCONFIGURED XCHAL_SEP \
318 XTHAL_INTTYPE_UNCONFIGURED
319
320/* Masks of interrupts for each type of interrupt: */
321#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000
322#define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000
323#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380
324#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F
325#define XCHAL_INTTYPE_MASK_TIMER 0x00001C00
326#define XCHAL_INTTYPE_MASK_NMI 0x00000000
327/* As an array of entries (eg. for C constant arrays): */
328#define XCHAL_INTTYPE_MASKS 0xFFFE0000 XCHAL_SEP \
329 0x0001E000 XCHAL_SEP \
330 0x00000380 XCHAL_SEP \
331 0x0000007F XCHAL_SEP \
332 0x00001C00 XCHAL_SEP \
333 0x00000000
334
335/* Interrupts assigned to each timer (CCOMPARE0 to CCOMPARE3), -1 if unassigned */
336#define XCHAL_TIMER0_INTERRUPT 10
337#define XCHAL_TIMER1_INTERRUPT 11
338#define XCHAL_TIMER2_INTERRUPT 12
339#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED
340/* As an array of entries (eg. for C constant arrays): */
341#define XCHAL_TIMER_INTERRUPTS 10 XCHAL_SEP \
342 11 XCHAL_SEP \
343 12 XCHAL_SEP \
344 XTHAL_TIMER_UNCONFIGURED
345
346/* Indexing macros: */
347#define _XCHAL_INTLEVEL_MASK(n) XCHAL_INTLEVEL ## n ## _MASK
348#define XCHAL_INTLEVEL_MASK(n) _XCHAL_INTLEVEL_MASK(n) /* n = 0 .. 15 */
349#define _XCHAL_INTLEVEL_ANDBELOWMASK(n) XCHAL_INTLEVEL ## n ## _ANDBELOW_MASK
350#define XCHAL_INTLEVEL_ANDBELOW_MASK(n) _XCHAL_INTLEVEL_ANDBELOWMASK(n) /* n = 0 .. 15 */
351#define _XCHAL_INT_LEVEL(n) XCHAL_INT ## n ## _LEVEL
352#define XCHAL_INT_LEVEL(n) _XCHAL_INT_LEVEL(n) /* n = 0 .. 31 */
353#define _XCHAL_INT_TYPE(n) XCHAL_INT ## n ## _TYPE
354#define XCHAL_INT_TYPE(n) _XCHAL_INT_TYPE(n) /* n = 0 .. 31 */
355#define _XCHAL_TIMER_INTERRUPT(n) XCHAL_TIMER ## n ## _INTERRUPT
356#define XCHAL_TIMER_INTERRUPT(n) _XCHAL_TIMER_INTERRUPT(n) /* n = 0 .. 3 */
357
358
359
360/*
361 * External interrupt vectors/levels.
362 * These macros describe how Xtensa processor interrupt numbers
363 * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
364 * map to external BInterrupt<n> pins, for those interrupts
365 * configured as external (level-triggered, edge-triggered, or NMI).
366 * See the Xtensa processor databook for more details.
367 */
368
369/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
370#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */
371#define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */
372#define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */
373#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */
374#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */
375#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */
376#define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */
377#define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */
378#define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */
379#define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */
380
381/* Corresponding interrupt masks: */
382#define XCHAL_EXTINT0_MASK 0x00000001
383#define XCHAL_EXTINT1_MASK 0x00000002
384#define XCHAL_EXTINT2_MASK 0x00000004
385#define XCHAL_EXTINT3_MASK 0x00000008
386#define XCHAL_EXTINT4_MASK 0x00000010
387#define XCHAL_EXTINT5_MASK 0x00000020
388#define XCHAL_EXTINT6_MASK 0x00000040
389#define XCHAL_EXTINT7_MASK 0x00000080
390#define XCHAL_EXTINT8_MASK 0x00000100
391#define XCHAL_EXTINT9_MASK 0x00000200
392
393/* Core config interrupt levels mapped to each external interrupt: */
394#define XCHAL_EXTINT0_LEVEL 1 /* (int number 0) */
395#define XCHAL_EXTINT1_LEVEL 2 /* (int number 1) */
396#define XCHAL_EXTINT2_LEVEL 3 /* (int number 2) */
397#define XCHAL_EXTINT3_LEVEL 1 /* (int number 3) */
398#define XCHAL_EXTINT4_LEVEL 1 /* (int number 4) */
399#define XCHAL_EXTINT5_LEVEL 1 /* (int number 5) */
400#define XCHAL_EXTINT6_LEVEL 1 /* (int number 6) */
401#define XCHAL_EXTINT7_LEVEL 1 /* (int number 7) */
402#define XCHAL_EXTINT8_LEVEL 2 /* (int number 8) */
403#define XCHAL_EXTINT9_LEVEL 3 /* (int number 9) */
404
405
406/*----------------------------------------------------------------------
407 EXCEPTIONS and VECTORS
408 ----------------------------------------------------------------------*/
409
410#define XCHAL_HAVE_EXCEPTIONS 1 /* 1 if exception option configured, 0 otherwise */
411
412#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture number: 1 for XEA1 (old), 2 for XEA2 (new) */
413#define XCHAL_HAVE_XEA1 0 /* 1 if XEA1, 0 otherwise */
414#define XCHAL_HAVE_XEA2 1 /* 1 if XEA2, 0 otherwise */
415/* For backward compatibility ONLY -- DO NOT USE (will be removed in future release): */
416#define XCHAL_HAVE_OLD_EXC_ARCH XCHAL_HAVE_XEA1 /* (DEPRECATED) 1 if old exception architecture (XEA1), 0 otherwise (eg. XEA2) */
417#define XCHAL_HAVE_EXCM XCHAL_HAVE_XEA2 /* (DEPRECATED) 1 if PS.EXCM bit exists (currently equals XCHAL_HAVE_TLBS) */
418
419#define XCHAL_RESET_VECTOR_VADDR 0xFE000020
420#define XCHAL_RESET_VECTOR_PADDR 0xFE000020
421#define XCHAL_USER_VECTOR_VADDR 0xD0000220
422#define XCHAL_PROGRAMEXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */
423#define XCHAL_USEREXC_VECTOR_VADDR XCHAL_USER_VECTOR_VADDR /* for backward compatibility */
424#define XCHAL_USER_VECTOR_PADDR 0x00000220
425#define XCHAL_PROGRAMEXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */
426#define XCHAL_USEREXC_VECTOR_PADDR XCHAL_USER_VECTOR_PADDR /* for backward compatibility */
427#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200
428#define XCHAL_STACKEDEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
429#define XCHAL_KERNELEXC_VECTOR_VADDR XCHAL_KERNEL_VECTOR_VADDR /* for backward compatibility */
430#define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
431#define XCHAL_STACKEDEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
432#define XCHAL_KERNELEXC_VECTOR_PADDR XCHAL_KERNEL_VECTOR_PADDR /* for backward compatibility */
433#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290
434#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290
435#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000
436#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000
437#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240
438#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240
439#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250
440#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250
441#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520
442#define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520
443#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR
444#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR
445
446/* Indexing macros: */
447#define _XCHAL_INTLEVEL_VECTOR_VADDR(n) XCHAL_INTLEVEL ## n ## _VECTOR_VADDR
448#define XCHAL_INTLEVEL_VECTOR_VADDR(n) _XCHAL_INTLEVEL_VECTOR_VADDR(n) /* n = 0 .. 15 */
449
450/*
451 * General Exception Causes
452 * (values of EXCCAUSE special register set by general exceptions,
453 * which vector to the user, kernel, or double-exception vectors):
454 */
455#define XCHAL_EXCCAUSE_ILLEGAL_INSTRUCTION 0 /* Illegal Instruction (IllegalInstruction) */
456#define XCHAL_EXCCAUSE_SYSTEM_CALL 1 /* System Call (SystemCall) */
457#define XCHAL_EXCCAUSE_INSTRUCTION_FETCH_ERROR 2 /* Instruction Fetch Error (InstructionFetchError) */
458#define XCHAL_EXCCAUSE_LOAD_STORE_ERROR 3 /* Load Store Error (LoadStoreError) */
459#define XCHAL_EXCCAUSE_LEVEL1_INTERRUPT 4 /* Level 1 Interrupt (Level1Interrupt) */
460#define XCHAL_EXCCAUSE_ALLOCA 5 /* Stack Extension Assist (Alloca) */
461#define XCHAL_EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6 /* Integer Divide by Zero (IntegerDivideByZero) */
462#define XCHAL_EXCCAUSE_SPECULATION 7 /* Speculation (Speculation) */
463#define XCHAL_EXCCAUSE_PRIVILEGED 8 /* Privileged Instruction (Privileged) */
464#define XCHAL_EXCCAUSE_UNALIGNED 9 /* Unaligned Load Store (Unaligned) */
465#define XCHAL_EXCCAUSE_ITLB_MISS 16 /* ITlb Miss Exception (ITlbMiss) */
466#define XCHAL_EXCCAUSE_ITLB_MULTIHIT 17 /* ITlb Mutltihit Exception (ITlbMultihit) */
467#define XCHAL_EXCCAUSE_ITLB_PRIVILEGE 18 /* ITlb Privilege Exception (ITlbPrivilege) */
468#define XCHAL_EXCCAUSE_ITLB_SIZE_RESTRICTION 19 /* ITlb Size Restriction Exception (ITlbSizeRestriction) */
469#define XCHAL_EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20 /* Fetch Cache Attribute Exception (FetchCacheAttribute) */
470#define XCHAL_EXCCAUSE_DTLB_MISS 24 /* DTlb Miss Exception (DTlbMiss) */
471#define XCHAL_EXCCAUSE_DTLB_MULTIHIT 25 /* DTlb Multihit Exception (DTlbMultihit) */
472#define XCHAL_EXCCAUSE_DTLB_PRIVILEGE 26 /* DTlb Privilege Exception (DTlbPrivilege) */
473#define XCHAL_EXCCAUSE_DTLB_SIZE_RESTRICTION 27 /* DTlb Size Restriction Exception (DTlbSizeRestriction) */
474#define XCHAL_EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28 /* Load Cache Attribute Exception (LoadCacheAttribute) */
475#define XCHAL_EXCCAUSE_STORE_CACHE_ATTRIBUTE 29 /* Store Cache Attribute Exception (StoreCacheAttribute) */
476#define XCHAL_EXCCAUSE_FLOATING_POINT 40 /* Floating Point Exception (FloatingPoint) */
477
478
479
480/*----------------------------------------------------------------------
481 TIMERS
482 ----------------------------------------------------------------------*/
483
484#define XCHAL_HAVE_CCOUNT 1 /* 1 if have CCOUNT, 0 otherwise */
485/*#define XCHAL_HAVE_TIMERS XCHAL_HAVE_CCOUNT*/
486#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */
487
488
489
490/*----------------------------------------------------------------------
491 DEBUG
492 ----------------------------------------------------------------------*/
493
494#define XCHAL_HAVE_DEBUG 1 /* 1 if debug option configured, 0 otherwise */
495#define XCHAL_HAVE_OCD 1 /* 1 if OnChipDebug option configured, 0 otherwise */
496#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */
497#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */
498#define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */
499/*DebugExternalInterrupt 0 0|1*/
500/*DebugUseDIRArray 0 0|1*/
501
502
503
504
505/*----------------------------------------------------------------------
506 COPROCESSORS and EXTRA STATE
507 ----------------------------------------------------------------------*/
508
509#define XCHAL_HAVE_CP 0 /* 1 if coprocessor option configured (CPENABLE present) */
510#define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one (per cfg) */
511
512#include <xtensa/config/tie.h>
513
514
515
516
517/*----------------------------------------------------------------------
518 INTERNAL I/D RAM/ROMs and XLMI
519 ----------------------------------------------------------------------*/
520
521#define XCHAL_NUM_INSTROM 0 /* number of core instruction ROMs configured */
522#define XCHAL_NUM_INSTRAM 0 /* number of core instruction RAMs configured */
523#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs configured */
524#define XCHAL_NUM_DATARAM 0 /* number of core data RAMs configured */
525#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports configured */
526#define XCHAL_NUM_IROM XCHAL_NUM_INSTROM /* (DEPRECATED) */
527#define XCHAL_NUM_IRAM XCHAL_NUM_INSTRAM /* (DEPRECATED) */
528#define XCHAL_NUM_DROM XCHAL_NUM_DATAROM /* (DEPRECATED) */
529#define XCHAL_NUM_DRAM XCHAL_NUM_DATARAM /* (DEPRECATED) */
530
531
532
533/*----------------------------------------------------------------------
534 CACHE
535 ----------------------------------------------------------------------*/
536
537/* Size of the cache lines in log2(bytes): */
538#define XCHAL_ICACHE_LINEWIDTH 4
539#define XCHAL_DCACHE_LINEWIDTH 4
540/* Size of the cache lines in bytes: */
541#define XCHAL_ICACHE_LINESIZE 16
542#define XCHAL_DCACHE_LINESIZE 16
543/* Max for both I-cache and D-cache (used for general alignment): */
544#define XCHAL_CACHE_LINEWIDTH_MAX 4
545#define XCHAL_CACHE_LINESIZE_MAX 16
546
547/* Number of cache sets in log2(lines per way): */
548#define XCHAL_ICACHE_SETWIDTH 8
549#define XCHAL_DCACHE_SETWIDTH 8
550/* Max for both I-cache and D-cache (used for general cache-coherency page alignment): */
551#define XCHAL_CACHE_SETWIDTH_MAX 8
552#define XCHAL_CACHE_SETSIZE_MAX 256
553
554/* Cache set associativity (number of ways): */
555#define XCHAL_ICACHE_WAYS 2
556#define XCHAL_DCACHE_WAYS 2
557
558/* Size of the caches in bytes (ways * 2^(linewidth + setwidth)): */
559#define XCHAL_ICACHE_SIZE 8192
560#define XCHAL_DCACHE_SIZE 8192
561
562/* Cache features: */
563#define XCHAL_DCACHE_IS_WRITEBACK 0
564/* Whether cache locking feature is available: */
565#define XCHAL_ICACHE_LINE_LOCKABLE 0
566#define XCHAL_DCACHE_LINE_LOCKABLE 0
567
568/* Number of (encoded) cache attribute bits: */
569#define XCHAL_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */
570/* (The number of access mode bits (decoded cache attribute bits) is defined by the architecture; see xtensa/hal.h?) */
571
572
573/* Cache Attribute encodings -- lists of access modes for each cache attribute: */
574#define XCHAL_FCA_LIST XTHAL_FAM_EXCEPTION XCHAL_SEP \
575 XTHAL_FAM_BYPASS XCHAL_SEP \
576 XTHAL_FAM_EXCEPTION XCHAL_SEP \
577 XTHAL_FAM_BYPASS XCHAL_SEP \
578 XTHAL_FAM_EXCEPTION XCHAL_SEP \
579 XTHAL_FAM_CACHED XCHAL_SEP \
580 XTHAL_FAM_EXCEPTION XCHAL_SEP \
581 XTHAL_FAM_CACHED XCHAL_SEP \
582 XTHAL_FAM_EXCEPTION XCHAL_SEP \
583 XTHAL_FAM_CACHED XCHAL_SEP \
584 XTHAL_FAM_EXCEPTION XCHAL_SEP \
585 XTHAL_FAM_CACHED XCHAL_SEP \
586 XTHAL_FAM_EXCEPTION XCHAL_SEP \
587 XTHAL_FAM_EXCEPTION XCHAL_SEP \
588 XTHAL_FAM_EXCEPTION XCHAL_SEP \
589 XTHAL_FAM_EXCEPTION
590#define XCHAL_LCA_LIST XTHAL_LAM_EXCEPTION XCHAL_SEP \
591 XTHAL_LAM_BYPASSG XCHAL_SEP \
592 XTHAL_LAM_EXCEPTION XCHAL_SEP \
593 XTHAL_LAM_BYPASSG XCHAL_SEP \
594 XTHAL_LAM_EXCEPTION XCHAL_SEP \
595 XTHAL_LAM_CACHED XCHAL_SEP \
596 XTHAL_LAM_EXCEPTION XCHAL_SEP \
597 XTHAL_LAM_CACHED XCHAL_SEP \
598 XTHAL_LAM_EXCEPTION XCHAL_SEP \
599 XTHAL_LAM_NACACHED XCHAL_SEP \
600 XTHAL_LAM_EXCEPTION XCHAL_SEP \
601 XTHAL_LAM_NACACHED XCHAL_SEP \
602 XTHAL_LAM_EXCEPTION XCHAL_SEP \
603 XTHAL_LAM_ISOLATE XCHAL_SEP \
604 XTHAL_LAM_EXCEPTION XCHAL_SEP \
605 XTHAL_LAM_CACHED
606#define XCHAL_SCA_LIST XTHAL_SAM_EXCEPTION XCHAL_SEP \
607 XTHAL_SAM_EXCEPTION XCHAL_SEP \
608 XTHAL_SAM_EXCEPTION XCHAL_SEP \
609 XTHAL_SAM_BYPASS XCHAL_SEP \
610 XTHAL_SAM_EXCEPTION XCHAL_SEP \
611 XTHAL_SAM_EXCEPTION XCHAL_SEP \
612 XTHAL_SAM_EXCEPTION XCHAL_SEP \
613 XTHAL_SAM_WRITETHRU XCHAL_SEP \
614 XTHAL_SAM_EXCEPTION XCHAL_SEP \
615 XTHAL_SAM_EXCEPTION XCHAL_SEP \
616 XTHAL_SAM_EXCEPTION XCHAL_SEP \
617 XTHAL_SAM_WRITETHRU XCHAL_SEP \
618 XTHAL_SAM_EXCEPTION XCHAL_SEP \
619 XTHAL_SAM_ISOLATE XCHAL_SEP \
620 XTHAL_SAM_EXCEPTION XCHAL_SEP \
621 XTHAL_SAM_WRITETHRU
622
623/* Test:
624 read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14
625 read/only: 0 + 1 + 2 + 4 + 5 + 6 + 8 + 9 + 10 + 12 + 14
626 all: 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
627 fault: 0 + 2 + 4 + 6 + 8 + 10 + 12 + 14
628 r/w/x cached:
629 r/w/x dcached:
630 I-bypass: 1 + 3
631
632 load guard bit set: 1 + 3
633 load guard bit clr: 0 + 2 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15
634 hit-cache r/w/x: 7 + 11
635
636 fams: 5
637 fams: 0 / 6 / 18 / 1 / 2
638 fams: Bypass / Isolate / Cached / Exception / NACached
639
640 MMU okay: yes
641*/
642
643
644/*----------------------------------------------------------------------
645 MMU
646 ----------------------------------------------------------------------*/
647
648/*
649 * General notes on MMU parameters.
650 *
651 * Terminology:
652 * ASID = address-space ID (acts as an "extension" of virtual addresses)
653 * VPN = virtual page number
654 * PPN = physical page number
655 * CA = encoded cache attribute (access modes)
656 * TLB = translation look-aside buffer (term is stretched somewhat here)
657 * I = instruction (fetch accesses)
658 * D = data (load and store accesses)
659 * way = each TLB (ITLB and DTLB) consists of a number of "ways"
660 * that simultaneously match the virtual address of an access;
661 * a TLB successfully translates a virtual address if exactly
662 * one way matches the vaddr; if none match, it is a miss;
663 * if multiple match, one gets a "multihit" exception;
664 * each way can be independently configured in terms of number of
665 * entries, page sizes, which fields are writable or constant, etc.
666 * set = group of contiguous ways with exactly identical parameters
667 * ARF = auto-refill; hardware services a 1st-level miss by loading a PTE
668 * from the page table and storing it in one of the auto-refill ways;
669 * if this PTE load also misses, a miss exception is posted for s/w.
670 * min-wired = a "min-wired" way can be used to map a single (minimum-sized)
671 * page arbitrarily under program control; it has a single entry,
672 * is non-auto-refill (some other way(s) must be auto-refill),
673 * all its fields (VPN, PPN, ASID, CA) are all writable, and it
674 * supports the XCHAL_MMU_MIN_PTE_PAGE_SIZE page size (a current
675 * restriction is that this be the only page size it supports).
676 *
677 * TLB way entries are virtually indexed.
678 * TLB ways that support multiple page sizes:
679 * - must have all writable VPN and PPN fields;
680 * - can only use one page size at any given time (eg. setup at startup),
681 * selected by the respective ITLBCFG or DTLBCFG special register,
682 * whose bits n*4+3 .. n*4 index the list of page sizes for way n
683 * (XCHAL_xTLB_SETm_PAGESZ_LOG2_LIST for set m corresponding to way n);
684 * this list may be sparse for auto-refill ways because auto-refill
685 * ways have independent lists of supported page sizes sharing a
686 * common encoding with PTE entries; the encoding is the index into
687 * this list; unsupported sizes for a given way are zero in the list;
688 * selecting unsupported sizes results in undefined hardware behaviour;
689 * - is only possible for ways 0 thru 7 (due to ITLBCFG/DTLBCFG definition).
690 */
691
692#define XCHAL_HAVE_CACHEATTR 0 /* 1 if CACHEATTR register present, 0 if TLBs present instead */
693#define XCHAL_HAVE_TLBS 1 /* 1 if TLBs present, 0 if CACHEATTR present instead */
694#define XCHAL_HAVE_MMU XCHAL_HAVE_TLBS /* (DEPRECATED; use XCHAL_HAVE_TLBS instead; will be removed in future release) */
695#define XCHAL_HAVE_SPANNING_WAY 0 /* 1 if single way maps entire virtual address space in I+D */
696#define XCHAL_HAVE_IDENTITY_MAP 0 /* 1 if virtual addr == physical addr always, 0 otherwise */
697#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config (CaMMU) */
698#define XCHAL_HAVE_XLT_CACHEATTR 0 /* 1 if have MMU that mimics a CACHEATTR config, but with translation (CaXltMMU) */
699
700#define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs (address space IDs) */
701#define XCHAL_MMU_ASID_INVALID 0 /* ASID value indicating invalid address space */
702#define XCHAL_MMU_ASID_KERNEL 1 /* ASID value indicating kernel (ring 0) address space */
703#define XCHAL_MMU_RINGS 4 /* number of rings supported (1..4) */
704#define XCHAL_MMU_RING_BITS 2 /* number of bits needed to hold ring number */
705#define XCHAL_MMU_SR_BITS 0 /* number of size-restriction bits supported */
706#define XCHAL_MMU_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */
707#define XCHAL_MMU_MAX_PTE_PAGE_SIZE 12 /* max page size in a PTE structure (log2) */
708#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 12 /* min page size in a PTE structure (log2) */
709
710
711/*** Instruction TLB: ***/
712
713#define XCHAL_ITLB_WAY_BITS 3 /* number of bits holding the ways */
714#define XCHAL_ITLB_WAYS 7 /* number of ways (n-way set-associative TLB) */
715#define XCHAL_ITLB_ARF_WAYS 4 /* number of auto-refill ways */
716#define XCHAL_ITLB_SETS 4 /* number of sets (groups of ways with identical settings) */
717
718/* Way set to which each way belongs: */
719#define XCHAL_ITLB_WAY0_SET 0
720#define XCHAL_ITLB_WAY1_SET 0
721#define XCHAL_ITLB_WAY2_SET 0
722#define XCHAL_ITLB_WAY3_SET 0
723#define XCHAL_ITLB_WAY4_SET 1
724#define XCHAL_ITLB_WAY5_SET 2
725#define XCHAL_ITLB_WAY6_SET 3
726
727/* Ways sets that are used by hardware auto-refill (ARF): */
728#define XCHAL_ITLB_ARF_SETS 1 /* number of auto-refill sets */
729#define XCHAL_ITLB_ARF_SET0 0 /* index of n'th auto-refill set */
730
731/* Way sets that are "min-wired" (see terminology comment above): */
732#define XCHAL_ITLB_MINWIRED_SETS 0 /* number of "min-wired" sets */
733
734
735/* ITLB way set 0 (group of ways 0 thru 3): */
736#define XCHAL_ITLB_SET0_WAY 0 /* index of first way in this way set */
737#define XCHAL_ITLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */
738#define XCHAL_ITLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
739#define XCHAL_ITLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */
740#define XCHAL_ITLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
741#define XCHAL_ITLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */
742#define XCHAL_ITLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */
743#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
744#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
745#define XCHAL_ITLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
746 2^PAGESZ_BITS entries in list, unsupported entries are zero */
747#define XCHAL_ITLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
748#define XCHAL_ITLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
749#define XCHAL_ITLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
750#define XCHAL_ITLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
751#define XCHAL_ITLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
752#define XCHAL_ITLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
753#define XCHAL_ITLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
754#define XCHAL_ITLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
755
756/* ITLB way set 1 (group of ways 4 thru 4): */
757#define XCHAL_ITLB_SET1_WAY 4 /* index of first way in this way set */
758#define XCHAL_ITLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */
759#define XCHAL_ITLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
760#define XCHAL_ITLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */
761#define XCHAL_ITLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
762#define XCHAL_ITLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */
763#define XCHAL_ITLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */
764#define XCHAL_ITLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */
765#define XCHAL_ITLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */
766#define XCHAL_ITLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP;
767 2^PAGESZ_BITS entries in list, unsupported entries are zero */
768#define XCHAL_ITLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
769#define XCHAL_ITLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
770#define XCHAL_ITLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
771#define XCHAL_ITLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
772#define XCHAL_ITLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
773#define XCHAL_ITLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
774#define XCHAL_ITLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
775#define XCHAL_ITLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
776
777/* ITLB way set 2 (group of ways 5 thru 5): */
778#define XCHAL_ITLB_SET2_WAY 5 /* index of first way in this way set */
779#define XCHAL_ITLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */
780#define XCHAL_ITLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
781#define XCHAL_ITLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */
782#define XCHAL_ITLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
783#define XCHAL_ITLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */
784#define XCHAL_ITLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */
785#define XCHAL_ITLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */
786#define XCHAL_ITLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */
787#define XCHAL_ITLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP;
788 2^PAGESZ_BITS entries in list, unsupported entries are zero */
789#define XCHAL_ITLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
790#define XCHAL_ITLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
791#define XCHAL_ITLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */
792#define XCHAL_ITLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
793#define XCHAL_ITLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
794#define XCHAL_ITLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
795#define XCHAL_ITLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
796#define XCHAL_ITLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
797/* Constant ASID values for each entry of ITLB way set 2 (because ASID_CONSTMASK is non-zero): */
798#define XCHAL_ITLB_SET2_E0_ASID_CONST 0x01
799#define XCHAL_ITLB_SET2_E1_ASID_CONST 0x01
800/* Constant VPN values for each entry of ITLB way set 2 (because VPN_CONSTMASK is non-zero): */
801#define XCHAL_ITLB_SET2_E0_VPN_CONST 0xD0000000
802#define XCHAL_ITLB_SET2_E1_VPN_CONST 0xD8000000
803/* Constant PPN values for each entry of ITLB way set 2 (because PPN_CONSTMASK is non-zero): */
804#define XCHAL_ITLB_SET2_E0_PPN_CONST 0x00000000
805#define XCHAL_ITLB_SET2_E1_PPN_CONST 0x00000000
806/* Constant CA values for each entry of ITLB way set 2 (because CA_CONSTMASK is non-zero): */
807#define XCHAL_ITLB_SET2_E0_CA_CONST 0x07
808#define XCHAL_ITLB_SET2_E1_CA_CONST 0x03
809
810/* ITLB way set 3 (group of ways 6 thru 6): */
811#define XCHAL_ITLB_SET3_WAY 6 /* index of first way in this way set */
812#define XCHAL_ITLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */
813#define XCHAL_ITLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
814#define XCHAL_ITLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */
815#define XCHAL_ITLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
816#define XCHAL_ITLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */
817#define XCHAL_ITLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */
818#define XCHAL_ITLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */
819#define XCHAL_ITLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */
820#define XCHAL_ITLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP;
821 2^PAGESZ_BITS entries in list, unsupported entries are zero */
822#define XCHAL_ITLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
823#define XCHAL_ITLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
824#define XCHAL_ITLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */
825#define XCHAL_ITLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
826#define XCHAL_ITLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
827#define XCHAL_ITLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
828#define XCHAL_ITLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
829#define XCHAL_ITLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
830/* Constant ASID values for each entry of ITLB way set 3 (because ASID_CONSTMASK is non-zero): */
831#define XCHAL_ITLB_SET3_E0_ASID_CONST 0x01
832#define XCHAL_ITLB_SET3_E1_ASID_CONST 0x01
833/* Constant VPN values for each entry of ITLB way set 3 (because VPN_CONSTMASK is non-zero): */
834#define XCHAL_ITLB_SET3_E0_VPN_CONST 0xE0000000
835#define XCHAL_ITLB_SET3_E1_VPN_CONST 0xF0000000
836/* Constant PPN values for each entry of ITLB way set 3 (because PPN_CONSTMASK is non-zero): */
837#define XCHAL_ITLB_SET3_E0_PPN_CONST 0xF0000000
838#define XCHAL_ITLB_SET3_E1_PPN_CONST 0xF0000000
839/* Constant CA values for each entry of ITLB way set 3 (because CA_CONSTMASK is non-zero): */
840#define XCHAL_ITLB_SET3_E0_CA_CONST 0x07
841#define XCHAL_ITLB_SET3_E1_CA_CONST 0x03
842
843/* Indexing macros: */
844#define _XCHAL_ITLB_SET(n,_what) XCHAL_ITLB_SET ## n ## _what
845#define XCHAL_ITLB_SET(n,what) _XCHAL_ITLB_SET(n, _ ## what )
846#define _XCHAL_ITLB_SET_E(n,i,_what) XCHAL_ITLB_SET ## n ## _E ## i ## _what
847#define XCHAL_ITLB_SET_E(n,i,what) _XCHAL_ITLB_SET_E(n,i, _ ## what )
848/*
849 * Example use: XCHAL_ITLB_SET(XCHAL_ITLB_ARF_SET0,ENTRIES)
850 * to get the value of XCHAL_ITLB_SET<n>_ENTRIES where <n> is the first auto-refill set.
851 */
852
853
854/*** Data TLB: ***/
855
856#define XCHAL_DTLB_WAY_BITS 4 /* number of bits holding the ways */
857#define XCHAL_DTLB_WAYS 10 /* number of ways (n-way set-associative TLB) */
858#define XCHAL_DTLB_ARF_WAYS 4 /* number of auto-refill ways */
859#define XCHAL_DTLB_SETS 5 /* number of sets (groups of ways with identical settings) */
860
861/* Way set to which each way belongs: */
862#define XCHAL_DTLB_WAY0_SET 0
863#define XCHAL_DTLB_WAY1_SET 0
864#define XCHAL_DTLB_WAY2_SET 0
865#define XCHAL_DTLB_WAY3_SET 0
866#define XCHAL_DTLB_WAY4_SET 1
867#define XCHAL_DTLB_WAY5_SET 2
868#define XCHAL_DTLB_WAY6_SET 3
869#define XCHAL_DTLB_WAY7_SET 4
870#define XCHAL_DTLB_WAY8_SET 4
871#define XCHAL_DTLB_WAY9_SET 4
872
873/* Ways sets that are used by hardware auto-refill (ARF): */
874#define XCHAL_DTLB_ARF_SETS 1 /* number of auto-refill sets */
875#define XCHAL_DTLB_ARF_SET0 0 /* index of n'th auto-refill set */
876
877/* Way sets that are "min-wired" (see terminology comment above): */
878#define XCHAL_DTLB_MINWIRED_SETS 1 /* number of "min-wired" sets */
879#define XCHAL_DTLB_MINWIRED_SET0 4 /* index of n'th "min-wired" set */
880
881
882/* DTLB way set 0 (group of ways 0 thru 3): */
883#define XCHAL_DTLB_SET0_WAY 0 /* index of first way in this way set */
884#define XCHAL_DTLB_SET0_WAYS 4 /* number of (contiguous) ways in this way set */
885#define XCHAL_DTLB_SET0_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
886#define XCHAL_DTLB_SET0_ENTRIES 4 /* number of entries in this way (always a power of 2) */
887#define XCHAL_DTLB_SET0_ARF 1 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
888#define XCHAL_DTLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */
889#define XCHAL_DTLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */
890#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
891#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
892#define XCHAL_DTLB_SET0_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
893 2^PAGESZ_BITS entries in list, unsupported entries are zero */
894#define XCHAL_DTLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
895#define XCHAL_DTLB_SET0_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
896#define XCHAL_DTLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
897#define XCHAL_DTLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
898#define XCHAL_DTLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
899#define XCHAL_DTLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
900#define XCHAL_DTLB_SET0_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
901#define XCHAL_DTLB_SET0_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
902
903/* DTLB way set 1 (group of ways 4 thru 4): */
904#define XCHAL_DTLB_SET1_WAY 4 /* index of first way in this way set */
905#define XCHAL_DTLB_SET1_WAYS 1 /* number of (contiguous) ways in this way set */
906#define XCHAL_DTLB_SET1_ENTRIES_LOG2 2 /* log2(number of entries in this way) */
907#define XCHAL_DTLB_SET1_ENTRIES 4 /* number of entries in this way (always a power of 2) */
908#define XCHAL_DTLB_SET1_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
909#define XCHAL_DTLB_SET1_PAGESIZES 4 /* number of supported page sizes in this way */
910#define XCHAL_DTLB_SET1_PAGESZ_BITS 2 /* number of bits to encode the page size */
911#define XCHAL_DTLB_SET1_PAGESZ_LOG2_MIN 20 /* log2(minimum supported page size) */
912#define XCHAL_DTLB_SET1_PAGESZ_LOG2_MAX 26 /* log2(maximum supported page size) */
913#define XCHAL_DTLB_SET1_PAGESZ_LOG2_LIST 20 XCHAL_SEP 22 XCHAL_SEP 24 XCHAL_SEP 26 /* list of log2(page size)s, separated by XCHAL_SEP;
914 2^PAGESZ_BITS entries in list, unsupported entries are zero */
915#define XCHAL_DTLB_SET1_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
916#define XCHAL_DTLB_SET1_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
917#define XCHAL_DTLB_SET1_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
918#define XCHAL_DTLB_SET1_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
919#define XCHAL_DTLB_SET1_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
920#define XCHAL_DTLB_SET1_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
921#define XCHAL_DTLB_SET1_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
922#define XCHAL_DTLB_SET1_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
923
924/* DTLB way set 2 (group of ways 5 thru 5): */
925#define XCHAL_DTLB_SET2_WAY 5 /* index of first way in this way set */
926#define XCHAL_DTLB_SET2_WAYS 1 /* number of (contiguous) ways in this way set */
927#define XCHAL_DTLB_SET2_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
928#define XCHAL_DTLB_SET2_ENTRIES 2 /* number of entries in this way (always a power of 2) */
929#define XCHAL_DTLB_SET2_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
930#define XCHAL_DTLB_SET2_PAGESIZES 1 /* number of supported page sizes in this way */
931#define XCHAL_DTLB_SET2_PAGESZ_BITS 0 /* number of bits to encode the page size */
932#define XCHAL_DTLB_SET2_PAGESZ_LOG2_MIN 27 /* log2(minimum supported page size) */
933#define XCHAL_DTLB_SET2_PAGESZ_LOG2_MAX 27 /* log2(maximum supported page size) */
934#define XCHAL_DTLB_SET2_PAGESZ_LOG2_LIST 27 /* list of log2(page size)s, separated by XCHAL_SEP;
935 2^PAGESZ_BITS entries in list, unsupported entries are zero */
936#define XCHAL_DTLB_SET2_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
937#define XCHAL_DTLB_SET2_VPN_CONSTMASK 0xF0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
938#define XCHAL_DTLB_SET2_PPN_CONSTMASK 0xF8000000 /* constant PPN bits, including entry index bits; 0 if all writable */
939#define XCHAL_DTLB_SET2_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
940#define XCHAL_DTLB_SET2_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
941#define XCHAL_DTLB_SET2_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
942#define XCHAL_DTLB_SET2_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
943#define XCHAL_DTLB_SET2_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
944/* Constant ASID values for each entry of DTLB way set 2 (because ASID_CONSTMASK is non-zero): */
945#define XCHAL_DTLB_SET2_E0_ASID_CONST 0x01
946#define XCHAL_DTLB_SET2_E1_ASID_CONST 0x01
947/* Constant VPN values for each entry of DTLB way set 2 (because VPN_CONSTMASK is non-zero): */
948#define XCHAL_DTLB_SET2_E0_VPN_CONST 0xD0000000
949#define XCHAL_DTLB_SET2_E1_VPN_CONST 0xD8000000
950/* Constant PPN values for each entry of DTLB way set 2 (because PPN_CONSTMASK is non-zero): */
951#define XCHAL_DTLB_SET2_E0_PPN_CONST 0x00000000
952#define XCHAL_DTLB_SET2_E1_PPN_CONST 0x00000000
953/* Constant CA values for each entry of DTLB way set 2 (because CA_CONSTMASK is non-zero): */
954#define XCHAL_DTLB_SET2_E0_CA_CONST 0x07
955#define XCHAL_DTLB_SET2_E1_CA_CONST 0x03
956
957/* DTLB way set 3 (group of ways 6 thru 6): */
958#define XCHAL_DTLB_SET3_WAY 6 /* index of first way in this way set */
959#define XCHAL_DTLB_SET3_WAYS 1 /* number of (contiguous) ways in this way set */
960#define XCHAL_DTLB_SET3_ENTRIES_LOG2 1 /* log2(number of entries in this way) */
961#define XCHAL_DTLB_SET3_ENTRIES 2 /* number of entries in this way (always a power of 2) */
962#define XCHAL_DTLB_SET3_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
963#define XCHAL_DTLB_SET3_PAGESIZES 1 /* number of supported page sizes in this way */
964#define XCHAL_DTLB_SET3_PAGESZ_BITS 0 /* number of bits to encode the page size */
965#define XCHAL_DTLB_SET3_PAGESZ_LOG2_MIN 28 /* log2(minimum supported page size) */
966#define XCHAL_DTLB_SET3_PAGESZ_LOG2_MAX 28 /* log2(maximum supported page size) */
967#define XCHAL_DTLB_SET3_PAGESZ_LOG2_LIST 28 /* list of log2(page size)s, separated by XCHAL_SEP;
968 2^PAGESZ_BITS entries in list, unsupported entries are zero */
969#define XCHAL_DTLB_SET3_ASID_CONSTMASK 0xFF /* constant ASID bits; 0 if all writable */
970#define XCHAL_DTLB_SET3_VPN_CONSTMASK 0xE0000000 /* constant VPN bits, not including entry index bits; 0 if all writable */
971#define XCHAL_DTLB_SET3_PPN_CONSTMASK 0xF0000000 /* constant PPN bits, including entry index bits; 0 if all writable */
972#define XCHAL_DTLB_SET3_CA_CONSTMASK 0x0000000F /* constant CA bits; 0 if all writable */
973#define XCHAL_DTLB_SET3_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
974#define XCHAL_DTLB_SET3_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
975#define XCHAL_DTLB_SET3_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
976#define XCHAL_DTLB_SET3_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
977/* Constant ASID values for each entry of DTLB way set 3 (because ASID_CONSTMASK is non-zero): */
978#define XCHAL_DTLB_SET3_E0_ASID_CONST 0x01
979#define XCHAL_DTLB_SET3_E1_ASID_CONST 0x01
980/* Constant VPN values for each entry of DTLB way set 3 (because VPN_CONSTMASK is non-zero): */
981#define XCHAL_DTLB_SET3_E0_VPN_CONST 0xE0000000
982#define XCHAL_DTLB_SET3_E1_VPN_CONST 0xF0000000
983/* Constant PPN values for each entry of DTLB way set 3 (because PPN_CONSTMASK is non-zero): */
984#define XCHAL_DTLB_SET3_E0_PPN_CONST 0xF0000000
985#define XCHAL_DTLB_SET3_E1_PPN_CONST 0xF0000000
986/* Constant CA values for each entry of DTLB way set 3 (because CA_CONSTMASK is non-zero): */
987#define XCHAL_DTLB_SET3_E0_CA_CONST 0x07
988#define XCHAL_DTLB_SET3_E1_CA_CONST 0x03
989
990/* DTLB way set 4 (group of ways 7 thru 9): */
991#define XCHAL_DTLB_SET4_WAY 7 /* index of first way in this way set */
992#define XCHAL_DTLB_SET4_WAYS 3 /* number of (contiguous) ways in this way set */
993#define XCHAL_DTLB_SET4_ENTRIES_LOG2 0 /* log2(number of entries in this way) */
994#define XCHAL_DTLB_SET4_ENTRIES 1 /* number of entries in this way (always a power of 2) */
995#define XCHAL_DTLB_SET4_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */
996#define XCHAL_DTLB_SET4_PAGESIZES 1 /* number of supported page sizes in this way */
997#define XCHAL_DTLB_SET4_PAGESZ_BITS 0 /* number of bits to encode the page size */
998#define XCHAL_DTLB_SET4_PAGESZ_LOG2_MIN 12 /* log2(minimum supported page size) */
999#define XCHAL_DTLB_SET4_PAGESZ_LOG2_MAX 12 /* log2(maximum supported page size) */
1000#define XCHAL_DTLB_SET4_PAGESZ_LOG2_LIST 12 /* list of log2(page size)s, separated by XCHAL_SEP;
1001 2^PAGESZ_BITS entries in list, unsupported entries are zero */
1002#define XCHAL_DTLB_SET4_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */
1003#define XCHAL_DTLB_SET4_VPN_CONSTMASK 0 /* constant VPN bits, not including entry index bits; 0 if all writable */
1004#define XCHAL_DTLB_SET4_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */
1005#define XCHAL_DTLB_SET4_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */
1006#define XCHAL_DTLB_SET4_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */
1007#define XCHAL_DTLB_SET4_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */
1008#define XCHAL_DTLB_SET4_PPN_RESET 0 /* 1 if PPN reset values defined (and all writable); 0 otherwise */
1009#define XCHAL_DTLB_SET4_CA_RESET 0 /* 1 if CA reset values defined (and all writable); 0 otherwise */
1010
1011/* Indexing macros: */
1012#define _XCHAL_DTLB_SET(n,_what) XCHAL_DTLB_SET ## n ## _what
1013#define XCHAL_DTLB_SET(n,what) _XCHAL_DTLB_SET(n, _ ## what )
1014#define _XCHAL_DTLB_SET_E(n,i,_what) XCHAL_DTLB_SET ## n ## _E ## i ## _what
1015#define XCHAL_DTLB_SET_E(n,i,what) _XCHAL_DTLB_SET_E(n,i, _ ## what )
1016/*
1017 * Example use: XCHAL_DTLB_SET(XCHAL_DTLB_ARF_SET0,ENTRIES)
1018 * to get the value of XCHAL_DTLB_SET<n>_ENTRIES where <n> is the first auto-refill set.
1019 */
1020
1021
1022/*
1023 * Determine whether we have a full MMU (with Page Table and Protection)
1024 * usable for an MMU-based OS:
1025 */
1026#if XCHAL_HAVE_TLBS && !XCHAL_HAVE_SPANNING_WAY && XCHAL_ITLB_ARF_WAYS > 0 && XCHAL_DTLB_ARF_WAYS > 0 && XCHAL_MMU_RINGS >= 2
1027# define XCHAL_HAVE_PTP_MMU 1 /* have full MMU (with page table [autorefill] and protection) */
1028#else
1029# define XCHAL_HAVE_PTP_MMU 0 /* don't have full MMU */
1030#endif
1031
1032/*
1033 * For full MMUs, report kernel RAM segment and kernel I/O segment static page mappings:
1034 */
1035#if XCHAL_HAVE_PTP_MMU
1036#define XCHAL_KSEG_CACHED_VADDR 0xD0000000 /* virt.addr of kernel RAM cached static map */
1037#define XCHAL_KSEG_CACHED_PADDR 0x00000000 /* phys.addr of kseg_cached */
1038#define XCHAL_KSEG_CACHED_SIZE 0x08000000 /* size in bytes of kseg_cached (assumed power of 2!!!) */
1039#define XCHAL_KSEG_BYPASS_VADDR 0xD8000000 /* virt.addr of kernel RAM bypass (uncached) static map */
1040#define XCHAL_KSEG_BYPASS_PADDR 0x00000000 /* phys.addr of kseg_bypass */
1041#define XCHAL_KSEG_BYPASS_SIZE 0x08000000 /* size in bytes of kseg_bypass (assumed power of 2!!!) */
1042
1043#define XCHAL_KIO_CACHED_VADDR 0xE0000000 /* virt.addr of kernel I/O cached static map */
1044#define XCHAL_KIO_CACHED_PADDR 0xF0000000 /* phys.addr of kio_cached */
1045#define XCHAL_KIO_CACHED_SIZE 0x10000000 /* size in bytes of kio_cached (assumed power of 2!!!) */
1046#define XCHAL_KIO_BYPASS_VADDR 0xF0000000 /* virt.addr of kernel I/O bypass (uncached) static map */
1047#define XCHAL_KIO_BYPASS_PADDR 0xF0000000 /* phys.addr of kio_bypass */
1048#define XCHAL_KIO_BYPASS_SIZE 0x10000000 /* size in bytes of kio_bypass (assumed power of 2!!!) */
1049
1050#define XCHAL_SEG_MAPPABLE_VADDR 0x00000000 /* start of largest non-static-mapped virtual addr area */
1051#define XCHAL_SEG_MAPPABLE_SIZE 0xD0000000 /* size in bytes of " */
1052/* define XCHAL_SEG_MAPPABLE2_xxx if more areas present, sorted in order of descending size. */
1053#endif
1054
1055
1056/*----------------------------------------------------------------------
1057 MISC
1058 ----------------------------------------------------------------------*/
1059
1060#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* number of write buffer entries */
1061
1062#define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier
1063 (CoreID) set in the Xtensa Processor Generator */
1064
1065#define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */
1066
1067/* These definitions describe the hardware targeted by this software: */
1068#define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */
1069#define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */
1070#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
1071#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
1072#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
1073#define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
1074#define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
1075#define XTHAL_HW_REL_T1050 1
1076#define XTHAL_HW_REL_T1050_1 1
1077#define XCHAL_HW_CONFIGID_RELIABLE 1
1078
1079
1080/*
1081 * Miscellaneous special register fields:
1082 */
1083
1084
1085/* DBREAKC (special register number 160): */
1086#define XCHAL_DBREAKC_VALIDMASK 0xC000003F /* bits of DBREAKC that are defined */
1087/* MASK field: */
1088#define XCHAL_DBREAKC_MASK_BITS 6 /* number of bits in MASK field */
1089#define XCHAL_DBREAKC_MASK_NUM 64 /* max number of possible causes (2^bits) */
1090#define XCHAL_DBREAKC_MASK_SHIFT 0 /* position of MASK bits in DBREAKC, starting from lsbit */
1091#define XCHAL_DBREAKC_MASK_MASK 0x0000003F /* mask of bits in MASK field of DBREAKC */
1092/* LOADBREAK field: */
1093#define XCHAL_DBREAKC_LOADBREAK_BITS 1 /* number of bits in LOADBREAK field */
1094#define XCHAL_DBREAKC_LOADBREAK_NUM 2 /* max number of possible causes (2^bits) */
1095#define XCHAL_DBREAKC_LOADBREAK_SHIFT 30 /* position of LOADBREAK bits in DBREAKC, starting from lsbit */
1096#define XCHAL_DBREAKC_LOADBREAK_MASK 0x40000000 /* mask of bits in LOADBREAK field of DBREAKC */
1097/* STOREBREAK field: */
1098#define XCHAL_DBREAKC_STOREBREAK_BITS 1 /* number of bits in STOREBREAK field */
1099#define XCHAL_DBREAKC_STOREBREAK_NUM 2 /* max number of possible causes (2^bits) */
1100#define XCHAL_DBREAKC_STOREBREAK_SHIFT 31 /* position of STOREBREAK bits in DBREAKC, starting from lsbit */
1101#define XCHAL_DBREAKC_STOREBREAK_MASK 0x80000000 /* mask of bits in STOREBREAK field of DBREAKC */
1102
1103/* PS (special register number 230): */
1104#define XCHAL_PS_VALIDMASK 0x00070FFF /* bits of PS that are defined */
1105/* INTLEVEL field: */
1106#define XCHAL_PS_INTLEVEL_BITS 4 /* number of bits in INTLEVEL field */
1107#define XCHAL_PS_INTLEVEL_NUM 16 /* max number of possible causes (2^bits) */
1108#define XCHAL_PS_INTLEVEL_SHIFT 0 /* position of INTLEVEL bits in PS, starting from lsbit */
1109#define XCHAL_PS_INTLEVEL_MASK 0x0000000F /* mask of bits in INTLEVEL field of PS */
1110/* EXCM field: */
1111#define XCHAL_PS_EXCM_BITS 1 /* number of bits in EXCM field */
1112#define XCHAL_PS_EXCM_NUM 2 /* max number of possible causes (2^bits) */
1113#define XCHAL_PS_EXCM_SHIFT 4 /* position of EXCM bits in PS, starting from lsbit */
1114#define XCHAL_PS_EXCM_MASK 0x00000010 /* mask of bits in EXCM field of PS */
1115/* PROGSTACK field: */
1116#define XCHAL_PS_PROGSTACK_BITS 1 /* number of bits in PROGSTACK field */
1117#define XCHAL_PS_PROGSTACK_NUM 2 /* max number of possible causes (2^bits) */
1118#define XCHAL_PS_PROGSTACK_SHIFT 5 /* position of PROGSTACK bits in PS, starting from lsbit */
1119#define XCHAL_PS_PROGSTACK_MASK 0x00000020 /* mask of bits in PROGSTACK field of PS */
1120/* RING field: */
1121#define XCHAL_PS_RING_BITS 2 /* number of bits in RING field */
1122#define XCHAL_PS_RING_NUM 4 /* max number of possible causes (2^bits) */
1123#define XCHAL_PS_RING_SHIFT 6 /* position of RING bits in PS, starting from lsbit */
1124#define XCHAL_PS_RING_MASK 0x000000C0 /* mask of bits in RING field of PS */
1125/* OWB field: */
1126#define XCHAL_PS_OWB_BITS 4 /* number of bits in OWB field */
1127#define XCHAL_PS_OWB_NUM 16 /* max number of possible causes (2^bits) */
1128#define XCHAL_PS_OWB_SHIFT 8 /* position of OWB bits in PS, starting from lsbit */
1129#define XCHAL_PS_OWB_MASK 0x00000F00 /* mask of bits in OWB field of PS */
1130/* CALLINC field: */
1131#define XCHAL_PS_CALLINC_BITS 2 /* number of bits in CALLINC field */
1132#define XCHAL_PS_CALLINC_NUM 4 /* max number of possible causes (2^bits) */
1133#define XCHAL_PS_CALLINC_SHIFT 16 /* position of CALLINC bits in PS, starting from lsbit */
1134#define XCHAL_PS_CALLINC_MASK 0x00030000 /* mask of bits in CALLINC field of PS */
1135/* WOE field: */
1136#define XCHAL_PS_WOE_BITS 1 /* number of bits in WOE field */
1137#define XCHAL_PS_WOE_NUM 2 /* max number of possible causes (2^bits) */
1138#define XCHAL_PS_WOE_SHIFT 18 /* position of WOE bits in PS, starting from lsbit */
1139#define XCHAL_PS_WOE_MASK 0x00040000 /* mask of bits in WOE field of PS */
1140
1141/* EXCCAUSE (special register number 232): */
1142#define XCHAL_EXCCAUSE_VALIDMASK 0x0000003F /* bits of EXCCAUSE that are defined */
1143/* EXCCAUSE field: */
1144#define XCHAL_EXCCAUSE_BITS 6 /* number of bits in EXCCAUSE register */
1145#define XCHAL_EXCCAUSE_NUM 64 /* max number of possible causes (2^bits) */
1146#define XCHAL_EXCCAUSE_SHIFT 0 /* position of EXCCAUSE bits in register, starting from lsbit */
1147#define XCHAL_EXCCAUSE_MASK 0x0000003F /* mask of bits in EXCCAUSE register */
1148
1149/* DEBUGCAUSE (special register number 233): */
1150#define XCHAL_DEBUGCAUSE_VALIDMASK 0x0000003F /* bits of DEBUGCAUSE that are defined */
1151/* ICOUNT field: */
1152#define XCHAL_DEBUGCAUSE_ICOUNT_BITS 1 /* number of bits in ICOUNT field */
1153#define XCHAL_DEBUGCAUSE_ICOUNT_NUM 2 /* max number of possible causes (2^bits) */
1154#define XCHAL_DEBUGCAUSE_ICOUNT_SHIFT 0 /* position of ICOUNT bits in DEBUGCAUSE, starting from lsbit */
1155#define XCHAL_DEBUGCAUSE_ICOUNT_MASK 0x00000001 /* mask of bits in ICOUNT field of DEBUGCAUSE */
1156/* IBREAK field: */
1157#define XCHAL_DEBUGCAUSE_IBREAK_BITS 1 /* number of bits in IBREAK field */
1158#define XCHAL_DEBUGCAUSE_IBREAK_NUM 2 /* max number of possible causes (2^bits) */
1159#define XCHAL_DEBUGCAUSE_IBREAK_SHIFT 1 /* position of IBREAK bits in DEBUGCAUSE, starting from lsbit */
1160#define XCHAL_DEBUGCAUSE_IBREAK_MASK 0x00000002 /* mask of bits in IBREAK field of DEBUGCAUSE */
1161/* DBREAK field: */
1162#define XCHAL_DEBUGCAUSE_DBREAK_BITS 1 /* number of bits in DBREAK field */
1163#define XCHAL_DEBUGCAUSE_DBREAK_NUM 2 /* max number of possible causes (2^bits) */
1164#define XCHAL_DEBUGCAUSE_DBREAK_SHIFT 2 /* position of DBREAK bits in DEBUGCAUSE, starting from lsbit */
1165#define XCHAL_DEBUGCAUSE_DBREAK_MASK 0x00000004 /* mask of bits in DBREAK field of DEBUGCAUSE */
1166/* BREAK field: */
1167#define XCHAL_DEBUGCAUSE_BREAK_BITS 1 /* number of bits in BREAK field */
1168#define XCHAL_DEBUGCAUSE_BREAK_NUM 2 /* max number of possible causes (2^bits) */
1169#define XCHAL_DEBUGCAUSE_BREAK_SHIFT 3 /* position of BREAK bits in DEBUGCAUSE, starting from lsbit */
1170#define XCHAL_DEBUGCAUSE_BREAK_MASK 0x00000008 /* mask of bits in BREAK field of DEBUGCAUSE */
1171/* BREAKN field: */
1172#define XCHAL_DEBUGCAUSE_BREAKN_BITS 1 /* number of bits in BREAKN field */
1173#define XCHAL_DEBUGCAUSE_BREAKN_NUM 2 /* max number of possible causes (2^bits) */
1174#define XCHAL_DEBUGCAUSE_BREAKN_SHIFT 4 /* position of BREAKN bits in DEBUGCAUSE, starting from lsbit */
1175#define XCHAL_DEBUGCAUSE_BREAKN_MASK 0x00000010 /* mask of bits in BREAKN field of DEBUGCAUSE */
1176/* DEBUGINT field: */
1177#define XCHAL_DEBUGCAUSE_DEBUGINT_BITS 1 /* number of bits in DEBUGINT field */
1178#define XCHAL_DEBUGCAUSE_DEBUGINT_NUM 2 /* max number of possible causes (2^bits) */
1179#define XCHAL_DEBUGCAUSE_DEBUGINT_SHIFT 5 /* position of DEBUGINT bits in DEBUGCAUSE, starting from lsbit */
1180#define XCHAL_DEBUGCAUSE_DEBUGINT_MASK 0x00000020 /* mask of bits in DEBUGINT field of DEBUGCAUSE */
1181
1182
1183
1184/*----------------------------------------------------------------------
1185 ISA
1186 ----------------------------------------------------------------------*/
1187
1188#define XCHAL_HAVE_DENSITY 1 /* 1 if density option configured, 0 otherwise */
1189#define XCHAL_HAVE_LOOPS 1 /* 1 if zero-overhead loops option configured, 0 otherwise */
1190/* Misc instructions: */
1191#define XCHAL_HAVE_NSA 0 /* 1 if NSA/NSAU instructions option configured, 0 otherwise */
1192#define XCHAL_HAVE_MINMAX 0 /* 1 if MIN/MAX instructions option configured, 0 otherwise */
1193#define XCHAL_HAVE_SEXT 0 /* 1 if sign-extend instruction option configured, 0 otherwise */
1194#define XCHAL_HAVE_CLAMPS 0 /* 1 if CLAMPS instruction option configured, 0 otherwise */
1195#define XCHAL_HAVE_MAC16 0 /* 1 if MAC16 option configured, 0 otherwise */
1196#define XCHAL_HAVE_MUL16 0 /* 1 if 16-bit integer multiply option configured, 0 otherwise */
1197/*#define XCHAL_HAVE_POPC 0*/ /* 1 if CRC instruction option configured, 0 otherwise */
1198/*#define XCHAL_HAVE_CRC 0*/ /* 1 if POPC instruction option configured, 0 otherwise */
1199
1200#define XCHAL_HAVE_SPECULATION 0 /* 1 if speculation option configured, 0 otherwise */
1201/*#define XCHAL_HAVE_MP_SYNC 0*/ /* 1 if multiprocessor sync. option configured, 0 otherwise */
1202#define XCHAL_HAVE_PRID 0 /* 1 if processor ID register configured, 0 otherwise */
1203
1204#define XCHAL_NUM_MISC_REGS 2 /* number of miscellaneous registers (0..4) */
1205
1206/* These relate a bit more to TIE: */
1207#define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */
1208#define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */
1209#define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */
1210#define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */
1211
1212
1213/*----------------------------------------------------------------------
1214 DERIVED
1215 ----------------------------------------------------------------------*/
1216
1217#if XCHAL_HAVE_BE
1218#define XCHAL_INST_ILLN 0xD60F /* 2-byte illegal instruction, msb-first */
1219#define XCHAL_INST_ILLN_BYTE0 0xD6 /* 2-byte illegal instruction, 1st byte */
1220#define XCHAL_INST_ILLN_BYTE1 0x0F /* 2-byte illegal instruction, 2nd byte */
1221#else
1222#define XCHAL_INST_ILLN 0xF06D /* 2-byte illegal instruction, lsb-first */
1223#define XCHAL_INST_ILLN_BYTE0 0x6D /* 2-byte illegal instruction, 1st byte */
1224#define XCHAL_INST_ILLN_BYTE1 0xF0 /* 2-byte illegal instruction, 2nd byte */
1225#endif
1226/* Belongs in xtensa/hal.h: */
1227#define XTHAL_INST_ILL 0x000000 /* 3-byte illegal instruction */
1228
1229
1230/*
1231 * Because information as to exactly which hardware release is targeted
1232 * by a given software build is not always available, compile-time HAL
1233 * Hardware-Release "_AT" macros are fuzzy (return 0, 1, or XCHAL_MAYBE):
1234 */
1235#ifndef XCHAL_HW_RELEASE_MAJOR
1236# define XCHAL_HW_CONFIGID_RELIABLE 0
1237#endif
1238#if XCHAL_HW_CONFIGID_RELIABLE
1239# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) (XTHAL_REL_LE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1240# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) (XTHAL_REL_GE( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1241# define XCHAL_HW_RELEASE_AT(major,minor) (XTHAL_REL_EQ( XCHAL_HW_RELEASE_MAJOR,XCHAL_HW_RELEASE_MINOR, major,minor ) ? 1 : 0)
1242# define XCHAL_HW_RELEASE_MAJOR_AT(major) ((XCHAL_HW_RELEASE_MAJOR == (major)) ? 1 : 0)
1243#else
1244# define XCHAL_HW_RELEASE_AT_OR_BELOW(major,minor) ( ((major) < 1040 && XCHAL_HAVE_XEA2) ? 0 \
1245 : ((major) > 1050 && XCHAL_HAVE_XEA1) ? 1 \
1246 : XTHAL_MAYBE )
1247# define XCHAL_HW_RELEASE_AT_OR_ABOVE(major,minor) ( ((major) >= 2000 && XCHAL_HAVE_XEA1) ? 0 \
1248 : (XTHAL_REL_LE(major,minor, 1040,0) && XCHAL_HAVE_XEA2) ? 1 \
1249 : XTHAL_MAYBE )
1250# define XCHAL_HW_RELEASE_AT(major,minor) ( (((major) < 1040 && XCHAL_HAVE_XEA2) || \
1251 ((major) >= 2000 && XCHAL_HAVE_XEA1)) ? 0 : XTHAL_MAYBE)
1252# define XCHAL_HW_RELEASE_MAJOR_AT(major) XCHAL_HW_RELEASE_AT(major,0)
1253#endif
1254
1255/*
1256 * Specific errata:
1257 */
1258
1259/*
1260 * Erratum T1020.H13, T1030.H7, T1040.H10, T1050.H4 (fixed in T1040.3 and T1050.1;
1261 * relevant only in XEA1, kernel-vector mode, level-one interrupts and overflows enabled):
1262 */
1263#define XCHAL_MAYHAVE_ERRATUM_XEA1KWIN (XCHAL_HAVE_XEA1 && \
1264 (XCHAL_HW_RELEASE_AT_OR_BELOW(1040,2) != 0 \
1265 || XCHAL_HW_RELEASE_AT(1050,0)))
1266
1267
1268
1269#endif /*XTENSA_CONFIG_CORE_H*/
1270
diff --git a/include/asm-xtensa/xtensa/config-linux_be/defs.h b/include/asm-xtensa/xtensa/config-linux_be/defs.h
new file mode 100644
index 000000000000..f7c58b273371
--- /dev/null
+++ b/include/asm-xtensa/xtensa/config-linux_be/defs.h
@@ -0,0 +1,270 @@
1/* Definitions for Xtensa instructions, types, and protos. */
2
3/*
4 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2.1 of the GNU Lesser General Public
8 * License as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * Further, this software is distributed without any warranty that it is
15 * free of the rightful claim of any third person regarding infringement
16 * or the like. Any license provided herein, whether implied or
17 * otherwise, applies only to this software file. Patent licenses, if
18 * any, provided herein do not apply to combinations of this program with
19 * other software, or any other product whatsoever.
20 *
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this program; if not, write the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
24 * USA.
25 */
26
27/* Do not modify. This is automatically generated.*/
28
29#ifndef _XTENSA_BASE_HEADER
30#define _XTENSA_BASE_HEADER
31
32#ifdef __XTENSA__
33#if defined(__GNUC__) && !defined(__XCC__)
34
35#define L8UI_ASM(arr, ars, imm) { \
36 __asm__ volatile("l8ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
37}
38
39#define XT_L8UI(ars, imm) \
40({ \
41 unsigned char _arr; \
42 const unsigned char *_ars = ars; \
43 L8UI_ASM(_arr, _ars, imm); \
44 _arr; \
45})
46
47#define L16UI_ASM(arr, ars, imm) { \
48 __asm__ volatile("l16ui %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
49}
50
51#define XT_L16UI(ars, imm) \
52({ \
53 unsigned short _arr; \
54 const unsigned short *_ars = ars; \
55 L16UI_ASM(_arr, _ars, imm); \
56 _arr; \
57})
58
59#define L16SI_ASM(arr, ars, imm) {\
60 __asm__ volatile("l16si %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
61}
62
63#define XT_L16SI(ars, imm) \
64({ \
65 signed short _arr; \
66 const signed short *_ars = ars; \
67 L16SI_ASM(_arr, _ars, imm); \
68 _arr; \
69})
70
71#define L32I_ASM(arr, ars, imm) { \
72 __asm__ volatile("l32i %0, %1, %2" : "=a" (arr) : "a" (ars) , "i" (imm)); \
73}
74
75#define XT_L32I(ars, imm) \
76({ \
77 unsigned _arr; \
78 const unsigned *_ars = ars; \
79 L32I_ASM(_arr, _ars, imm); \
80 _arr; \
81})
82
83#define S8I_ASM(arr, ars, imm) {\
84 __asm__ volatile("s8i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
85}
86
87#define XT_S8I(arr, ars, imm) \
88({ \
89 signed char _arr = arr; \
90 const signed char *_ars = ars; \
91 S8I_ASM(_arr, _ars, imm); \
92})
93
94#define S16I_ASM(arr, ars, imm) {\
95 __asm__ volatile("s16i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
96}
97
98#define XT_S16I(arr, ars, imm) \
99({ \
100 signed short _arr = arr; \
101 const signed short *_ars = ars; \
102 S16I_ASM(_arr, _ars, imm); \
103})
104
105#define S32I_ASM(arr, ars, imm) { \
106 __asm__ volatile("s32i %0, %1, %2" : : "a" (arr), "a" (ars) , "i" (imm) : "memory" ); \
107}
108
109#define XT_S32I(arr, ars, imm) \
110({ \
111 signed int _arr = arr; \
112 const signed int *_ars = ars; \
113 S32I_ASM(_arr, _ars, imm); \
114})
115
116#define ADDI_ASM(art, ars, imm) {\
117 __asm__ ("addi %0, %1, %2" : "=a" (art) : "a" (ars), "i" (imm)); \
118}
119
120#define XT_ADDI(ars, imm) \
121({ \
122 unsigned _art; \
123 unsigned _ars = ars; \
124 ADDI_ASM(_art, _ars, imm); \
125 _art; \
126})
127
128#define ABS_ASM(arr, art) {\
129 __asm__ ("abs %0, %1" : "=a" (arr) : "a" (art)); \
130}
131
132#define XT_ABS(art) \
133({ \
134 unsigned _arr; \
135 signed _art = art; \
136 ABS_ASM(_arr, _art); \
137 _arr; \
138})
139
140/* Note: In the following macros that reference SAR, the magic "state"
141 register is used to capture the dependency on SAR. This is because
142 SAR is a 5-bit register and thus there are no C types that can be
143 used to represent it. It doesn't appear that the SAR register is
144 even relevant to GCC, but it is marked as "clobbered" just in
145 case. */
146
147#define SRC_ASM(arr, ars, art) {\
148 register int _xt_sar __asm__ ("state"); \
149 __asm__ ("src %0, %1, %2" \
150 : "=a" (arr) : "a" (ars), "a" (art), "t" (_xt_sar)); \
151}
152
153#define XT_SRC(ars, art) \
154({ \
155 unsigned _arr; \
156 unsigned _ars = ars; \
157 unsigned _art = art; \
158 SRC_ASM(_arr, _ars, _art); \
159 _arr; \
160})
161
162#define SSR_ASM(ars) {\
163 register int _xt_sar __asm__ ("state"); \
164 __asm__ ("ssr %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
165}
166
167#define XT_SSR(ars) \
168({ \
169 unsigned _ars = ars; \
170 SSR_ASM(_ars); \
171})
172
173#define SSL_ASM(ars) {\
174 register int _xt_sar __asm__ ("state"); \
175 __asm__ ("ssl %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
176}
177
178#define XT_SSL(ars) \
179({ \
180 unsigned _ars = ars; \
181 SSL_ASM(_ars); \
182})
183
184#define SSA8B_ASM(ars) {\
185 register int _xt_sar __asm__ ("state"); \
186 __asm__ ("ssa8b %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
187}
188
189#define XT_SSA8B(ars) \
190({ \
191 unsigned _ars = ars; \
192 SSA8B_ASM(_ars); \
193})
194
195#define SSA8L_ASM(ars) {\
196 register int _xt_sar __asm__ ("state"); \
197 __asm__ ("ssa8l %1" : "=t" (_xt_sar) : "a" (ars) : "sar"); \
198}
199
200#define XT_SSA8L(ars) \
201({ \
202 unsigned _ars = ars; \
203 SSA8L_ASM(_ars); \
204})
205
206#define SSAI_ASM(imm) {\
207 register int _xt_sar __asm__ ("state"); \
208 __asm__ ("ssai %1" : "=t" (_xt_sar) : "i" (imm) : "sar"); \
209}
210
211#define XT_SSAI(imm) \
212({ \
213 SSAI_ASM(imm); \
214})
215
216
217
218
219
220
221
222
223#endif /* __GNUC__ && !__XCC__ */
224
225#ifdef __XCC__
226
227/* Core load/store instructions */
228extern unsigned char _TIE_L8UI(const unsigned char * ars, immediate imm);
229extern unsigned short _TIE_L16UI(const unsigned short * ars, immediate imm);
230extern signed short _TIE_L16SI(const signed short * ars, immediate imm);
231extern unsigned _TIE_L32I(const unsigned * ars, immediate imm);
232extern void _TIE_S8I(unsigned char arr, unsigned char * ars, immediate imm);
233extern void _TIE_S16I(unsigned short arr, unsigned short * ars, immediate imm);
234extern void _TIE_S32I(unsigned arr, unsigned * ars, immediate imm);
235
236#define XT_L8UI _TIE_L8UI
237#define XT_L16UI _TIE_L16UI
238#define XT_L16SI _TIE_L16SI
239#define XT_L32I _TIE_L32I
240#define XT_S8I _TIE_S8I
241#define XT_S16I _TIE_S16I
242#define XT_S32I _TIE_S32I
243
244/* Add-immediate instruction */
245extern unsigned _TIE_ADDI(unsigned ars, immediate imm);
246#define XT_ADDI _TIE_ADDI
247
248/* Absolute value instruction */
249extern unsigned _TIE_ABS(int art);
250#define XT_ABS _TIE_ABS
251
252/* funnel shift instructions */
253extern unsigned _TIE_SRC(unsigned ars, unsigned art);
254#define XT_SRC _TIE_SRC
255extern void _TIE_SSR(unsigned ars);
256#define XT_SSR _TIE_SSR
257extern void _TIE_SSL(unsigned ars);
258#define XT_SSL _TIE_SSL
259extern void _TIE_SSA8B(unsigned ars);
260#define XT_SSA8B _TIE_SSA8B
261extern void _TIE_SSA8L(unsigned ars);
262#define XT_SSA8L _TIE_SSA8L
263extern void _TIE_SSAI(immediate imm);
264#define XT_SSAI _TIE_SSAI
265
266
267#endif /* __XCC__ */
268
269#endif /* __XTENSA__ */
270#endif /* !_XTENSA_BASE_HEADER */
diff --git a/include/asm-xtensa/xtensa/config-linux_be/specreg.h b/include/asm-xtensa/xtensa/config-linux_be/specreg.h
new file mode 100644
index 000000000000..fa4106aa9a02
--- /dev/null
+++ b/include/asm-xtensa/xtensa/config-linux_be/specreg.h
@@ -0,0 +1,99 @@
1/*
2 * Xtensa Special Register symbolic names
3 */
4
5/* $Id: specreg.h,v 1.2 2003/03/07 19:15:18 joetaylor Exp $ */
6
7/*
8 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2.1 of the GNU Lesser General Public
12 * License as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it would be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 *
18 * Further, this software is distributed without any warranty that it is
19 * free of the rightful claim of any third person regarding infringement
20 * or the like. Any license provided herein, whether implied or
21 * otherwise, applies only to this software file. Patent licenses, if
22 * any, provided herein do not apply to combinations of this program with
23 * other software, or any other product whatsoever.
24 *
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this program; if not, write the Free Software
27 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
28 * USA.
29 */
30
31#ifndef XTENSA_SPECREG_H
32#define XTENSA_SPECREG_H
33
34/* Include these special register bitfield definitions, for historical reasons: */
35#include <xtensa/corebits.h>
36
37
38/* Special registers: */
39#define LBEG 0
40#define LEND 1
41#define LCOUNT 2
42#define SAR 3
43#define WINDOWBASE 72
44#define WINDOWSTART 73
45#define PTEVADDR 83
46#define RASID 90
47#define ITLBCFG 91
48#define DTLBCFG 92
49#define IBREAKENABLE 96
50#define DDR 104
51#define IBREAKA_0 128
52#define IBREAKA_1 129
53#define DBREAKA_0 144
54#define DBREAKA_1 145
55#define DBREAKC_0 160
56#define DBREAKC_1 161
57#define EPC_1 177
58#define EPC_2 178
59#define EPC_3 179
60#define EPC_4 180
61#define DEPC 192
62#define EPS_2 194
63#define EPS_3 195
64#define EPS_4 196
65#define EXCSAVE_1 209
66#define EXCSAVE_2 210
67#define EXCSAVE_3 211
68#define EXCSAVE_4 212
69#define INTERRUPT 226
70#define INTENABLE 228
71#define PS 230
72#define EXCCAUSE 232
73#define DEBUGCAUSE 233
74#define CCOUNT 234
75#define ICOUNT 236
76#define ICOUNTLEVEL 237
77#define EXCVADDR 238
78#define CCOMPARE_0 240
79#define CCOMPARE_1 241
80#define CCOMPARE_2 242
81#define MISC_REG_0 244
82#define MISC_REG_1 245
83
84/* Special cases (bases of special register series): */
85#define IBREAKA 128
86#define DBREAKA 144
87#define DBREAKC 160
88#define EPC 176
89#define EPS 192
90#define EXCSAVE 208
91#define CCOMPARE 240
92
93/* Special names for read-only and write-only interrupt registers: */
94#define INTREAD 226
95#define INTSET 226
96#define INTCLEAR 227
97
98#endif /* XTENSA_SPECREG_H */
99
diff --git a/include/asm-xtensa/xtensa/config-linux_be/system.h b/include/asm-xtensa/xtensa/config-linux_be/system.h
new file mode 100644
index 000000000000..cf9d4d308e3a
--- /dev/null
+++ b/include/asm-xtensa/xtensa/config-linux_be/system.h
@@ -0,0 +1,198 @@
1/*
2 * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration
3 *
4 * NOTE: The location and contents of this file are highly subject to change.
5 *
6 * Source for configuration-independent binaries (which link in a
7 * configuration-specific HAL library) must NEVER include this file.
8 * The HAL itself has historically included this file in some instances,
9 * but this is not appropriate either, because the HAL is meant to be
10 * core-specific but system independent.
11 */
12
13/*
14 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of version 2.1 of the GNU Lesser General Public
18 * License as published by the Free Software Foundation.
19 *
20 * This program is distributed in the hope that it would be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 * Further, this software is distributed without any warranty that it is
25 * free of the rightful claim of any third person regarding infringement
26 * or the like. Any license provided herein, whether implied or
27 * otherwise, applies only to this software file. Patent licenses, if
28 * any, provided herein do not apply to combinations of this program with
29 * other software, or any other product whatsoever.
30 *
31 * You should have received a copy of the GNU Lesser General Public
32 * License along with this program; if not, write the Free Software
33 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
34 * USA.
35 */
36
37
38#ifndef XTENSA_CONFIG_SYSTEM_H
39#define XTENSA_CONFIG_SYSTEM_H
40
41/*#include <xtensa/hal.h>*/
42
43
44
45/*----------------------------------------------------------------------
46 DEVICE ADDRESSES
47 ----------------------------------------------------------------------*/
48
49/*
50 * Strange place to find these, but the configuration GUI
51 * allows moving these around to account for various core
52 * configurations. Specific boards (and their BSP software)
53 * will have specific meanings for these components.
54 */
55
56/* I/O Block areas: */
57#define XSHAL_IOBLOCK_CACHED_VADDR 0xE0000000
58#define XSHAL_IOBLOCK_CACHED_PADDR 0xF0000000
59#define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000
60
61#define XSHAL_IOBLOCK_BYPASS_VADDR 0xF0000000
62#define XSHAL_IOBLOCK_BYPASS_PADDR 0xF0000000
63#define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000
64
65/* System ROM: */
66#define XSHAL_ROM_VADDR 0xEE000000
67#define XSHAL_ROM_PADDR 0xFE000000
68#define XSHAL_ROM_SIZE 0x00400000
69/* Largest available area (free of vectors): */
70#define XSHAL_ROM_AVAIL_VADDR 0xEE00052C
71#define XSHAL_ROM_AVAIL_VSIZE 0x003FFAD4
72
73/* System RAM: */
74#define XSHAL_RAM_VADDR 0xD0000000
75#define XSHAL_RAM_PADDR 0x00000000
76#define XSHAL_RAM_VSIZE 0x08000000
77#define XSHAL_RAM_PSIZE 0x10000000
78#define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE
79/* Largest available area (free of vectors): */
80#define XSHAL_RAM_AVAIL_VADDR 0xD0000370
81#define XSHAL_RAM_AVAIL_VSIZE 0x07FFFC90
82
83/*
84 * Shadow system RAM (same device as system RAM, at different address).
85 * (Emulation boards need this for the SONIC Ethernet driver
86 * when data caches are configured for writeback mode.)
87 * NOTE: on full MMU configs, this points to the BYPASS virtual address
88 * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual
89 * addresses are viewed through the BYPASS static map rather than
90 * the CACHED static map.
91 */
92#define XSHAL_RAM_BYPASS_VADDR 0xD8000000
93#define XSHAL_RAM_BYPASS_PADDR 0x00000000
94#define XSHAL_RAM_BYPASS_PSIZE 0x08000000
95
96/* Alternate system RAM (different device than system RAM): */
97#define XSHAL_ALTRAM_VADDR 0xCEE00000
98#define XSHAL_ALTRAM_PADDR 0xC0000000
99#define XSHAL_ALTRAM_SIZE 0x00200000
100
101
102/*----------------------------------------------------------------------
103 * DEVICE-ADDRESS DEPENDENT...
104 *
105 * Values written to CACHEATTR special register (or its equivalent)
106 * to enable and disable caches in various modes.
107 *----------------------------------------------------------------------*/
108
109/*----------------------------------------------------------------------
110 BACKWARD COMPATIBILITY ...
111 ----------------------------------------------------------------------*/
112
113/*
114 * NOTE: the following two macros are DEPRECATED. Use the latter
115 * board-specific macros instead, which are specially tuned for the
116 * particular target environments' memory maps.
117 */
118#define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */
119#define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */
120
121/*----------------------------------------------------------------------
122 ISS (Instruction Set Simulator) SPECIFIC ...
123 ----------------------------------------------------------------------*/
124
125#define XSHAL_ISS_CACHEATTR_WRITEBACK 0x1122222F /* enable caches in write-back mode */
126#define XSHAL_ISS_CACHEATTR_WRITEALLOC 0x1122222F /* enable caches in write-allocate mode */
127#define XSHAL_ISS_CACHEATTR_WRITETHRU 0x1122222F /* enable caches in write-through mode */
128#define XSHAL_ISS_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */
129#define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_ISS_CACHEATTR_WRITEBACK /* default setting to enable caches */
130
131/* For Coware only: */
132#define XSHAL_COWARE_CACHEATTR_WRITEBACK 0x11222222 /* enable caches in write-back mode */
133#define XSHAL_COWARE_CACHEATTR_WRITEALLOC 0x11222222 /* enable caches in write-allocate mode */
134#define XSHAL_COWARE_CACHEATTR_WRITETHRU 0x11222222 /* enable caches in write-through mode */
135#define XSHAL_COWARE_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */
136#define XSHAL_COWARE_CACHEATTR_DEFAULT XSHAL_COWARE_CACHEATTR_WRITEBACK /* default setting to enable caches */
137
138/* For BFM and other purposes: */
139#define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x11222222 /* enable caches without any invalid regions */
140#define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting for caches without any invalid regions */
141
142#define XSHAL_ISS_PIPE_REGIONS 0
143#define XSHAL_ISS_SDRAM_REGIONS 0
144
145
146/*----------------------------------------------------------------------
147 XT2000 BOARD SPECIFIC ...
148 ----------------------------------------------------------------------*/
149
150#define XSHAL_XT2000_CACHEATTR_WRITEBACK 0x22FFFFFF /* enable caches in write-back mode */
151#define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0x22FFFFFF /* enable caches in write-allocate mode */
152#define XSHAL_XT2000_CACHEATTR_WRITETHRU 0x22FFFFFF /* enable caches in write-through mode */
153#define XSHAL_XT2000_CACHEATTR_BYPASS 0x22FFFFFF /* disable caches in bypass mode */
154#define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */
155
156#define XSHAL_XT2000_PIPE_REGIONS 0x00001000 /* BusInt pipeline regions */
157#define XSHAL_XT2000_SDRAM_REGIONS 0x00000005 /* BusInt SDRAM regions */
158
159
160/*----------------------------------------------------------------------
161 VECTOR SIZES
162 ----------------------------------------------------------------------*/
163
164/*
165 * Sizes allocated to vectors by the system (memory map) configuration.
166 * These sizes are constrained by core configuration (eg. one vector's
167 * code cannot overflow into another vector) but are dependent on the
168 * system or board (or LSP) memory map configuration.
169 *
170 * Whether or not each vector happens to be in a system ROM is also
171 * a system configuration matter, sometimes useful, included here also:
172 */
173#define XSHAL_RESET_VECTOR_SIZE 0x000004E0
174#define XSHAL_RESET_VECTOR_ISROM 1
175#define XSHAL_USER_VECTOR_SIZE 0x0000001C
176#define XSHAL_USER_VECTOR_ISROM 0
177#define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
178#define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */
179#define XSHAL_KERNEL_VECTOR_SIZE 0x0000001C
180#define XSHAL_KERNEL_VECTOR_ISROM 0
181#define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
182#define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */
183#define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x000000E0
184#define XSHAL_DOUBLEEXC_VECTOR_ISROM 0
185#define XSHAL_WINDOW_VECTORS_SIZE 0x00000180
186#define XSHAL_WINDOW_VECTORS_ISROM 0
187#define XSHAL_INTLEVEL2_VECTOR_SIZE 0x0000000C
188#define XSHAL_INTLEVEL2_VECTOR_ISROM 0
189#define XSHAL_INTLEVEL3_VECTOR_SIZE 0x0000000C
190#define XSHAL_INTLEVEL3_VECTOR_ISROM 0
191#define XSHAL_INTLEVEL4_VECTOR_SIZE 0x0000000C
192#define XSHAL_INTLEVEL4_VECTOR_ISROM 1
193#define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL4_VECTOR_SIZE
194#define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL4_VECTOR_ISROM
195
196
197#endif /*XTENSA_CONFIG_SYSTEM_H*/
198
diff --git a/include/asm-xtensa/xtensa/config-linux_be/tie.h b/include/asm-xtensa/xtensa/config-linux_be/tie.h
new file mode 100644
index 000000000000..3c2e514602f4
--- /dev/null
+++ b/include/asm-xtensa/xtensa/config-linux_be/tie.h
@@ -0,0 +1,275 @@
1/*
2 * xtensa/config/tie.h -- HAL definitions that are dependent on CORE and TIE configuration
3 *
4 * This header file is sometimes referred to as the "compile-time HAL" or CHAL.
5 * It was generated for a specific Xtensa processor configuration,
6 * and furthermore for a specific set of TIE source files that extend
7 * basic core functionality.
8 *
9 * Source for configuration-independent binaries (which link in a
10 * configuration-specific HAL library) must NEVER include this file.
11 * It is perfectly normal, however, for the HAL source itself to include this file.
12 */
13
14/*
15 * Copyright (c) 2003 Tensilica, Inc. All Rights Reserved.
16 *
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of version 2.1 of the GNU Lesser General Public
19 * License as published by the Free Software Foundation.
20 *
21 * This program is distributed in the hope that it would be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 *
25 * Further, this software is distributed without any warranty that it is
26 * free of the rightful claim of any third person regarding infringement
27 * or the like. Any license provided herein, whether implied or
28 * otherwise, applies only to this software file. Patent licenses, if
29 * any, provided herein do not apply to combinations of this program with
30 * other software, or any other product whatsoever.
31 *
32 * You should have received a copy of the GNU Lesser General Public
33 * License along with this program; if not, write the Free Software
34 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
35 * USA.
36 */
37
38
39#ifndef XTENSA_CONFIG_TIE_H
40#define XTENSA_CONFIG_TIE_H
41
42#include <xtensa/hal.h>
43
44
45/*----------------------------------------------------------------------
46 GENERAL
47 ----------------------------------------------------------------------*/
48
49/*
50 * Separators for macros that expand into arrays.
51 * These can be predefined by files that #include this one,
52 * when different separators are required.
53 */
54/* Element separator for macros that expand into 1-dimensional arrays: */
55#ifndef XCHAL_SEP
56#define XCHAL_SEP ,
57#endif
58/* Array separator for macros that expand into 2-dimensional arrays: */
59#ifndef XCHAL_SEP2
60#define XCHAL_SEP2 },{
61#endif
62
63
64
65
66
67
68/*----------------------------------------------------------------------
69 COPROCESSORS and EXTRA STATE
70 ----------------------------------------------------------------------*/
71
72#define XCHAL_CP_NUM 0 /* number of coprocessors */
73#define XCHAL_CP_MAX 0 /* max coprocessor id plus one (0 if none) */
74#define XCHAL_CP_MASK 0x00 /* bitmask of coprocessors by id */
75
76/* Space for coprocessors' state save areas: */
77#define XCHAL_CP0_SA_SIZE 0
78#define XCHAL_CP1_SA_SIZE 0
79#define XCHAL_CP2_SA_SIZE 0
80#define XCHAL_CP3_SA_SIZE 0
81#define XCHAL_CP4_SA_SIZE 0
82#define XCHAL_CP5_SA_SIZE 0
83#define XCHAL_CP6_SA_SIZE 0
84#define XCHAL_CP7_SA_SIZE 0
85/* Minimum required alignments of CP state save areas: */
86#define XCHAL_CP0_SA_ALIGN 1
87#define XCHAL_CP1_SA_ALIGN 1
88#define XCHAL_CP2_SA_ALIGN 1
89#define XCHAL_CP3_SA_ALIGN 1
90#define XCHAL_CP4_SA_ALIGN 1
91#define XCHAL_CP5_SA_ALIGN 1
92#define XCHAL_CP6_SA_ALIGN 1
93#define XCHAL_CP7_SA_ALIGN 1
94
95/* Indexing macros: */
96#define _XCHAL_CP_SA_SIZE(n) XCHAL_CP ## n ## _SA_SIZE
97#define XCHAL_CP_SA_SIZE(n) _XCHAL_CP_SA_SIZE(n) /* n = 0 .. 7 */
98#define _XCHAL_CP_SA_ALIGN(n) XCHAL_CP ## n ## _SA_ALIGN
99#define XCHAL_CP_SA_ALIGN(n) _XCHAL_CP_SA_ALIGN(n) /* n = 0 .. 7 */
100
101
102/* Space for "extra" state (user special registers and non-cp TIE) save area: */
103#define XCHAL_EXTRA_SA_SIZE 0
104#define XCHAL_EXTRA_SA_ALIGN 1
105
106/* Total save area size (extra + all coprocessors) */
107/* (not useful until xthal_{save,restore}_all_extra() is implemented, */
108/* but included for Tor2 beta; doesn't account for alignment!): */
109#define XCHAL_CPEXTRA_SA_SIZE_TOR2 0 /* Tor2Beta temporary definition -- do not use */
110
111/* Combined required alignment for all CP and EXTRA state save areas */
112/* (does not include required alignment for any base config registers): */
113#define XCHAL_CPEXTRA_SA_ALIGN 1
114
115/* ... */
116
117
118#ifdef _ASMLANGUAGE
119/*
120 * Assembly-language specific definitions (assembly macros, etc.).
121 */
122#include <xtensa/config/specreg.h>
123
124/********************
125 * Macros to save and restore the non-coprocessor TIE portion of EXTRA state.
126 */
127
128/* (none) */
129
130
131/********************
132 * Macros to create functions that save and restore all EXTRA (non-coprocessor) state
133 * (does not include zero-overhead loop registers and non-optional registers).
134 */
135
136 /*
137 * Macro that expands to the body of a function that
138 * stores the extra (non-coprocessor) optional/custom state.
139 * Entry: a2 = ptr to save area in which to save extra state
140 * Exit: any register a2-a15 (?) may have been clobbered.
141 */
142 .macro xchal_extra_store_funcbody
143 .endm
144
145
146 /*
147 * Macro that expands to the body of a function that
148 * loads the extra (non-coprocessor) optional/custom state.
149 * Entry: a2 = ptr to save area from which to restore extra state
150 * Exit: any register a2-a15 (?) may have been clobbered.
151 */
152 .macro xchal_extra_load_funcbody
153 .endm
154
155
156/********************
157 * Macros to save and restore the state of each TIE coprocessor.
158 */
159
160
161
162/********************
163 * Macros to create functions that save and restore the state of *any* TIE coprocessor.
164 */
165
166 /*
167 * Macro that expands to the body of a function
168 * that stores the selected coprocessor's state (registers etc).
169 * Entry: a2 = ptr to save area in which to save cp state
170 * a3 = coprocessor number
171 * Exit: any register a2-a15 (?) may have been clobbered.
172 */
173 .macro xchal_cpi_store_funcbody
174 .endm
175
176
177 /*
178 * Macro that expands to the body of a function
179 * that loads the selected coprocessor's state (registers etc).
180 * Entry: a2 = ptr to save area from which to restore cp state
181 * a3 = coprocessor number
182 * Exit: any register a2-a15 (?) may have been clobbered.
183 */
184 .macro xchal_cpi_load_funcbody
185 .endm
186
187#endif /*_ASMLANGUAGE*/
188
189
190/*
191 * Contents of save areas in terms of libdb register numbers.
192 * NOTE: CONTENTS_LIBDB_{UREG,REGF} macros are not defined in this file;
193 * it is up to the user of this header file to define these macros
194 * usefully before each expansion of the CONTENTS_LIBDB macros.
195 * (Fields rsv[123] are reserved for future additions; they are currently
196 * set to zero but may be set to some useful values in the future.)
197 *
198 * CONTENTS_LIBDB_SREG(libdbnum, offset, size, align, rsv1, name, sregnum, bitmask, rsv2, rsv3)
199 * CONTENTS_LIBDB_UREG(libdbnum, offset, size, align, rsv1, name, uregnum, bitmask, rsv2, rsv3)
200 * CONTENTS_LIBDB_REGF(libdbnum, offset, size, align, rsv1, name, index, numentries, contentsize, regname_base, regfile_name, rsv2, rsv3)
201 */
202
203#define XCHAL_EXTRA_SA_CONTENTS_LIBDB_NUM 0
204#define XCHAL_EXTRA_SA_CONTENTS_LIBDB /* empty */
205
206#define XCHAL_CP0_SA_CONTENTS_LIBDB_NUM 0
207#define XCHAL_CP0_SA_CONTENTS_LIBDB /* empty */
208
209#define XCHAL_CP1_SA_CONTENTS_LIBDB_NUM 0
210#define XCHAL_CP1_SA_CONTENTS_LIBDB /* empty */
211
212#define XCHAL_CP2_SA_CONTENTS_LIBDB_NUM 0
213#define XCHAL_CP2_SA_CONTENTS_LIBDB /* empty */
214
215#define XCHAL_CP3_SA_CONTENTS_LIBDB_NUM 0
216#define XCHAL_CP3_SA_CONTENTS_LIBDB /* empty */
217
218#define XCHAL_CP4_SA_CONTENTS_LIBDB_NUM 0
219#define XCHAL_CP4_SA_CONTENTS_LIBDB /* empty */
220
221#define XCHAL_CP5_SA_CONTENTS_LIBDB_NUM 0
222#define XCHAL_CP5_SA_CONTENTS_LIBDB /* empty */
223
224#define XCHAL_CP6_SA_CONTENTS_LIBDB_NUM 0
225#define XCHAL_CP6_SA_CONTENTS_LIBDB /* empty */
226
227#define XCHAL_CP7_SA_CONTENTS_LIBDB_NUM 0
228#define XCHAL_CP7_SA_CONTENTS_LIBDB /* empty */
229
230
231
232
233
234
235/*----------------------------------------------------------------------
236 MISC
237 ----------------------------------------------------------------------*/
238
239#if 0 /* is there something equivalent for user TIE? */
240#define XCHAL_CORE_ID "linux_be" /* configuration's alphanumeric core identifier
241 (CoreID) set in the Xtensa Processor Generator */
242
243#define XCHAL_BUILD_UNIQUE_ID 0x00003256 /* software build-unique ID (22-bit) */
244
245/* These definitions describe the hardware targeted by this software: */
246#define XCHAL_HW_CONFIGID0 0xC103D1FF /* config ID reg 0 value (upper 32 of 64 bits) */
247#define XCHAL_HW_CONFIGID1 0x00803256 /* config ID reg 1 value (lower 32 of 64 bits) */
248#define XCHAL_CONFIGID0 XCHAL_HW_CONFIGID0 /* for backward compatibility only -- don't use! */
249#define XCHAL_CONFIGID1 XCHAL_HW_CONFIGID1 /* for backward compatibility only -- don't use! */
250#define XCHAL_HW_RELEASE_MAJOR 1050 /* major release of targeted hardware */
251#define XCHAL_HW_RELEASE_MINOR 1 /* minor release of targeted hardware */
252#define XCHAL_HW_RELEASE_NAME "T1050.1" /* full release name of targeted hardware */
253#define XTHAL_HW_REL_T1050 1
254#define XTHAL_HW_REL_T1050_1 1
255#define XCHAL_HW_CONFIGID_RELIABLE 1
256#endif /*0*/
257
258
259
260/*----------------------------------------------------------------------
261 ISA
262 ----------------------------------------------------------------------*/
263
264#if 0 /* these probably don't belong here, but are related to or implemented using TIE */
265#define XCHAL_HAVE_BOOLEANS 0 /* 1 if booleans option configured, 0 otherwise */
266/* Misc instructions: */
267#define XCHAL_HAVE_MUL32 0 /* 1 if 32-bit integer multiply option configured, 0 otherwise */
268#define XCHAL_HAVE_MUL32_HIGH 0 /* 1 if MUL32 option includes MULUH and MULSH, 0 otherwise */
269
270#define XCHAL_HAVE_FP 0 /* 1 if floating point option configured, 0 otherwise */
271#endif /*0*/
272
273
274#endif /*XTENSA_CONFIG_TIE_H*/
275
diff --git a/include/asm-xtensa/xtensa/coreasm.h b/include/asm-xtensa/xtensa/coreasm.h
new file mode 100644
index 000000000000..a8cfb54c20a1
--- /dev/null
+++ b/include/asm-xtensa/xtensa/coreasm.h
@@ -0,0 +1,526 @@
1#ifndef XTENSA_COREASM_H
2#define XTENSA_COREASM_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/coreasm.h -- assembler-specific
8 * definitions that depend on CORE configuration.
9 *
10 * Source for configuration-independent binaries (which link in a
11 * configuration-specific HAL library) must NEVER include this file.
12 * It is perfectly normal, however, for the HAL itself to include this
13 * file.
14 *
15 * This file must NOT include xtensa/config/system.h. Any assembler
16 * header file that depends on system information should likely go in
17 * a new systemasm.h (or sysasm.h) header file.
18 *
19 * NOTE: macro beqi32 is NOT configuration-dependent, and is placed
20 * here til we will have configuration-independent header file.
21 *
22 * This file is subject to the terms and conditions of the GNU General
23 * Public License. See the file "COPYING" in the main directory of
24 * this archive for more details.
25 *
26 * Copyright (C) 2002 Tensilica Inc.
27 */
28
29
30#include <xtensa/config/core.h>
31#include <xtensa/config/specreg.h>
32
33/*
34 * Assembly-language specific definitions (assembly macros, etc.).
35 */
36
37/*----------------------------------------------------------------------
38 * find_ms_setbit
39 *
40 * This macro finds the most significant bit that is set in <as>
41 * and return its index + <base> in <ad>, or <base> - 1 if <as> is zero.
42 * The index counts starting at zero for the lsbit, so the return
43 * value ranges from <base>-1 (no bit set) to <base>+31 (msbit set).
44 *
45 * Parameters:
46 * <ad> destination address register (any register)
47 * <as> source address register
48 * <at> temporary address register (must be different than <as>)
49 * <base> constant value added to result (usually 0 or 1)
50 * On entry:
51 * <ad> = undefined if different than <as>
52 * <as> = value whose most significant set bit is to be found
53 * <at> = undefined
54 * no other registers are used by this macro.
55 * On exit:
56 * <ad> = <base> + index of msbit set in original <as>,
57 * = <base> - 1 if original <as> was zero.
58 * <as> clobbered (if not <ad>)
59 * <at> clobbered (if not <ad>)
60 * Example:
61 * find_ms_setbit a0, a4, a0, 0 -- return in a0 index of msbit set in a4
62 */
63
64 .macro find_ms_setbit ad, as, at, base
65#if XCHAL_HAVE_NSA
66 movi \at, 31+\base
67 nsau \as, \as // get index of \as, numbered from msbit (32 if absent)
68 sub \ad, \at, \as // get numbering from lsbit (0..31, -1 if absent)
69#else /* XCHAL_HAVE_NSA */
70 movi \at, \base // start with result of 0 (point to lsbit of 32)
71
72 beqz \as, 2f // special case for zero argument: return -1
73 bltui \as, 0x10000, 1f // is it one of the 16 lsbits? (if so, check lower 16 bits)
74 addi \at, \at, 16 // no, increment result to upper 16 bits (of 32)
75 //srli \as, \as, 16 // check upper half (shift right 16 bits)
76 extui \as, \as, 16, 16 // check upper half (shift right 16 bits)
771: bltui \as, 0x100, 1f // is it one of the 8 lsbits? (if so, check lower 8 bits)
78 addi \at, \at, 8 // no, increment result to upper 8 bits (of 16)
79 srli \as, \as, 8 // shift right to check upper 8 bits
801: bltui \as, 0x10, 1f // is it one of the 4 lsbits? (if so, check lower 4 bits)
81 addi \at, \at, 4 // no, increment result to upper 4 bits (of 8)
82 srli \as, \as, 4 // shift right 4 bits to check upper half
831: bltui \as, 0x4, 1f // is it one of the 2 lsbits? (if so, check lower 2 bits)
84 addi \at, \at, 2 // no, increment result to upper 2 bits (of 4)
85 srli \as, \as, 2 // shift right 2 bits to check upper half
861: bltui \as, 0x2, 1f // is it the lsbit?
87 addi \at, \at, 2 // no, increment result to upper bit (of 2)
882: addi \at, \at, -1 // (from just above: add 1; from beqz: return -1)
89 //srli \as, \as, 1
901: // done! \at contains index of msbit set (or -1 if none set)
91 .if 0x\ad - 0x\at // destination different than \at ? (works because regs are a0-a15)
92 mov \ad, \at // then move result to \ad
93 .endif
94#endif /* XCHAL_HAVE_NSA */
95 .endm // find_ms_setbit
96
97/*----------------------------------------------------------------------
98 * find_ls_setbit
99 *
100 * This macro finds the least significant bit that is set in <as>,
101 * and return its index in <ad>.
102 * Usage is the same as for the find_ms_setbit macro.
103 * Example:
104 * find_ls_setbit a0, a4, a0, 0 -- return in a0 index of lsbit set in a4
105 */
106
107 .macro find_ls_setbit ad, as, at, base
108 neg \at, \as // keep only the least-significant bit that is set...
109 and \as, \at, \as // ... in \as
110 find_ms_setbit \ad, \as, \at, \base
111 .endm // find_ls_setbit
112
113/*----------------------------------------------------------------------
114 * find_ls_one
115 *
116 * Same as find_ls_setbit with base zero.
117 * Source (as) and destination (ad) registers must be different.
118 * Provided for backward compatibility.
119 */
120
121 .macro find_ls_one ad, as
122 find_ls_setbit \ad, \as, \ad, 0
123 .endm // find_ls_one
124
125/*----------------------------------------------------------------------
126 * floop, floopnez, floopgtz, floopend
127 *
128 * These macros are used for fast inner loops that
129 * work whether or not the Loops options is configured.
130 * If the Loops option is configured, they simply use
131 * the zero-overhead LOOP instructions; otherwise
132 * they use explicit decrement and branch instructions.
133 *
134 * They are used in pairs, with floop, floopnez or floopgtz
135 * at the beginning of the loop, and floopend at the end.
136 *
137 * Each pair of loop macro calls must be given the loop count
138 * address register and a unique label for that loop.
139 *
140 * Example:
141 *
142 * movi a3, 16 // loop 16 times
143 * floop a3, myloop1
144 * :
145 * bnez a7, end1 // exit loop if a7 != 0
146 * :
147 * floopend a3, myloop1
148 * end1:
149 *
150 * Like the LOOP instructions, these macros cannot be
151 * nested, must include at least one instruction,
152 * cannot call functions inside the loop, etc.
153 * The loop can be exited by jumping to the instruction
154 * following floopend (or elsewhere outside the loop),
155 * or continued by jumping to a NOP instruction placed
156 * immediately before floopend.
157 *
158 * Unlike LOOP instructions, the register passed to floop*
159 * cannot be used inside the loop, because it is used as
160 * the loop counter if the Loops option is not configured.
161 * And its value is undefined after exiting the loop.
162 * And because the loop counter register is active inside
163 * the loop, you can't easily use this construct to loop
164 * across a register file using ROTW as you might with LOOP
165 * instructions, unless you copy the loop register along.
166 */
167
168 /* Named label version of the macros: */
169
170 .macro floop ar, endlabel
171 floop_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
172 .endm
173
174 .macro floopnez ar, endlabel
175 floopnez_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
176 .endm
177
178 .macro floopgtz ar, endlabel
179 floopgtz_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
180 .endm
181
182 .macro floopend ar, endlabel
183 floopend_ \ar, .Lfloopstart_\endlabel, .Lfloopend_\endlabel
184 .endm
185
186 /* Numbered local label version of the macros: */
187#if 0 /*UNTESTED*/
188 .macro floop89 ar
189 floop_ \ar, 8, 9f
190 .endm
191
192 .macro floopnez89 ar
193 floopnez_ \ar, 8, 9f
194 .endm
195
196 .macro floopgtz89 ar
197 floopgtz_ \ar, 8, 9f
198 .endm
199
200 .macro floopend89 ar
201 floopend_ \ar, 8b, 9
202 .endm
203#endif /*0*/
204
205 /* Underlying version of the macros: */
206
207 .macro floop_ ar, startlabel, endlabelref
208 .ifdef _infloop_
209 .if _infloop_
210 .err // Error: floop cannot be nested
211 .endif
212 .endif
213 .set _infloop_, 1
214#if XCHAL_HAVE_LOOPS
215 loop \ar, \endlabelref
216#else /* XCHAL_HAVE_LOOPS */
217\startlabel:
218 addi \ar, \ar, -1
219#endif /* XCHAL_HAVE_LOOPS */
220 .endm // floop_
221
222 .macro floopnez_ ar, startlabel, endlabelref
223 .ifdef _infloop_
224 .if _infloop_
225 .err // Error: floopnez cannot be nested
226 .endif
227 .endif
228 .set _infloop_, 1
229#if XCHAL_HAVE_LOOPS
230 loopnez \ar, \endlabelref
231#else /* XCHAL_HAVE_LOOPS */
232 beqz \ar, \endlabelref
233\startlabel:
234 addi \ar, \ar, -1
235#endif /* XCHAL_HAVE_LOOPS */
236 .endm // floopnez_
237
238 .macro floopgtz_ ar, startlabel, endlabelref
239 .ifdef _infloop_
240 .if _infloop_
241 .err // Error: floopgtz cannot be nested
242 .endif
243 .endif
244 .set _infloop_, 1
245#if XCHAL_HAVE_LOOPS
246 loopgtz \ar, \endlabelref
247#else /* XCHAL_HAVE_LOOPS */
248 bltz \ar, \endlabelref
249 beqz \ar, \endlabelref
250\startlabel:
251 addi \ar, \ar, -1
252#endif /* XCHAL_HAVE_LOOPS */
253 .endm // floopgtz_
254
255
256 .macro floopend_ ar, startlabelref, endlabel
257 .ifndef _infloop_
258 .err // Error: floopend without matching floopXXX
259 .endif
260 .ifeq _infloop_
261 .err // Error: floopend without matching floopXXX
262 .endif
263 .set _infloop_, 0
264#if ! XCHAL_HAVE_LOOPS
265 bnez \ar, \startlabelref
266#endif /* XCHAL_HAVE_LOOPS */
267\endlabel:
268 .endm // floopend_
269
270/*----------------------------------------------------------------------
271 * crsil -- conditional RSIL (read/set interrupt level)
272 *
273 * Executes the RSIL instruction if it exists, else just reads PS.
274 * The RSIL instruction does not exist in the new exception architecture
275 * if the interrupt option is not selected.
276 */
277
278 .macro crsil ar, newlevel
279#if XCHAL_HAVE_OLD_EXC_ARCH || XCHAL_HAVE_INTERRUPTS
280 rsil \ar, \newlevel
281#else
282 rsr \ar, PS
283#endif
284 .endm // crsil
285
286/*----------------------------------------------------------------------
287 * window_spill{4,8,12}
288 *
289 * These macros spill callers' register windows to the stack.
290 * They work for both privileged and non-privileged tasks.
291 * Must be called from a windowed ABI context, eg. within
292 * a windowed ABI function (ie. valid stack frame, window
293 * exceptions enabled, not in exception mode, etc).
294 *
295 * This macro requires a single invocation of the window_spill_common
296 * macro in the same assembly unit and section.
297 *
298 * Note that using window_spill{4,8,12} macros is more efficient
299 * than calling a function implemented using window_spill_function,
300 * because the latter needs extra code to figure out the size of
301 * the call to the spilling function.
302 *
303 * Example usage:
304 *
305 * .text
306 * .align 4
307 * .global some_function
308 * .type some_function,@function
309 * some_function:
310 * entry a1, 16
311 * :
312 * :
313 *
314 * window_spill4 // spill windows of some_function's callers; preserves a0..a3 only;
315 * // to use window_spill{8,12} in this example function we'd have
316 * // to increase space allocated by the entry instruction, because
317 * // 16 bytes only allows call4; 32 or 48 bytes (+locals) are needed
318 * // for call8/window_spill8 or call12/window_spill12 respectively.
319 * :
320 *
321 * retw
322 *
323 * window_spill_common // instantiates code used by window_spill4
324 *
325 *
326 * On entry:
327 * none (if window_spill4)
328 * stack frame has enough space allocated for call8 (if window_spill8)
329 * stack frame has enough space allocated for call12 (if window_spill12)
330 * On exit:
331 * a4..a15 clobbered (if window_spill4)
332 * a8..a15 clobbered (if window_spill8)
333 * a12..a15 clobbered (if window_spill12)
334 * no caller windows are in live registers
335 */
336
337 .macro window_spill4
338#if XCHAL_HAVE_WINDOWED
339# if XCHAL_NUM_AREGS == 16
340 movi a15, 0 // for 16-register files, no need to call to reach the end
341# elif XCHAL_NUM_AREGS == 32
342 call4 .L__wdwspill_assist28 // call deep enough to clear out any live callers
343# elif XCHAL_NUM_AREGS == 64
344 call4 .L__wdwspill_assist60 // call deep enough to clear out any live callers
345# endif
346#endif
347 .endm // window_spill4
348
349 .macro window_spill8
350#if XCHAL_HAVE_WINDOWED
351# if XCHAL_NUM_AREGS == 16
352 movi a15, 0 // for 16-register files, no need to call to reach the end
353# elif XCHAL_NUM_AREGS == 32
354 call8 .L__wdwspill_assist24 // call deep enough to clear out any live callers
355# elif XCHAL_NUM_AREGS == 64
356 call8 .L__wdwspill_assist56 // call deep enough to clear out any live callers
357# endif
358#endif
359 .endm // window_spill8
360
361 .macro window_spill12
362#if XCHAL_HAVE_WINDOWED
363# if XCHAL_NUM_AREGS == 16
364 movi a15, 0 // for 16-register files, no need to call to reach the end
365# elif XCHAL_NUM_AREGS == 32
366 call12 .L__wdwspill_assist20 // call deep enough to clear out any live callers
367# elif XCHAL_NUM_AREGS == 64
368 call12 .L__wdwspill_assist52 // call deep enough to clear out any live callers
369# endif
370#endif
371 .endm // window_spill12
372
373/*----------------------------------------------------------------------
374 * window_spill_function
375 *
376 * This macro outputs a function that will spill its caller's callers'
377 * register windows to the stack. Eg. it could be used to implement
378 * a version of xthal_window_spill() that works in non-privileged tasks.
379 * This works for both privileged and non-privileged tasks.
380 *
381 * Typical usage:
382 *
383 * .text
384 * .align 4
385 * .global my_spill_function
386 * .type my_spill_function,@function
387 * my_spill_function:
388 * window_spill_function
389 *
390 * On entry to resulting function:
391 * none
392 * On exit from resulting function:
393 * none (no caller windows are in live registers)
394 */
395
396 .macro window_spill_function
397#if XCHAL_HAVE_WINDOWED
398# if XCHAL_NUM_AREGS == 32
399 entry sp, 48
400 bbci.l a0, 31, 1f // branch if called with call4
401 bbsi.l a0, 30, 2f // branch if called with call12
402 call8 .L__wdwspill_assist16 // called with call8, only need another 8
403 retw
4041: call12 .L__wdwspill_assist16 // called with call4, only need another 12
405 retw
4062: call4 .L__wdwspill_assist16 // called with call12, only need another 4
407 retw
408# elif XCHAL_NUM_AREGS == 64
409 entry sp, 48
410 bbci.l a0, 31, 1f // branch if called with call4
411 bbsi.l a0, 30, 2f // branch if called with call12
412 call4 .L__wdwspill_assist52 // called with call8, only need a call4
413 retw
4141: call8 .L__wdwspill_assist52 // called with call4, only need a call8
415 retw
4162: call12 .L__wdwspill_assist40 // called with call12, can skip a call12
417 retw
418# elif XCHAL_NUM_AREGS == 16
419 entry sp, 16
420 bbci.l a0, 31, 1f // branch if called with call4
421 bbsi.l a0, 30, 2f // branch if called with call12
422 movi a7, 0 // called with call8
423 retw
4241: movi a11, 0 // called with call4
4252: retw // if called with call12, everything already spilled
426
427// movi a15, 0 // trick to spill all but the direct caller
428// j 1f
429// // The entry instruction is magical in the assembler (gets auto-aligned)
430// // so we have to jump to it to avoid falling through the padding.
431// // We need entry/retw to know where to return.
432//1: entry sp, 16
433// retw
434# else
435# error "unrecognized address register file size"
436# endif
437#endif /* XCHAL_HAVE_WINDOWED */
438 window_spill_common
439 .endm // window_spill_function
440
441/*----------------------------------------------------------------------
442 * window_spill_common
443 *
444 * Common code used by any number of invocations of the window_spill##
445 * and window_spill_function macros.
446 *
447 * Must be instantiated exactly once within a given assembly unit,
448 * within call/j range of and same section as window_spill##
449 * macro invocations for that assembly unit.
450 * (Is automatically instantiated by the window_spill_function macro.)
451 */
452
453 .macro window_spill_common
454#if XCHAL_HAVE_WINDOWED && (XCHAL_NUM_AREGS == 32 || XCHAL_NUM_AREGS == 64)
455 .ifndef .L__wdwspill_defined
456# if XCHAL_NUM_AREGS >= 64
457.L__wdwspill_assist60:
458 entry sp, 32
459 call8 .L__wdwspill_assist52
460 retw
461.L__wdwspill_assist56:
462 entry sp, 16
463 call4 .L__wdwspill_assist52
464 retw
465.L__wdwspill_assist52:
466 entry sp, 48
467 call12 .L__wdwspill_assist40
468 retw
469.L__wdwspill_assist40:
470 entry sp, 48
471 call12 .L__wdwspill_assist28
472 retw
473# endif
474.L__wdwspill_assist28:
475 entry sp, 48
476 call12 .L__wdwspill_assist16
477 retw
478.L__wdwspill_assist24:
479 entry sp, 32
480 call8 .L__wdwspill_assist16
481 retw
482.L__wdwspill_assist20:
483 entry sp, 16
484 call4 .L__wdwspill_assist16
485 retw
486.L__wdwspill_assist16:
487 entry sp, 16
488 movi a15, 0
489 retw
490 .set .L__wdwspill_defined, 1
491 .endif
492#endif /* XCHAL_HAVE_WINDOWED with 32 or 64 aregs */
493 .endm // window_spill_common
494
495/*----------------------------------------------------------------------
496 * beqi32
497 *
498 * macro implements version of beqi for arbitrary 32-bit immidiate value
499 *
500 * beqi32 ax, ay, imm32, label
501 *
502 * Compares value in register ax with imm32 value and jumps to label if
503 * equal. Clobberes register ay if needed
504 *
505 */
506 .macro beqi32 ax, ay, imm, label
507 .ifeq ((\imm-1) & ~7) // 1..8 ?
508 beqi \ax, \imm, \label
509 .else
510 .ifeq (\imm+1) // -1 ?
511 beqi \ax, \imm, \label
512 .else
513 .ifeq (\imm) // 0 ?
514 beqz \ax, \label
515 .else
516 // We could also handle immediates 10,12,16,32,64,128,256
517 // but it would be a long macro...
518 movi \ay, \imm
519 beq \ax, \ay, \label
520 .endif
521 .endif
522 .endif
523 .endm // beqi32
524
525#endif /*XTENSA_COREASM_H*/
526
diff --git a/include/asm-xtensa/xtensa/corebits.h b/include/asm-xtensa/xtensa/corebits.h
new file mode 100644
index 000000000000..e578ade41632
--- /dev/null
+++ b/include/asm-xtensa/xtensa/corebits.h
@@ -0,0 +1,77 @@
1#ifndef XTENSA_COREBITS_H
2#define XTENSA_COREBITS_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * xtensa/corebits.h - Xtensa Special Register field positions and masks.
8 *
9 * (In previous releases, these were defined in specreg.h, a generated file.
10 * This file is not generated, i.e. it is processor configuration independent.)
11 */
12
13
14/* EXCCAUSE register fields: */
15#define EXCCAUSE_EXCCAUSE_SHIFT 0
16#define EXCCAUSE_EXCCAUSE_MASK 0x3F
17/* Exception causes (mostly incomplete!): */
18#define EXCCAUSE_ILLEGAL 0
19#define EXCCAUSE_SYSCALL 1
20#define EXCCAUSE_IFETCHERROR 2
21#define EXCCAUSE_LOADSTOREERROR 3
22#define EXCCAUSE_LEVEL1INTERRUPT 4
23#define EXCCAUSE_ALLOCA 5
24
25/* PS register fields: */
26#define PS_WOE_SHIFT 18
27#define PS_WOE_MASK 0x00040000
28#define PS_WOE PS_WOE_MASK
29#define PS_CALLINC_SHIFT 16
30#define PS_CALLINC_MASK 0x00030000
31#define PS_CALLINC(n) (((n)&3)<<PS_CALLINC_SHIFT) /* n = 0..3 */
32#define PS_OWB_SHIFT 8
33#define PS_OWB_MASK 0x00000F00
34#define PS_OWB(n) (((n)&15)<<PS_OWB_SHIFT) /* n = 0..15 (or 0..7) */
35#define PS_RING_SHIFT 6
36#define PS_RING_MASK 0x000000C0
37#define PS_RING(n) (((n)&3)<<PS_RING_SHIFT) /* n = 0..3 */
38#define PS_UM_SHIFT 5
39#define PS_UM_MASK 0x00000020
40#define PS_UM PS_UM_MASK
41#define PS_EXCM_SHIFT 4
42#define PS_EXCM_MASK 0x00000010
43#define PS_EXCM PS_EXCM_MASK
44#define PS_INTLEVEL_SHIFT 0
45#define PS_INTLEVEL_MASK 0x0000000F
46#define PS_INTLEVEL(n) ((n)&PS_INTLEVEL_MASK) /* n = 0..15 */
47/* Backward compatibility (deprecated): */
48#define PS_PROGSTACK_SHIFT PS_UM_SHIFT
49#define PS_PROGSTACK_MASK PS_UM_MASK
50#define PS_PROG_SHIFT PS_UM_SHIFT
51#define PS_PROG_MASK PS_UM_MASK
52#define PS_PROG PS_UM
53
54/* DBREAKCn register fields: */
55#define DBREAKC_MASK_SHIFT 0
56#define DBREAKC_MASK_MASK 0x0000003F
57#define DBREAKC_LOADBREAK_SHIFT 30
58#define DBREAKC_LOADBREAK_MASK 0x40000000
59#define DBREAKC_STOREBREAK_SHIFT 31
60#define DBREAKC_STOREBREAK_MASK 0x80000000
61
62/* DEBUGCAUSE register fields: */
63#define DEBUGCAUSE_DEBUGINT_SHIFT 5
64#define DEBUGCAUSE_DEBUGINT_MASK 0x20 /* debug interrupt */
65#define DEBUGCAUSE_BREAKN_SHIFT 4
66#define DEBUGCAUSE_BREAKN_MASK 0x10 /* BREAK.N instruction */
67#define DEBUGCAUSE_BREAK_SHIFT 3
68#define DEBUGCAUSE_BREAK_MASK 0x08 /* BREAK instruction */
69#define DEBUGCAUSE_DBREAK_SHIFT 2
70#define DEBUGCAUSE_DBREAK_MASK 0x04 /* DBREAK match */
71#define DEBUGCAUSE_IBREAK_SHIFT 1
72#define DEBUGCAUSE_IBREAK_MASK 0x02 /* IBREAK match */
73#define DEBUGCAUSE_ICOUNT_SHIFT 0
74#define DEBUGCAUSE_ICOUNT_MASK 0x01 /* ICOUNT would increment to zero */
75
76#endif /*XTENSA_COREBITS_H*/
77
diff --git a/include/asm-xtensa/xtensa/hal.h b/include/asm-xtensa/xtensa/hal.h
new file mode 100644
index 000000000000..d10472505454
--- /dev/null
+++ b/include/asm-xtensa/xtensa/hal.h
@@ -0,0 +1,822 @@
1#ifndef XTENSA_HAL_H
2#define XTENSA_HAL_H
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/hal.h -- contains a definition of the
8 * Core HAL interface.
9 *
10 * All definitions in this header file are independent of any specific
11 * Xtensa processor configuration. Thus an OS or other software can
12 * include this header file and be compiled into configuration-
13 * independent objects that can be distributed and eventually linked
14 * to the HAL library (libhal.a) to create a configuration-specific
15 * final executable.
16 *
17 * Certain definitions, however, are release-specific -- such as the
18 * XTHAL_RELEASE_xxx macros (or additions made in later releases).
19 *
20 * This file is subject to the terms and conditions of the GNU General Public
21 * License. See the file "COPYING" in the main directory of this archive
22 * for more details.
23 *
24 * Copyright (C) 2002 Tensilica Inc.
25 */
26
27
28/*----------------------------------------------------------------------
29 Constant Definitions
30 (shared with assembly)
31 ----------------------------------------------------------------------*/
32
33/* Software release information (not configuration-specific!): */
34#define XTHAL_RELEASE_MAJOR 1050
35#define XTHAL_RELEASE_MINOR 0
36#define XTHAL_RELEASE_NAME "T1050.0-2002-08-06-eng0"
37#define XTHAL_RELEASE_INTERNAL "2002-08-06-eng0"
38#define XTHAL_REL_T1050 1
39#define XTHAL_REL_T1050_0 1
40#define XTHAL_REL_T1050_0_2002 1
41#define XTHAL_REL_T1050_0_2002_08 1
42#define XTHAL_REL_T1050_0_2002_08_06 1
43#define XTHAL_REL_T1050_0_2002_08_06_ENG0 1
44
45/* HAL version numbers (these names are for backward compatibility): */
46#define XTHAL_MAJOR_REV XTHAL_RELEASE_MAJOR
47#define XTHAL_MINOR_REV XTHAL_RELEASE_MINOR
48/*
49 * A bit of software release history on values of XTHAL_{MAJOR,MINOR}_REV:
50 *
51 * Release MAJOR MINOR Comment
52 * ======= ===== ===== =======
53 * T1015.n n/a n/a (HAL not yet available)
54 * T1020.{0,1,2} 0 1 (HAL beta)
55 * T1020.{3,4} 0 2 First release.
56 * T1020.n (n>4) 0 2 or >3 (TBD)
57 * T1030.0 0 1 (HAL beta)
58 * T1030.{1,2} 0 3 Equivalent to first release.
59 * T1030.n (n>=3) 0 >= 3 (TBD)
60 * T1040.n 1040 n Full CHAL available from T1040.2
61 * T1050.n 1050 n Current release.
62 *
63 *
64 * Note: there is a distinction between the software release with
65 * which something is compiled (accessible using XTHAL_RELEASE_* macros)
66 * and the software release with which the HAL library was compiled
67 * (accessible using Xthal_release_* global variables). This
68 * distinction is particularly relevant for vendors that distribute
69 * configuration-independent binaries (eg. an OS), where their customer
70 * might link it with a HAL of a different Xtensa software release.
71 * In this case, it may be appropriate for the OS to verify at run-time
72 * whether XTHAL_RELEASE_* and Xthal_release_* are compatible.
73 * [Guidelines as to which release is compatible with which are not
74 * currently provided explicitly, but might be inferred from reading
75 * OSKit documentation for all releases -- compatibility is also highly
76 * dependent on which HAL features are used. Each release is usually
77 * backward compatible, with very few exceptions if any.]
78 *
79 * Notes:
80 * Tornado 2.0 supported in T1020.3+, T1030.1+, and T1040.{0,1} only.
81 * Tornado 2.0.2 supported in T1040.2+, and T1050.
82 * Compile-time HAL port of NucleusPlus supported by T1040.2+ and T1050.
83 */
84
85
86/*
87 * Architectural limits, independent of configuration.
88 * Note that these are ISA-defined limits, not micro-architecture implementation
89 * limits enforced by the Xtensa Processor Generator (which may be stricter than
90 * these below).
91 */
92#define XTHAL_MAX_CPS 8 /* max number of coprocessors (0..7) */
93#define XTHAL_MAX_INTERRUPTS 32 /* max number of interrupts (0..31) */
94#define XTHAL_MAX_INTLEVELS 16 /* max number of interrupt levels (0..15) */
95 /* (as of T1040, implementation limit is 7: 0..6) */
96#define XTHAL_MAX_TIMERS 4 /* max number of timers (CCOMPARE0..CCOMPARE3) */
97 /* (as of T1040, implementation limit is 3: 0..2) */
98
99/* Misc: */
100#define XTHAL_LITTLEENDIAN 0
101#define XTHAL_BIGENDIAN 1
102
103
104/* Interrupt types: */
105#define XTHAL_INTTYPE_UNCONFIGURED 0
106#define XTHAL_INTTYPE_SOFTWARE 1
107#define XTHAL_INTTYPE_EXTERN_EDGE 2
108#define XTHAL_INTTYPE_EXTERN_LEVEL 3
109#define XTHAL_INTTYPE_TIMER 4
110#define XTHAL_INTTYPE_NMI 5
111#define XTHAL_MAX_INTTYPES 6 /* number of interrupt types */
112
113/* Timer related: */
114#define XTHAL_TIMER_UNCONFIGURED -1 /* Xthal_timer_interrupt[] value for non-existent timers */
115#define XTHAL_TIMER_UNASSIGNED XTHAL_TIMER_UNCONFIGURED /* (for backwards compatibility only) */
116
117
118/* Access Mode bits (tentative): */ /* bit abbr unit short_name PPC equ - Description */
119#define XTHAL_AMB_EXCEPTION 0 /* 001 E EX fls: EXception none - generate exception on any access (aka "illegal") */
120#define XTHAL_AMB_HITCACHE 1 /* 002 C CH fls: use Cache on Hit ~(I CI) - use cache on hit -- way from tag match [or H HC, or U UC] (ISA: same, except for Isolate case) */
121#define XTHAL_AMB_ALLOCATE 2 /* 004 A AL fl?: ALlocate none - refill cache on miss -- way from LRU [or F FI fill] (ISA: Read/Write Miss Refill) */
122#define XTHAL_AMB_WRITETHRU 3 /* 008 W WT --s: WriteThrough W WT - store immediately to memory (ISA: same) */
123#define XTHAL_AMB_ISOLATE 4 /* 010 I IS fls: ISolate none - use cache regardless of hit-vs-miss -- way from vaddr (ISA: use-cache-on-miss+hit) */
124#define XTHAL_AMB_GUARD 5 /* 020 G GU ?l?: GUard G * - non-speculative; spec/replay refs not permitted */
125#if 0
126#define XTHAL_AMB_ORDERED x /* 000 O OR fls: ORdered G * - mem accesses cannot be out of order */
127#define XTHAL_AMB_FUSEWRITES x /* 000 F FW --s: FuseWrites none - allow combining/merging multiple writes (to same datapath data unit) into one (implied by writeback) */
128#define XTHAL_AMB_COHERENT x /* 000 M MC fl?: Mem/MP Coherent M - on reads, other CPUs/bus-masters may need to supply data */
129#define XTHAL_AMB_TRUSTED x /* 000 T TR ?l?: TRusted none - memory will not bus error (if it does, handle as fatal imprecise interrupt) */
130#define XTHAL_AMB_PREFETCH x /* 000 P PR fl?: PRefetch none - on refill, read line+1 into prefetch buffers */
131#define XTHAL_AMB_STREAM x /* 000 S ST ???: STreaming none - access one of N stream buffers */
132#endif /*0*/
133
134#define XTHAL_AM_EXCEPTION (1<<XTHAL_AMB_EXCEPTION)
135#define XTHAL_AM_HITCACHE (1<<XTHAL_AMB_HITCACHE)
136#define XTHAL_AM_ALLOCATE (1<<XTHAL_AMB_ALLOCATE)
137#define XTHAL_AM_WRITETHRU (1<<XTHAL_AMB_WRITETHRU)
138#define XTHAL_AM_ISOLATE (1<<XTHAL_AMB_ISOLATE)
139#define XTHAL_AM_GUARD (1<<XTHAL_AMB_GUARD)
140#if 0
141#define XTHAL_AM_ORDERED (1<<XTHAL_AMB_ORDERED)
142#define XTHAL_AM_FUSEWRITES (1<<XTHAL_AMB_FUSEWRITES)
143#define XTHAL_AM_COHERENT (1<<XTHAL_AMB_COHERENT)
144#define XTHAL_AM_TRUSTED (1<<XTHAL_AMB_TRUSTED)
145#define XTHAL_AM_PREFETCH (1<<XTHAL_AMB_PREFETCH)
146#define XTHAL_AM_STREAM (1<<XTHAL_AMB_STREAM)
147#endif /*0*/
148
149/*
150 * Allowed Access Modes (bit combinations).
151 *
152 * Columns are:
153 * "FOGIWACE"
154 * Access mode bits (see XTHAL_AMB_xxx above).
155 * <letter> = bit is set
156 * '-' = bit is clear
157 * '.' = bit is irrelevant / don't care, as follows:
158 * E=1 makes all others irrelevant
159 * W,F relevant only for stores
160 * "2345"
161 * Indicates which Xtensa releases support the corresponding
162 * access mode. Releases for each character column are:
163 * 2 = prior to T1020.2: T1015 (V1.5), T1020.0, T1020.1
164 * 3 = T1020.2 and later: T1020.2+, T1030
165 * 4 = T1040
166 * 5 = T1050 (maybe)
167 * And the character column contents are:
168 * <number> = support by release(s)
169 * "." = unsupported by release(s)
170 * "?" = support unknown
171 */
172 /* FOGIWACE 2345 */
173/* For instruction fetch: */
174#define XTHAL_FAM_EXCEPTION 0x001 /* .......E 2345 exception */
175#define XTHAL_FAM_ISOLATE 0x012 /* .--I.-C- .... isolate */
176#define XTHAL_FAM_BYPASS 0x000 /* .---.--- 2345 bypass */
177#define XTHAL_FAM_NACACHED 0x002 /* .---.-C- .... cached no-allocate (frozen) */
178#define XTHAL_FAM_CACHED 0x006 /* .---.AC- 2345 cached */
179/* For data load: */
180#define XTHAL_LAM_EXCEPTION 0x001 /* .......E 2345 exception */
181#define XTHAL_LAM_ISOLATE 0x012 /* .--I.-C- 2345 isolate */
182#define XTHAL_LAM_BYPASS 0x000 /* .O--.--- 2... bypass speculative */
183#define XTHAL_LAM_BYPASSG 0x020 /* .OG-.--- .345 bypass guarded */
184#define XTHAL_LAM_NACACHED 0x002 /* .O--.-C- 2... cached no-allocate speculative */
185#define XTHAL_LAM_NACACHEDG 0x022 /* .OG-.-C- .345 cached no-allocate guarded */
186#define XTHAL_LAM_CACHED 0x006 /* .---.AC- 2345 cached speculative */
187#define XTHAL_LAM_CACHEDG 0x026 /* .?G-.AC- .... cached guarded */
188/* For data store: */
189#define XTHAL_SAM_EXCEPTION 0x001 /* .......E 2345 exception */
190#define XTHAL_SAM_ISOLATE 0x032 /* .-GI--C- 2345 isolate */
191#define XTHAL_SAM_BYPASS 0x028 /* -OG-W--- 2345 bypass */
192/*efine XTHAL_SAM_BYPASSF 0x028*/ /* F-G-W--- ...? bypass write-combined */
193#define XTHAL_SAM_WRITETHRU 0x02A /* -OG-W-C- 234? writethrough */
194/*efine XTHAL_SAM_WRITETHRUF 0x02A*/ /* F-G-W-C- ...5 writethrough write-combined */
195#define XTHAL_SAM_WRITEALLOC 0x02E /* -OG-WAC- ...? writethrough-allocate */
196/*efine XTHAL_SAM_WRITEALLOCF 0x02E*/ /* F-G-WAC- ...? writethrough-allocate write-combined */
197#define XTHAL_SAM_WRITEBACK 0x026 /* F-G--AC- ...5 writeback */
198
199#if 0
200/*
201 Cache attribute encoding for CACHEATTR (per ISA):
202 (Note: if this differs from ISA Ref Manual, ISA has precedence)
203
204 Inst-fetches Loads Stores
205 ------------- ------------ -------------
2060x0 FCA_EXCEPTION ?LCA_NACACHED_G* SCA_WRITETHRU "uncached"
2070x1 FCA_CACHED LCA_CACHED SCA_WRITETHRU cached
2080x2 FCA_BYPASS LCA_BYPASS_G* SCA_BYPASS bypass
2090x3 FCA_CACHED LCA_CACHED SCA_WRITEALLOCF write-allocate
210 or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented)
2110x4 FCA_CACHED LCA_CACHED SCA_WRITEBACK write-back
212 or LCA_EXCEPTION SCA_EXCEPTION (if unimplemented)
2130x5..D FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION (reserved)
2140xE FCA_EXCEPTION LCA_ISOLATE SCA_ISOLATE isolate
2150xF FCA_EXCEPTION LCA_EXCEPTION SCA_EXCEPTION illegal
216 * Prior to T1020.2?, guard feature not supported, this defaulted to speculative (no _G)
217*/
218#endif /*0*/
219
220
221#if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE)
222#ifdef __cplusplus
223extern "C" {
224#endif
225
226/*----------------------------------------------------------------------
227 HAL
228 ----------------------------------------------------------------------*/
229
230/* Constant to be checked in build = (XTHAL_MAJOR_REV<<16)|XTHAL_MINOR_REV */
231extern const unsigned int Xthal_rev_no;
232
233
234/*----------------------------------------------------------------------
235 Processor State
236 ----------------------------------------------------------------------*/
237/* save & restore the extra processor state */
238extern void xthal_save_extra(void *base);
239extern void xthal_restore_extra(void *base);
240
241extern void xthal_save_cpregs(void *base, int);
242extern void xthal_restore_cpregs(void *base, int);
243
244/*extern void xthal_save_all_extra(void *base);*/
245/*extern void xthal_restore_all_extra(void *base);*/
246
247/* space for processor state */
248extern const unsigned int Xthal_extra_size;
249extern const unsigned int Xthal_extra_align;
250/* space for TIE register files */
251extern const unsigned int Xthal_cpregs_size[XTHAL_MAX_CPS];
252extern const unsigned int Xthal_cpregs_align[XTHAL_MAX_CPS];
253
254/* total of space for the processor state (for Tor2) */
255extern const unsigned int Xthal_all_extra_size;
256extern const unsigned int Xthal_all_extra_align;
257
258/* initialize the extra processor */
259/*extern void xthal_init_extra(void);*/
260/* initialize the TIE coprocessor */
261/*extern void xthal_init_cp(int);*/
262
263/* initialize the extra processor */
264extern void xthal_init_mem_extra(void *);
265/* initialize the TIE coprocessor */
266extern void xthal_init_mem_cp(void *, int);
267
268/* validate & invalidate the TIE register file */
269extern void xthal_validate_cp(int);
270extern void xthal_invalidate_cp(int);
271
272/* the number of TIE coprocessors contiguous from zero (for Tor2) */
273extern const unsigned int Xthal_num_coprocessors;
274
275/* actual number of coprocessors */
276extern const unsigned char Xthal_cp_num;
277/* index of highest numbered coprocessor, plus one */
278extern const unsigned char Xthal_cp_max;
279/* index of highest allowed coprocessor number, per cfg, plus one */
280/*extern const unsigned char Xthal_cp_maxcfg;*/
281/* bitmask of which coprocessors are present */
282extern const unsigned int Xthal_cp_mask;
283
284/* read and write cpenable register */
285extern void xthal_set_cpenable(unsigned);
286extern unsigned xthal_get_cpenable(void);
287
288/* read & write extra state register */
289/*extern int xthal_read_extra(void *base, unsigned reg, unsigned *value);*/
290/*extern int xthal_write_extra(void *base, unsigned reg, unsigned value);*/
291
292/* read & write a TIE coprocessor register */
293/*extern int xthal_read_cpreg(void *base, int cp, unsigned reg, unsigned *value);*/
294/*extern int xthal_write_cpreg(void *base, int cp, unsigned reg, unsigned value);*/
295
296/* return coprocessor number based on register */
297/*extern int xthal_which_cp(unsigned reg);*/
298
299/*----------------------------------------------------------------------
300 Interrupts
301 ----------------------------------------------------------------------*/
302
303/* the number of interrupt levels */
304extern const unsigned char Xthal_num_intlevels;
305/* the number of interrupts */
306extern const unsigned char Xthal_num_interrupts;
307
308/* mask for level of interrupts */
309extern const unsigned int Xthal_intlevel_mask[XTHAL_MAX_INTLEVELS];
310/* mask for level 0 to N interrupts */
311extern const unsigned int Xthal_intlevel_andbelow_mask[XTHAL_MAX_INTLEVELS];
312
313/* level of each interrupt */
314extern const unsigned char Xthal_intlevel[XTHAL_MAX_INTERRUPTS];
315
316/* type per interrupt */
317extern const unsigned char Xthal_inttype[XTHAL_MAX_INTERRUPTS];
318
319/* masks of each type of interrupt */
320extern const unsigned int Xthal_inttype_mask[XTHAL_MAX_INTTYPES];
321
322/* interrupt numbers assigned to each timer interrupt */
323extern const int Xthal_timer_interrupt[XTHAL_MAX_TIMERS];
324
325/*** Virtual interrupt prioritization: ***/
326
327/* Convert between interrupt levels (as per PS.INTLEVEL) and virtual interrupt priorities: */
328extern unsigned xthal_vpri_to_intlevel(unsigned vpri);
329extern unsigned xthal_intlevel_to_vpri(unsigned intlevel);
330
331/* Enables/disables given set (mask) of interrupts; returns previous enabled-mask of all ints: */
332extern unsigned xthal_int_enable(unsigned);
333extern unsigned xthal_int_disable(unsigned);
334
335/* Set/get virtual priority of an interrupt: */
336extern int xthal_set_int_vpri(int intnum, int vpri);
337extern int xthal_get_int_vpri(int intnum);
338
339/* Set/get interrupt lockout level for exclusive access to virtual priority data structures: */
340extern void xthal_set_vpri_locklevel(unsigned intlevel);
341extern unsigned xthal_get_vpri_locklevel(void);
342
343/* Set/get current virtual interrupt priority: */
344extern unsigned xthal_set_vpri(unsigned vpri);
345extern unsigned xthal_get_vpri(unsigned vpri);
346extern unsigned xthal_set_vpri_intlevel(unsigned intlevel);
347extern unsigned xthal_set_vpri_lock(void);
348
349
350
351/*----------------------------------------------------------------------
352 Generic Interrupt Trampolining Support
353 ----------------------------------------------------------------------*/
354
355typedef void (XtHalVoidFunc)(void);
356
357/*
358 * Bitmask of interrupts currently trampolining down:
359 */
360extern unsigned Xthal_tram_pending;
361
362/*
363 * Bitmask of which interrupts currently trampolining down
364 * synchronously are actually enabled; this bitmask is necessary
365 * because INTENABLE cannot hold that state (sync-trampolining
366 * interrupts must be kept disabled while trampolining);
367 * in the current implementation, any bit set here is not set
368 * in INTENABLE, and vice-versa; once a sync-trampoline is
369 * handled (at level one), its enable bit must be moved from
370 * here to INTENABLE:
371 */
372extern unsigned Xthal_tram_enabled;
373
374/*
375 * Bitmask of interrupts configured for sync trampolining:
376 */
377extern unsigned Xthal_tram_sync;
378
379
380/* Trampoline support functions: */
381extern unsigned xthal_tram_pending_to_service( void );
382extern void xthal_tram_done( unsigned serviced_mask );
383extern int xthal_tram_set_sync( int intnum, int sync );
384extern XtHalVoidFunc* xthal_set_tram_trigger_func( XtHalVoidFunc *trigger_fn );
385
386/* INTENABLE,INTREAD,INTSET,INTCLEAR register access functions: */
387extern unsigned xthal_get_intenable( void );
388extern void xthal_set_intenable( unsigned );
389extern unsigned xthal_get_intread( void );
390extern void xthal_set_intset( unsigned );
391extern void xthal_set_intclear( unsigned );
392
393
394/*----------------------------------------------------------------------
395 Register Windows
396 ----------------------------------------------------------------------*/
397
398/* number of registers in register window */
399extern const unsigned int Xthal_num_aregs;
400extern const unsigned char Xthal_num_aregs_log2;
401
402/* This spill any live register windows (other than the caller's): */
403extern void xthal_window_spill( void );
404
405
406/*----------------------------------------------------------------------
407 Cache
408 ----------------------------------------------------------------------*/
409
410/* size of the cache lines in log2(bytes) */
411extern const unsigned char Xthal_icache_linewidth;
412extern const unsigned char Xthal_dcache_linewidth;
413/* size of the cache lines in bytes */
414extern const unsigned short Xthal_icache_linesize;
415extern const unsigned short Xthal_dcache_linesize;
416/* number of cache sets in log2(lines per way) */
417extern const unsigned char Xthal_icache_setwidth;
418extern const unsigned char Xthal_dcache_setwidth;
419/* cache set associativity (number of ways) */
420extern const unsigned int Xthal_icache_ways;
421extern const unsigned int Xthal_dcache_ways;
422/* size of the caches in bytes (ways * 2^(linewidth + setwidth)) */
423extern const unsigned int Xthal_icache_size;
424extern const unsigned int Xthal_dcache_size;
425/* cache features */
426extern const unsigned char Xthal_dcache_is_writeback;
427extern const unsigned char Xthal_icache_line_lockable;
428extern const unsigned char Xthal_dcache_line_lockable;
429
430/* cache attribute register control (used by other HAL routines) */
431extern unsigned xthal_get_cacheattr( void );
432extern unsigned xthal_get_icacheattr( void );
433extern unsigned xthal_get_dcacheattr( void );
434extern void xthal_set_cacheattr( unsigned );
435extern void xthal_set_icacheattr( unsigned );
436extern void xthal_set_dcacheattr( unsigned );
437
438/* initialize cache support (must be called once at startup, before all other cache calls) */
439/*extern void xthal_cache_startinit( void );*/
440/* reset caches */
441/*extern void xthal_icache_reset( void );*/
442/*extern void xthal_dcache_reset( void );*/
443/* enable caches */
444extern void xthal_icache_enable( void ); /* DEPRECATED */
445extern void xthal_dcache_enable( void ); /* DEPRECATED */
446/* disable caches */
447extern void xthal_icache_disable( void ); /* DEPRECATED */
448extern void xthal_dcache_disable( void ); /* DEPRECATED */
449
450/* invalidate the caches */
451extern void xthal_icache_all_invalidate( void );
452extern void xthal_dcache_all_invalidate( void );
453extern void xthal_icache_region_invalidate( void *addr, unsigned size );
454extern void xthal_dcache_region_invalidate( void *addr, unsigned size );
455extern void xthal_icache_line_invalidate(void *addr);
456extern void xthal_dcache_line_invalidate(void *addr);
457/* write dirty data back */
458extern void xthal_dcache_all_writeback( void );
459extern void xthal_dcache_region_writeback( void *addr, unsigned size );
460extern void xthal_dcache_line_writeback(void *addr);
461/* write dirty data back and invalidate */
462extern void xthal_dcache_all_writeback_inv( void );
463extern void xthal_dcache_region_writeback_inv( void *addr, unsigned size );
464extern void xthal_dcache_line_writeback_inv(void *addr);
465/* prefetch and lock specified memory range into cache */
466extern void xthal_icache_region_lock( void *addr, unsigned size );
467extern void xthal_dcache_region_lock( void *addr, unsigned size );
468extern void xthal_icache_line_lock(void *addr);
469extern void xthal_dcache_line_lock(void *addr);
470/* unlock from cache */
471extern void xthal_icache_all_unlock( void );
472extern void xthal_dcache_all_unlock( void );
473extern void xthal_icache_region_unlock( void *addr, unsigned size );
474extern void xthal_dcache_region_unlock( void *addr, unsigned size );
475extern void xthal_icache_line_unlock(void *addr);
476extern void xthal_dcache_line_unlock(void *addr);
477
478
479/* sync icache and memory */
480extern void xthal_icache_sync( void );
481/* sync dcache and memory */
482extern void xthal_dcache_sync( void );
483
484/*----------------------------------------------------------------------
485 Debug
486 ----------------------------------------------------------------------*/
487
488/* 1 if debug option configured, 0 if not: */
489extern const int Xthal_debug_configured;
490
491/* Number of instruction and data break registers: */
492extern const int Xthal_num_ibreak;
493extern const int Xthal_num_dbreak;
494
495/* Set (plant) and remove software breakpoint, both synchronizing cache: */
496extern unsigned int xthal_set_soft_break(void *addr);
497extern void xthal_remove_soft_break(void *addr, unsigned int);
498
499
500/*----------------------------------------------------------------------
501 Disassembler
502 ----------------------------------------------------------------------*/
503
504/* Max expected size of the return buffer for a disassembled instruction (hint only): */
505#define XTHAL_DISASM_BUFSIZE 80
506
507/* Disassembly option bits for selecting what to return: */
508#define XTHAL_DISASM_OPT_ADDR 0x0001 /* display address */
509#define XTHAL_DISASM_OPT_OPHEX 0x0002 /* display opcode bytes in hex */
510#define XTHAL_DISASM_OPT_OPCODE 0x0004 /* display opcode name (mnemonic) */
511#define XTHAL_DISASM_OPT_PARMS 0x0008 /* display parameters */
512#define XTHAL_DISASM_OPT_ALL 0x0FFF /* display everything */
513
514/* routine to get a string for the disassembled instruction */
515extern int xthal_disassemble( unsigned char *instr_buf, void *tgt_addr,
516 char *buffer, unsigned buflen, unsigned options );
517
518/* routine to get the size of the next instruction. Returns 0 for
519 illegal instruction */
520extern int xthal_disassemble_size( unsigned char *instr_buf );
521
522
523/*----------------------------------------------------------------------
524 Core Counter
525 ----------------------------------------------------------------------*/
526
527/* counter info */
528extern const unsigned char Xthal_have_ccount; /* set if CCOUNT register present */
529extern const unsigned char Xthal_num_ccompare; /* number of CCOMPAREn registers */
530
531/* get CCOUNT register (if not present return 0) */
532extern unsigned xthal_get_ccount(void);
533
534/* set and get CCOMPAREn registers (if not present, get returns 0) */
535extern void xthal_set_ccompare(int, unsigned);
536extern unsigned xthal_get_ccompare(int);
537
538
539/*----------------------------------------------------------------------
540 Instruction/Data RAM/ROM Access
541 ----------------------------------------------------------------------*/
542
543extern void* xthal_memcpy(void *dst, const void *src, unsigned len);
544extern void* xthal_bcopy(const void *src, void *dst, unsigned len);
545
546/*----------------------------------------------------------------------
547 MP Synchronization
548 ----------------------------------------------------------------------*/
549extern int xthal_compare_and_set( int *addr, int test_val, int compare_val );
550extern unsigned xthal_get_prid( void );
551
552/*extern const char Xthal_have_s32c1i;*/
553extern const unsigned char Xthal_have_prid;
554
555
556/*----------------------------------------------------------------------
557 Miscellaneous
558 ----------------------------------------------------------------------*/
559
560extern const unsigned int Xthal_release_major;
561extern const unsigned int Xthal_release_minor;
562extern const char * const Xthal_release_name;
563extern const char * const Xthal_release_internal;
564
565extern const unsigned char Xthal_memory_order;
566extern const unsigned char Xthal_have_windowed;
567extern const unsigned char Xthal_have_density;
568extern const unsigned char Xthal_have_booleans;
569extern const unsigned char Xthal_have_loops;
570extern const unsigned char Xthal_have_nsa;
571extern const unsigned char Xthal_have_minmax;
572extern const unsigned char Xthal_have_sext;
573extern const unsigned char Xthal_have_clamps;
574extern const unsigned char Xthal_have_mac16;
575extern const unsigned char Xthal_have_mul16;
576extern const unsigned char Xthal_have_fp;
577extern const unsigned char Xthal_have_speculation;
578extern const unsigned char Xthal_have_exceptions;
579extern const unsigned char Xthal_xea_version;
580extern const unsigned char Xthal_have_interrupts;
581extern const unsigned char Xthal_have_highlevel_interrupts;
582extern const unsigned char Xthal_have_nmi;
583
584extern const unsigned short Xthal_num_writebuffer_entries;
585
586extern const unsigned int Xthal_build_unique_id;
587/* Release info for hardware targeted by software upgrades: */
588extern const unsigned int Xthal_hw_configid0;
589extern const unsigned int Xthal_hw_configid1;
590extern const unsigned int Xthal_hw_release_major;
591extern const unsigned int Xthal_hw_release_minor;
592extern const char * const Xthal_hw_release_name;
593extern const char * const Xthal_hw_release_internal;
594
595
596/* Internal memories... */
597
598extern const unsigned char Xthal_num_instrom;
599extern const unsigned char Xthal_num_instram;
600extern const unsigned char Xthal_num_datarom;
601extern const unsigned char Xthal_num_dataram;
602extern const unsigned char Xthal_num_xlmi;
603extern const unsigned int Xthal_instrom_vaddr[1];
604extern const unsigned int Xthal_instrom_paddr[1];
605extern const unsigned int Xthal_instrom_size [1];
606extern const unsigned int Xthal_instram_vaddr[1];
607extern const unsigned int Xthal_instram_paddr[1];
608extern const unsigned int Xthal_instram_size [1];
609extern const unsigned int Xthal_datarom_vaddr[1];
610extern const unsigned int Xthal_datarom_paddr[1];
611extern const unsigned int Xthal_datarom_size [1];
612extern const unsigned int Xthal_dataram_vaddr[1];
613extern const unsigned int Xthal_dataram_paddr[1];
614extern const unsigned int Xthal_dataram_size [1];
615extern const unsigned int Xthal_xlmi_vaddr[1];
616extern const unsigned int Xthal_xlmi_paddr[1];
617extern const unsigned int Xthal_xlmi_size [1];
618
619
620
621/*----------------------------------------------------------------------
622 Memory Management Unit
623 ----------------------------------------------------------------------*/
624
625extern const unsigned char Xthal_have_spanning_way;
626extern const unsigned char Xthal_have_identity_map;
627extern const unsigned char Xthal_have_mimic_cacheattr;
628extern const unsigned char Xthal_have_xlt_cacheattr;
629extern const unsigned char Xthal_have_cacheattr;
630extern const unsigned char Xthal_have_tlbs;
631
632extern const unsigned char Xthal_mmu_asid_bits; /* 0 .. 8 */
633extern const unsigned char Xthal_mmu_asid_kernel;
634extern const unsigned char Xthal_mmu_rings; /* 1 .. 4 (perhaps 0 if no MMU and/or no protection?) */
635extern const unsigned char Xthal_mmu_ring_bits;
636extern const unsigned char Xthal_mmu_sr_bits;
637extern const unsigned char Xthal_mmu_ca_bits;
638extern const unsigned int Xthal_mmu_max_pte_page_size;
639extern const unsigned int Xthal_mmu_min_pte_page_size;
640
641extern const unsigned char Xthal_itlb_way_bits;
642extern const unsigned char Xthal_itlb_ways;
643extern const unsigned char Xthal_itlb_arf_ways;
644extern const unsigned char Xthal_dtlb_way_bits;
645extern const unsigned char Xthal_dtlb_ways;
646extern const unsigned char Xthal_dtlb_arf_ways;
647
648/* Convert between virtual and physical addresses (through static maps only): */
649/*** WARNING: these two functions may go away in a future release; don't depend on them! ***/
650extern int xthal_static_v2p( unsigned vaddr, unsigned *paddrp );
651extern int xthal_static_p2v( unsigned paddr, unsigned *vaddrp, unsigned cached );
652
653#if 0
654/******************* EXPERIMENTAL AND TENTATIVE ONLY ********************/
655
656#define XTHAL_MMU_PAGESZ_COUNT_MAX 8 /* maximum number of different page sizes */
657extern const char Xthal_mmu_pagesz_count; /* 0 .. 8 number of different page sizes configured */
658
659/* Note: the following table doesn't necessarily have page sizes in increasing order: */
660extern const char Xthal_mmu_pagesz_log2[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 10 .. 28 (0 past count) */
661
662/* Sorted (increasing) table of page sizes, that indexes into the above table: */
663extern const char Xthal_mmu_pagesz_sorted[XTHAL_MMU_PAGESZ_COUNT_MAX]; /* 0 .. 7 (0 past count) */
664
665/*u32 Xthal_virtual_exceptions;*/ /* bitmask of which exceptions execute in virtual mode... */
666
667extern const char Xthal_mmu_pte_pagesz_log2_min; /* ?? minimum page size in PTEs */
668extern const char Xthal_mmu_pte_pagesz_log2_max; /* ?? maximum page size in PTEs */
669
670/* Cache Attribute Bits Implemented by the Cache (part of the cache abstraction) */
671extern const char Xthal_icache_fca_bits_implemented; /* ITLB/UTLB only! */
672extern const char Xthal_dcache_lca_bits_implemented; /* DTLB/UTLB only! */
673extern const char Xthal_dcache_sca_bits_implemented; /* DTLB/UTLB only! */
674
675/* Per TLB Parameters (Instruction, Data, Unified) */
676struct XtHalMmuTlb Xthal_itlb; /* description of MMU I-TLB generic features */
677struct XtHalMmuTlb Xthal_dtlb; /* description of MMU D-TLB generic features */
678struct XtHalMmuTlb Xthal_utlb; /* description of MMU U-TLB generic features */
679
680#define XTHAL_MMU_WAYS_MAX 8 /* maximum number of ways (associativities) for each TLB */
681
682/* Structure for common information described for each possible TLB (instruction, data and unified): */
683typedef struct XtHalMmuTlb {
684 u8 va_bits; /* 32 (number of virtual address bits) */
685 u8 pa_bits; /* 32 (number of physical address bits) */
686 bool tlb_va_indexed; /* 1 (set if TLB is indexed by virtual address) */
687 bool tlb_va_tagged; /* 0 (set if TLB is tagged by virtual address) */
688 bool cache_va_indexed; /* 1 (set if cache is indexed by virtual address) */
689 bool cache_va_tagged; /* 0 (set if cache is tagged by virtual address) */
690 /*bool (whether page tables are traversed in vaddr sorted order, paddr sorted order, ...) */
691 /*u8 (set of available page attribute bits, other than cache attribute bits defined above) */
692 /*u32 (various masks for pages, MMU table/TLB entries, etc.) */
693 u8 way_count; /* 0 .. 8 (number of ways, a.k.a. associativities, for this TLB) */
694 XtHalMmuTlbWay * ways[XTHAL_MMU_WAYS_MAX]; /* pointers to per-way parms for each way */
695} XtHalMmuTlb;
696
697/* Per TLB Way (Per Associativity) Parameters */
698typedef struct XtHalMmuTlbWay {
699 u32 index_count_log2; /* 0 .. 4 */
700 u32 pagesz_mask; /* 0 .. 2^pagesz_count - 1 (each bit corresponds to a size */
701 /* defined in the Xthal_mmu_pagesz_log2[] table) */
702 u32 vpn_const_mask;
703 u32 vpn_const_value;
704 u64 ppn_const_mask; /* future may support pa_bits > 32 */
705 u64 ppn_const_value;
706 u32 ppn_id_mask; /* paddr bits taken directly from vaddr */
707 bool backgnd_match; /* 0 or 1 */
708 /* These are defined in terms of the XTHAL_CACHE_xxx bits: */
709 u8 fca_const_mask; /* ITLB/UTLB only! */
710 u8 fca_const_value; /* ITLB/UTLB only! */
711 u8 lca_const_mask; /* DTLB/UTLB only! */
712 u8 lca_const_value; /* DTLB/UTLB only! */
713 u8 sca_const_mask; /* DTLB/UTLB only! */
714 u8 sca_const_value; /* DTLB/UTLB only! */
715 /* These define an encoding that map 5 bits in TLB and PTE entries to */
716 /* 8 bits (FCA, ITLB), 16 bits (LCA+SCA, DTLB) or 24 bits (FCA+LCA+SCA, UTLB): */
717 /* (they may be moved to struct XtHalMmuTlb) */
718 u8 ca_bits; /* number of bits in TLB/PTE entries for cache attributes */
719 u32 * ca_map; /* pointer to array of 2^ca_bits entries of FCA+LCA+SCA bits */
720} XtHalMmuTlbWay;
721
722/*
723 * The way to determine whether protection support is present in core
724 * is to [look at Xthal_mmu_rings ???].
725 * Give info on memory requirements for MMU tables and other in-memory
726 * data structures (globally, per task, base and per page, etc.) - whatever bounds can be calculated.
727 */
728
729
730/* Default vectors: */
731xthal_immu_fetch_miss_vector
732xthal_dmmu_load_miss_vector
733xthal_dmmu_store_miss_vector
734
735/* Functions called when a fault is detected: */
736typedef void (XtHalMmuFaultFunc)( unsigned vaddr, ...context... );
737/* Or, */
738/* a? = vaddr */
739/* a? = context... */
740/* PS.xxx = xxx */
741XtHalMMuFaultFunc *Xthal_immu_fetch_fault_func;
742XtHalMMuFaultFunc *Xthal_dmmu_load_fault_func;
743XtHalMMuFaultFunc *Xthal_dmmu_store_fault_func;
744
745/* Default Handlers: */
746/* The user and/or kernel exception handlers may jump to these handlers to handle the relevant exceptions,
747 * according to the value of EXCCAUSE. The exact register state on entry to these handlers is TBD. */
748/* When multiple TLB entries match (hit) on the same access: */
749xthal_immu_fetch_multihit_handler
750xthal_dmmu_load_multihit_handler
751xthal_dmmu_store_multihit_handler
752/* Protection violations according to cache attributes, and other cache attribute mismatches: */
753xthal_immu_fetch_attr_handler
754xthal_dmmu_load_attr_handler
755xthal_dmmu_store_attr_handler
756/* Protection violations due to insufficient ring level: */
757xthal_immu_fetch_priv_handler
758xthal_dmmu_load_priv_handler
759xthal_dmmu_store_priv_handler
760/* Alignment exception handlers (if supported by the particular Xtensa MMU configuration): */
761xthal_dmmu_load_align_handler
762xthal_dmmu_store_align_handler
763
764/* Or, alternatively, the OS user and/or kernel exception handlers may simply jump to the
765 * following entry points which will handle any values of EXCCAUSE not handled by the OS: */
766xthal_user_exc_default_handler
767xthal_kernel_exc_default_handler
768
769#endif /*0*/
770
771#ifdef INCLUDE_DEPRECATED_HAL_CODE
772extern const unsigned char Xthal_have_old_exc_arch;
773extern const unsigned char Xthal_have_mmu;
774extern const unsigned int Xthal_num_regs;
775extern const unsigned char Xthal_num_iroms;
776extern const unsigned char Xthal_num_irams;
777extern const unsigned char Xthal_num_droms;
778extern const unsigned char Xthal_num_drams;
779extern const unsigned int Xthal_configid0;
780extern const unsigned int Xthal_configid1;
781#endif
782
783#ifdef INCLUDE_DEPRECATED_HAL_DEBUG_CODE
784#define XTHAL_24_BIT_BREAK 0x80000000
785#define XTHAL_16_BIT_BREAK 0x40000000
786extern const unsigned short Xthal_ill_inst_16[16];
787#define XTHAL_DEST_REG 0xf0000000 /* Mask for destination register */
788#define XTHAL_DEST_REG_INST 0x08000000 /* Branch address is in register */
789#define XTHAL_DEST_REL_INST 0x04000000 /* Branch address is relative */
790#define XTHAL_RFW_INST 0x00000800
791#define XTHAL_RFUE_INST 0x00000400
792#define XTHAL_RFI_INST 0x00000200
793#define XTHAL_RFE_INST 0x00000100
794#define XTHAL_RET_INST 0x00000080
795#define XTHAL_BREAK_INST 0x00000040
796#define XTHAL_SYSCALL_INST 0x00000020
797#define XTHAL_LOOP_END 0x00000010 /* Not set by xthal_inst_type */
798#define XTHAL_JUMP_INST 0x00000008 /* Call or jump instruction */
799#define XTHAL_BRANCH_INST 0x00000004 /* Branch instruction */
800#define XTHAL_24_BIT_INST 0x00000002
801#define XTHAL_16_BIT_INST 0x00000001
802typedef struct xthal_state {
803 unsigned pc;
804 unsigned ar[16];
805 unsigned lbeg;
806 unsigned lend;
807 unsigned lcount;
808 unsigned extra_ptr;
809 unsigned cpregs_ptr[XTHAL_MAX_CPS];
810} XTHAL_STATE;
811extern unsigned int xthal_inst_type(void *addr);
812extern unsigned int xthal_branch_addr(void *addr);
813extern unsigned int xthal_get_npc(XTHAL_STATE *user_state);
814#endif /* INCLUDE_DEPRECATED_HAL_DEBUG_CODE */
815
816#ifdef __cplusplus
817}
818#endif
819#endif /*!__ASSEMBLY__ */
820
821#endif /*XTENSA_HAL_H*/
822
diff --git a/include/asm-xtensa/xtensa/simcall.h b/include/asm-xtensa/xtensa/simcall.h
new file mode 100644
index 000000000000..a2b868929a49
--- /dev/null
+++ b/include/asm-xtensa/xtensa/simcall.h
@@ -0,0 +1,130 @@
1#ifndef SIMCALL_INCLUDED
2#define SIMCALL_INCLUDED
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/simcall.h - Simulator call numbers
8 *
9 * This file is subject to the terms and conditions of the GNU General
10 * Public License. See the file "COPYING" in the main directory of
11 * this archive for more details.
12 *
13 * Copyright (C) 2002 Tensilica Inc.
14 */
15
16
17/*
18 * System call like services offered by the simulator host.
19 * These are modeled after the Linux 2.4 kernel system calls
20 * for Xtensa processors. However not all system calls and
21 * not all functionality of a given system call are implemented,
22 * or necessarily have well defined or equivalent semantics in
23 * the context of a simulation (as opposed to a Unix kernel).
24 *
25 * These services behave largely as if they had been invoked
26 * as a task in the simulator host's operating system
27 * (eg. files accessed are those of the simulator host).
28 * However, these SIMCALLs model a virtual operating system
29 * so that various definitions, bit assignments etc
30 * (eg. open mode bits, errno values, etc) are independent
31 * of the host operating system used to run the simulation.
32 * Rather these definitions are specific to the Xtensa ISS.
33 * This way Xtensa ISA code written to use these SIMCALLs
34 * can (in principle) be simulated on any host.
35 *
36 * Up to 6 parameters are passed in registers a3 to a8
37 * (note the 6th parameter isn't passed on the stack,
38 * unlike windowed function calling conventions).
39 * The return value is in a2. A negative value in the
40 * range -4096 to -1 indicates a negated error code to be
41 * reported in errno with a return value of -1, otherwise
42 * the value in a2 is returned as is.
43 */
44
45/* These #defines need to match what's in Xtensa/OS/vxworks/xtiss/simcalls.c */
46
47#define SYS_nop 0 /* n/a - setup; used to flush register windows */
48#define SYS_exit 1 /*x*/
49#define SYS_fork 2
50#define SYS_read 3 /*x*/
51#define SYS_write 4 /*x*/
52#define SYS_open 5 /*x*/
53#define SYS_close 6 /*x*/
54#define SYS_rename 7 /*x 38 - waitpid */
55#define SYS_creat 8 /*x*/
56#define SYS_link 9 /*x (not implemented on WIN32) */
57#define SYS_unlink 10 /*x*/
58#define SYS_execv 11 /* n/a - execve */
59#define SYS_execve 12 /* 11 - chdir */
60#define SYS_pipe 13 /* 42 - time */
61#define SYS_stat 14 /* 106 - mknod */
62#define SYS_chmod 15
63#define SYS_chown 16 /* 202 - lchown */
64#define SYS_utime 17 /* 30 - break */
65#define SYS_wait 18 /* n/a - oldstat */
66#define SYS_lseek 19 /*x*/
67#define SYS_getpid 20
68#define SYS_isatty 21 /* n/a - mount */
69#define SYS_fstat 22 /* 108 - oldumount */
70#define SYS_time 23 /* 13 - setuid */
71#define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */
72#define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */
73#define SYS_socket 26
74#define SYS_sendto 27
75#define SYS_recvfrom 28
76#define SYS_select_one 29 /* not compitible select, one file descriptor at the time */
77#define SYS_bind 30
78#define SYS_ioctl 31
79
80/*
81 * Other...
82 */
83#define SYS_iss_argc 1000 /* returns value of argc */
84#define SYS_iss_argv_size 1001 /* bytes needed for argv & arg strings */
85#define SYS_iss_set_argv 1002 /* saves argv & arg strings at given addr */
86
87/*
88 * SIMCALLs for the ferret memory debugger. All are invoked by
89 * libferret.a ... ( Xtensa/Target-Libs/ferret )
90 */
91#define SYS_ferret 1010
92#define SYS_malloc 1011
93#define SYS_free 1012
94#define SYS_more_heap 1013
95#define SYS_no_heap 1014
96
97
98/*
99 * Extra SIMCALLs for GDB:
100 */
101#define SYS_gdb_break -1 /* invoked by XTOS on user exceptions if EPC points
102 to a break.n/break, regardless of cause! */
103#define SYS_xmon_out -2 /* invoked by XMON: ... */
104#define SYS_xmon_in -3 /* invoked by XMON: ... */
105#define SYS_xmon_flush -4 /* invoked by XMON: ... */
106#define SYS_gdb_abort -5 /* invoked by XTOS in _xtos_panic() */
107#define SYS_gdb_illegal_inst -6 /* invoked by XTOS for illegal instructions (too deeply) */
108#define SYS_xmon_init -7 /* invoked by XMON: ... */
109#define SYS_gdb_enter_sktloop -8 /* invoked by XTOS on debug exceptions */
110
111/*
112 * SIMCALLs for vxWorks xtiss BSP:
113 */
114#define SYS_setup_ppp_pipes -83
115#define SYS_log_msg -84
116
117/*
118 * Test SIMCALLs:
119 */
120#define SYS_test_write_state -100
121#define SYS_test_read_state -101
122
123/*
124 * SYS_select_one specifiers
125 */
126#define XTISS_SELECT_ONE_READ 1
127#define XTISS_SELECT_ONE_WRITE 2
128#define XTISS_SELECT_ONE_EXCEPT 3
129
130#endif /* !SIMCALL_INCLUDED */
diff --git a/include/asm-xtensa/xtensa/xt2000-uart.h b/include/asm-xtensa/xtensa/xt2000-uart.h
new file mode 100644
index 000000000000..0154460f0ed8
--- /dev/null
+++ b/include/asm-xtensa/xtensa/xt2000-uart.h
@@ -0,0 +1,155 @@
1#ifndef _uart_h_included_
2#define _uart_h_included_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/xt2000-uart.h -- NatSemi PC16552D DUART
8 * definitions
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/xt2000.h>
19
20
21/* 16550 UART DEVICE REGISTERS
22 The XT2000 board aligns each register to a 32-bit word but the UART device only uses
23 one byte of the word, which is the least-significant byte regardless of the
24 endianness of the core (ie. byte offset 0 for little-endian and 3 for big-endian).
25 So if using word accesses then endianness doesn't matter.
26 The macros provided here do that.
27*/
28struct uart_dev_s {
29 union {
30 unsigned int rxb; /* DLAB=0: receive buffer, read-only */
31 unsigned int txb; /* DLAB=0: transmit buffer, write-only */
32 unsigned int dll; /* DLAB=1: divisor, least-significant byte latch (was write-only?) */
33 } w0;
34 union {
35 unsigned int ier; /* DLAB=0: interrupt-enable register (was write-only?) */
36 unsigned int dlm; /* DLAB=1: divisor, most-significant byte latch (was write-only?) */
37 } w1;
38
39 union {
40 unsigned int isr; /* DLAB=0: interrupt status register, read-only */
41 unsigned int fcr; /* DLAB=0: FIFO control register, write-only */
42 unsigned int afr; /* DLAB=1: alternate function register */
43 } w2;
44
45 unsigned int lcr; /* line control-register, write-only */
46 unsigned int mcr; /* modem control-regsiter, write-only */
47 unsigned int lsr; /* line status register, read-only */
48 unsigned int msr; /* modem status register, read-only */
49 unsigned int scr; /* scratch regsiter, read/write */
50};
51
52#define _RXB(u) ((u)->w0.rxb)
53#define _TXB(u) ((u)->w0.txb)
54#define _DLL(u) ((u)->w0.dll)
55#define _IER(u) ((u)->w1.ier)
56#define _DLM(u) ((u)->w1.dlm)
57#define _ISR(u) ((u)->w2.isr)
58#define _FCR(u) ((u)->w2.fcr)
59#define _AFR(u) ((u)->w2.afr)
60#define _LCR(u) ((u)->lcr)
61#define _MCR(u) ((u)->mcr)
62#define _LSR(u) ((u)->lsr)
63#define _MSR(u) ((u)->msr)
64#define _SCR(u) ((u)->scr)
65
66typedef volatile struct uart_dev_s uart_dev_t;
67
68/* IER bits */
69#define RCVR_DATA_REG_INTENABLE 0x01
70#define XMIT_HOLD_REG_INTENABLE 0x02
71#define RCVR_STATUS_INTENABLE 0x04
72#define MODEM_STATUS_INTENABLE 0x08
73
74/* FCR bits */
75#define _FIFO_ENABLE 0x01
76#define RCVR_FIFO_RESET 0x02
77#define XMIT_FIFO_RESET 0x04
78#define DMA_MODE_SELECT 0x08
79#define RCVR_TRIGGER_LSB 0x40
80#define RCVR_TRIGGER_MSB 0x80
81
82/* AFR bits */
83#define AFR_CONC_WRITE 0x01
84#define AFR_BAUDOUT_SEL 0x02
85#define AFR_RXRDY_SEL 0x04
86
87/* ISR bits */
88#define INT_STATUS(r) ((r)&1)
89#define INT_PRIORITY(r) (((r)>>1)&0x7)
90
91/* LCR bits */
92#define WORD_LENGTH(n) (((n)-5)&0x3)
93#define STOP_BIT_ENABLE 0x04
94#define PARITY_ENABLE 0x08
95#define EVEN_PARITY 0x10
96#define FORCE_PARITY 0x20
97#define XMIT_BREAK 0x40
98#define DLAB_ENABLE 0x80
99
100/* MCR bits */
101#define _DTR 0x01
102#define _RTS 0x02
103#define _OP1 0x04
104#define _OP2 0x08
105#define LOOP_BACK 0x10
106
107/* LSR Bits */
108#define RCVR_DATA_READY 0x01
109#define OVERRUN_ERROR 0x02
110#define PARITY_ERROR 0x04
111#define FRAMING_ERROR 0x08
112#define BREAK_INTERRUPT 0x10
113#define XMIT_HOLD_EMPTY 0x20
114#define XMIT_EMPTY 0x40
115#define FIFO_ERROR 0x80
116#define RCVR_READY(u) (_LSR(u)&RCVR_DATA_READY)
117#define XMIT_READY(u) (_LSR(u)&XMIT_HOLD_EMPTY)
118
119/* MSR bits */
120#define _RDR 0x01
121#define DELTA_DSR 0x02
122#define DELTA_RI 0x04
123#define DELTA_CD 0x08
124#define _CTS 0x10
125#define _DSR 0x20
126#define _RI 0x40
127#define _CD 0x80
128
129/* prototypes */
130void uart_init( uart_dev_t *u, int bitrate );
131void uart_out( uart_dev_t *u, char c );
132void uart_puts( uart_dev_t *u, char *s );
133char uart_in( uart_dev_t *u );
134void uart_enable_rcvr_int( uart_dev_t *u );
135void uart_disable_rcvr_int( uart_dev_t *u );
136
137#ifdef DUART16552_1_VADDR
138/* DUART present. */
139#define DUART_1_BASE (*(uart_dev_t*)DUART16552_1_VADDR)
140#define DUART_2_BASE (*(uart_dev_t*)DUART16552_2_VADDR)
141#define UART1_PUTS(s) uart_puts( &DUART_1_BASE, s )
142#define UART2_PUTS(s) uart_puts( &DUART_2_BASE, s )
143#else
144/* DUART not configured, use dummy placeholders to allow compiles to work. */
145#define DUART_1_BASE (*(uart_dev_t*)0)
146#define DUART_2_BASE (*(uart_dev_t*)0)
147#define UART1_PUTS(s)
148#define UART2_PUTS(s)
149#endif
150
151/* Compute 16-bit divisor for baudrate generator, with rounding: */
152#define DUART_DIVISOR(crystal,speed) (((crystal)/16 + (speed)/2)/(speed))
153
154#endif /*_uart_h_included_*/
155
diff --git a/include/asm-xtensa/xtensa/xt2000.h b/include/asm-xtensa/xtensa/xt2000.h
new file mode 100644
index 000000000000..703a45002f8f
--- /dev/null
+++ b/include/asm-xtensa/xtensa/xt2000.h
@@ -0,0 +1,408 @@
1#ifndef _INC_XT2000_H_
2#define _INC_XT2000_H_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * include/asm-xtensa/xtensa/xt2000.h - Definitions specific to the
8 * Tensilica XT2000 Emulation Board
9 *
10 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive
12 * for more details.
13 *
14 * Copyright (C) 2002 Tensilica Inc.
15 */
16
17
18#include <xtensa/config/core.h>
19#include <xtensa/config/system.h>
20
21
22/*
23 * Default assignment of XT2000 devices to external interrupts.
24 */
25
26/* Ethernet interrupt: */
27#ifdef XCHAL_EXTINT3_NUM
28#define SONIC83934_INTNUM XCHAL_EXTINT3_NUM
29#define SONIC83934_INTLEVEL XCHAL_EXTINT3_LEVEL
30#define SONIC83934_INTMASK XCHAL_EXTINT3_MASK
31#else
32#define SONIC83934_INTMASK 0
33#endif
34
35/* DUART channel 1 interrupt (P1 - console): */
36#ifdef XCHAL_EXTINT4_NUM
37#define DUART16552_1_INTNUM XCHAL_EXTINT4_NUM
38#define DUART16552_1_INTLEVEL XCHAL_EXTINT4_LEVEL
39#define DUART16552_1_INTMASK XCHAL_EXTINT4_MASK
40#else
41#define DUART16552_1_INTMASK 0
42#endif
43
44/* DUART channel 2 interrupt (P2 - 2nd serial port): */
45#ifdef XCHAL_EXTINT5_NUM
46#define DUART16552_2_INTNUM XCHAL_EXTINT5_NUM
47#define DUART16552_2_INTLEVEL XCHAL_EXTINT5_LEVEL
48#define DUART16552_2_INTMASK XCHAL_EXTINT5_MASK
49#else
50#define DUART16552_2_INTMASK 0
51#endif
52
53/* FPGA-combined PCI/etc interrupts: */
54#ifdef XCHAL_EXTINT6_NUM
55#define XT2000_FPGAPCI_INTNUM XCHAL_EXTINT6_NUM
56#define XT2000_FPGAPCI_INTLEVEL XCHAL_EXTINT6_LEVEL
57#define XT2000_FPGAPCI_INTMASK XCHAL_EXTINT6_MASK
58#else
59#define XT2000_FPGAPCI_INTMASK 0
60#endif
61
62
63
64/*
65 * Device addresses.
66 *
67 * Note: for endianness-independence, use 32-bit loads and stores for all
68 * register accesses to Ethernet, DUART and LED devices. Undefined bits
69 * may need to be masked out if needed when reading if the actual register
70 * size is smaller than 32 bits.
71 *
72 * Note: XT2000 bus byte lanes are defined in terms of msbyte and lsbyte
73 * relative to the processor. So 32-bit registers are accessed consistently
74 * from both big and little endian processors. However, this means byte
75 * sequences are not consistent between big and little endian processors.
76 * This is fine for RAM, and for ROM if ROM is created for a specific
77 * processor (and thus has correct byte sequences). However this may be
78 * unexpected for Flash, which might contain a file-system that one wants
79 * to use for multiple processor configurations (eg. the Flash might contain
80 * the Ethernet card's address, endianness-independent application data, etc).
81 * That is, byte sequences written in Flash by a core of a given endianness
82 * will be byte-swapped when seen by a core of the other endianness.
83 * Someone implementing an endianness-independent Flash file system will
84 * likely handle this byte-swapping issue in the Flash driver software.
85 */
86
87#define DUART16552_XTAL_FREQ 18432000 /* crystal frequency in Hz */
88#define XTBOARD_FLASH_MAXSIZE 0x4000000 /* 64 MB (max; depends on what is socketed!) */
89#define XTBOARD_EPROM_MAXSIZE 0x0400000 /* 4 MB (max; depends on what is socketed!) */
90#define XTBOARD_EEPROM_MAXSIZE 0x0080000 /* 512 kB (max; depends on what is socketed!) */
91#define XTBOARD_ASRAM_SIZE 0x0100000 /* 1 MB */
92#define XTBOARD_PCI_MEM_SIZE 0x8000000 /* 128 MB (allocated) */
93#define XTBOARD_PCI_IO_SIZE 0x1000000 /* 16 MB (allocated) */
94
95#ifdef XSHAL_IOBLOCK_BYPASS_PADDR
96/* PCI memory space: */
97# define XTBOARD_PCI_MEM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x0000000)
98/* Socketed Flash (eg. 2 x 16-bit devices): */
99# define XTBOARD_FLASH_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0x8000000)
100/* PCI I/O space: */
101# define XTBOARD_PCI_IO_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xC000000)
102/* V3 PCI interface chip register/config space: */
103# define XTBOARD_V3PCI_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD000000)
104/* Bus Interface registers: */
105# define XTBOARD_BUSINT_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD010000)
106/* FPGA registers: */
107# define XT2000_FPGAREGS_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD020000)
108/* SONIC SN83934 Ethernet controller/transceiver: */
109# define SONIC83934_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD030000)
110/* 8-character bitmapped LED display: */
111# define XTBOARD_LED_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD040000)
112/* National-Semi PC16552D DUART: */
113# define DUART16552_1_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050020) /* channel 1 (P1 - console) */
114# define DUART16552_2_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD050000) /* channel 2 (P2) */
115/* Asynchronous Static RAM: */
116# define XTBOARD_ASRAM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD400000)
117/* 8-bit EEPROM: */
118# define XTBOARD_EEPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD600000)
119/* 2 x 16-bit EPROMs: */
120# define XTBOARD_EPROM_PADDR (XSHAL_IOBLOCK_BYPASS_PADDR+0xD800000)
121#endif /* XSHAL_IOBLOCK_BYPASS_PADDR */
122
123/* These devices might be accessed cached: */
124#ifdef XSHAL_IOBLOCK_CACHED_PADDR
125# define XTBOARD_PCI_MEM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x0000000)
126# define XTBOARD_FLASH_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0x8000000)
127# define XTBOARD_ASRAM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD400000)
128# define XTBOARD_EEPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD600000)
129# define XTBOARD_EPROM_CACHED_PADDR (XSHAL_IOBLOCK_CACHED_PADDR+0xD800000)
130#endif /* XSHAL_IOBLOCK_CACHED_PADDR */
131
132
133/*** Same thing over again, this time with virtual addresses: ***/
134
135#ifdef XSHAL_IOBLOCK_BYPASS_VADDR
136/* PCI memory space: */
137# define XTBOARD_PCI_MEM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x0000000)
138/* Socketed Flash (eg. 2 x 16-bit devices): */
139# define XTBOARD_FLASH_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0x8000000)
140/* PCI I/O space: */
141# define XTBOARD_PCI_IO_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xC000000)
142/* V3 PCI interface chip register/config space: */
143# define XTBOARD_V3PCI_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD000000)
144/* Bus Interface registers: */
145# define XTBOARD_BUSINT_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD010000)
146/* FPGA registers: */
147# define XT2000_FPGAREGS_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD020000)
148/* SONIC SN83934 Ethernet controller/transceiver: */
149# define SONIC83934_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD030000)
150/* 8-character bitmapped LED display: */
151# define XTBOARD_LED_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD040000)
152/* National-Semi PC16552D DUART: */
153# define DUART16552_1_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050020) /* channel 1 (P1 - console) */
154# define DUART16552_2_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD050000) /* channel 2 (P2) */
155/* Asynchronous Static RAM: */
156# define XTBOARD_ASRAM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD400000)
157/* 8-bit EEPROM: */
158# define XTBOARD_EEPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD600000)
159/* 2 x 16-bit EPROMs: */
160# define XTBOARD_EPROM_VADDR (XSHAL_IOBLOCK_BYPASS_VADDR+0xD800000)
161#endif /* XSHAL_IOBLOCK_BYPASS_VADDR */
162
163/* These devices might be accessed cached: */
164#ifdef XSHAL_IOBLOCK_CACHED_VADDR
165# define XTBOARD_PCI_MEM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x0000000)
166# define XTBOARD_FLASH_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0x8000000)
167# define XTBOARD_ASRAM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD400000)
168# define XTBOARD_EEPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD600000)
169# define XTBOARD_EPROM_CACHED_VADDR (XSHAL_IOBLOCK_CACHED_VADDR+0xD800000)
170#endif /* XSHAL_IOBLOCK_CACHED_VADDR */
171
172
173/* System ROM: */
174#define XTBOARD_ROM_SIZE XSHAL_ROM_SIZE
175#ifdef XSHAL_ROM_VADDR
176#define XTBOARD_ROM_VADDR XSHAL_ROM_VADDR
177#endif
178#ifdef XSHAL_ROM_PADDR
179#define XTBOARD_ROM_PADDR XSHAL_ROM_PADDR
180#endif
181
182/* System RAM: */
183#define XTBOARD_RAM_SIZE XSHAL_RAM_SIZE
184#ifdef XSHAL_RAM_VADDR
185#define XTBOARD_RAM_VADDR XSHAL_RAM_VADDR
186#endif
187#ifdef XSHAL_RAM_PADDR
188#define XTBOARD_RAM_PADDR XSHAL_RAM_PADDR
189#endif
190#define XTBOARD_RAM_BYPASS_VADDR XSHAL_RAM_BYPASS_VADDR
191#define XTBOARD_RAM_BYPASS_PADDR XSHAL_RAM_BYPASS_PADDR
192
193
194
195/*
196 * Things that depend on device addresses.
197 */
198
199
200#define XTBOARD_CACHEATTR_WRITEBACK XSHAL_XT2000_CACHEATTR_WRITEBACK
201#define XTBOARD_CACHEATTR_WRITEALLOC XSHAL_XT2000_CACHEATTR_WRITEALLOC
202#define XTBOARD_CACHEATTR_WRITETHRU XSHAL_XT2000_CACHEATTR_WRITETHRU
203#define XTBOARD_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS
204#define XTBOARD_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT
205
206#define XTBOARD_BUSINT_PIPE_REGIONS XSHAL_XT2000_PIPE_REGIONS
207#define XTBOARD_BUSINT_SDRAM_REGIONS XSHAL_XT2000_SDRAM_REGIONS
208
209
210
211/*
212 * BusLogic (FPGA) registers.
213 * All these registers are normally accessed using 32-bit loads/stores.
214 */
215
216/* Register offsets: */
217#define XT2000_DATECD_OFS 0x00 /* date code (read-only) */
218#define XT2000_STSREG_OFS 0x04 /* status (read-only) */
219#define XT2000_SYSLED_OFS 0x08 /* system LED */
220#define XT2000_WRPROT_OFS 0x0C /* write protect */
221#define XT2000_SWRST_OFS 0x10 /* software reset */
222#define XT2000_SYSRST_OFS 0x14 /* system (peripherals) reset */
223#define XT2000_IMASK_OFS 0x18 /* interrupt mask */
224#define XT2000_ISTAT_OFS 0x1C /* interrupt status */
225#define XT2000_V3CFG_OFS 0x20 /* V3 config (V320 PCI) */
226
227/* Physical register addresses: */
228#ifdef XT2000_FPGAREGS_PADDR
229#define XT2000_DATECD_PADDR (XT2000_FPGAREGS_PADDR+XT2000_DATECD_OFS)
230#define XT2000_STSREG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_STSREG_OFS)
231#define XT2000_SYSLED_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSLED_OFS)
232#define XT2000_WRPROT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_WRPROT_OFS)
233#define XT2000_SWRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SWRST_OFS)
234#define XT2000_SYSRST_PADDR (XT2000_FPGAREGS_PADDR+XT2000_SYSRST_OFS)
235#define XT2000_IMASK_PADDR (XT2000_FPGAREGS_PADDR+XT2000_IMASK_OFS)
236#define XT2000_ISTAT_PADDR (XT2000_FPGAREGS_PADDR+XT2000_ISTAT_OFS)
237#define XT2000_V3CFG_PADDR (XT2000_FPGAREGS_PADDR+XT2000_V3CFG_OFS)
238#endif
239
240/* Virtual register addresses: */
241#ifdef XT2000_FPGAREGS_VADDR
242#define XT2000_DATECD_VADDR (XT2000_FPGAREGS_VADDR+XT2000_DATECD_OFS)
243#define XT2000_STSREG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_STSREG_OFS)
244#define XT2000_SYSLED_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSLED_OFS)
245#define XT2000_WRPROT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_WRPROT_OFS)
246#define XT2000_SWRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SWRST_OFS)
247#define XT2000_SYSRST_VADDR (XT2000_FPGAREGS_VADDR+XT2000_SYSRST_OFS)
248#define XT2000_IMASK_VADDR (XT2000_FPGAREGS_VADDR+XT2000_IMASK_OFS)
249#define XT2000_ISTAT_VADDR (XT2000_FPGAREGS_VADDR+XT2000_ISTAT_OFS)
250#define XT2000_V3CFG_VADDR (XT2000_FPGAREGS_VADDR+XT2000_V3CFG_OFS)
251/* Register access (for C code): */
252#define XT2000_DATECD_REG (*(volatile unsigned*) XT2000_DATECD_VADDR)
253#define XT2000_STSREG_REG (*(volatile unsigned*) XT2000_STSREG_VADDR)
254#define XT2000_SYSLED_REG (*(volatile unsigned*) XT2000_SYSLED_VADDR)
255#define XT2000_WRPROT_REG (*(volatile unsigned*) XT2000_WRPROT_VADDR)
256#define XT2000_SWRST_REG (*(volatile unsigned*) XT2000_SWRST_VADDR)
257#define XT2000_SYSRST_REG (*(volatile unsigned*) XT2000_SYSRST_VADDR)
258#define XT2000_IMASK_REG (*(volatile unsigned*) XT2000_IMASK_VADDR)
259#define XT2000_ISTAT_REG (*(volatile unsigned*) XT2000_ISTAT_VADDR)
260#define XT2000_V3CFG_REG (*(volatile unsigned*) XT2000_V3CFG_VADDR)
261#endif
262
263/* DATECD (date code) bit fields: */
264
265/* BCD-coded month (01..12): */
266#define XT2000_DATECD_MONTH_SHIFT 24
267#define XT2000_DATECD_MONTH_BITS 8
268#define XT2000_DATECD_MONTH_MASK 0xFF000000
269/* BCD-coded day (01..31): */
270#define XT2000_DATECD_DAY_SHIFT 16
271#define XT2000_DATECD_DAY_BITS 8
272#define XT2000_DATECD_DAY_MASK 0x00FF0000
273/* BCD-coded year (2001..9999): */
274#define XT2000_DATECD_YEAR_SHIFT 0
275#define XT2000_DATECD_YEAR_BITS 16
276#define XT2000_DATECD_YEAR_MASK 0x0000FFFF
277
278/* STSREG (status) bit fields: */
279
280/* Switch SW3 setting bit fields (0=off/up, 1=on/down): */
281#define XT2000_STSREG_SW3_SHIFT 0
282#define XT2000_STSREG_SW3_BITS 4
283#define XT2000_STSREG_SW3_MASK 0x0000000F
284/* Boot-select bits of switch SW3: */
285#define XT2000_STSREG_BOOTSEL_SHIFT 0
286#define XT2000_STSREG_BOOTSEL_BITS 2
287#define XT2000_STSREG_BOOTSEL_MASK 0x00000003
288/* Boot-select values: */
289#define XT2000_STSREG_BOOTSEL_FLASH 0
290#define XT2000_STSREG_BOOTSEL_EPROM16 1
291#define XT2000_STSREG_BOOTSEL_PROM8 2
292#define XT2000_STSREG_BOOTSEL_ASRAM 3
293/* User-defined bits of switch SW3: */
294#define XT2000_STSREG_SW3_2_SHIFT 2
295#define XT2000_STSREG_SW3_2_MASK 0x00000004
296#define XT2000_STSREG_SW3_3_SHIFT 3
297#define XT2000_STSREG_SW3_3_MASK 0x00000008
298
299/* SYSLED (system LED) bit fields: */
300
301/* LED control bit (0=off, 1=on): */
302#define XT2000_SYSLED_LEDON_SHIFT 0
303#define XT2000_SYSLED_LEDON_MASK 0x00000001
304
305/* WRPROT (write protect) bit fields (0=writable, 1=write-protected [default]): */
306
307/* Flash write protect: */
308#define XT2000_WRPROT_FLWP_SHIFT 0
309#define XT2000_WRPROT_FLWP_MASK 0x00000001
310/* Reserved but present write protect bits: */
311#define XT2000_WRPROT_WRP_SHIFT 1
312#define XT2000_WRPROT_WRP_BITS 7
313#define XT2000_WRPROT_WRP_MASK 0x000000FE
314
315/* SWRST (software reset; allows s/w to generate power-on equivalent reset): */
316
317/* Software reset bits: */
318#define XT2000_SWRST_SWR_SHIFT 0
319#define XT2000_SWRST_SWR_BITS 16
320#define XT2000_SWRST_SWR_MASK 0x0000FFFF
321/* Software reset value -- writing this value resets the board: */
322#define XT2000_SWRST_RESETVALUE 0x0000DEAD
323
324/* SYSRST (system reset; controls reset of individual peripherals): */
325
326/* All-device reset: */
327#define XT2000_SYSRST_ALL_SHIFT 0
328#define XT2000_SYSRST_ALL_BITS 4
329#define XT2000_SYSRST_ALL_MASK 0x0000000F
330/* HDSP-2534 LED display reset (1=reset, 0=nothing): */
331#define XT2000_SYSRST_LED_SHIFT 0
332#define XT2000_SYSRST_LED_MASK 0x00000001
333/* Sonic DP83934 Ethernet controller reset (1=reset, 0=nothing): */
334#define XT2000_SYSRST_SONIC_SHIFT 1
335#define XT2000_SYSRST_SONIC_MASK 0x00000002
336/* DP16552 DUART reset (1=reset, 0=nothing): */
337#define XT2000_SYSRST_DUART_SHIFT 2
338#define XT2000_SYSRST_DUART_MASK 0x00000004
339/* V3 V320 PCI bridge controller reset (1=reset, 0=nothing): */
340#define XT2000_SYSRST_V3_SHIFT 3
341#define XT2000_SYSRST_V3_MASK 0x00000008
342
343/* IMASK (interrupt mask; 0=disable, 1=enable): */
344/* ISTAT (interrupt status; 0=inactive, 1=pending): */
345
346/* PCI INTP interrupt: */
347#define XT2000_INTMUX_PCI_INTP_SHIFT 2
348#define XT2000_INTMUX_PCI_INTP_MASK 0x00000004
349/* PCI INTS interrupt: */
350#define XT2000_INTMUX_PCI_INTS_SHIFT 3
351#define XT2000_INTMUX_PCI_INTS_MASK 0x00000008
352/* PCI INTD interrupt: */
353#define XT2000_INTMUX_PCI_INTD_SHIFT 4
354#define XT2000_INTMUX_PCI_INTD_MASK 0x00000010
355/* V320 PCI controller interrupt: */
356#define XT2000_INTMUX_V3_SHIFT 5
357#define XT2000_INTMUX_V3_MASK 0x00000020
358/* PCI ENUM interrupt: */
359#define XT2000_INTMUX_PCI_ENUM_SHIFT 6
360#define XT2000_INTMUX_PCI_ENUM_MASK 0x00000040
361/* PCI DEG interrupt: */
362#define XT2000_INTMUX_PCI_DEG_SHIFT 7
363#define XT2000_INTMUX_PCI_DEG_MASK 0x00000080
364
365/* V3CFG (V3 config, V320 PCI controller): */
366
367/* V3 address control (0=pass-thru, 1=V3 address bits 31:28 set to 4'b0001 [default]): */
368#define XT2000_V3CFG_V3ADC_SHIFT 0
369#define XT2000_V3CFG_V3ADC_MASK 0x00000001
370
371/* I2C Devices */
372
373#define XT2000_I2C_RTC_ID 0x68
374#define XT2000_I2C_NVRAM0_ID 0x56 /* 1st 256 byte block */
375#define XT2000_I2C_NVRAM1_ID 0x57 /* 2nd 256 byte block */
376
377/* NVRAM Board Info structure: */
378
379#define XT2000_NVRAM_SIZE 512
380
381#define XT2000_NVRAM_BINFO_START 0x100
382#define XT2000_NVRAM_BINFO_SIZE 0x20
383#define XT2000_NVRAM_BINFO_VERSION 0x10 /* version 1.0 */
384#if 0
385#define XT2000_NVRAM_BINFO_VERSION_OFFSET 0x00
386#define XT2000_NVRAM_BINFO_VERSION_SIZE 0x1
387#define XT2000_NVRAM_BINFO_ETH_ADDR_OFFSET 0x02
388#define XT2000_NVRAM_BINFO_ETH_ADDR_SIZE 0x6
389#define XT2000_NVRAM_BINFO_SN_OFFSET 0x10
390#define XT2000_NVRAM_BINFO_SN_SIZE 0xE
391#define XT2000_NVRAM_BINFO_CRC_OFFSET 0x1E
392#define XT2000_NVRAM_BINFO_CRC_SIZE 0x2
393#endif /*0*/
394
395#if !defined(__ASSEMBLY__) && !defined(_NOCLANGUAGE)
396typedef struct xt2000_nvram_binfo {
397 unsigned char version;
398 unsigned char reserved1;
399 unsigned char eth_addr[6];
400 unsigned char reserved8[8];
401 unsigned char serialno[14];
402 unsigned char crc[2]; /* 16-bit CRC */
403} xt2000_nvram_binfo;
404#endif /*!__ASSEMBLY__ && !_NOCLANGUAGE*/
405
406
407#endif /*_INC_XT2000_H_*/
408
diff --git a/include/asm-xtensa/xtensa/xtboard.h b/include/asm-xtensa/xtensa/xtboard.h
new file mode 100644
index 000000000000..22469c175307
--- /dev/null
+++ b/include/asm-xtensa/xtensa/xtboard.h
@@ -0,0 +1,120 @@
1#ifndef _xtboard_h_included_
2#define _xtboard_h_included_
3
4/*
5 * THIS FILE IS GENERATED -- DO NOT MODIFY BY HAND
6 *
7 * xtboard.h -- Routines for getting useful information from the board.
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 *
13 * Copyright (C) 2002 Tensilica Inc.
14 */
15
16
17#include <xtensa/xt2000.h>
18
19#define XTBOARD_RTC_ERROR -1
20#define XTBOARD_RTC_STOPPED -2
21
22
23/* xt2000-i2cdev.c: */
24typedef void XtboardDelayFunc( unsigned );
25extern XtboardDelayFunc* xtboard_set_nsdelay_func( XtboardDelayFunc *delay_fn );
26extern int xtboard_i2c_read (unsigned id, unsigned char *buf, unsigned addr, unsigned size);
27extern int xtboard_i2c_write(unsigned id, unsigned char *buf, unsigned addr, unsigned size);
28extern int xtboard_i2c_wait_nvram_ack(unsigned id, unsigned swtimer);
29
30/* xtboard.c: */
31extern int xtboard_nvram_read (unsigned addr, unsigned len, unsigned char *buf);
32extern int xtboard_nvram_write(unsigned addr, unsigned len, unsigned char *buf);
33extern int xtboard_nvram_binfo_read (xt2000_nvram_binfo *buf);
34extern int xtboard_nvram_binfo_write(xt2000_nvram_binfo *buf);
35extern int xtboard_nvram_binfo_valid(xt2000_nvram_binfo *buf);
36extern int xtboard_ethermac_get(unsigned char *buf);
37extern int xtboard_ethermac_set(unsigned char *buf);
38
39/*+*----------------------------------------------------------------------------
40/ Function: xtboard_get_rtc_time
41/
42/ Description: Get time stored in real-time clock.
43/
44/ Returns: time in seconds stored in real-time clock.
45/-**----------------------------------------------------------------------------*/
46
47extern unsigned xtboard_get_rtc_time(void);
48
49/*+*----------------------------------------------------------------------------
50/ Function: xtboard_set_rtc_time
51/
52/ Description: Set time stored in real-time clock.
53/
54/ Parameters: time -- time in seconds to store to real-time clock
55/
56/ Returns: 0 on success, xtboard_i2c_write() error code otherwise.
57/-**----------------------------------------------------------------------------*/
58
59extern int xtboard_set_rtc_time(unsigned time);
60
61
62/* xtfreq.c: */
63/*+*----------------------------------------------------------------------------
64/ Function: xtboard_measure_sys_clk
65/
66/ Description: Get frequency of system clock.
67/
68/ Parameters: none
69/
70/ Returns: frequency of system clock.
71/-**----------------------------------------------------------------------------*/
72
73extern unsigned xtboard_measure_sys_clk(void);
74
75
76#if 0 /* old stuff from xtboard.c: */
77
78/*+*----------------------------------------------------------------------------
79/ Function: xtboard_nvram valid
80/
81/ Description: Determines if data in NVRAM is valid.
82/
83/ Parameters: delay -- 10us delay function
84/
85/ Returns: 1 if NVRAM is valid, 0 otherwise
86/-**----------------------------------------------------------------------------*/
87
88extern unsigned xtboard_nvram_valid(void (*delay)( void ));
89
90/*+*----------------------------------------------------------------------------
91/ Function: xtboard_get_nvram_contents
92/
93/ Description: Returns contents of NVRAM.
94/
95/ Parameters: buf -- buffer to NVRAM contents.
96/ delay -- 10us delay function
97/
98/ Returns: 1 if NVRAM is valid, 0 otherwise
99/-**----------------------------------------------------------------------------*/
100
101extern unsigned xtboard_get_nvram_contents(unsigned char *buf, void (*delay)( void ));
102
103/*+*----------------------------------------------------------------------------
104/ Function: xtboard_get_ether_addr
105/
106/ Description: Returns ethernet address of board.
107/
108/ Parameters: buf -- buffer to store ethernet address
109/ delay -- 10us delay function
110/
111/ Returns: nothing.
112/-**----------------------------------------------------------------------------*/
113
114extern void xtboard_get_ether_addr(unsigned char *buf, void (*delay)( void ));
115
116#endif /*0*/
117
118
119#endif /*_xtboard_h_included_*/
120
diff --git a/include/linux/a.out.h b/include/linux/a.out.h
index af8a1dfa5c32..f913cc3e1b0d 100644
--- a/include/linux/a.out.h
+++ b/include/linux/a.out.h
@@ -138,7 +138,7 @@ enum machine_type {
138#endif 138#endif
139#endif 139#endif
140 140
141#define _N_SEGMENT_ROUND(x) (((x) + SEGMENT_SIZE - 1) & ~(SEGMENT_SIZE - 1)) 141#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
142 142
143#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text) 143#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
144 144
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b123cc08773d..b46a5205ee7b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -206,7 +206,10 @@ struct acpi_table_plat_int_src {
206 u8 eid; 206 u8 eid;
207 u8 iosapic_vector; 207 u8 iosapic_vector;
208 u32 global_irq; 208 u32 global_irq;
209 u32 reserved; 209 struct {
210 u32 cpei_override_flag:1;
211 u32 reserved:31;
212 } plint_flags;
210} __attribute__ ((packed)); 213} __attribute__ ((packed));
211 214
212enum acpi_interrupt_id { 215enum acpi_interrupt_id {
@@ -342,11 +345,19 @@ struct acpi_table_ecdt {
342 345
343/* PCI MMCONFIG */ 346/* PCI MMCONFIG */
344 347
348/* Defined in PCI Firmware Specification 3.0 */
349struct acpi_table_mcfg_config {
350 u32 base_address;
351 u32 base_reserved;
352 u16 pci_segment_group_number;
353 u8 start_bus_number;
354 u8 end_bus_number;
355 u8 reserved[4];
356} __attribute__ ((packed));
345struct acpi_table_mcfg { 357struct acpi_table_mcfg {
346 struct acpi_table_header header; 358 struct acpi_table_header header;
347 u8 reserved[8]; 359 u8 reserved[8];
348 u32 base_address; 360 struct acpi_table_mcfg_config config[0];
349 u32 base_reserved;
350} __attribute__ ((packed)); 361} __attribute__ ((packed));
351 362
352/* Table Handlers */ 363/* Table Handlers */
@@ -391,6 +402,7 @@ int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler);
391int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header); 402int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header);
392int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 403int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
393int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 404int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries);
405int acpi_parse_mcfg (unsigned long phys_addr, unsigned long size);
394void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); 406void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
395void acpi_table_print_madt_entry (acpi_table_entry_header *madt); 407void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
396void acpi_table_print_srat_entry (acpi_table_entry_header *srat); 408void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
@@ -407,9 +419,13 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu);
407int acpi_unmap_lsapic(int cpu); 419int acpi_unmap_lsapic(int cpu);
408#endif /* CONFIG_ACPI_HOTPLUG_CPU */ 420#endif /* CONFIG_ACPI_HOTPLUG_CPU */
409 421
422int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
423int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
424
410extern int acpi_mp_config; 425extern int acpi_mp_config;
411 426
412extern u32 pci_mmcfg_base_addr; 427extern struct acpi_table_mcfg_config *pci_mmcfg_config;
428extern int pci_mmcfg_config_num;
413 429
414extern int sbf_port ; 430extern int sbf_port ;
415 431
@@ -437,9 +453,7 @@ int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
437 * If this matches the last registration, any IRQ resources for gsi 453 * If this matches the last registration, any IRQ resources for gsi
438 * are freed. 454 * are freed.
439 */ 455 */
440#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
441void acpi_unregister_gsi (u32 gsi); 456void acpi_unregister_gsi (u32 gsi);
442#endif
443 457
444#ifdef CONFIG_ACPI_PCI 458#ifdef CONFIG_ACPI_PCI
445 459
@@ -462,11 +476,9 @@ struct acpi_prt_list {
462struct pci_dev; 476struct pci_dev;
463 477
464int acpi_pci_irq_enable (struct pci_dev *dev); 478int acpi_pci_irq_enable (struct pci_dev *dev);
465void acpi_penalize_isa_irq(int irq); 479void acpi_penalize_isa_irq(int irq, int active);
466 480
467#ifdef CONFIG_ACPI_DEALLOCATE_IRQ
468void acpi_pci_irq_disable (struct pci_dev *dev); 481void acpi_pci_irq_disable (struct pci_dev *dev);
469#endif
470 482
471struct acpi_pci_driver { 483struct acpi_pci_driver {
472 struct acpi_pci_driver *next; 484 struct acpi_pci_driver *next;
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 09a1451c1159..911c09cb9bf9 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -1,6 +1,8 @@
1#ifndef __LINUX_ATALK_H__ 1#ifndef __LINUX_ATALK_H__
2#define __LINUX_ATALK_H__ 2#define __LINUX_ATALK_H__
3 3
4#include <asm/byteorder.h>
5
4/* 6/*
5 * AppleTalk networking structures 7 * AppleTalk networking structures
6 * 8 *
diff --git a/include/linux/audit.h b/include/linux/audit.h
index bf2ad3ba72eb..68aba0c02e49 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -165,7 +165,7 @@
165#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT) 165#define AUDIT_ARCH_SH64 (EM_SH|__AUDIT_ARCH_64BIT)
166#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 166#define AUDIT_ARCH_SHEL64 (EM_SH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
167#define AUDIT_ARCH_SPARC (EM_SPARC) 167#define AUDIT_ARCH_SPARC (EM_SPARC)
168#define AUDIT_ARCH_SPARC64 (EM_SPARC64|__AUDIT_ARCH_64BIT) 168#define AUDIT_ARCH_SPARC64 (EM_SPARCV9|__AUDIT_ARCH_64BIT)
169#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) 169#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE)
170#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 170#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
171 171
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 7e736e201c46..c1e82c514443 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -69,6 +69,11 @@ extern void remove_arg_zero(struct linux_binprm *);
69extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); 69extern int search_binary_handler(struct linux_binprm *,struct pt_regs *);
70extern int flush_old_exec(struct linux_binprm * bprm); 70extern int flush_old_exec(struct linux_binprm * bprm);
71 71
72extern int suid_dumpable;
73#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
74#define SUID_DUMP_USER 1 /* Dump as user of process */
75#define SUID_DUMP_ROOT 2 /* Dump as root */
76
72/* Stack area protections */ 77/* Stack area protections */
73#define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */ 78#define EXSTACK_DEFAULT 0 /* Whatever the arch defaults to */
74#define EXSTACK_DISABLE_X 1 /* Disable executable stacks */ 79#define EXSTACK_DISABLE_X 1 /* Disable executable stacks */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 038022763f09..36ef29fa0d8b 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -22,6 +22,7 @@
22 22
23#include <linux/highmem.h> 23#include <linux/highmem.h>
24#include <linux/mempool.h> 24#include <linux/mempool.h>
25#include <linux/ioprio.h>
25 26
26/* Platforms may set this to teach the BIO layer about IOMMU hardware. */ 27/* Platforms may set this to teach the BIO layer about IOMMU hardware. */
27#include <asm/io.h> 28#include <asm/io.h>
@@ -150,6 +151,19 @@ struct bio {
150#define BIO_RW_SYNC 4 151#define BIO_RW_SYNC 4
151 152
152/* 153/*
154 * upper 16 bits of bi_rw define the io priority of this bio
155 */
156#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
157#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
158#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
159
160#define bio_set_prio(bio, prio) do { \
161 WARN_ON(prio >= (1 << IOPRIO_BITS)); \
162 (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1); \
163 (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT); \
164} while (0)
165
166/*
153 * various member access, note that bio_data should of course not be used 167 * various member access, note that bio_data should of course not be used
154 * on highmem page vectors 168 * on highmem page vectors
155 */ 169 */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4a99b76c5a33..19bd8e7e11bf 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -54,16 +54,23 @@ struct as_io_context {
54 54
55struct cfq_queue; 55struct cfq_queue;
56struct cfq_io_context { 56struct cfq_io_context {
57 void (*dtor)(struct cfq_io_context *);
58 void (*exit)(struct cfq_io_context *);
59
60 struct io_context *ioc;
61
62 /* 57 /*
63 * circular list of cfq_io_contexts belonging to a process io context 58 * circular list of cfq_io_contexts belonging to a process io context
64 */ 59 */
65 struct list_head list; 60 struct list_head list;
66 struct cfq_queue *cfqq; 61 struct cfq_queue *cfqq;
62 void *key;
63
64 struct io_context *ioc;
65
66 unsigned long last_end_request;
67 unsigned long last_queue;
68 unsigned long ttime_total;
69 unsigned long ttime_samples;
70 unsigned long ttime_mean;
71
72 void (*dtor)(struct cfq_io_context *);
73 void (*exit)(struct cfq_io_context *);
67}; 74};
68 75
69/* 76/*
@@ -73,7 +80,9 @@ struct cfq_io_context {
73 */ 80 */
74struct io_context { 81struct io_context {
75 atomic_t refcount; 82 atomic_t refcount;
76 pid_t pid; 83 struct task_struct *task;
84
85 int (*set_ioprio)(struct io_context *, unsigned int);
77 86
78 /* 87 /*
79 * For request batching 88 * For request batching
@@ -81,14 +90,13 @@ struct io_context {
81 unsigned long last_waited; /* Time last woken after wait for request */ 90 unsigned long last_waited; /* Time last woken after wait for request */
82 int nr_batch_requests; /* Number of requests left in the batch */ 91 int nr_batch_requests; /* Number of requests left in the batch */
83 92
84 spinlock_t lock;
85
86 struct as_io_context *aic; 93 struct as_io_context *aic;
87 struct cfq_io_context *cic; 94 struct cfq_io_context *cic;
88}; 95};
89 96
90void put_io_context(struct io_context *ioc); 97void put_io_context(struct io_context *ioc);
91void exit_io_context(void); 98void exit_io_context(void);
99struct io_context *current_io_context(int gfp_flags);
92struct io_context *get_io_context(int gfp_flags); 100struct io_context *get_io_context(int gfp_flags);
93void copy_io_context(struct io_context **pdst, struct io_context **psrc); 101void copy_io_context(struct io_context **pdst, struct io_context **psrc);
94void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
@@ -134,6 +142,8 @@ struct request {
134 142
135 void *elevator_private; 143 void *elevator_private;
136 144
145 unsigned short ioprio;
146
137 int rq_status; /* should split this into a few status bits */ 147 int rq_status; /* should split this into a few status bits */
138 struct gendisk *rq_disk; 148 struct gendisk *rq_disk;
139 int errors; 149 int errors;
@@ -285,9 +295,6 @@ enum blk_queue_state {
285 Queue_up, 295 Queue_up,
286}; 296};
287 297
288#define BLK_TAGS_PER_LONG (sizeof(unsigned long) * 8)
289#define BLK_TAGS_MASK (BLK_TAGS_PER_LONG - 1)
290
291struct blk_queue_tag { 298struct blk_queue_tag {
292 struct request **tag_index; /* map of busy tags */ 299 struct request **tag_index; /* map of busy tags */
293 unsigned long *tag_map; /* bit map of free/busy tags */ 300 unsigned long *tag_map; /* bit map of free/busy tags */
@@ -396,6 +403,7 @@ struct request_queue
396 */ 403 */
397 unsigned int sg_timeout; 404 unsigned int sg_timeout;
398 unsigned int sg_reserved_size; 405 unsigned int sg_reserved_size;
406 int node;
399 407
400 struct list_head drain_list; 408 struct list_head drain_list;
401 409
@@ -542,15 +550,12 @@ extern void generic_make_request(struct bio *bio);
542extern void blk_put_request(struct request *); 550extern void blk_put_request(struct request *);
543extern void blk_end_sync_rq(struct request *rq); 551extern void blk_end_sync_rq(struct request *rq);
544extern void blk_attempt_remerge(request_queue_t *, struct request *); 552extern void blk_attempt_remerge(request_queue_t *, struct request *);
545extern void __blk_attempt_remerge(request_queue_t *, struct request *);
546extern struct request *blk_get_request(request_queue_t *, int, int); 553extern struct request *blk_get_request(request_queue_t *, int, int);
547extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 554extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
548extern void blk_requeue_request(request_queue_t *, struct request *); 555extern void blk_requeue_request(request_queue_t *, struct request *);
549extern void blk_plug_device(request_queue_t *); 556extern void blk_plug_device(request_queue_t *);
550extern int blk_remove_plug(request_queue_t *); 557extern int blk_remove_plug(request_queue_t *);
551extern void blk_recount_segments(request_queue_t *, struct bio *); 558extern void blk_recount_segments(request_queue_t *, struct bio *);
552extern int blk_phys_contig_segment(request_queue_t *q, struct bio *, struct bio *);
553extern int blk_hw_contig_segment(request_queue_t *q, struct bio *, struct bio *);
554extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 559extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
555extern void blk_start_queue(request_queue_t *q); 560extern void blk_start_queue(request_queue_t *q);
556extern void blk_stop_queue(request_queue_t *q); 561extern void blk_stop_queue(request_queue_t *q);
@@ -615,6 +620,8 @@ static inline void blkdev_dequeue_request(struct request *req)
615/* 620/*
616 * Access functions for manipulating queue properties 621 * Access functions for manipulating queue properties
617 */ 622 */
623extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn,
624 spinlock_t *lock, int node_id);
618extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *); 625extern request_queue_t *blk_init_queue(request_fn_proc *, spinlock_t *);
619extern void blk_cleanup_queue(request_queue_t *); 626extern void blk_cleanup_queue(request_queue_t *);
620extern void blk_queue_make_request(request_queue_t *, make_request_fn *); 627extern void blk_queue_make_request(request_queue_t *, make_request_fn *);
@@ -632,7 +639,6 @@ extern void blk_queue_dma_alignment(request_queue_t *, int);
632extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 639extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
633extern void blk_queue_ordered(request_queue_t *, int); 640extern void blk_queue_ordered(request_queue_t *, int);
634extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 641extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *);
635extern int blkdev_scsi_issue_flush_fn(request_queue_t *, struct gendisk *, sector_t *);
636extern struct request *blk_start_pre_flush(request_queue_t *,struct request *); 642extern struct request *blk_start_pre_flush(request_queue_t *,struct request *);
637extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int); 643extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int);
638extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int); 644extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int);
@@ -646,7 +652,8 @@ extern void blk_wait_queue_drained(request_queue_t *, int);
646extern void blk_finish_queue_drain(request_queue_t *); 652extern void blk_finish_queue_drain(request_queue_t *);
647 653
648int blk_get_queue(request_queue_t *); 654int blk_get_queue(request_queue_t *);
649request_queue_t *blk_alloc_queue(int); 655request_queue_t *blk_alloc_queue(int gfp_mask);
656request_queue_t *blk_alloc_queue_node(int,int);
650#define blk_put_queue(q) blk_cleanup_queue((q)) 657#define blk_put_queue(q) blk_cleanup_queue((q))
651 658
652/* 659/*
@@ -675,8 +682,6 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
675 682
676#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) 683#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
677 684
678extern void drive_stat_acct(struct request *, int, int);
679
680static inline int queue_hardsect_size(request_queue_t *q) 685static inline int queue_hardsect_size(request_queue_t *q)
681{ 686{
682 int retval = 512; 687 int retval = 512;
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 0dd8ca1a3d5a..82bd8842d11c 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -22,6 +22,10 @@ extern unsigned long min_low_pfn;
22 */ 22 */
23extern unsigned long max_pfn; 23extern unsigned long max_pfn;
24 24
25#ifdef CONFIG_CRASH_DUMP
26extern unsigned long saved_max_pfn;
27#endif
28
25/* 29/*
26 * node_bootmem_map is a map pointer - the bits represent all physical 30 * node_bootmem_map is a map pointer - the bits represent all physical
27 * memory pages (including holes) on the node. 31 * memory pages (including holes) on the node.
@@ -67,6 +71,15 @@ extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size,
67 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) 71 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0)
68#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 72#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
69 73
74#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
75extern void *alloc_remap(int nid, unsigned long size);
76#else
77static inline void *alloc_remap(int nid, unsigned long size)
78{
79 return NULL;
80}
81#endif
82
70extern unsigned long __initdata nr_kernel_pages; 83extern unsigned long __initdata nr_kernel_pages;
71extern unsigned long __initdata nr_all_pages; 84extern unsigned long __initdata nr_all_pages;
72 85
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 802c91e9b3da..90828493791f 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -19,6 +19,9 @@ enum bh_state_bits {
19 BH_Dirty, /* Is dirty */ 19 BH_Dirty, /* Is dirty */
20 BH_Lock, /* Is locked */ 20 BH_Lock, /* Is locked */
21 BH_Req, /* Has been submitted for I/O */ 21 BH_Req, /* Has been submitted for I/O */
22 BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise
23 * IO completion of other buffers in the page
24 */
22 25
23 BH_Mapped, /* Has a disk mapping */ 26 BH_Mapped, /* Has a disk mapping */
24 BH_New, /* Disk mapping was newly created by get_block */ 27 BH_New, /* Disk mapping was newly created by get_block */
diff --git a/include/linux/byteorder/swabb.h b/include/linux/byteorder/swabb.h
index d28d9a804d3b..d5f2a3205109 100644
--- a/include/linux/byteorder/swabb.h
+++ b/include/linux/byteorder/swabb.h
@@ -92,29 +92,32 @@
92#endif /* OPTIMIZE */ 92#endif /* OPTIMIZE */
93 93
94 94
95static __inline__ __const__ __u32 __fswahw32(__u32 x) 95static inline __u32 __fswahw32(__u32 x)
96{ 96{
97 return __arch__swahw32(x); 97 return __arch__swahw32(x);
98} 98}
99static __inline__ __u32 __swahw32p(__u32 *x) 99
100static inline __u32 __swahw32p(__u32 *x)
100{ 101{
101 return __arch__swahw32p(x); 102 return __arch__swahw32p(x);
102} 103}
103static __inline__ void __swahw32s(__u32 *addr) 104
105static inline void __swahw32s(__u32 *addr)
104{ 106{
105 __arch__swahw32s(addr); 107 __arch__swahw32s(addr);
106} 108}
107 109
108 110static inline __u32 __fswahb32(__u32 x)
109static __inline__ __const__ __u32 __fswahb32(__u32 x)
110{ 111{
111 return __arch__swahb32(x); 112 return __arch__swahb32(x);
112} 113}
113static __inline__ __u32 __swahb32p(__u32 *x) 114
115static inline __u32 __swahb32p(__u32 *x)
114{ 116{
115 return __arch__swahb32p(x); 117 return __arch__swahb32p(x);
116} 118}
117static __inline__ void __swahb32s(__u32 *addr) 119
120static inline void __swahb32s(__u32 *addr)
118{ 121{
119 __arch__swahb32s(addr); 122 __arch__swahb32s(addr);
120} 123}
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 4d767b93738a..f6b5a46c5f82 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -13,6 +13,12 @@
13#define SMP_CACHE_BYTES L1_CACHE_BYTES 13#define SMP_CACHE_BYTES L1_CACHE_BYTES
14#endif 14#endif
15 15
16#if defined(CONFIG_X86) || defined(CONFIG_SPARC64)
17#define __read_mostly __attribute__((__section__(".data.read_mostly")))
18#else
19#define __read_mostly
20#endif
21
16#ifndef ____cacheline_aligned 22#ifndef ____cacheline_aligned
17#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES))) 23#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
18#endif 24#endif
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h
index ee0c6e8995da..424d5e622b43 100644
--- a/include/linux/cciss_ioctl.h
+++ b/include/linux/cciss_ioctl.h
@@ -10,6 +10,7 @@
10typedef struct _cciss_pci_info_struct 10typedef struct _cciss_pci_info_struct
11{ 11{
12 unsigned char bus; 12 unsigned char bus;
13 unsigned short domain;
13 unsigned char dev_fn; 14 unsigned char dev_fn;
14 __u32 board_id; 15 __u32 board_id;
15} cciss_pci_info_struct; 16} cciss_pci_info_struct;
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index 70a4ebb5d964..ecb0d39c0798 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -346,10 +346,27 @@ COMPATIBLE_IOCTL(PPPOEIOCDFWD)
346/* LP */ 346/* LP */
347COMPATIBLE_IOCTL(LPGETSTATUS) 347COMPATIBLE_IOCTL(LPGETSTATUS)
348/* ppdev */ 348/* ppdev */
349COMPATIBLE_IOCTL(PPSETMODE)
350COMPATIBLE_IOCTL(PPRSTATUS)
351COMPATIBLE_IOCTL(PPRCONTROL)
352COMPATIBLE_IOCTL(PPWCONTROL)
353COMPATIBLE_IOCTL(PPFCONTROL)
354COMPATIBLE_IOCTL(PPRDATA)
355COMPATIBLE_IOCTL(PPWDATA)
349COMPATIBLE_IOCTL(PPCLAIM) 356COMPATIBLE_IOCTL(PPCLAIM)
350COMPATIBLE_IOCTL(PPRELEASE) 357COMPATIBLE_IOCTL(PPRELEASE)
351COMPATIBLE_IOCTL(PPEXCL)
352COMPATIBLE_IOCTL(PPYIELD) 358COMPATIBLE_IOCTL(PPYIELD)
359COMPATIBLE_IOCTL(PPEXCL)
360COMPATIBLE_IOCTL(PPDATADIR)
361COMPATIBLE_IOCTL(PPNEGOT)
362COMPATIBLE_IOCTL(PPWCTLONIRQ)
363COMPATIBLE_IOCTL(PPCLRIRQ)
364COMPATIBLE_IOCTL(PPSETPHASE)
365COMPATIBLE_IOCTL(PPGETMODES)
366COMPATIBLE_IOCTL(PPGETMODE)
367COMPATIBLE_IOCTL(PPGETPHASE)
368COMPATIBLE_IOCTL(PPGETFLAGS)
369COMPATIBLE_IOCTL(PPSETFLAGS)
353/* CDROM stuff */ 370/* CDROM stuff */
354COMPATIBLE_IOCTL(CDROMPAUSE) 371COMPATIBLE_IOCTL(CDROMPAUSE)
355COMPATIBLE_IOCTL(CDROMRESUME) 372COMPATIBLE_IOCTL(CDROMRESUME)
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index fe0298e5dae1..e8904c0da686 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -69,6 +69,7 @@ extern struct semaphore cpucontrol;
69 register_cpu_notifier(&fn##_nb); \ 69 register_cpu_notifier(&fn##_nb); \
70} 70}
71int cpu_down(unsigned int cpu); 71int cpu_down(unsigned int cpu);
72extern int __attribute__((weak)) smp_prepare_cpu(int cpu);
72#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) 73#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
73#else 74#else
74#define lock_cpu_hotplug() do { } while (0) 75#define lock_cpu_hotplug() do { } while (0)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 927daa86c9b3..ff7f80f48df1 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -201,7 +201,7 @@ struct cpufreq_driver {
201 201
202 /* optional */ 202 /* optional */
203 int (*exit) (struct cpufreq_policy *policy); 203 int (*exit) (struct cpufreq_policy *policy);
204 int (*suspend) (struct cpufreq_policy *policy, u32 state); 204 int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg);
205 int (*resume) (struct cpufreq_policy *policy); 205 int (*resume) (struct cpufreq_policy *policy);
206 struct freq_attr **attr; 206 struct freq_attr **attr;
207}; 207};
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
new file mode 100644
index 000000000000..534d750d922d
--- /dev/null
+++ b/include/linux/crash_dump.h
@@ -0,0 +1,18 @@
1#ifndef LINUX_CRASH_DUMP_H
2#define LINUX_CRASH_DUMP_H
3
4#ifdef CONFIG_CRASH_DUMP
5#include <linux/kexec.h>
6#include <linux/smp_lock.h>
7#include <linux/device.h>
8#include <linux/proc_fs.h>
9
10#define ELFCORE_ADDR_MAX (-1ULL)
11extern unsigned long long elfcorehdr_addr;
12extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
13 unsigned long, int);
14extern struct file_operations proc_vmcore_operations;
15extern struct proc_dir_entry *proc_vmcore;
16
17#endif /* CONFIG_CRASH_DUMP */
18#endif /* LINUX_CRASHDUMP_H */
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 387da6a3e58c..5e2bcc636a02 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -61,6 +61,15 @@
61#define CRYPTO_DIR_DECRYPT 0 61#define CRYPTO_DIR_DECRYPT 0
62 62
63struct scatterlist; 63struct scatterlist;
64struct crypto_tfm;
65
66struct cipher_desc {
67 struct crypto_tfm *tfm;
68 void (*crfn)(void *ctx, u8 *dst, const u8 *src);
69 unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst,
70 const u8 *src, unsigned int nbytes);
71 void *info;
72};
64 73
65/* 74/*
66 * Algorithms: modular crypto algorithm implementations, managed 75 * Algorithms: modular crypto algorithm implementations, managed
@@ -73,6 +82,19 @@ struct cipher_alg {
73 unsigned int keylen, u32 *flags); 82 unsigned int keylen, u32 *flags);
74 void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); 83 void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src);
75 void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); 84 void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src);
85
86 unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
87 u8 *dst, const u8 *src,
88 unsigned int nbytes);
89 unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
90 u8 *dst, const u8 *src,
91 unsigned int nbytes);
92 unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
93 u8 *dst, const u8 *src,
94 unsigned int nbytes);
95 unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
96 u8 *dst, const u8 *src,
97 unsigned int nbytes);
76}; 98};
77 99
78struct digest_alg { 100struct digest_alg {
@@ -102,6 +124,7 @@ struct crypto_alg {
102 u32 cra_flags; 124 u32 cra_flags;
103 unsigned int cra_blocksize; 125 unsigned int cra_blocksize;
104 unsigned int cra_ctxsize; 126 unsigned int cra_ctxsize;
127 unsigned int cra_alignmask;
105 const char cra_name[CRYPTO_MAX_ALG_NAME]; 128 const char cra_name[CRYPTO_MAX_ALG_NAME];
106 129
107 union { 130 union {
@@ -136,7 +159,6 @@ static inline int crypto_alg_available(const char *name, u32 flags)
136 * and core processing logic. Managed via crypto_alloc_tfm() and 159 * and core processing logic. Managed via crypto_alloc_tfm() and
137 * crypto_free_tfm(), as well as the various helpers below. 160 * crypto_free_tfm(), as well as the various helpers below.
138 */ 161 */
139struct crypto_tfm;
140 162
141struct cipher_tfm { 163struct cipher_tfm {
142 void *cit_iv; 164 void *cit_iv;
@@ -266,6 +288,16 @@ static inline unsigned int crypto_tfm_alg_digestsize(struct crypto_tfm *tfm)
266 return tfm->__crt_alg->cra_digest.dia_digestsize; 288 return tfm->__crt_alg->cra_digest.dia_digestsize;
267} 289}
268 290
291static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
292{
293 return tfm->__crt_alg->cra_alignmask;
294}
295
296static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
297{
298 return (void *)&tfm[1];
299}
300
269/* 301/*
270 * API wrappers. 302 * API wrappers.
271 */ 303 */
diff --git a/include/linux/dcookies.h b/include/linux/dcookies.h
index c28050136164..1d68428c925d 100644
--- a/include/linux/dcookies.h
+++ b/include/linux/dcookies.h
@@ -48,12 +48,12 @@ int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
48 48
49#else 49#else
50 50
51struct dcookie_user * dcookie_register(void) 51static inline struct dcookie_user * dcookie_register(void)
52{ 52{
53 return NULL; 53 return NULL;
54} 54}
55 55
56void dcookie_unregister(struct dcookie_user * user) 56static inline void dcookie_unregister(struct dcookie_user * user)
57{ 57{
58 return; 58 return;
59} 59}
diff --git a/include/linux/device.h b/include/linux/device.h
index 7b781a72b293..06e5d42f2c7b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -69,7 +69,7 @@ struct bus_type {
69extern int bus_register(struct bus_type * bus); 69extern int bus_register(struct bus_type * bus);
70extern void bus_unregister(struct bus_type * bus); 70extern void bus_unregister(struct bus_type * bus);
71 71
72extern int bus_rescan_devices(struct bus_type * bus); 72extern void bus_rescan_devices(struct bus_type * bus);
73 73
74extern struct bus_type * get_bus(struct bus_type * bus); 74extern struct bus_type * get_bus(struct bus_type * bus);
75extern void put_bus(struct bus_type * bus); 75extern void put_bus(struct bus_type * bus);
@@ -80,6 +80,8 @@ extern struct bus_type * find_bus(char * name);
80 80
81int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, 81int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data,
82 int (*fn)(struct device *, void *)); 82 int (*fn)(struct device *, void *));
83struct device * bus_find_device(struct bus_type *bus, struct device *start,
84 void *data, int (*match)(struct device *, void *));
83 85
84int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, 86int bus_for_each_drv(struct bus_type * bus, struct device_driver * start,
85 void * data, int (*fn)(struct device_driver *, void *)); 87 void * data, int (*fn)(struct device_driver *, void *));
@@ -142,6 +144,9 @@ extern void driver_remove_file(struct device_driver *, struct driver_attribute *
142 144
143extern int driver_for_each_device(struct device_driver * drv, struct device * start, 145extern int driver_for_each_device(struct device_driver * drv, struct device * start,
144 void * data, int (*fn)(struct device *, void *)); 146 void * data, int (*fn)(struct device *, void *));
147struct device * driver_find_device(struct device_driver *drv,
148 struct device *start, void *data,
149 int (*match)(struct device *, void *));
145 150
146 151
147/* 152/*
@@ -279,8 +284,10 @@ struct device {
279 struct device_driver *driver; /* which driver has allocated this 284 struct device_driver *driver; /* which driver has allocated this
280 device */ 285 device */
281 void *driver_data; /* data private to the driver */ 286 void *driver_data; /* data private to the driver */
282 void *platform_data; /* Platform specific data (e.g. ACPI, 287 void *platform_data; /* Platform specific data, device
283 BIOS data relevant to device) */ 288 core doesn't touch it */
289 void *firmware_data; /* Firmware specific data (e.g. ACPI,
290 BIOS data),reserved for device core*/
284 struct dev_pm_info power; 291 struct dev_pm_info power;
285 292
286 u64 *dma_mask; /* dma mask (if dma'able device) */ 293 u64 *dma_mask; /* dma mask (if dma'able device) */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index d2bcf556088b..5e93e6dce9a4 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -9,6 +9,7 @@ enum dmi_field {
9 DMI_SYS_VENDOR, 9 DMI_SYS_VENDOR,
10 DMI_PRODUCT_NAME, 10 DMI_PRODUCT_NAME,
11 DMI_PRODUCT_VERSION, 11 DMI_PRODUCT_VERSION,
12 DMI_PRODUCT_SERIAL,
12 DMI_BOARD_VENDOR, 13 DMI_BOARD_VENDOR,
13 DMI_BOARD_NAME, 14 DMI_BOARD_NAME,
14 DMI_BOARD_VERSION, 15 DMI_BOARD_VERSION,
diff --git a/include/linux/dqblk_v1.h b/include/linux/dqblk_v1.h
index 42fbf4797156..57f1250d5a52 100644
--- a/include/linux/dqblk_v1.h
+++ b/include/linux/dqblk_v1.h
@@ -11,6 +11,12 @@
11/* Root squash turned on */ 11/* Root squash turned on */
12#define V1_DQF_RSQUASH 1 12#define V1_DQF_RSQUASH 1
13 13
14/* Numbers of blocks needed for updates */
15#define V1_INIT_ALLOC 1
16#define V1_INIT_REWRITE 1
17#define V1_DEL_ALLOC 0
18#define V1_DEL_REWRITE 2
19
14/* Special information about quotafile */ 20/* Special information about quotafile */
15struct v1_mem_dqinfo { 21struct v1_mem_dqinfo {
16}; 22};
diff --git a/include/linux/dqblk_v2.h b/include/linux/dqblk_v2.h
index 4a6c5f6867bb..4f853322cb7f 100644
--- a/include/linux/dqblk_v2.h
+++ b/include/linux/dqblk_v2.h
@@ -10,6 +10,12 @@
10/* id numbers of quota format */ 10/* id numbers of quota format */
11#define QFMT_VFS_V0 2 11#define QFMT_VFS_V0 2
12 12
13/* Numbers of blocks needed for updates */
14#define V2_INIT_ALLOC 4
15#define V2_INIT_REWRITE 2
16#define V2_DEL_ALLOC 0
17#define V2_DEL_REWRITE 6
18
13/* Inmemory copy of version specific information */ 19/* Inmemory copy of version specific information */
14struct v2_mem_dqinfo { 20struct v2_mem_dqinfo {
15 unsigned int dqi_blocks; 21 unsigned int dqi_blocks;
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 047e7222df7a..73781ec165b4 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -315,7 +315,7 @@ extern struct efi_memory_map memmap;
315 */ 315 */
316static inline int efi_range_is_wc(unsigned long start, unsigned long len) 316static inline int efi_range_is_wc(unsigned long start, unsigned long len)
317{ 317{
318 int i; 318 unsigned long i;
319 319
320 for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) { 320 for (i = 0; i < len; i += (1UL << EFI_PAGE_SHIFT)) {
321 unsigned long paddr = __pa(start + i); 321 unsigned long paddr = __pa(start + i);
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index ee54f81faad5..ea6bbc2d7407 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -16,9 +16,9 @@ typedef void (elevator_remove_req_fn) (request_queue_t *, struct request *);
16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *); 16typedef void (elevator_requeue_req_fn) (request_queue_t *, struct request *);
17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); 17typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); 18typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
19typedef int (elevator_may_queue_fn) (request_queue_t *, int); 19typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
20 20
21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, int); 21typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int);
22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 22typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 23typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
24 24
@@ -96,9 +96,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *);
96extern struct request *elv_latter_request(request_queue_t *, struct request *); 96extern struct request *elv_latter_request(request_queue_t *, struct request *);
97extern int elv_register_queue(request_queue_t *q); 97extern int elv_register_queue(request_queue_t *q);
98extern void elv_unregister_queue(request_queue_t *q); 98extern void elv_unregister_queue(request_queue_t *q);
99extern int elv_may_queue(request_queue_t *, int); 99extern int elv_may_queue(request_queue_t *, int, struct bio *);
100extern void elv_completed_request(request_queue_t *, struct request *); 100extern void elv_completed_request(request_queue_t *, struct request *);
101extern int elv_set_request(request_queue_t *, struct request *, int); 101extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int);
102extern void elv_put_request(request_queue_t *, struct request *); 102extern void elv_put_request(request_queue_t *, struct request *);
103 103
104/* 104/*
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index a1478258d002..ce8518e658b6 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -25,6 +25,7 @@
25#define _LINUX_ETHERDEVICE_H 25#define _LINUX_ETHERDEVICE_H
26 26
27#include <linux/if_ether.h> 27#include <linux/if_ether.h>
28#include <linux/netdevice.h>
28#include <linux/random.h> 29#include <linux/random.h>
29 30
30#ifdef __KERNEL__ 31#ifdef __KERNEL__
@@ -32,7 +33,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
32 unsigned short type, void *daddr, 33 unsigned short type, void *daddr,
33 void *saddr, unsigned len); 34 void *saddr, unsigned len);
34extern int eth_rebuild_header(struct sk_buff *skb); 35extern int eth_rebuild_header(struct sk_buff *skb);
35extern unsigned short eth_type_trans(struct sk_buff *skb, struct net_device *dev); 36extern __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
36extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev, 37extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev,
37 unsigned char * haddr); 38 unsigned char * haddr);
38extern int eth_header_cache(struct neighbour *neigh, 39extern int eth_header_cache(struct neighbour *neigh,
@@ -65,7 +66,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
65 */ 66 */
66static inline int is_multicast_ether_addr(const u8 *addr) 67static inline int is_multicast_ether_addr(const u8 *addr)
67{ 68{
68 return addr[0] & 0x01; 69 return ((addr[0] != 0xff) && (0x01 & addr[0]));
69} 70}
70 71
71/** 72/**
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index fab43527e597..a657130ba03a 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -300,18 +300,19 @@ struct ext2_inode {
300/* 300/*
301 * Mount flags 301 * Mount flags
302 */ 302 */
303#define EXT2_MOUNT_CHECK 0x0001 /* Do mount-time checks */ 303#define EXT2_MOUNT_CHECK 0x000001 /* Do mount-time checks */
304#define EXT2_MOUNT_OLDALLOC 0x0002 /* Don't use the new Orlov allocator */ 304#define EXT2_MOUNT_OLDALLOC 0x000002 /* Don't use the new Orlov allocator */
305#define EXT2_MOUNT_GRPID 0x0004 /* Create files with directory's group */ 305#define EXT2_MOUNT_GRPID 0x000004 /* Create files with directory's group */
306#define EXT2_MOUNT_DEBUG 0x0008 /* Some debugging messages */ 306#define EXT2_MOUNT_DEBUG 0x000008 /* Some debugging messages */
307#define EXT2_MOUNT_ERRORS_CONT 0x0010 /* Continue on errors */ 307#define EXT2_MOUNT_ERRORS_CONT 0x000010 /* Continue on errors */
308#define EXT2_MOUNT_ERRORS_RO 0x0020 /* Remount fs ro on errors */ 308#define EXT2_MOUNT_ERRORS_RO 0x000020 /* Remount fs ro on errors */
309#define EXT2_MOUNT_ERRORS_PANIC 0x0040 /* Panic on errors */ 309#define EXT2_MOUNT_ERRORS_PANIC 0x000040 /* Panic on errors */
310#define EXT2_MOUNT_MINIX_DF 0x0080 /* Mimics the Minix statfs */ 310#define EXT2_MOUNT_MINIX_DF 0x000080 /* Mimics the Minix statfs */
311#define EXT2_MOUNT_NOBH 0x0100 /* No buffer_heads */ 311#define EXT2_MOUNT_NOBH 0x000100 /* No buffer_heads */
312#define EXT2_MOUNT_NO_UID32 0x0200 /* Disable 32-bit UIDs */ 312#define EXT2_MOUNT_NO_UID32 0x000200 /* Disable 32-bit UIDs */
313#define EXT2_MOUNT_XATTR_USER 0x4000 /* Extended user attributes */ 313#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
314#define EXT2_MOUNT_POSIX_ACL 0x8000 /* POSIX Access Control Lists */ 314#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
315#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
315 316
316#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt 317#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
317#define set_opt(o, opt) o |= EXT2_MOUNT_##opt 318#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 74ad31781e3e..c16662836c58 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -239,6 +239,20 @@ struct ext3_new_group_data {
239#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) 239#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
240 240
241/* 241/*
242 * Mount options
243 */
244struct ext3_mount_options {
245 unsigned long s_mount_opt;
246 uid_t s_resuid;
247 gid_t s_resgid;
248 unsigned long s_commit_interval;
249#ifdef CONFIG_QUOTA
250 int s_jquota_fmt;
251 char *s_qf_names[MAXQUOTAS];
252#endif
253};
254
255/*
242 * Structure of an inode on the disk 256 * Structure of an inode on the disk
243 */ 257 */
244struct ext3_inode { 258struct ext3_inode {
@@ -358,6 +372,7 @@ struct ext3_inode {
358#define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */ 372#define EXT3_MOUNT_RESERVATION 0x10000 /* Preallocation */
359#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ 373#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
360#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ 374#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
375#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
361 376
362/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ 377/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
363#ifndef _LINUX_EXT2_FS_H 378#ifndef _LINUX_EXT2_FS_H
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h
index e8292af9033b..c8307c02dd07 100644
--- a/include/linux/ext3_jbd.h
+++ b/include/linux/ext3_jbd.h
@@ -42,15 +42,15 @@
42 * superblock only gets updated once, of course, so don't bother 42 * superblock only gets updated once, of course, so don't bother
43 * counting that again for the quota updates. */ 43 * counting that again for the quota updates. */
44 44
45#define EXT3_DATA_TRANS_BLOCKS (EXT3_SINGLEDATA_TRANS_BLOCKS + \ 45#define EXT3_DATA_TRANS_BLOCKS(sb) (EXT3_SINGLEDATA_TRANS_BLOCKS + \
46 EXT3_XATTR_TRANS_BLOCKS - 2 + \ 46 EXT3_XATTR_TRANS_BLOCKS - 2 + \
47 2*EXT3_QUOTA_TRANS_BLOCKS) 47 2*EXT3_QUOTA_TRANS_BLOCKS(sb))
48 48
49/* Delete operations potentially hit one directory's namespace plus an 49/* Delete operations potentially hit one directory's namespace plus an
50 * entire inode, plus arbitrary amounts of bitmap/indirection data. Be 50 * entire inode, plus arbitrary amounts of bitmap/indirection data. Be
51 * generous. We can grow the delete transaction later if necessary. */ 51 * generous. We can grow the delete transaction later if necessary. */
52 52
53#define EXT3_DELETE_TRANS_BLOCKS (2 * EXT3_DATA_TRANS_BLOCKS + 64) 53#define EXT3_DELETE_TRANS_BLOCKS(sb) (2 * EXT3_DATA_TRANS_BLOCKS(sb) + 64)
54 54
55/* Define an arbitrary limit for the amount of data we will anticipate 55/* Define an arbitrary limit for the amount of data we will anticipate
56 * writing to any given transaction. For unbounded transactions such as 56 * writing to any given transaction. For unbounded transactions such as
@@ -74,14 +74,17 @@
74#ifdef CONFIG_QUOTA 74#ifdef CONFIG_QUOTA
75/* Amount of blocks needed for quota update - we know that the structure was 75/* Amount of blocks needed for quota update - we know that the structure was
76 * allocated so we need to update only inode+data */ 76 * allocated so we need to update only inode+data */
77#define EXT3_QUOTA_TRANS_BLOCKS 2 77#define EXT3_QUOTA_TRANS_BLOCKS(sb) (test_opt(sb, QUOTA) ? 2 : 0)
78/* Amount of blocks needed for quota insert/delete - we do some block writes 78/* Amount of blocks needed for quota insert/delete - we do some block writes
79 * but inode, sb and group updates are done only once */ 79 * but inode, sb and group updates are done only once */
80#define EXT3_QUOTA_INIT_BLOCKS (DQUOT_MAX_WRITES*\ 80#define EXT3_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\
81 (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3) 81 (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_INIT_REWRITE) : 0)
82#define EXT3_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_DEL_ALLOC*\
83 (EXT3_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_DEL_REWRITE) : 0)
82#else 84#else
83#define EXT3_QUOTA_TRANS_BLOCKS 0 85#define EXT3_QUOTA_TRANS_BLOCKS(sb) 0
84#define EXT3_QUOTA_INIT_BLOCKS 0 86#define EXT3_QUOTA_INIT_BLOCKS(sb) 0
87#define EXT3_QUOTA_DEL_BLOCKS(sb) 0
85#endif 88#endif
86 89
87int 90int
diff --git a/include/linux/fadvise.h b/include/linux/fadvise.h
index 6fc656dfb93d..e8e747139b9a 100644
--- a/include/linux/fadvise.h
+++ b/include/linux/fadvise.h
@@ -5,7 +5,17 @@
5#define POSIX_FADV_RANDOM 1 /* Expect random page references. */ 5#define POSIX_FADV_RANDOM 1 /* Expect random page references. */
6#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */ 6#define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
7#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */ 7#define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
8
9/*
10 * The advise values for POSIX_FADV_DONTNEED and POSIX_ADV_NOREUSE
11 * for s390-64 differ from the values for the rest of the world.
12 */
13#if defined(__s390x__)
14#define POSIX_FADV_DONTNEED 6 /* Don't need these pages. */
15#define POSIX_FADV_NOREUSE 7 /* Data will be accessed once. */
16#else
8#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */ 17#define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
9#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */ 18#define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
19#endif
10 20
11#endif /* FADVISE_H_INCLUDED */ 21#endif /* FADVISE_H_INCLUDED */
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 704fb76b6334..8a7c82151de9 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -25,6 +25,10 @@
25 25
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27 27
28#ifndef force_o_largefile
29#define force_o_largefile() (BITS_PER_LONG != 32)
30#endif
31
28#if BITS_PER_LONG == 32 32#if BITS_PER_LONG == 32
29#define IS_GETLK32(cmd) ((cmd) == F_GETLK) 33#define IS_GETLK32(cmd) ((cmd) == F_GETLK)
30#define IS_SETLK32(cmd) ((cmd) == F_SETLK) 34#define IS_SETLK32(cmd) ((cmd) == F_SETLK)
diff --git a/include/linux/fddidevice.h b/include/linux/fddidevice.h
index 002f6367697d..e61e42dfd317 100644
--- a/include/linux/fddidevice.h
+++ b/include/linux/fddidevice.h
@@ -25,7 +25,7 @@
25#include <linux/if_fddi.h> 25#include <linux/if_fddi.h>
26 26
27#ifdef __KERNEL__ 27#ifdef __KERNEL__
28extern unsigned short fddi_type_trans(struct sk_buff *skb, 28extern __be16 fddi_type_trans(struct sk_buff *skb,
29 struct net_device *dev); 29 struct net_device *dev);
30extern struct net_device *alloc_fddidev(int sizeof_priv); 30extern struct net_device *alloc_fddidev(int sizeof_priv);
31#endif 31#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9b8b696d4f15..67e6732d4fdc 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -213,6 +213,7 @@ extern int dir_notify_enable;
213#include <linux/radix-tree.h> 213#include <linux/radix-tree.h>
214#include <linux/prio_tree.h> 214#include <linux/prio_tree.h>
215#include <linux/init.h> 215#include <linux/init.h>
216#include <linux/sched.h>
216 217
217#include <asm/atomic.h> 218#include <asm/atomic.h>
218#include <asm/semaphore.h> 219#include <asm/semaphore.h>
@@ -220,6 +221,7 @@ extern int dir_notify_enable;
220 221
221struct iovec; 222struct iovec;
222struct nameidata; 223struct nameidata;
224struct kiocb;
223struct pipe_inode_info; 225struct pipe_inode_info;
224struct poll_table_struct; 226struct poll_table_struct;
225struct kstatfs; 227struct kstatfs;
@@ -240,7 +242,7 @@ typedef int (get_block_t)(struct inode *inode, sector_t iblock,
240typedef int (get_blocks_t)(struct inode *inode, sector_t iblock, 242typedef int (get_blocks_t)(struct inode *inode, sector_t iblock,
241 unsigned long max_blocks, 243 unsigned long max_blocks,
242 struct buffer_head *bh_result, int create); 244 struct buffer_head *bh_result, int create);
243typedef void (dio_iodone_t)(struct inode *inode, loff_t offset, 245typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
244 ssize_t bytes, void *private); 246 ssize_t bytes, void *private);
245 247
246/* 248/*
@@ -302,7 +304,6 @@ struct iattr {
302struct page; 304struct page;
303struct address_space; 305struct address_space;
304struct writeback_control; 306struct writeback_control;
305struct kiocb;
306 307
307struct address_space_operations { 308struct address_space_operations {
308 int (*writepage)(struct page *page, struct writeback_control *wbc); 309 int (*writepage)(struct page *page, struct writeback_control *wbc);
@@ -330,6 +331,8 @@ struct address_space_operations {
330 int (*releasepage) (struct page *, int); 331 int (*releasepage) (struct page *, int);
331 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, 332 ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
332 loff_t offset, unsigned long nr_segs); 333 loff_t offset, unsigned long nr_segs);
334 struct page* (*get_xip_page)(struct address_space *, sector_t,
335 int);
333}; 336};
334 337
335struct backing_dev_info; 338struct backing_dev_info;
@@ -471,6 +474,11 @@ struct inode {
471 struct dnotify_struct *i_dnotify; /* for directory notifications */ 474 struct dnotify_struct *i_dnotify; /* for directory notifications */
472#endif 475#endif
473 476
477#ifdef CONFIG_INOTIFY
478 struct list_head inotify_watches; /* watches on this inode */
479 struct semaphore inotify_sem; /* protects the watches list */
480#endif
481
474 unsigned long i_state; 482 unsigned long i_state;
475 unsigned long dirtied_when; /* jiffies of first dirtying */ 483 unsigned long dirtied_when; /* jiffies of first dirtying */
476 484
@@ -581,7 +589,6 @@ struct file {
581 atomic_t f_count; 589 atomic_t f_count;
582 unsigned int f_flags; 590 unsigned int f_flags;
583 mode_t f_mode; 591 mode_t f_mode;
584 int f_error;
585 loff_t f_pos; 592 loff_t f_pos;
586 struct fown_struct f_owner; 593 struct fown_struct f_owner;
587 unsigned int f_uid, f_gid; 594 unsigned int f_uid, f_gid;
@@ -674,6 +681,7 @@ struct file_lock {
674 struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ 681 struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
675 union { 682 union {
676 struct nfs_lock_info nfs_fl; 683 struct nfs_lock_info nfs_fl;
684 struct nfs4_lock_info nfs4_fl;
677 } fl_u; 685 } fl_u;
678}; 686};
679 687
@@ -689,11 +697,13 @@ extern struct list_head file_lock_list;
689#include <linux/fcntl.h> 697#include <linux/fcntl.h>
690 698
691extern int fcntl_getlk(struct file *, struct flock __user *); 699extern int fcntl_getlk(struct file *, struct flock __user *);
692extern int fcntl_setlk(struct file *, unsigned int, struct flock __user *); 700extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
701 struct flock __user *);
693 702
694#if BITS_PER_LONG == 32 703#if BITS_PER_LONG == 32
695extern int fcntl_getlk64(struct file *, struct flock64 __user *); 704extern int fcntl_getlk64(struct file *, struct flock64 __user *);
696extern int fcntl_setlk64(struct file *, unsigned int, struct flock64 __user *); 705extern int fcntl_setlk64(unsigned int, struct file *, unsigned int,
706 struct flock64 __user *);
697#endif 707#endif
698 708
699extern void send_sigio(struct fown_struct *fown, int fd, int band); 709extern void send_sigio(struct fown_struct *fown, int fd, int band);
@@ -820,16 +830,34 @@ enum {
820#define vfs_check_frozen(sb, level) \ 830#define vfs_check_frozen(sb, level) \
821 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 831 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
822 832
833static inline void get_fs_excl(void)
834{
835 atomic_inc(&current->fs_excl);
836}
837
838static inline void put_fs_excl(void)
839{
840 atomic_dec(&current->fs_excl);
841}
842
843static inline int has_fs_excl(void)
844{
845 return atomic_read(&current->fs_excl);
846}
847
848
823/* 849/*
824 * Superblock locking. 850 * Superblock locking.
825 */ 851 */
826static inline void lock_super(struct super_block * sb) 852static inline void lock_super(struct super_block * sb)
827{ 853{
854 get_fs_excl();
828 down(&sb->s_lock); 855 down(&sb->s_lock);
829} 856}
830 857
831static inline void unlock_super(struct super_block * sb) 858static inline void unlock_super(struct super_block * sb)
832{ 859{
860 put_fs_excl();
833 up(&sb->s_lock); 861 up(&sb->s_lock);
834} 862}
835 863
@@ -883,7 +911,9 @@ struct block_device_operations {
883 int (*open) (struct inode *, struct file *); 911 int (*open) (struct inode *, struct file *);
884 int (*release) (struct inode *, struct file *); 912 int (*release) (struct inode *, struct file *);
885 int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); 913 int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long);
914 long (*unlocked_ioctl) (struct file *, unsigned, unsigned long);
886 long (*compat_ioctl) (struct file *, unsigned, unsigned long); 915 long (*compat_ioctl) (struct file *, unsigned, unsigned long);
916 int (*direct_access) (struct block_device *, sector_t, unsigned long *);
887 int (*media_changed) (struct gendisk *); 917 int (*media_changed) (struct gendisk *);
888 int (*revalidate_disk) (struct gendisk *); 918 int (*revalidate_disk) (struct gendisk *);
889 struct module *owner; 919 struct module *owner;
@@ -963,8 +993,8 @@ struct inode_operations {
963 int (*rename) (struct inode *, struct dentry *, 993 int (*rename) (struct inode *, struct dentry *,
964 struct inode *, struct dentry *); 994 struct inode *, struct dentry *);
965 int (*readlink) (struct dentry *, char __user *,int); 995 int (*readlink) (struct dentry *, char __user *,int);
966 int (*follow_link) (struct dentry *, struct nameidata *); 996 void * (*follow_link) (struct dentry *, struct nameidata *);
967 void (*put_link) (struct dentry *, struct nameidata *); 997 void (*put_link) (struct dentry *, struct nameidata *, void *);
968 void (*truncate) (struct inode *); 998 void (*truncate) (struct inode *);
969 int (*permission) (struct inode *, int, struct nameidata *); 999 int (*permission) (struct inode *, int, struct nameidata *);
970 int (*setattr) (struct dentry *, struct iattr *); 1000 int (*setattr) (struct dentry *, struct iattr *);
@@ -1024,6 +1054,7 @@ struct super_operations {
1024#define I_FREEING 16 1054#define I_FREEING 16
1025#define I_CLEAR 32 1055#define I_CLEAR 32
1026#define I_NEW 64 1056#define I_NEW 64
1057#define I_WILL_FREE 128
1027 1058
1028#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1059#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1029 1060
@@ -1369,7 +1400,6 @@ extern void emergency_remount(void);
1369extern int do_remount_sb(struct super_block *sb, int flags, 1400extern int do_remount_sb(struct super_block *sb, int flags,
1370 void *data, int force); 1401 void *data, int force);
1371extern sector_t bmap(struct inode *, sector_t); 1402extern sector_t bmap(struct inode *, sector_t);
1372extern int setattr_mask(unsigned int);
1373extern int notify_change(struct dentry *, struct iattr *); 1403extern int notify_change(struct dentry *, struct iattr *);
1374extern int permission(struct inode *, int, struct nameidata *); 1404extern int permission(struct inode *, int, struct nameidata *);
1375extern int generic_permission(struct inode *, int, 1405extern int generic_permission(struct inode *, int,
@@ -1411,7 +1441,11 @@ extern struct inode * igrab(struct inode *);
1411extern ino_t iunique(struct super_block *, ino_t); 1441extern ino_t iunique(struct super_block *, ino_t);
1412extern int inode_needs_sync(struct inode *inode); 1442extern int inode_needs_sync(struct inode *inode);
1413extern void generic_delete_inode(struct inode *inode); 1443extern void generic_delete_inode(struct inode *inode);
1444extern void generic_drop_inode(struct inode *inode);
1414 1445
1446extern struct inode *ilookup5_nowait(struct super_block *sb,
1447 unsigned long hashval, int (*test)(struct inode *, void *),
1448 void *data);
1415extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval, 1449extern struct inode *ilookup5(struct super_block *sb, unsigned long hashval,
1416 int (*test)(struct inode *, void *), void *data); 1450 int (*test)(struct inode *, void *), void *data);
1417extern struct inode *ilookup(struct super_block *sb, unsigned long ino); 1451extern struct inode *ilookup(struct super_block *sb, unsigned long ino);
@@ -1494,6 +1528,23 @@ extern loff_t remote_llseek(struct file *file, loff_t offset, int origin);
1494extern int generic_file_open(struct inode * inode, struct file * filp); 1528extern int generic_file_open(struct inode * inode, struct file * filp);
1495extern int nonseekable_open(struct inode * inode, struct file * filp); 1529extern int nonseekable_open(struct inode * inode, struct file * filp);
1496 1530
1531#ifdef CONFIG_FS_XIP
1532extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
1533 loff_t *ppos);
1534extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos,
1535 size_t count, read_actor_t actor,
1536 void *target);
1537extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
1538extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
1539 size_t len, loff_t *ppos);
1540extern int xip_truncate_page(struct address_space *mapping, loff_t from);
1541#else
1542static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
1543{
1544 return 0;
1545}
1546#endif
1547
1497static inline void do_generic_file_read(struct file * filp, loff_t *ppos, 1548static inline void do_generic_file_read(struct file * filp, loff_t *ppos,
1498 read_descriptor_t * desc, 1549 read_descriptor_t * desc,
1499 read_actor_t actor) 1550 read_actor_t actor)
@@ -1551,8 +1602,8 @@ extern struct file_operations generic_ro_fops;
1551extern int vfs_readlink(struct dentry *, char __user *, int, const char *); 1602extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
1552extern int vfs_follow_link(struct nameidata *, const char *); 1603extern int vfs_follow_link(struct nameidata *, const char *);
1553extern int page_readlink(struct dentry *, char __user *, int); 1604extern int page_readlink(struct dentry *, char __user *, int);
1554extern int page_follow_link_light(struct dentry *, struct nameidata *); 1605extern void *page_follow_link_light(struct dentry *, struct nameidata *);
1555extern void page_put_link(struct dentry *, struct nameidata *); 1606extern void page_put_link(struct dentry *, struct nameidata *, void *);
1556extern int page_symlink(struct inode *inode, const char *symname, int len); 1607extern int page_symlink(struct inode *inode, const char *symname, int len);
1557extern struct inode_operations page_symlink_inode_operations; 1608extern struct inode_operations page_symlink_inode_operations;
1558extern int generic_readlink(struct dentry *, char __user *, int); 1609extern int generic_readlink(struct dentry *, char __user *, int);
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
new file mode 100644
index 000000000000..03b8e7932b83
--- /dev/null
+++ b/include/linux/fsnotify.h
@@ -0,0 +1,251 @@
1#ifndef _LINUX_FS_NOTIFY_H
2#define _LINUX_FS_NOTIFY_H
3
4/*
5 * include/linux/fsnotify.h - generic hooks for filesystem notification, to
6 * reduce in-source duplication from both dnotify and inotify.
7 *
8 * We don't compile any of this away in some complicated menagerie of ifdefs.
9 * Instead, we rely on the code inside to optimize away as needed.
10 *
11 * (C) Copyright 2005 Robert Love
12 */
13
14#ifdef __KERNEL__
15
16#include <linux/dnotify.h>
17#include <linux/inotify.h>
18
19/*
20 * fsnotify_move - file old_name at old_dir was moved to new_name at new_dir
21 */
22static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir,
23 const char *old_name, const char *new_name,
24 int isdir, struct inode *target, struct inode *source)
25{
26 u32 cookie = inotify_get_cookie();
27
28 if (old_dir == new_dir)
29 inode_dir_notify(old_dir, DN_RENAME);
30 else {
31 inode_dir_notify(old_dir, DN_DELETE);
32 inode_dir_notify(new_dir, DN_CREATE);
33 }
34
35 if (isdir)
36 isdir = IN_ISDIR;
37 inotify_inode_queue_event(old_dir, IN_MOVED_FROM|isdir,cookie,old_name);
38 inotify_inode_queue_event(new_dir, IN_MOVED_TO|isdir, cookie, new_name);
39
40 if (target) {
41 inotify_inode_queue_event(target, IN_DELETE_SELF, 0, NULL);
42 inotify_inode_is_dead(target);
43 }
44
45 if (source) {
46 inotify_inode_queue_event(source, IN_MOVE_SELF, 0, NULL);
47 }
48}
49
50/*
51 * fsnotify_nameremove - a filename was removed from a directory
52 */
53static inline void fsnotify_nameremove(struct dentry *dentry, int isdir)
54{
55 if (isdir)
56 isdir = IN_ISDIR;
57 dnotify_parent(dentry, DN_DELETE);
58 inotify_dentry_parent_queue_event(dentry, IN_DELETE|isdir, 0, dentry->d_name.name);
59}
60
61/*
62 * fsnotify_inoderemove - an inode is going away
63 */
64static inline void fsnotify_inoderemove(struct inode *inode)
65{
66 inotify_inode_queue_event(inode, IN_DELETE_SELF, 0, NULL);
67 inotify_inode_is_dead(inode);
68}
69
70/*
71 * fsnotify_create - 'name' was linked in
72 */
73static inline void fsnotify_create(struct inode *inode, const char *name)
74{
75 inode_dir_notify(inode, DN_CREATE);
76 inotify_inode_queue_event(inode, IN_CREATE, 0, name);
77}
78
79/*
80 * fsnotify_mkdir - directory 'name' was created
81 */
82static inline void fsnotify_mkdir(struct inode *inode, const char *name)
83{
84 inode_dir_notify(inode, DN_CREATE);
85 inotify_inode_queue_event(inode, IN_CREATE | IN_ISDIR, 0, name);
86}
87
88/*
89 * fsnotify_access - file was read
90 */
91static inline void fsnotify_access(struct dentry *dentry)
92{
93 struct inode *inode = dentry->d_inode;
94 u32 mask = IN_ACCESS;
95
96 if (S_ISDIR(inode->i_mode))
97 mask |= IN_ISDIR;
98
99 dnotify_parent(dentry, DN_ACCESS);
100 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
101 inotify_inode_queue_event(inode, mask, 0, NULL);
102}
103
104/*
105 * fsnotify_modify - file was modified
106 */
107static inline void fsnotify_modify(struct dentry *dentry)
108{
109 struct inode *inode = dentry->d_inode;
110 u32 mask = IN_MODIFY;
111
112 if (S_ISDIR(inode->i_mode))
113 mask |= IN_ISDIR;
114
115 dnotify_parent(dentry, DN_MODIFY);
116 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
117 inotify_inode_queue_event(inode, mask, 0, NULL);
118}
119
120/*
121 * fsnotify_open - file was opened
122 */
123static inline void fsnotify_open(struct dentry *dentry)
124{
125 struct inode *inode = dentry->d_inode;
126 u32 mask = IN_OPEN;
127
128 if (S_ISDIR(inode->i_mode))
129 mask |= IN_ISDIR;
130
131 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
132 inotify_inode_queue_event(inode, mask, 0, NULL);
133}
134
135/*
136 * fsnotify_close - file was closed
137 */
138static inline void fsnotify_close(struct file *file)
139{
140 struct dentry *dentry = file->f_dentry;
141 struct inode *inode = dentry->d_inode;
142 const char *name = dentry->d_name.name;
143 mode_t mode = file->f_mode;
144 u32 mask = (mode & FMODE_WRITE) ? IN_CLOSE_WRITE : IN_CLOSE_NOWRITE;
145
146 if (S_ISDIR(inode->i_mode))
147 mask |= IN_ISDIR;
148
149 inotify_dentry_parent_queue_event(dentry, mask, 0, name);
150 inotify_inode_queue_event(inode, mask, 0, NULL);
151}
152
153/*
154 * fsnotify_xattr - extended attributes were changed
155 */
156static inline void fsnotify_xattr(struct dentry *dentry)
157{
158 struct inode *inode = dentry->d_inode;
159 u32 mask = IN_ATTRIB;
160
161 if (S_ISDIR(inode->i_mode))
162 mask |= IN_ISDIR;
163
164 inotify_dentry_parent_queue_event(dentry, mask, 0, dentry->d_name.name);
165 inotify_inode_queue_event(inode, mask, 0, NULL);
166}
167
168/*
169 * fsnotify_change - notify_change event. file was modified and/or metadata
170 * was changed.
171 */
172static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
173{
174 struct inode *inode = dentry->d_inode;
175 int dn_mask = 0;
176 u32 in_mask = 0;
177
178 if (ia_valid & ATTR_UID) {
179 in_mask |= IN_ATTRIB;
180 dn_mask |= DN_ATTRIB;
181 }
182 if (ia_valid & ATTR_GID) {
183 in_mask |= IN_ATTRIB;
184 dn_mask |= DN_ATTRIB;
185 }
186 if (ia_valid & ATTR_SIZE) {
187 in_mask |= IN_MODIFY;
188 dn_mask |= DN_MODIFY;
189 }
190 /* both times implies a utime(s) call */
191 if ((ia_valid & (ATTR_ATIME | ATTR_MTIME)) == (ATTR_ATIME | ATTR_MTIME))
192 {
193 in_mask |= IN_ATTRIB;
194 dn_mask |= DN_ATTRIB;
195 } else if (ia_valid & ATTR_ATIME) {
196 in_mask |= IN_ACCESS;
197 dn_mask |= DN_ACCESS;
198 } else if (ia_valid & ATTR_MTIME) {
199 in_mask |= IN_MODIFY;
200 dn_mask |= DN_MODIFY;
201 }
202 if (ia_valid & ATTR_MODE) {
203 in_mask |= IN_ATTRIB;
204 dn_mask |= DN_ATTRIB;
205 }
206
207 if (dn_mask)
208 dnotify_parent(dentry, dn_mask);
209 if (in_mask) {
210 if (S_ISDIR(inode->i_mode))
211 in_mask |= IN_ISDIR;
212 inotify_inode_queue_event(inode, in_mask, 0, NULL);
213 inotify_dentry_parent_queue_event(dentry, in_mask, 0,
214 dentry->d_name.name);
215 }
216}
217
218#ifdef CONFIG_INOTIFY /* inotify helpers */
219
220/*
221 * fsnotify_oldname_init - save off the old filename before we change it
222 */
223static inline const char *fsnotify_oldname_init(const char *name)
224{
225 return kstrdup(name, GFP_KERNEL);
226}
227
228/*
229 * fsnotify_oldname_free - free the name we got from fsnotify_oldname_init
230 */
231static inline void fsnotify_oldname_free(const char *old_name)
232{
233 kfree(old_name);
234}
235
236#else /* CONFIG_INOTIFY */
237
238static inline const char *fsnotify_oldname_init(const char *name)
239{
240 return NULL;
241}
242
243static inline void fsnotify_oldname_free(const char *old_name)
244{
245}
246
247#endif /* ! CONFIG_INOTIFY */
248
249#endif /* __KERNEL__ */
250
251#endif /* _LINUX_FS_NOTIFY_H */
diff --git a/include/linux/ftape.h b/include/linux/ftape.h
index c6b38d5b9186..72faeec9f6e1 100644
--- a/include/linux/ftape.h
+++ b/include/linux/ftape.h
@@ -165,7 +165,7 @@ typedef union {
165# undef CONFIG_FT_FDC_DMA 165# undef CONFIG_FT_FDC_DMA
166# define CONFIG_FT_FDC_DMA 2 166# define CONFIG_FT_FDC_DMA 2
167# endif 167# endif
168#elif CONFIG_FT_ALT_FDC == 1 /* CONFIG_FT_MACH2 */ 168#elif defined(CONFIG_FT_ALT_FDC) /* CONFIG_FT_MACH2 */
169# if CONFIG_FT_FDC_BASE == 0 169# if CONFIG_FT_FDC_BASE == 0
170# undef CONFIG_FT_FDC_BASE 170# undef CONFIG_FT_FDC_BASE
171# define CONFIG_FT_FDC_BASE 0x370 171# define CONFIG_FT_FDC_BASE 0x370
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 47dedaf971d6..01796c41c951 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -224,7 +224,7 @@ static inline void free_disk_stats(struct gendisk *disk)
224extern void disk_round_stats(struct gendisk *disk); 224extern void disk_round_stats(struct gendisk *disk);
225 225
226/* drivers/block/genhd.c */ 226/* drivers/block/genhd.c */
227extern int get_blkdev_list(char *); 227extern int get_blkdev_list(char *, int);
228extern void add_disk(struct gendisk *disk); 228extern void add_disk(struct gendisk *disk);
229extern void del_gendisk(struct gendisk *gp); 229extern void del_gendisk(struct gendisk *gp);
230extern void unlink_gendisk(struct gendisk *gp); 230extern void unlink_gendisk(struct gendisk *gp);
@@ -403,6 +403,7 @@ extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev);
403extern void add_partition(struct gendisk *, int, sector_t, sector_t); 403extern void add_partition(struct gendisk *, int, sector_t, sector_t);
404extern void delete_partition(struct gendisk *, int); 404extern void delete_partition(struct gendisk *, int);
405 405
406extern struct gendisk *alloc_disk_node(int minors, int node_id);
406extern struct gendisk *alloc_disk(int minors); 407extern struct gendisk *alloc_disk(int minors);
407extern struct kobject *get_disk(struct gendisk *disk); 408extern struct kobject *get_disk(struct gendisk *disk);
408extern void put_disk(struct gendisk *disk); 409extern void put_disk(struct gendisk *disk);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 8d6bf608b199..7c7400137e97 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -12,8 +12,8 @@ struct vm_area_struct;
12 * GFP bitmasks.. 12 * GFP bitmasks..
13 */ 13 */
14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */ 14/* Zone modifiers in GFP_ZONEMASK (see linux/mmzone.h - low two bits) */
15#define __GFP_DMA 0x01 15#define __GFP_DMA 0x01u
16#define __GFP_HIGHMEM 0x02 16#define __GFP_HIGHMEM 0x02u
17 17
18/* 18/*
19 * Action modifiers - doesn't change the zoning 19 * Action modifiers - doesn't change the zoning
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 8336dba18971..5912874ca83c 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -2,6 +2,7 @@
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5#include <linux/preempt.h>
5#include <linux/smp_lock.h> 6#include <linux/smp_lock.h>
6#include <asm/hardirq.h> 7#include <asm/hardirq.h>
7#include <asm/system.h> 8#include <asm/system.h>
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index ed2927ef1ff7..df695e9ae327 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -242,8 +242,8 @@ static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
242} 242}
243 243
244 244
245static __inline__ unsigned short hdlc_type_trans(struct sk_buff *skb, 245static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
246 struct net_device *dev) 246 struct net_device *dev)
247{ 247{
248 hdlc_device *hdlc = dev_to_hdlc(dev); 248 hdlc_device *hdlc = dev_to_hdlc(dev);
249 249
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 2a7e6c65c882..6bece9280eb7 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -28,6 +28,7 @@ static inline void *kmap(struct page *page)
28 28
29#define kmap_atomic(page, idx) page_address(page) 29#define kmap_atomic(page, idx) page_address(page)
30#define kunmap_atomic(addr, idx) do { } while (0) 30#define kunmap_atomic(addr, idx) do { } while (0)
31#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
31#define kmap_atomic_to_page(ptr) virt_to_page(ptr) 32#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
32 33
33#endif /* CONFIG_HIGHMEM */ 34#endif /* CONFIG_HIGHMEM */
diff --git a/include/linux/i2c-sysfs.h b/include/linux/hwmon-sysfs.h
index d7bf6ce11679..1b5018a965f5 100644
--- a/include/linux/i2c-sysfs.h
+++ b/include/linux/hwmon-sysfs.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * i2c-sysfs.h - i2c chip driver sysfs defines 2 * hwmon-sysfs.h - hardware monitoring chip driver sysfs defines
3 * 3 *
4 * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com> 4 * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com>
5 * 5 *
@@ -17,8 +17,8 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */ 19 */
20#ifndef _LINUX_I2C_SYSFS_H 20#ifndef _LINUX_HWMON_SYSFS_H
21#define _LINUX_I2C_SYSFS_H 21#define _LINUX_HWMON_SYSFS_H
22 22
23struct sensor_device_attribute{ 23struct sensor_device_attribute{
24 struct device_attribute dev_attr; 24 struct device_attribute dev_attr;
@@ -33,4 +33,4 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \
33 .index = _index, \ 33 .index = _index, \
34} 34}
35 35
36#endif /* _LINUX_I2C_SYSFS_H */ 36#endif /* _LINUX_HWMON_SYSFS_H */
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h
index d228230ffe5d..541695679762 100644
--- a/include/linux/i2c-dev.h
+++ b/include/linux/i2c-dev.h
@@ -25,6 +25,7 @@
25#define _LINUX_I2C_DEV_H 25#define _LINUX_I2C_DEV_H
26 26
27#include <linux/types.h> 27#include <linux/types.h>
28#include <linux/compiler.h>
28 29
29/* Some IOCTL commands are defined in <linux/i2c.h> */ 30/* Some IOCTL commands are defined in <linux/i2c.h> */
30/* Note: 10-bit addresses are NOT supported! */ 31/* Note: 10-bit addresses are NOT supported! */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 89270ce51470..33f08258f22b 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -108,6 +108,7 @@
108#define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */ 108#define I2C_DRIVERID_TDA7313 62 /* TDA7313 audio processor */
109#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */ 109#define I2C_DRIVERID_MAX6900 63 /* MAX6900 real-time clock */
110#define I2C_DRIVERID_SAA7114H 64 /* video decoder */ 110#define I2C_DRIVERID_SAA7114H 64 /* video decoder */
111#define I2C_DRIVERID_DS1374 65 /* DS1374 real time clock */
111 112
112 113
113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */ 114#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h
index 974835e3530f..41d0635e0ba9 100644
--- a/include/linux/i2c-vid.h
+++ b/include/linux/i2c-vid.h
@@ -97,3 +97,15 @@ static inline int vid_from_reg(int val, int vrm)
97 2050 - (val) * 50); 97 2050 - (val) * 50);
98 } 98 }
99} 99}
100
101static inline int vid_to_reg(int val, int vrm)
102{
103 switch (vrm) {
104 case 91: /* VRM 9.1 */
105 case 90: /* VRM 9.0 */
106 return ((val >= 1100) && (val <= 1850) ?
107 ((18499 - val * 10) / 25 + 5) / 10 : -1);
108 default:
109 return -1;
110 }
111}
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index ebcd745f4cd6..be837b13f297 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -290,11 +290,8 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
290 */ 290 */
291struct i2c_client_address_data { 291struct i2c_client_address_data {
292 unsigned short *normal_i2c; 292 unsigned short *normal_i2c;
293 unsigned short *normal_i2c_range;
294 unsigned short *probe; 293 unsigned short *probe;
295 unsigned short *probe_range;
296 unsigned short *ignore; 294 unsigned short *ignore;
297 unsigned short *ignore_range;
298 unsigned short *force; 295 unsigned short *force;
299}; 296};
300 297
@@ -563,24 +560,15 @@ union i2c_smbus_data {
563#define I2C_CLIENT_INSMOD \ 560#define I2C_CLIENT_INSMOD \
564 I2C_CLIENT_MODULE_PARM(probe, \ 561 I2C_CLIENT_MODULE_PARM(probe, \
565 "List of adapter,address pairs to scan additionally"); \ 562 "List of adapter,address pairs to scan additionally"); \
566 I2C_CLIENT_MODULE_PARM(probe_range, \
567 "List of adapter,start-addr,end-addr triples to scan " \
568 "additionally"); \
569 I2C_CLIENT_MODULE_PARM(ignore, \ 563 I2C_CLIENT_MODULE_PARM(ignore, \
570 "List of adapter,address pairs not to scan"); \ 564 "List of adapter,address pairs not to scan"); \
571 I2C_CLIENT_MODULE_PARM(ignore_range, \
572 "List of adapter,start-addr,end-addr triples not to " \
573 "scan"); \
574 I2C_CLIENT_MODULE_PARM(force, \ 565 I2C_CLIENT_MODULE_PARM(force, \
575 "List of adapter,address pairs to boldly assume " \ 566 "List of adapter,address pairs to boldly assume " \
576 "to be present"); \ 567 "to be present"); \
577 static struct i2c_client_address_data addr_data = { \ 568 static struct i2c_client_address_data addr_data = { \
578 .normal_i2c = normal_i2c, \ 569 .normal_i2c = normal_i2c, \
579 .normal_i2c_range = normal_i2c_range, \
580 .probe = probe, \ 570 .probe = probe, \
581 .probe_range = probe_range, \
582 .ignore = ignore, \ 571 .ignore = ignore, \
583 .ignore_range = ignore_range, \
584 .force = force, \ 572 .force = force, \
585 } 573 }
586 574
diff --git a/include/linux/i2o-dev.h b/include/linux/i2o-dev.h
index ef7f644dd873..36fd18cdad28 100644
--- a/include/linux/i2o-dev.h
+++ b/include/linux/i2o-dev.h
@@ -24,6 +24,13 @@
24#define MAX_I2O_CONTROLLERS 32 24#define MAX_I2O_CONTROLLERS 32
25 25
26//#include <linux/ioctl.h> 26//#include <linux/ioctl.h>
27#ifndef __KERNEL__
28
29typedef unsigned char u8;
30typedef unsigned short u16;
31typedef unsigned int u32;
32
33#endif /* __KERNEL__ */
27 34
28/* 35/*
29 * I2O Control IOCTLs and structures 36 * I2O Control IOCTLs and structures
@@ -113,6 +120,10 @@ struct i2o_evt_get {
113 int lost; 120 int lost;
114}; 121};
115 122
123typedef struct i2o_sg_io_hdr {
124 unsigned int flags; /* see I2O_DPT_SG_IO_FLAGS */
125} i2o_sg_io_hdr_t;
126
116/************************************************************************** 127/**************************************************************************
117 * HRT related constants and structures 128 * HRT related constants and structures
118 **************************************************************************/ 129 **************************************************************************/
@@ -126,14 +137,6 @@ struct i2o_evt_get {
126#define I2O_BUS_CARDBUS 7 137#define I2O_BUS_CARDBUS 7
127#define I2O_BUS_UNKNOWN 0x80 138#define I2O_BUS_UNKNOWN 0x80
128 139
129#ifndef __KERNEL__
130
131typedef unsigned char u8;
132typedef unsigned short u16;
133typedef unsigned int u32;
134
135#endif /* __KERNEL__ */
136
137typedef struct _i2o_pci_bus { 140typedef struct _i2o_pci_bus {
138 u8 PciFunctionNumber; 141 u8 PciFunctionNumber;
139 u8 PciDeviceNumber; 142 u8 PciDeviceNumber;
@@ -333,7 +336,7 @@ typedef struct _i2o_status_block {
333#define I2O_CLASS_ATE_PERIPHERAL 0x061 336#define I2O_CLASS_ATE_PERIPHERAL 0x061
334#define I2O_CLASS_FLOPPY_CONTROLLER 0x070 337#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
335#define I2O_CLASS_FLOPPY_DEVICE 0x071 338#define I2O_CLASS_FLOPPY_DEVICE 0x071
336#define I2O_CLASS_BUS_ADAPTER_PORT 0x080 339#define I2O_CLASS_BUS_ADAPTER 0x080
337#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090 340#define I2O_CLASS_PEER_TRANSPORT_AGENT 0x090
338#define I2O_CLASS_PEER_TRANSPORT 0x091 341#define I2O_CLASS_PEER_TRANSPORT 0x091
339#define I2O_CLASS_END 0xfff 342#define I2O_CLASS_END 0xfff
@@ -399,4 +402,26 @@ typedef struct _i2o_status_block {
399#define ADAPTER_STATE_FAILED 0x10 402#define ADAPTER_STATE_FAILED 0x10
400#define ADAPTER_STATE_FAULTED 0x11 403#define ADAPTER_STATE_FAULTED 0x11
401 404
405/*
406 * Software module types
407 */
408#define I2O_SOFTWARE_MODULE_IRTOS 0x11
409#define I2O_SOFTWARE_MODULE_IOP_PRIVATE 0x22
410#define I2O_SOFTWARE_MODULE_IOP_CONFIG 0x23
411
412/*
413 * Vendors
414 */
415#define I2O_VENDOR_DPT 0x001b
416
417/*
418 * DPT / Adaptec specific values for i2o_sg_io_hdr flags.
419 */
420#define I2O_DPT_SG_FLAG_INTERPRET 0x00010000
421#define I2O_DPT_SG_FLAG_PHYSICAL 0x00020000
422
423#define I2O_DPT_FLASH_FRAG_SIZE 0x10000
424#define I2O_DPT_FLASH_READ 0x0101
425#define I2O_DPT_FLASH_WRITE 0x0102
426
402#endif /* _I2O_DEV_H */ 427#endif /* _I2O_DEV_H */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index ea9a3ad4b67f..bdc286ec947c 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -119,12 +119,21 @@ struct i2o_driver {
119}; 119};
120 120
121/* 121/*
122 * Contains all information which are necessary for DMA operations 122 * Contains DMA mapped address information
123 */ 123 */
124struct i2o_dma { 124struct i2o_dma {
125 void *virt; 125 void *virt;
126 dma_addr_t phys; 126 dma_addr_t phys;
127 u32 len; 127 size_t len;
128};
129
130/*
131 * Contains IO mapped address information
132 */
133struct i2o_io {
134 void __iomem *virt;
135 unsigned long phys;
136 unsigned long len;
128}; 137};
129 138
130/* 139/*
@@ -147,28 +156,25 @@ struct i2o_controller {
147 156
148 struct pci_dev *pdev; /* PCI device */ 157 struct pci_dev *pdev; /* PCI device */
149 158
150 unsigned int short_req:1; /* use small block sizes */ 159 unsigned int promise:1; /* Promise controller */
160 unsigned int adaptec:1; /* DPT / Adaptec controller */
161 unsigned int raptor:1; /* split bar */
151 unsigned int no_quiesce:1; /* dont quiesce before reset */ 162 unsigned int no_quiesce:1; /* dont quiesce before reset */
152 unsigned int raptor:1; /* split bar */ 163 unsigned int short_req:1; /* use small block sizes */
153 unsigned int promise:1; /* Promise controller */ 164 unsigned int limit_sectors:1; /* limit number of sectors / request */
154 165 unsigned int pae_support:1; /* controller has 64-bit SGL support */
155#ifdef CONFIG_MTRR
156 int mtrr_reg0;
157 int mtrr_reg1;
158#endif
159 166
160 struct list_head devices; /* list of I2O devices */ 167 struct list_head devices; /* list of I2O devices */
161
162 struct notifier_block *event_notifer; /* Events */
163 atomic_t users;
164 struct list_head list; /* Controller list */ 168 struct list_head list; /* Controller list */
165 void __iomem *post_port; /* Inbout port address */ 169
166 void __iomem *reply_port; /* Outbound port address */ 170 void __iomem *in_port; /* Inbout port address */
167 void __iomem *irq_mask; /* Interrupt register address */ 171 void __iomem *out_port; /* Outbound port address */
172 void __iomem *irq_status; /* Interrupt status register address */
173 void __iomem *irq_mask; /* Interrupt mask register address */
168 174
169 /* Dynamic LCT related data */ 175 /* Dynamic LCT related data */
170 176
171 struct i2o_dma status; /* status of IOP */ 177 struct i2o_dma status; /* IOP status block */
172 178
173 struct i2o_dma hrt; /* HW Resource Table */ 179 struct i2o_dma hrt; /* HW Resource Table */
174 i2o_lct *lct; /* Logical Config Table */ 180 i2o_lct *lct; /* Logical Config Table */
@@ -176,21 +182,19 @@ struct i2o_controller {
176 struct semaphore lct_lock; /* Lock for LCT updates */ 182 struct semaphore lct_lock; /* Lock for LCT updates */
177 struct i2o_dma status_block; /* IOP status block */ 183 struct i2o_dma status_block; /* IOP status block */
178 184
179 struct i2o_dma base; /* controller messaging unit */ 185 struct i2o_io base; /* controller messaging unit */
180 struct i2o_dma in_queue; /* inbound message queue Host->IOP */ 186 struct i2o_io in_queue; /* inbound message queue Host->IOP */
181 struct i2o_dma out_queue; /* outbound message queue IOP->Host */ 187 struct i2o_dma out_queue; /* outbound message queue IOP->Host */
182 188
183 unsigned int battery:1; /* Has a battery backup */ 189 unsigned int battery:1; /* Has a battery backup */
184 unsigned int io_alloc:1; /* An I/O resource was allocated */ 190 unsigned int io_alloc:1; /* An I/O resource was allocated */
185 unsigned int mem_alloc:1; /* A memory resource was allocated */ 191 unsigned int mem_alloc:1; /* A memory resource was allocated */
186 192
187 struct resource io_resource; /* I/O resource allocated to the IOP */ 193 struct resource io_resource; /* I/O resource allocated to the IOP */
188 struct resource mem_resource; /* Mem resource allocated to the IOP */ 194 struct resource mem_resource; /* Mem resource allocated to the IOP */
189 195
190 struct proc_dir_entry *proc_entry; /* /proc dir */
191
192 struct list_head bus_list; /* list of busses on IOP */
193 struct device device; 196 struct device device;
197 struct class_device classdev; /* I2O controller class */
194 struct i2o_device *exec; /* Executive */ 198 struct i2o_device *exec; /* Executive */
195#if BITS_PER_LONG == 64 199#if BITS_PER_LONG == 64
196 spinlock_t context_list_lock; /* lock for context_list */ 200 spinlock_t context_list_lock; /* lock for context_list */
@@ -241,9 +245,10 @@ struct i2o_sys_tbl {
241extern struct list_head i2o_controllers; 245extern struct list_head i2o_controllers;
242 246
243/* Message functions */ 247/* Message functions */
244static inline u32 i2o_msg_get(struct i2o_controller *, struct i2o_message __iomem **); 248static inline u32 i2o_msg_get(struct i2o_controller *,
245extern u32 i2o_msg_get_wait(struct i2o_controller *, struct i2o_message __iomem **, 249 struct i2o_message __iomem **);
246 int); 250extern u32 i2o_msg_get_wait(struct i2o_controller *,
251 struct i2o_message __iomem **, int);
247static inline void i2o_msg_post(struct i2o_controller *, u32); 252static inline void i2o_msg_post(struct i2o_controller *, u32);
248static inline int i2o_msg_post_wait(struct i2o_controller *, u32, 253static inline int i2o_msg_post_wait(struct i2o_controller *, u32,
249 unsigned long); 254 unsigned long);
@@ -252,15 +257,6 @@ extern int i2o_msg_post_wait_mem(struct i2o_controller *, u32, unsigned long,
252extern void i2o_msg_nop(struct i2o_controller *, u32); 257extern void i2o_msg_nop(struct i2o_controller *, u32);
253static inline void i2o_flush_reply(struct i2o_controller *, u32); 258static inline void i2o_flush_reply(struct i2o_controller *, u32);
254 259
255/* DMA handling functions */
256static inline int i2o_dma_alloc(struct device *, struct i2o_dma *, size_t,
257 unsigned int);
258static inline void i2o_dma_free(struct device *, struct i2o_dma *);
259int i2o_dma_realloc(struct device *, struct i2o_dma *, size_t, unsigned int);
260
261static inline int i2o_dma_map(struct device *, struct i2o_dma *);
262static inline void i2o_dma_unmap(struct device *, struct i2o_dma *);
263
264/* IOP functions */ 260/* IOP functions */
265extern int i2o_status_get(struct i2o_controller *); 261extern int i2o_status_get(struct i2o_controller *);
266 262
@@ -285,6 +281,16 @@ static inline u32 i2o_ptr_high(void *ptr)
285{ 281{
286 return (u32) ((u64) ptr >> 32); 282 return (u32) ((u64) ptr >> 32);
287}; 283};
284
285static inline u32 i2o_dma_low(dma_addr_t dma_addr)
286{
287 return (u32) (u64) dma_addr;
288};
289
290static inline u32 i2o_dma_high(dma_addr_t dma_addr)
291{
292 return (u32) ((u64) dma_addr >> 32);
293};
288#else 294#else
289static inline u32 i2o_cntxt_list_add(struct i2o_controller *c, void *ptr) 295static inline u32 i2o_cntxt_list_add(struct i2o_controller *c, void *ptr)
290{ 296{
@@ -315,8 +321,246 @@ static inline u32 i2o_ptr_high(void *ptr)
315{ 321{
316 return 0; 322 return 0;
317}; 323};
324
325static inline u32 i2o_dma_low(dma_addr_t dma_addr)
326{
327 return (u32) dma_addr;
328};
329
330static inline u32 i2o_dma_high(dma_addr_t dma_addr)
331{
332 return 0;
333};
318#endif 334#endif
319 335
336/**
337 * i2o_sg_tablesize - Calculate the maximum number of elements in a SGL
338 * @c: I2O controller for which the calculation should be done
339 * @body_size: maximum body size used for message in 32-bit words.
340 *
341 * Return the maximum number of SG elements in a SG list.
342 */
343static inline u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size)
344{
345 i2o_status_block *sb = c->status_block.virt;
346 u16 sg_count =
347 (sb->inbound_frame_size - sizeof(struct i2o_message) / 4) -
348 body_size;
349
350 if (c->pae_support) {
351 /*
352 * for 64-bit a SG attribute element must be added and each
353 * SG element needs 12 bytes instead of 8.
354 */
355 sg_count -= 2;
356 sg_count /= 3;
357 } else
358 sg_count /= 2;
359
360 if (c->short_req && (sg_count > 8))
361 sg_count = 8;
362
363 return sg_count;
364};
365
366/**
367 * i2o_dma_map_single - Map pointer to controller and fill in I2O message.
368 * @c: I2O controller
369 * @ptr: pointer to the data which should be mapped
370 * @size: size of data in bytes
371 * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE
372 * @sg_ptr: pointer to the SG list inside the I2O message
373 *
374 * This function does all necessary DMA handling and also writes the I2O
375 * SGL elements into the I2O message. For details on DMA handling see also
376 * dma_map_single(). The pointer sg_ptr will only be set to the end of the
377 * SG list if the allocation was successful.
378 *
379 * Returns DMA address which must be checked for failures using
380 * dma_mapping_error().
381 */
382static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
383 size_t size,
384 enum dma_data_direction direction,
385 u32 __iomem ** sg_ptr)
386{
387 u32 sg_flags;
388 u32 __iomem *mptr = *sg_ptr;
389 dma_addr_t dma_addr;
390
391 switch (direction) {
392 case DMA_TO_DEVICE:
393 sg_flags = 0xd4000000;
394 break;
395 case DMA_FROM_DEVICE:
396 sg_flags = 0xd0000000;
397 break;
398 default:
399 return 0;
400 }
401
402 dma_addr = dma_map_single(&c->pdev->dev, ptr, size, direction);
403 if (!dma_mapping_error(dma_addr)) {
404#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
405 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
406 writel(0x7C020002, mptr++);
407 writel(PAGE_SIZE, mptr++);
408 }
409#endif
410
411 writel(sg_flags | size, mptr++);
412 writel(i2o_dma_low(dma_addr), mptr++);
413#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
414 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
415 writel(i2o_dma_high(dma_addr), mptr++);
416#endif
417 *sg_ptr = mptr;
418 }
419 return dma_addr;
420};
421
422/**
423 * i2o_dma_map_sg - Map a SG List to controller and fill in I2O message.
424 * @c: I2O controller
425 * @sg: SG list to be mapped
426 * @sg_count: number of elements in the SG list
427 * @direction: DMA_TO_DEVICE / DMA_FROM_DEVICE
428 * @sg_ptr: pointer to the SG list inside the I2O message
429 *
430 * This function does all necessary DMA handling and also writes the I2O
431 * SGL elements into the I2O message. For details on DMA handling see also
432 * dma_map_sg(). The pointer sg_ptr will only be set to the end of the SG
433 * list if the allocation was successful.
434 *
435 * Returns 0 on failure or 1 on success.
436 */
437static inline int i2o_dma_map_sg(struct i2o_controller *c,
438 struct scatterlist *sg, int sg_count,
439 enum dma_data_direction direction,
440 u32 __iomem ** sg_ptr)
441{
442 u32 sg_flags;
443 u32 __iomem *mptr = *sg_ptr;
444
445 switch (direction) {
446 case DMA_TO_DEVICE:
447 sg_flags = 0x14000000;
448 break;
449 case DMA_FROM_DEVICE:
450 sg_flags = 0x10000000;
451 break;
452 default:
453 return 0;
454 }
455
456 sg_count = dma_map_sg(&c->pdev->dev, sg, sg_count, direction);
457 if (!sg_count)
458 return 0;
459
460#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
461 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
462 writel(0x7C020002, mptr++);
463 writel(PAGE_SIZE, mptr++);
464 }
465#endif
466
467 while (sg_count-- > 0) {
468 if (!sg_count)
469 sg_flags |= 0xC0000000;
470 writel(sg_flags | sg_dma_len(sg), mptr++);
471 writel(i2o_dma_low(sg_dma_address(sg)), mptr++);
472#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
473 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
474 writel(i2o_dma_high(sg_dma_address(sg)), mptr++);
475#endif
476 sg++;
477 }
478 *sg_ptr = mptr;
479
480 return 1;
481};
482
483/**
484 * i2o_dma_alloc - Allocate DMA memory
485 * @dev: struct device pointer to the PCI device of the I2O controller
486 * @addr: i2o_dma struct which should get the DMA buffer
487 * @len: length of the new DMA memory
488 * @gfp_mask: GFP mask
489 *
490 * Allocate a coherent DMA memory and write the pointers into addr.
491 *
492 * Returns 0 on success or -ENOMEM on failure.
493 */
494static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
495 size_t len, unsigned int gfp_mask)
496{
497 struct pci_dev *pdev = to_pci_dev(dev);
498 int dma_64 = 0;
499
500 if ((sizeof(dma_addr_t) > 4) && (pdev->dma_mask == DMA_64BIT_MASK)) {
501 dma_64 = 1;
502 if (pci_set_dma_mask(pdev, DMA_32BIT_MASK))
503 return -ENOMEM;
504 }
505
506 addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask);
507
508 if ((sizeof(dma_addr_t) > 4) && dma_64)
509 if (pci_set_dma_mask(pdev, DMA_64BIT_MASK))
510 printk(KERN_WARNING "i2o: unable to set 64-bit DMA");
511
512 if (!addr->virt)
513 return -ENOMEM;
514
515 memset(addr->virt, 0, len);
516 addr->len = len;
517
518 return 0;
519};
520
521/**
522 * i2o_dma_free - Free DMA memory
523 * @dev: struct device pointer to the PCI device of the I2O controller
524 * @addr: i2o_dma struct which contains the DMA buffer
525 *
526 * Free a coherent DMA memory and set virtual address of addr to NULL.
527 */
528static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
529{
530 if (addr->virt) {
531 if (addr->phys)
532 dma_free_coherent(dev, addr->len, addr->virt,
533 addr->phys);
534 else
535 kfree(addr->virt);
536 addr->virt = NULL;
537 }
538};
539
540/**
541 * i2o_dma_realloc - Realloc DMA memory
542 * @dev: struct device pointer to the PCI device of the I2O controller
543 * @addr: pointer to a i2o_dma struct DMA buffer
544 * @len: new length of memory
545 * @gfp_mask: GFP mask
546 *
547 * If there was something allocated in the addr, free it first. If len > 0
548 * than try to allocate it and write the addresses back to the addr
549 * structure. If len == 0 set the virtual address to NULL.
550 *
551 * Returns the 0 on success or negative error code on failure.
552 */
553static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
554 size_t len, unsigned int gfp_mask)
555{
556 i2o_dma_free(dev, addr);
557
558 if (len)
559 return i2o_dma_alloc(dev, addr, len, gfp_mask);
560
561 return 0;
562};
563
320/* I2O driver (OSM) functions */ 564/* I2O driver (OSM) functions */
321extern int i2o_driver_register(struct i2o_driver *); 565extern int i2o_driver_register(struct i2o_driver *);
322extern void i2o_driver_unregister(struct i2o_driver *); 566extern void i2o_driver_unregister(struct i2o_driver *);
@@ -385,49 +629,11 @@ extern int i2o_device_claim_release(struct i2o_device *);
385/* Exec OSM functions */ 629/* Exec OSM functions */
386extern int i2o_exec_lct_get(struct i2o_controller *); 630extern int i2o_exec_lct_get(struct i2o_controller *);
387 631
388/* device to i2o_device and driver to i2o_driver convertion functions */ 632/* device / driver / kobject conversion functions */
389#define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver) 633#define to_i2o_driver(drv) container_of(drv,struct i2o_driver, driver)
390#define to_i2o_device(dev) container_of(dev, struct i2o_device, device) 634#define to_i2o_device(dev) container_of(dev, struct i2o_device, device)
391 635#define to_i2o_controller(dev) container_of(dev, struct i2o_controller, device)
392/* 636#define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj))
393 * Messenger inlines
394 */
395static inline u32 I2O_POST_READ32(struct i2o_controller *c)
396{
397 rmb();
398 return readl(c->post_port);
399};
400
401static inline void I2O_POST_WRITE32(struct i2o_controller *c, u32 val)
402{
403 wmb();
404 writel(val, c->post_port);
405};
406
407static inline u32 I2O_REPLY_READ32(struct i2o_controller *c)
408{
409 rmb();
410 return readl(c->reply_port);
411};
412
413static inline void I2O_REPLY_WRITE32(struct i2o_controller *c, u32 val)
414{
415 wmb();
416 writel(val, c->reply_port);
417};
418
419static inline u32 I2O_IRQ_READ32(struct i2o_controller *c)
420{
421 rmb();
422 return readl(c->irq_mask);
423};
424
425static inline void I2O_IRQ_WRITE32(struct i2o_controller *c, u32 val)
426{
427 wmb();
428 writel(val, c->irq_mask);
429 wmb();
430};
431 637
432/** 638/**
433 * i2o_msg_get - obtain an I2O message from the IOP 639 * i2o_msg_get - obtain an I2O message from the IOP
@@ -443,11 +649,11 @@ static inline void I2O_IRQ_WRITE32(struct i2o_controller *c, u32 val)
443 * available returns I2O_QUEUE_EMPTY and msg is leaved untouched. 649 * available returns I2O_QUEUE_EMPTY and msg is leaved untouched.
444 */ 650 */
445static inline u32 i2o_msg_get(struct i2o_controller *c, 651static inline u32 i2o_msg_get(struct i2o_controller *c,
446 struct i2o_message __iomem **msg) 652 struct i2o_message __iomem ** msg)
447{ 653{
448 u32 m; 654 u32 m = readl(c->in_port);
449 655
450 if ((m = I2O_POST_READ32(c)) != I2O_QUEUE_EMPTY) 656 if (m != I2O_QUEUE_EMPTY)
451 *msg = c->in_queue.virt + m; 657 *msg = c->in_queue.virt + m;
452 658
453 return m; 659 return m;
@@ -462,7 +668,7 @@ static inline u32 i2o_msg_get(struct i2o_controller *c,
462 */ 668 */
463static inline void i2o_msg_post(struct i2o_controller *c, u32 m) 669static inline void i2o_msg_post(struct i2o_controller *c, u32 m)
464{ 670{
465 I2O_POST_WRITE32(c, m); 671 writel(m, c->in_port);
466}; 672};
467 673
468/** 674/**
@@ -491,12 +697,10 @@ static inline int i2o_msg_post_wait(struct i2o_controller *c, u32 m,
491 * The I2O controller must be informed that the reply message is not needed 697 * The I2O controller must be informed that the reply message is not needed
492 * anymore. If you forget to flush the reply, the message frame can't be 698 * anymore. If you forget to flush the reply, the message frame can't be
493 * used by the controller anymore and is therefore lost. 699 * used by the controller anymore and is therefore lost.
494 *
495 * FIXME: is there a timeout after which the controller reuse the message?
496 */ 700 */
497static inline void i2o_flush_reply(struct i2o_controller *c, u32 m) 701static inline void i2o_flush_reply(struct i2o_controller *c, u32 m)
498{ 702{
499 I2O_REPLY_WRITE32(c, m); 703 writel(m, c->out_port);
500}; 704};
501 705
502/** 706/**
@@ -530,97 +734,13 @@ static inline struct i2o_message *i2o_msg_out_to_virt(struct i2o_controller *c,
530 * work for receive side messages as they are kmalloc objects 734 * work for receive side messages as they are kmalloc objects
531 * in a different pool. 735 * in a different pool.
532 */ 736 */
533static inline struct i2o_message __iomem *i2o_msg_in_to_virt(struct i2o_controller *c, 737static inline struct i2o_message __iomem *i2o_msg_in_to_virt(struct
534 u32 m) 738 i2o_controller *c,
739 u32 m)
535{ 740{
536 return c->in_queue.virt + m; 741 return c->in_queue.virt + m;
537}; 742};
538 743
539/**
540 * i2o_dma_alloc - Allocate DMA memory
541 * @dev: struct device pointer to the PCI device of the I2O controller
542 * @addr: i2o_dma struct which should get the DMA buffer
543 * @len: length of the new DMA memory
544 * @gfp_mask: GFP mask
545 *
546 * Allocate a coherent DMA memory and write the pointers into addr.
547 *
548 * Returns 0 on success or -ENOMEM on failure.
549 */
550static inline int i2o_dma_alloc(struct device *dev, struct i2o_dma *addr,
551 size_t len, unsigned int gfp_mask)
552{
553 addr->virt = dma_alloc_coherent(dev, len, &addr->phys, gfp_mask);
554 if (!addr->virt)
555 return -ENOMEM;
556
557 memset(addr->virt, 0, len);
558 addr->len = len;
559
560 return 0;
561};
562
563/**
564 * i2o_dma_free - Free DMA memory
565 * @dev: struct device pointer to the PCI device of the I2O controller
566 * @addr: i2o_dma struct which contains the DMA buffer
567 *
568 * Free a coherent DMA memory and set virtual address of addr to NULL.
569 */
570static inline void i2o_dma_free(struct device *dev, struct i2o_dma *addr)
571{
572 if (addr->virt) {
573 if (addr->phys)
574 dma_free_coherent(dev, addr->len, addr->virt,
575 addr->phys);
576 else
577 kfree(addr->virt);
578 addr->virt = NULL;
579 }
580};
581
582/**
583 * i2o_dma_map - Map the memory to DMA
584 * @dev: struct device pointer to the PCI device of the I2O controller
585 * @addr: i2o_dma struct which should be mapped
586 *
587 * Map the memory in addr->virt to coherent DMA memory and write the
588 * physical address into addr->phys.
589 *
590 * Returns 0 on success or -ENOMEM on failure.
591 */
592static inline int i2o_dma_map(struct device *dev, struct i2o_dma *addr)
593{
594 if (!addr->virt)
595 return -EFAULT;
596
597 if (!addr->phys)
598 addr->phys = dma_map_single(dev, addr->virt, addr->len,
599 DMA_BIDIRECTIONAL);
600 if (!addr->phys)
601 return -ENOMEM;
602
603 return 0;
604};
605
606/**
607 * i2o_dma_unmap - Unmap the DMA memory
608 * @dev: struct device pointer to the PCI device of the I2O controller
609 * @addr: i2o_dma struct which should be unmapped
610 *
611 * Unmap the memory in addr->virt from DMA memory.
612 */
613static inline void i2o_dma_unmap(struct device *dev, struct i2o_dma *addr)
614{
615 if (!addr->virt)
616 return;
617
618 if (addr->phys) {
619 dma_unmap_single(dev, addr->phys, addr->len, DMA_BIDIRECTIONAL);
620 addr->phys = 0;
621 }
622};
623
624/* 744/*
625 * Endian handling wrapped into the macro - keeps the core code 745 * Endian handling wrapped into the macro - keeps the core code
626 * cleaner. 746 * cleaner.
@@ -773,6 +893,14 @@ extern void i2o_debug_state(struct i2o_controller *c);
773#define I2O_CMD_SCSI_BUSRESET 0x27 893#define I2O_CMD_SCSI_BUSRESET 0x27
774 894
775/* 895/*
896 * Bus Adapter Class
897 */
898#define I2O_CMD_BUS_ADAPTER_RESET 0x85
899#define I2O_CMD_BUS_RESET 0x87
900#define I2O_CMD_BUS_SCAN 0x89
901#define I2O_CMD_BUS_QUIESCE 0x8b
902
903/*
776 * Random Block Storage Class 904 * Random Block Storage Class
777 */ 905 */
778#define I2O_CMD_BLOCK_READ 0x30 906#define I2O_CMD_BLOCK_READ 0x30
@@ -784,7 +912,7 @@ extern void i2o_debug_state(struct i2o_controller *c);
784#define I2O_CMD_BLOCK_MEJECT 0x43 912#define I2O_CMD_BLOCK_MEJECT 0x43
785#define I2O_CMD_BLOCK_POWER 0x70 913#define I2O_CMD_BLOCK_POWER 0x70
786 914
787#define I2O_PRIVATE_MSG 0xFF 915#define I2O_CMD_PRIVATE 0xFF
788 916
789/* Command status values */ 917/* Command status values */
790 918
@@ -922,7 +1050,7 @@ extern void i2o_debug_state(struct i2o_controller *c);
922#define I2OVER15 0x0001 1050#define I2OVER15 0x0001
923#define I2OVER20 0x0002 1051#define I2OVER20 0x0002
924 1052
925/* Default is 1.5, FIXME: Need support for both 1.5 and 2.0 */ 1053/* Default is 1.5 */
926#define I2OVERSION I2OVER15 1054#define I2OVERSION I2OVER15
927 1055
928#define SGL_OFFSET_0 I2OVERSION 1056#define SGL_OFFSET_0 I2OVERSION
@@ -933,9 +1061,9 @@ extern void i2o_debug_state(struct i2o_controller *c);
933#define SGL_OFFSET_8 (0x0080 | I2OVERSION) 1061#define SGL_OFFSET_8 (0x0080 | I2OVERSION)
934#define SGL_OFFSET_9 (0x0090 | I2OVERSION) 1062#define SGL_OFFSET_9 (0x0090 | I2OVERSION)
935#define SGL_OFFSET_10 (0x00A0 | I2OVERSION) 1063#define SGL_OFFSET_10 (0x00A0 | I2OVERSION)
936 1064#define SGL_OFFSET_11 (0x00B0 | I2OVERSION)
937#define TRL_OFFSET_5 (0x0050 | I2OVERSION) 1065#define SGL_OFFSET_12 (0x00C0 | I2OVERSION)
938#define TRL_OFFSET_6 (0x0060 | I2OVERSION) 1066#define SGL_OFFSET(x) (((x)<<4) | I2OVERSION)
939 1067
940/* Transaction Reply Lists (TRL) Control Word structure */ 1068/* Transaction Reply Lists (TRL) Control Word structure */
941#define TRL_SINGLE_FIXED_LENGTH 0x00 1069#define TRL_SINGLE_FIXED_LENGTH 0x00
@@ -962,17 +1090,13 @@ extern void i2o_debug_state(struct i2o_controller *c);
962#define ELEVEN_WORD_MSG_SIZE 0x000B0000 1090#define ELEVEN_WORD_MSG_SIZE 0x000B0000
963#define I2O_MESSAGE_SIZE(x) ((x)<<16) 1091#define I2O_MESSAGE_SIZE(x) ((x)<<16)
964 1092
965/* Special TID Assignments */ 1093/* special TID assignments */
966
967#define ADAPTER_TID 0 1094#define ADAPTER_TID 0
968#define HOST_TID 1 1095#define HOST_TID 1
969 1096
970#define MSG_FRAME_SIZE 128 /* i2o_scsi assumes >= 32 */ 1097/* outbound queue defines */
971#define REPLY_FRAME_SIZE 17 1098#define I2O_MAX_OUTBOUND_MSG_FRAMES 128
972#define SG_TABLESIZE 30 1099#define I2O_OUTBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */
973#define NMBR_MSG_FRAMES 128
974
975#define MSG_POOL_SIZE (MSG_FRAME_SIZE*NMBR_MSG_FRAMES*sizeof(u32))
976 1100
977#define I2O_POST_WAIT_OK 0 1101#define I2O_POST_WAIT_OK 0
978#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT 1102#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT
@@ -993,11 +1117,10 @@ extern void i2o_debug_state(struct i2o_controller *c);
993#define I2O_HRT_GET_TRIES 3 1117#define I2O_HRT_GET_TRIES 3
994#define I2O_LCT_GET_TRIES 3 1118#define I2O_LCT_GET_TRIES 3
995 1119
996/* request queue sizes */ 1120/* defines for max_sectors and max_phys_segments */
997#define I2O_MAX_SECTORS 1024 1121#define I2O_MAX_SECTORS 1024
998#define I2O_MAX_SEGMENTS 128 1122#define I2O_MAX_SECTORS_LIMITED 256
999 1123#define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS
1000#define I2O_REQ_MEMPOOL_SIZE 32
1001 1124
1002#endif /* __KERNEL__ */ 1125#endif /* __KERNEL__ */
1003#endif /* _I2O_H */ 1126#endif /* _I2O_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 336d6e509f59..a6dbb51ecd7b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -917,7 +917,7 @@ typedef struct hwif_s {
917 unsigned dma; 917 unsigned dma;
918 918
919 void (*led_act)(void *data, int rw); 919 void (*led_act)(void *data, int rw);
920} ide_hwif_t; 920} ____cacheline_maxaligned_in_smp ide_hwif_t;
921 921
922/* 922/*
923 * internal ide interrupt handler type 923 * internal ide interrupt handler type
@@ -1501,4 +1501,10 @@ extern struct bus_type ide_bus_type;
1501#define ide_id_has_flush_cache_ext(id) \ 1501#define ide_id_has_flush_cache_ext(id) \
1502 (((id)->cfs_enable_2 & 0x2400) == 0x2400) 1502 (((id)->cfs_enable_2 & 0x2400) == 0x2400)
1503 1503
1504static inline int hwif_to_node(ide_hwif_t *hwif)
1505{
1506 struct pci_dev *dev = hwif->pci_dev;
1507 return dev ? pcibus_to_node(dev->bus) : -1;
1508}
1509
1504#endif /* _IDE_H */ 1510#endif /* _IDE_H */
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h
index 57024ce2c74f..84598fa2e9de 100644
--- a/include/linux/if_bonding.h
+++ b/include/linux/if_bonding.h
@@ -35,6 +35,9 @@
35 * 35 *
36 * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com> 36 * 2003/12/01 - Shmulik Hen <shmulik.hen at intel dot com>
37 * - Code cleanup and style changes 37 * - Code cleanup and style changes
38 *
39 * 2005/05/05 - Jason Gabler <jygabler at lbl dot gov>
40 * - added definitions for various XOR hashing policies
38 */ 41 */
39 42
40#ifndef _LINUX_IF_BONDING_H 43#ifndef _LINUX_IF_BONDING_H
@@ -80,6 +83,10 @@
80 83
81#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ 84#define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */
82 85
86/* hashing types */
87#define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */
88#define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ MAC) */
89
83typedef struct ifbond { 90typedef struct ifbond {
84 __s32 bond_mode; 91 __s32 bond_mode;
85 __s32 num_slaves; 92 __s32 num_slaves;
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
index 004e6f09a6e2..68c896a36a34 100644
--- a/include/linux/if_shaper.h
+++ b/include/linux/if_shaper.h
@@ -23,7 +23,7 @@ struct shaper
23 __u32 shapeclock; 23 __u32 shapeclock;
24 unsigned long recovery; /* Time we can next clock a packet out on 24 unsigned long recovery; /* Time we can next clock a packet out on
25 an empty queue */ 25 an empty queue */
26 struct semaphore sem; 26 spinlock_t lock;
27 struct net_device_stats stats; 27 struct net_device_stats stats;
28 struct net_device *dev; 28 struct net_device *dev;
29 int (*hard_start_xmit) (struct sk_buff *skb, 29 int (*hard_start_xmit) (struct sk_buff *skb,
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 390e760a96d3..0c31ef0b5bad 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -148,7 +148,6 @@ struct ip_sf_socklist
148struct ip_mc_socklist 148struct ip_mc_socklist
149{ 149{
150 struct ip_mc_socklist *next; 150 struct ip_mc_socklist *next;
151 int count;
152 struct ip_mreqn multi; 151 struct ip_mreqn multi;
153 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 152 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
154 struct ip_sf_socklist *sflist; 153 struct ip_sf_socklist *sflist;
diff --git a/include/linux/in6.h b/include/linux/in6.h
index f8256c582845..dcf5720ffcbb 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -156,7 +156,7 @@ struct in6_flowlabel_req
156#define IPV6_CHECKSUM 7 156#define IPV6_CHECKSUM 7
157#define IPV6_HOPLIMIT 8 157#define IPV6_HOPLIMIT 8
158#define IPV6_NEXTHOP 9 158#define IPV6_NEXTHOP 9
159#define IPV6_AUTHHDR 10 159#define IPV6_AUTHHDR 10 /* obsolete */
160#define IPV6_FLOWINFO 11 160#define IPV6_FLOWINFO 11
161 161
162#define IPV6_UNICAST_HOPS 16 162#define IPV6_UNICAST_HOPS 16
diff --git a/include/linux/init.h b/include/linux/init.h
index 05c83e0521ca..59008c3826cf 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -229,6 +229,18 @@ void __init parse_early_param(void);
229#define __devexitdata __exitdata 229#define __devexitdata __exitdata
230#endif 230#endif
231 231
232#ifdef CONFIG_HOTPLUG_CPU
233#define __cpuinit
234#define __cpuinitdata
235#define __cpuexit
236#define __cpuexitdata
237#else
238#define __cpuinit __init
239#define __cpuinitdata __initdata
240#define __cpuexit __exit
241#define __cpuexitdata __exitdata
242#endif
243
232/* Functions marked as __devexit may be discarded at kernel link time, depending 244/* Functions marked as __devexit may be discarded at kernel link time, depending
233 on config options. Newer versions of binutils detect references from 245 on config options. Newer versions of binutils detect references from
234 retained sections to discarded sections and flag an error. Pointers to 246 retained sections to discarded sections and flag an error. Pointers to
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index a6a8c1a38d5e..c727c195a91a 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -81,6 +81,7 @@ extern struct group_info init_groups;
81 .mm = NULL, \ 81 .mm = NULL, \
82 .active_mm = &init_mm, \ 82 .active_mm = &init_mm, \
83 .run_list = LIST_HEAD_INIT(tsk.run_list), \ 83 .run_list = LIST_HEAD_INIT(tsk.run_list), \
84 .ioprio = 0, \
84 .time_slice = HZ, \ 85 .time_slice = HZ, \
85 .tasks = LIST_HEAD_INIT(tsk.tasks), \ 86 .tasks = LIST_HEAD_INIT(tsk.tasks), \
86 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \ 87 .ptrace_children= LIST_HEAD_INIT(tsk.ptrace_children), \
@@ -108,9 +109,9 @@ extern struct group_info init_groups;
108 .blocked = {{0}}, \ 109 .blocked = {{0}}, \
109 .alloc_lock = SPIN_LOCK_UNLOCKED, \ 110 .alloc_lock = SPIN_LOCK_UNLOCKED, \
110 .proc_lock = SPIN_LOCK_UNLOCKED, \ 111 .proc_lock = SPIN_LOCK_UNLOCKED, \
111 .switch_lock = SPIN_LOCK_UNLOCKED, \
112 .journal_info = NULL, \ 112 .journal_info = NULL, \
113 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 113 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
114 .fs_excl = ATOMIC_INIT(0), \
114} 115}
115 116
116 117
diff --git a/include/linux/inotify.h b/include/linux/inotify.h
new file mode 100644
index 000000000000..93bb3afe646b
--- /dev/null
+++ b/include/linux/inotify.h
@@ -0,0 +1,110 @@
1/*
2 * Inode based directory notification for Linux
3 *
4 * Copyright (C) 2005 John McCutchan
5 */
6
7#ifndef _LINUX_INOTIFY_H
8#define _LINUX_INOTIFY_H
9
10#include <linux/types.h>
11
12/*
13 * struct inotify_event - structure read from the inotify device for each event
14 *
15 * When you are watching a directory, you will receive the filename for events
16 * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd.
17 */
18struct inotify_event {
19 __s32 wd; /* watch descriptor */
20 __u32 mask; /* watch mask */
21 __u32 cookie; /* cookie to synchronize two events */
22 __u32 len; /* length (including nulls) of name */
23 char name[0]; /* stub for possible name */
24};
25
26/* the following are legal, implemented events that user-space can watch for */
27#define IN_ACCESS 0x00000001 /* File was accessed */
28#define IN_MODIFY 0x00000002 /* File was modified */
29#define IN_ATTRIB 0x00000004 /* Metadata changed */
30#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
31#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
32#define IN_OPEN 0x00000020 /* File was opened */
33#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
34#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
35#define IN_CREATE 0x00000100 /* Subfile was created */
36#define IN_DELETE 0x00000200 /* Subfile was deleted */
37#define IN_DELETE_SELF 0x00000400 /* Self was deleted */
38#define IN_MOVE_SELF 0x00000800 /* Self was moved */
39
40/* the following are legal events. they are sent as needed to any watch */
41#define IN_UNMOUNT 0x00002000 /* Backing fs was unmounted */
42#define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
43#define IN_IGNORED 0x00008000 /* File was ignored */
44
45/* helper events */
46#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */
47#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */
48
49/* special flags */
50#define IN_ISDIR 0x40000000 /* event occurred against dir */
51#define IN_ONESHOT 0x80000000 /* only send event once */
52
53/*
54 * All of the events - we build the list by hand so that we can add flags in
55 * the future and not break backward compatibility. Apps will get only the
56 * events that they originally wanted. Be sure to add new events here!
57 */
58#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \
59 IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \
60 IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \
61 IN_MOVE_SELF)
62
63#ifdef __KERNEL__
64
65#include <linux/dcache.h>
66#include <linux/fs.h>
67#include <linux/config.h>
68
69#ifdef CONFIG_INOTIFY
70
71extern void inotify_inode_queue_event(struct inode *, __u32, __u32,
72 const char *);
73extern void inotify_dentry_parent_queue_event(struct dentry *, __u32, __u32,
74 const char *);
75extern void inotify_unmount_inodes(struct list_head *);
76extern void inotify_inode_is_dead(struct inode *);
77extern u32 inotify_get_cookie(void);
78
79#else
80
81static inline void inotify_inode_queue_event(struct inode *inode,
82 __u32 mask, __u32 cookie,
83 const char *filename)
84{
85}
86
87static inline void inotify_dentry_parent_queue_event(struct dentry *dentry,
88 __u32 mask, __u32 cookie,
89 const char *filename)
90{
91}
92
93static inline void inotify_unmount_inodes(struct list_head *list)
94{
95}
96
97static inline void inotify_inode_is_dead(struct inode *inode)
98{
99}
100
101static inline u32 inotify_get_cookie(void)
102{
103 return 0;
104}
105
106#endif /* CONFIG_INOTIFY */
107
108#endif /* __KERNEL __ */
109
110#endif /* _LINUX_INOTIFY_H */
diff --git a/include/linux/input.h b/include/linux/input.h
index 9d9598ed760d..bdc53c6cc962 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -811,9 +811,9 @@ struct input_dev {
811 811
812 void *private; 812 void *private;
813 813
814 char *name; 814 const char *name;
815 char *phys; 815 const char *phys;
816 char *uniq; 816 const char *uniq;
817 struct input_id id; 817 struct input_id id;
818 818
819 unsigned long evbit[NBITS(EV_MAX)]; 819 unsigned long evbit[NBITS(EV_MAX)];
@@ -859,6 +859,10 @@ struct input_dev {
859 int (*erase_effect)(struct input_dev *dev, int effect_id); 859 int (*erase_effect)(struct input_dev *dev, int effect_id);
860 860
861 struct input_handle *grab; 861 struct input_handle *grab;
862
863 struct semaphore sem; /* serializes open and close operations */
864 unsigned int users;
865
862 struct device *dev; 866 struct device *dev;
863 867
864 struct list_head h_list; 868 struct list_head h_list;
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
new file mode 100644
index 000000000000..88d5961f7a3f
--- /dev/null
+++ b/include/linux/ioprio.h
@@ -0,0 +1,85 @@
1#ifndef IOPRIO_H
2#define IOPRIO_H
3
4#include <linux/sched.h>
5
6/*
7 * Gives us 8 prio classes with 13-bits of data for each class
8 */
9#define IOPRIO_BITS (16)
10#define IOPRIO_CLASS_SHIFT (13)
11#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
12
13#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
14#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
15#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
16
17#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
18
19/*
20 * These are the io priority groups as implemented by CFQ. RT is the realtime
21 * class, it always gets premium service. BE is the best-effort scheduling
22 * class, the default for any process. IDLE is the idle scheduling class, it
23 * is only served when no one else is using the disk.
24 */
25enum {
26 IOPRIO_CLASS_NONE,
27 IOPRIO_CLASS_RT,
28 IOPRIO_CLASS_BE,
29 IOPRIO_CLASS_IDLE,
30};
31
32/*
33 * 8 best effort priority levels are supported
34 */
35#define IOPRIO_BE_NR (8)
36
37enum {
38 IOPRIO_WHO_PROCESS = 1,
39 IOPRIO_WHO_PGRP,
40 IOPRIO_WHO_USER,
41};
42
43/*
44 * if process has set io priority explicitly, use that. if not, convert
45 * the cpu scheduler nice value to an io priority
46 */
47#define IOPRIO_NORM (4)
48static inline int task_ioprio(struct task_struct *task)
49{
50 WARN_ON(!ioprio_valid(task->ioprio));
51 return IOPRIO_PRIO_DATA(task->ioprio);
52}
53
54static inline int task_nice_ioprio(struct task_struct *task)
55{
56 return (task_nice(task) + 20) / 5;
57}
58
59/*
60 * For inheritance, return the highest of the two given priorities
61 */
62static inline int ioprio_best(unsigned short aprio, unsigned short bprio)
63{
64 unsigned short aclass = IOPRIO_PRIO_CLASS(aprio);
65 unsigned short bclass = IOPRIO_PRIO_CLASS(bprio);
66
67 if (!ioprio_valid(aprio))
68 return bprio;
69 if (!ioprio_valid(bprio))
70 return aprio;
71
72 if (aclass == IOPRIO_CLASS_NONE)
73 aclass = IOPRIO_CLASS_BE;
74 if (bclass == IOPRIO_CLASS_NONE)
75 bclass = IOPRIO_CLASS_BE;
76
77 if (aclass == bclass)
78 return min(aprio, bprio);
79 if (aclass > bclass)
80 return bprio;
81 else
82 return aprio;
83}
84
85#endif
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 2ec265e1045f..596ca6130159 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -209,6 +209,11 @@ struct kernel_ipmi_msg
209#include <linux/list.h> 209#include <linux/list.h>
210#include <linux/module.h> 210#include <linux/module.h>
211 211
212#ifdef CONFIG_PROC_FS
213#include <linux/proc_fs.h>
214extern struct proc_dir_entry *proc_ipmi_root;
215#endif /* CONFIG_PROC_FS */
216
212/* Opaque type for a IPMI message user. One of these is needed to 217/* Opaque type for a IPMI message user. One of these is needed to
213 send and receive messages. */ 218 send and receive messages. */
214typedef struct ipmi_user *ipmi_user_t; 219typedef struct ipmi_user *ipmi_user_t;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 7fc1022be9ee..069d3b84d311 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -85,10 +85,10 @@ extern int no_irq_affinity;
85extern int noirqdebug_setup(char *str); 85extern int noirqdebug_setup(char *str);
86 86
87extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs, 87extern fastcall int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
88 struct irqaction *action); 88 struct irqaction *action);
89extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs); 89extern fastcall unsigned int __do_IRQ(unsigned int irq, struct pt_regs *regs);
90extern void note_interrupt(unsigned int irq, irq_desc_t *desc, int action_ret); 90extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
91extern void report_bad_irq(unsigned int irq, irq_desc_t *desc, int action_ret); 91 int action_ret, struct pt_regs *regs);
92extern int can_request_irq(unsigned int irq, unsigned long irqflags); 92extern int can_request_irq(unsigned int irq, unsigned long irqflags);
93 93
94extern void init_irq_proc(void); 94extern void init_irq_proc(void);
diff --git a/include/linux/jffs2_fs_sb.h b/include/linux/jffs2_fs_sb.h
index 4afc8d8c2e9e..1e21546622de 100644
--- a/include/linux/jffs2_fs_sb.h
+++ b/include/linux/jffs2_fs_sb.h
@@ -1,4 +1,4 @@
1/* $Id: jffs2_fs_sb.h,v 1.48 2004/11/20 10:41:12 dwmw2 Exp $ */ 1/* $Id: jffs2_fs_sb.h,v 1.52 2005/05/19 16:12:17 gleixner Exp $ */
2 2
3#ifndef _JFFS2_FS_SB 3#ifndef _JFFS2_FS_SB
4#define _JFFS2_FS_SB 4#define _JFFS2_FS_SB
@@ -14,7 +14,8 @@
14#include <linux/rwsem.h> 14#include <linux/rwsem.h>
15 15
16#define JFFS2_SB_FLAG_RO 1 16#define JFFS2_SB_FLAG_RO 1
17#define JFFS2_SB_FLAG_MOUNTING 2 17#define JFFS2_SB_FLAG_SCANNING 2 /* Flash scanning is in progress */
18#define JFFS2_SB_FLAG_BUILDING 4 /* File system building is in progress */
18 19
19struct jffs2_inodirty; 20struct jffs2_inodirty;
20 21
@@ -31,7 +32,7 @@ struct jffs2_sb_info {
31 unsigned int flags; 32 unsigned int flags;
32 33
33 struct task_struct *gc_task; /* GC task struct */ 34 struct task_struct *gc_task; /* GC task struct */
34 struct semaphore gc_thread_start; /* GC thread start mutex */ 35 struct completion gc_thread_start; /* GC thread start completion */
35 struct completion gc_thread_exit; /* GC thread exit completion port */ 36 struct completion gc_thread_exit; /* GC thread exit completion port */
36 37
37 struct semaphore alloc_sem; /* Used to protect all the following 38 struct semaphore alloc_sem; /* Used to protect all the following
@@ -94,7 +95,7 @@ struct jffs2_sb_info {
94 to an obsoleted node. I don't like this. Alternatives welcomed. */ 95 to an obsoleted node. I don't like this. Alternatives welcomed. */
95 struct semaphore erase_free_sem; 96 struct semaphore erase_free_sem;
96 97
97#if defined CONFIG_JFFS2_FS_NAND || defined CONFIG_JFFS2_FS_NOR_ECC 98#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
98 /* Write-behind buffer for NAND flash */ 99 /* Write-behind buffer for NAND flash */
99 unsigned char *wbuf; 100 unsigned char *wbuf;
100 uint32_t wbuf_ofs; 101 uint32_t wbuf_ofs;
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index b7e0ab622cd7..06b9af77eb7f 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -111,18 +111,35 @@ struct js_corr {
111#define JS_SET_ALL 8 111#define JS_SET_ALL 8
112 112
113struct JS_DATA_TYPE { 113struct JS_DATA_TYPE {
114 int buttons; 114 __s32 buttons;
115 int x; 115 __s32 x;
116 int y; 116 __s32 y;
117}; 117};
118 118
119struct JS_DATA_SAVE_TYPE { 119struct JS_DATA_SAVE_TYPE_32 {
120 int JS_TIMEOUT; 120 __s32 JS_TIMEOUT;
121 int BUSY; 121 __s32 BUSY;
122 long JS_EXPIRETIME; 122 __s32 JS_EXPIRETIME;
123 long JS_TIMELIMIT; 123 __s32 JS_TIMELIMIT;
124 struct JS_DATA_TYPE JS_SAVE; 124 struct JS_DATA_TYPE JS_SAVE;
125 struct JS_DATA_TYPE JS_CORR; 125 struct JS_DATA_TYPE JS_CORR;
126}; 126};
127 127
128struct JS_DATA_SAVE_TYPE_64 {
129 __s32 JS_TIMEOUT;
130 __s32 BUSY;
131 __s64 JS_EXPIRETIME;
132 __s64 JS_TIMELIMIT;
133 struct JS_DATA_TYPE JS_SAVE;
134 struct JS_DATA_TYPE JS_CORR;
135};
136
137#if BITS_PER_LONG == 64
138#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_64
139#elif BITS_PER_LONG == 32
140#define JS_DATA_SAVE_TYPE JS_DATA_SAVE_TYPE_32
141#else
142#error Unexpected BITS_PER_LONG
143#endif
144
128#endif /* _LINUX_JOYSTICK_H */ 145#endif /* _LINUX_JOYSTICK_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e25b97062ce1..687ba8c9973d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -58,15 +58,23 @@ struct completion;
58 * be biten later when the calling function happens to sleep when it is not 58 * be biten later when the calling function happens to sleep when it is not
59 * supposed to. 59 * supposed to.
60 */ 60 */
61#ifdef CONFIG_PREEMPT_VOLUNTARY
62extern int cond_resched(void);
63# define might_resched() cond_resched()
64#else
65# define might_resched() do { } while (0)
66#endif
67
61#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 68#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
62#define might_sleep() __might_sleep(__FILE__, __LINE__) 69 void __might_sleep(char *file, int line);
63#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0) 70# define might_sleep() \
64void __might_sleep(char *file, int line); 71 do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0)
65#else 72#else
66#define might_sleep() do {} while(0) 73# define might_sleep() do { might_resched(); } while (0)
67#define might_sleep_if(cond) do {} while (0)
68#endif 74#endif
69 75
76#define might_sleep_if(cond) do { if (unlikely(cond)) might_sleep(); } while (0)
77
70#define abs(x) ({ \ 78#define abs(x) ({ \
71 int __x = (x); \ 79 int __x = (x); \
72 (__x < 0) ? -__x : __x; \ 80 (__x < 0) ? -__x : __x; \
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
new file mode 100644
index 000000000000..c8468472aec0
--- /dev/null
+++ b/include/linux/kexec.h
@@ -0,0 +1,135 @@
1#ifndef LINUX_KEXEC_H
2#define LINUX_KEXEC_H
3
4#ifdef CONFIG_KEXEC
5#include <linux/types.h>
6#include <linux/list.h>
7#include <linux/linkage.h>
8#include <linux/compat.h>
9#include <asm/kexec.h>
10
11/* Verify architecture specific macros are defined */
12
13#ifndef KEXEC_SOURCE_MEMORY_LIMIT
14#error KEXEC_SOURCE_MEMORY_LIMIT not defined
15#endif
16
17#ifndef KEXEC_DESTINATION_MEMORY_LIMIT
18#error KEXEC_DESTINATION_MEMORY_LIMIT not defined
19#endif
20
21#ifndef KEXEC_CONTROL_MEMORY_LIMIT
22#error KEXEC_CONTROL_MEMORY_LIMIT not defined
23#endif
24
25#ifndef KEXEC_CONTROL_CODE_SIZE
26#error KEXEC_CONTROL_CODE_SIZE not defined
27#endif
28
29#ifndef KEXEC_ARCH
30#error KEXEC_ARCH not defined
31#endif
32
33/*
34 * This structure is used to hold the arguments that are used when loading
35 * kernel binaries.
36 */
37
38typedef unsigned long kimage_entry_t;
39#define IND_DESTINATION 0x1
40#define IND_INDIRECTION 0x2
41#define IND_DONE 0x4
42#define IND_SOURCE 0x8
43
44#define KEXEC_SEGMENT_MAX 8
45struct kexec_segment {
46 void __user *buf;
47 size_t bufsz;
48 unsigned long mem; /* User space sees this as a (void *) ... */
49 size_t memsz;
50};
51
52#ifdef CONFIG_COMPAT
53struct compat_kexec_segment {
54 compat_uptr_t buf;
55 compat_size_t bufsz;
56 compat_ulong_t mem; /* User space sees this as a (void *) ... */
57 compat_size_t memsz;
58};
59#endif
60
61struct kimage {
62 kimage_entry_t head;
63 kimage_entry_t *entry;
64 kimage_entry_t *last_entry;
65
66 unsigned long destination;
67
68 unsigned long start;
69 struct page *control_code_page;
70
71 unsigned long nr_segments;
72 struct kexec_segment segment[KEXEC_SEGMENT_MAX];
73
74 struct list_head control_pages;
75 struct list_head dest_pages;
76 struct list_head unuseable_pages;
77
78 /* Address of next control page to allocate for crash kernels. */
79 unsigned long control_page;
80
81 /* Flags to indicate special processing */
82 unsigned int type : 1;
83#define KEXEC_TYPE_DEFAULT 0
84#define KEXEC_TYPE_CRASH 1
85};
86
87
88
89/* kexec interface functions */
90extern NORET_TYPE void machine_kexec(struct kimage *image) ATTRIB_NORET;
91extern int machine_kexec_prepare(struct kimage *image);
92extern void machine_kexec_cleanup(struct kimage *image);
93extern asmlinkage long sys_kexec_load(unsigned long entry,
94 unsigned long nr_segments,
95 struct kexec_segment __user *segments,
96 unsigned long flags);
97#ifdef CONFIG_COMPAT
98extern asmlinkage long compat_sys_kexec_load(unsigned long entry,
99 unsigned long nr_segments,
100 struct compat_kexec_segment __user *segments,
101 unsigned long flags);
102#endif
103extern struct page *kimage_alloc_control_pages(struct kimage *image,
104 unsigned int order);
105extern void crash_kexec(struct pt_regs *);
106int kexec_should_crash(struct task_struct *);
107extern struct kimage *kexec_image;
108
109#define KEXEC_ON_CRASH 0x00000001
110#define KEXEC_ARCH_MASK 0xffff0000
111
112/* These values match the ELF architecture values.
113 * Unless there is a good reason that should continue to be the case.
114 */
115#define KEXEC_ARCH_DEFAULT ( 0 << 16)
116#define KEXEC_ARCH_386 ( 3 << 16)
117#define KEXEC_ARCH_X86_64 (62 << 16)
118#define KEXEC_ARCH_PPC (20 << 16)
119#define KEXEC_ARCH_PPC64 (21 << 16)
120#define KEXEC_ARCH_IA_64 (50 << 16)
121#define KEXEC_ARCH_S390 (22 << 16)
122
123#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
124
125/* Location of a reserved region to hold the crash kernel.
126 */
127extern struct resource crashk_res;
128
129#else /* !CONFIG_KEXEC */
130struct pt_regs;
131struct task_struct;
132static inline void crash_kexec(struct pt_regs *regs) { }
133static inline int kexec_should_crash(struct task_struct *p) { return 0; }
134#endif /* CONFIG_KEXEC */
135#endif /* LINUX_KEXEC_H */
diff --git a/include/linux/key-ui.h b/include/linux/key-ui.h
index 60cc7b762e78..cc326174a808 100644
--- a/include/linux/key-ui.h
+++ b/include/linux/key-ui.h
@@ -1,4 +1,4 @@
1/* key-ui.h: key userspace interface stuff for use by keyfs 1/* key-ui.h: key userspace interface stuff
2 * 2 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 4 * Written by David Howells (dhowells@redhat.com)
@@ -31,8 +31,10 @@ extern spinlock_t key_serial_lock;
31 * subscribed 31 * subscribed
32 */ 32 */
33struct keyring_list { 33struct keyring_list {
34 unsigned maxkeys; /* max keys this list can hold */ 34 struct rcu_head rcu; /* RCU deletion hook */
35 unsigned nkeys; /* number of keys currently held */ 35 unsigned short maxkeys; /* max keys this list can hold */
36 unsigned short nkeys; /* number of keys currently held */
37 unsigned short delkey; /* key to be unlinked by RCU */
36 struct key *keys[0]; 38 struct key *keys[0];
37}; 39};
38 40
@@ -82,8 +84,45 @@ static inline int key_any_permission(const struct key *key, key_perm_t perm)
82 return kperm != 0; 84 return kperm != 0;
83} 85}
84 86
87static inline int key_task_groups_search(struct task_struct *tsk, gid_t gid)
88{
89 int ret;
90
91 task_lock(tsk);
92 ret = groups_search(tsk->group_info, gid);
93 task_unlock(tsk);
94 return ret;
95}
96
97static inline int key_task_permission(const struct key *key,
98 struct task_struct *context,
99 key_perm_t perm)
100{
101 key_perm_t kperm;
102
103 if (key->uid == context->fsuid) {
104 kperm = key->perm >> 16;
105 }
106 else if (key->gid != -1 &&
107 key->perm & KEY_GRP_ALL && (
108 key->gid == context->fsgid ||
109 key_task_groups_search(context, key->gid)
110 )
111 ) {
112 kperm = key->perm >> 8;
113 }
114 else {
115 kperm = key->perm;
116 }
117
118 kperm = kperm & perm & KEY_ALL;
119
120 return kperm == perm;
121
122}
85 123
86extern struct key *lookup_user_key(key_serial_t id, int create, int part, 124extern struct key *lookup_user_key(struct task_struct *context,
125 key_serial_t id, int create, int partial,
87 key_perm_t perm); 126 key_perm_t perm);
88 127
89extern long join_session_keyring(const char *name); 128extern long join_session_keyring(const char *name);
diff --git a/include/linux/key.h b/include/linux/key.h
index 6aa46d0e812f..970bbd916cf4 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -18,7 +18,7 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/rbtree.h> 20#include <linux/rbtree.h>
21#include <linux/spinlock.h> 21#include <linux/rcupdate.h>
22#include <asm/atomic.h> 22#include <asm/atomic.h>
23 23
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
@@ -78,7 +78,6 @@ struct key {
78 key_serial_t serial; /* key serial number */ 78 key_serial_t serial; /* key serial number */
79 struct rb_node serial_node; 79 struct rb_node serial_node;
80 struct key_type *type; /* type of key */ 80 struct key_type *type; /* type of key */
81 rwlock_t lock; /* examination vs change lock */
82 struct rw_semaphore sem; /* change vs change sem */ 81 struct rw_semaphore sem; /* change vs change sem */
83 struct key_user *user; /* owner of this key */ 82 struct key_user *user; /* owner of this key */
84 time_t expiry; /* time at which key expires (or 0) */ 83 time_t expiry; /* time at which key expires (or 0) */
@@ -86,14 +85,10 @@ struct key {
86 gid_t gid; 85 gid_t gid;
87 key_perm_t perm; /* access permissions */ 86 key_perm_t perm; /* access permissions */
88 unsigned short quotalen; /* length added to quota */ 87 unsigned short quotalen; /* length added to quota */
89 unsigned short datalen; /* payload data length */ 88 unsigned short datalen; /* payload data length
90 unsigned short flags; /* status flags (change with lock writelocked) */ 89 * - may not match RCU dereferenced payload
91#define KEY_FLAG_INSTANTIATED 0x00000001 /* set if key has been instantiated */ 90 * - payload should contain own length
92#define KEY_FLAG_DEAD 0x00000002 /* set if key type has been deleted */ 91 */
93#define KEY_FLAG_REVOKED 0x00000004 /* set if key had been revoked */
94#define KEY_FLAG_IN_QUOTA 0x00000008 /* set if key consumes quota */
95#define KEY_FLAG_USER_CONSTRUCT 0x00000010 /* set if key is being constructed in userspace */
96#define KEY_FLAG_NEGATIVE 0x00000020 /* set if key is negative */
97 92
98#ifdef KEY_DEBUGGING 93#ifdef KEY_DEBUGGING
99 unsigned magic; 94 unsigned magic;
@@ -101,6 +96,14 @@ struct key {
101#define KEY_DEBUG_MAGIC_X 0xf8e9dacbu 96#define KEY_DEBUG_MAGIC_X 0xf8e9dacbu
102#endif 97#endif
103 98
99 unsigned long flags; /* status flags (change with bitops) */
100#define KEY_FLAG_INSTANTIATED 0 /* set if key has been instantiated */
101#define KEY_FLAG_DEAD 1 /* set if key type has been deleted */
102#define KEY_FLAG_REVOKED 2 /* set if key had been revoked */
103#define KEY_FLAG_IN_QUOTA 3 /* set if key consumes quota */
104#define KEY_FLAG_USER_CONSTRUCT 4 /* set if key is being constructed in userspace */
105#define KEY_FLAG_NEGATIVE 5 /* set if key is negative */
106
104 /* the description string 107 /* the description string
105 * - this is used to match a key against search criteria 108 * - this is used to match a key against search criteria
106 * - this should be a printable string 109 * - this should be a printable string
@@ -196,10 +199,12 @@ extern int key_payload_reserve(struct key *key, size_t datalen);
196extern int key_instantiate_and_link(struct key *key, 199extern int key_instantiate_and_link(struct key *key,
197 const void *data, 200 const void *data,
198 size_t datalen, 201 size_t datalen,
199 struct key *keyring); 202 struct key *keyring,
203 struct key *instkey);
200extern int key_negate_and_link(struct key *key, 204extern int key_negate_and_link(struct key *key,
201 unsigned timeout, 205 unsigned timeout,
202 struct key *keyring); 206 struct key *keyring,
207 struct key *instkey);
203extern void key_revoke(struct key *key); 208extern void key_revoke(struct key *key);
204extern void key_put(struct key *key); 209extern void key_put(struct key *key);
205 210
@@ -242,14 +247,13 @@ extern struct key *keyring_search(struct key *keyring,
242 struct key_type *type, 247 struct key_type *type,
243 const char *description); 248 const char *description);
244 249
245extern struct key *search_process_keyrings(struct key_type *type,
246 const char *description);
247
248extern int keyring_add_key(struct key *keyring, 250extern int keyring_add_key(struct key *keyring,
249 struct key *key); 251 struct key *key);
250 252
251extern struct key *key_lookup(key_serial_t id); 253extern struct key *key_lookup(key_serial_t id);
252 254
255extern void keyring_replace_payload(struct key *key, void *replacement);
256
253#define key_serial(key) ((key) ? (key)->serial : 0) 257#define key_serial(key) ((key) ? (key)->serial : 0)
254 258
255/* 259/*
@@ -268,14 +272,22 @@ extern void key_fsuid_changed(struct task_struct *tsk);
268extern void key_fsgid_changed(struct task_struct *tsk); 272extern void key_fsgid_changed(struct task_struct *tsk);
269extern void key_init(void); 273extern void key_init(void);
270 274
275#define __install_session_keyring(tsk, keyring) \
276({ \
277 struct key *old_session = tsk->signal->session_keyring; \
278 tsk->signal->session_keyring = keyring; \
279 old_session; \
280})
281
271#else /* CONFIG_KEYS */ 282#else /* CONFIG_KEYS */
272 283
273#define key_validate(k) 0 284#define key_validate(k) 0
274#define key_serial(k) 0 285#define key_serial(k) 0
275#define key_get(k) NULL 286#define key_get(k) ({ NULL; })
276#define key_put(k) do { } while(0) 287#define key_put(k) do { } while(0)
277#define alloc_uid_keyring(u) 0 288#define alloc_uid_keyring(u) 0
278#define switch_uid_keyring(u) do { } while(0) 289#define switch_uid_keyring(u) do { } while(0)
290#define __install_session_keyring(t, k) ({ NULL; })
279#define copy_keys(f,t) 0 291#define copy_keys(f,t) 0
280#define copy_thread_group_keys(t) 0 292#define copy_thread_group_keys(t) 0
281#define exit_keys(t) do { } while(0) 293#define exit_keys(t) do { } while(0)
diff --git a/include/linux/keyctl.h b/include/linux/keyctl.h
index 381dedc370a3..8d7c59a29e09 100644
--- a/include/linux/keyctl.h
+++ b/include/linux/keyctl.h
@@ -20,6 +20,16 @@
20#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */ 20#define KEY_SPEC_USER_SESSION_KEYRING -5 /* - key ID for UID-session keyring */
21#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */ 21#define KEY_SPEC_GROUP_KEYRING -6 /* - key ID for GID-specific keyring */
22 22
23/* request-key default keyrings */
24#define KEY_REQKEY_DEFL_NO_CHANGE -1
25#define KEY_REQKEY_DEFL_DEFAULT 0
26#define KEY_REQKEY_DEFL_THREAD_KEYRING 1
27#define KEY_REQKEY_DEFL_PROCESS_KEYRING 2
28#define KEY_REQKEY_DEFL_SESSION_KEYRING 3
29#define KEY_REQKEY_DEFL_USER_KEYRING 4
30#define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5
31#define KEY_REQKEY_DEFL_GROUP_KEYRING 6
32
23/* keyctl commands */ 33/* keyctl commands */
24#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */ 34#define KEYCTL_GET_KEYRING_ID 0 /* ask for a keyring's ID */
25#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */ 35#define KEYCTL_JOIN_SESSION_KEYRING 1 /* join or start named session keyring */
@@ -35,5 +45,6 @@
35#define KEYCTL_READ 11 /* read a key or keyring's contents */ 45#define KEYCTL_READ 11 /* read a key or keyring's contents */
36#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */ 46#define KEYCTL_INSTANTIATE 12 /* instantiate a partially constructed key */
37#define KEYCTL_NEGATE 13 /* negate a partially constructed key */ 47#define KEYCTL_NEGATE 13 /* negate a partially constructed key */
48#define KEYCTL_SET_REQKEY_KEYRING 14 /* set default request-key keyring */
38 49
39#endif /* _LINUX_KEYCTL_H */ 50#endif /* _LINUX_KEYCTL_H */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 95d0e4b0814d..e4a231549407 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -19,6 +19,7 @@
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <linux/stddef.h>
22#include <linux/config.h> 23#include <linux/config.h>
23#include <linux/errno.h> 24#include <linux/errno.h>
24#include <linux/compiler.h> 25#include <linux/compiler.h>
@@ -34,7 +35,17 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
34#endif 35#endif
35 36
36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) 37#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
37extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait); 38
39struct key;
40extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[],
41 struct key *session_keyring, int wait);
42
43static inline int
44call_usermodehelper(char *path, char **argv, char **envp, int wait)
45{
46 return call_usermodehelper_keys(path, argv, envp, NULL, wait);
47}
48
38extern void usermodehelper_init(void); 49extern void usermodehelper_init(void);
39 50
40#endif /* __LINUX_KMOD_H__ */ 51#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index 99ddba5a4e00..e050fc2d4c26 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -25,27 +25,45 @@
25 * Rusty Russell). 25 * Rusty Russell).
26 * 2004-July Suparna Bhattacharya <suparna@in.ibm.com> added jumper probes 26 * 2004-July Suparna Bhattacharya <suparna@in.ibm.com> added jumper probes
27 * interface to access function arguments. 27 * interface to access function arguments.
28 * 2005-May Hien Nguyen <hien@us.ibm.com> and Jim Keniston
29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
30 * <prasanna@in.ibm.com> added function-return probes.
28 */ 31 */
29#include <linux/config.h> 32#include <linux/config.h>
30#include <linux/list.h> 33#include <linux/list.h>
31#include <linux/notifier.h> 34#include <linux/notifier.h>
32#include <linux/smp.h> 35#include <linux/smp.h>
36
33#include <asm/kprobes.h> 37#include <asm/kprobes.h>
34 38
39/* kprobe_status settings */
40#define KPROBE_HIT_ACTIVE 0x00000001
41#define KPROBE_HIT_SS 0x00000002
42#define KPROBE_REENTER 0x00000004
43#define KPROBE_HIT_SSDONE 0x00000008
44
35struct kprobe; 45struct kprobe;
36struct pt_regs; 46struct pt_regs;
47struct kretprobe;
48struct kretprobe_instance;
37typedef int (*kprobe_pre_handler_t) (struct kprobe *, struct pt_regs *); 49typedef int (*kprobe_pre_handler_t) (struct kprobe *, struct pt_regs *);
38typedef int (*kprobe_break_handler_t) (struct kprobe *, struct pt_regs *); 50typedef int (*kprobe_break_handler_t) (struct kprobe *, struct pt_regs *);
39typedef void (*kprobe_post_handler_t) (struct kprobe *, struct pt_regs *, 51typedef void (*kprobe_post_handler_t) (struct kprobe *, struct pt_regs *,
40 unsigned long flags); 52 unsigned long flags);
41typedef int (*kprobe_fault_handler_t) (struct kprobe *, struct pt_regs *, 53typedef int (*kprobe_fault_handler_t) (struct kprobe *, struct pt_regs *,
42 int trapnr); 54 int trapnr);
55typedef int (*kretprobe_handler_t) (struct kretprobe_instance *,
56 struct pt_regs *);
57
43struct kprobe { 58struct kprobe {
44 struct hlist_node hlist; 59 struct hlist_node hlist;
45 60
46 /* list of kprobes for multi-handler support */ 61 /* list of kprobes for multi-handler support */
47 struct list_head list; 62 struct list_head list;
48 63
64 /*count the number of times this probe was temporarily disarmed */
65 unsigned long nmissed;
66
49 /* location of the probe point */ 67 /* location of the probe point */
50 kprobe_opcode_t *addr; 68 kprobe_opcode_t *addr;
51 69
@@ -85,6 +103,41 @@ struct jprobe {
85 kprobe_opcode_t *entry; /* probe handling code to jump to */ 103 kprobe_opcode_t *entry; /* probe handling code to jump to */
86}; 104};
87 105
106#ifdef ARCH_SUPPORTS_KRETPROBES
107extern void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs);
108#else /* ARCH_SUPPORTS_KRETPROBES */
109static inline void arch_prepare_kretprobe(struct kretprobe *rp,
110 struct pt_regs *regs)
111{
112}
113#endif /* ARCH_SUPPORTS_KRETPROBES */
114/*
115 * Function-return probe -
116 * Note:
117 * User needs to provide a handler function, and initialize maxactive.
118 * maxactive - The maximum number of instances of the probed function that
119 * can be active concurrently.
120 * nmissed - tracks the number of times the probed function's return was
121 * ignored, due to maxactive being too low.
122 *
123 */
124struct kretprobe {
125 struct kprobe kp;
126 kretprobe_handler_t handler;
127 int maxactive;
128 int nmissed;
129 struct hlist_head free_instances;
130 struct hlist_head used_instances;
131};
132
133struct kretprobe_instance {
134 struct hlist_node uflist; /* either on free list or used list */
135 struct hlist_node hlist;
136 struct kretprobe *rp;
137 kprobe_opcode_t *ret_addr;
138 struct task_struct *task;
139};
140
88#ifdef CONFIG_KPROBES 141#ifdef CONFIG_KPROBES
89/* Locks kprobe: irq must be disabled */ 142/* Locks kprobe: irq must be disabled */
90void lock_kprobes(void); 143void lock_kprobes(void);
@@ -99,11 +152,17 @@ static inline int kprobe_running(void)
99 152
100extern int arch_prepare_kprobe(struct kprobe *p); 153extern int arch_prepare_kprobe(struct kprobe *p);
101extern void arch_copy_kprobe(struct kprobe *p); 154extern void arch_copy_kprobe(struct kprobe *p);
155extern void arch_arm_kprobe(struct kprobe *p);
156extern void arch_disarm_kprobe(struct kprobe *p);
102extern void arch_remove_kprobe(struct kprobe *p); 157extern void arch_remove_kprobe(struct kprobe *p);
158extern int arch_init_kprobes(void);
103extern void show_registers(struct pt_regs *regs); 159extern void show_registers(struct pt_regs *regs);
160extern kprobe_opcode_t *get_insn_slot(void);
161extern void free_insn_slot(kprobe_opcode_t *slot);
104 162
105/* Get the kprobe at this addr (if any). Must have called lock_kprobes */ 163/* Get the kprobe at this addr (if any). Must have called lock_kprobes */
106struct kprobe *get_kprobe(void *addr); 164struct kprobe *get_kprobe(void *addr);
165struct hlist_head * kretprobe_inst_table_head(struct task_struct *tsk);
107 166
108int register_kprobe(struct kprobe *p); 167int register_kprobe(struct kprobe *p);
109void unregister_kprobe(struct kprobe *p); 168void unregister_kprobe(struct kprobe *p);
@@ -113,7 +172,14 @@ int register_jprobe(struct jprobe *p);
113void unregister_jprobe(struct jprobe *p); 172void unregister_jprobe(struct jprobe *p);
114void jprobe_return(void); 173void jprobe_return(void);
115 174
116#else 175int register_kretprobe(struct kretprobe *rp);
176void unregister_kretprobe(struct kretprobe *rp);
177
178struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp);
179void add_rp_inst(struct kretprobe_instance *ri);
180void kprobe_flush_task(struct task_struct *tk);
181void recycle_rp_inst(struct kretprobe_instance *ri);
182#else /* CONFIG_KPROBES */
117static inline int kprobe_running(void) 183static inline int kprobe_running(void)
118{ 184{
119 return 0; 185 return 0;
@@ -135,5 +201,15 @@ static inline void unregister_jprobe(struct jprobe *p)
135static inline void jprobe_return(void) 201static inline void jprobe_return(void)
136{ 202{
137} 203}
138#endif 204static inline int register_kretprobe(struct kretprobe *rp)
205{
206 return -ENOSYS;
207}
208static inline void unregister_kretprobe(struct kretprobe *rp)
209{
210}
211static inline void kprobe_flush_task(struct task_struct *tk)
212{
213}
214#endif /* CONFIG_KPROBES */
139#endif /* _LINUX_KPROBES_H */ 215#endif /* _LINUX_KPROBES_H */
diff --git a/include/linux/libps2.h b/include/linux/libps2.h
index 923bdbc6d9e4..a710bddda4eb 100644
--- a/include/linux/libps2.h
+++ b/include/linux/libps2.h
@@ -41,6 +41,7 @@ struct ps2dev {
41 41
42void ps2_init(struct ps2dev *ps2dev, struct serio *serio); 42void ps2_init(struct ps2dev *ps2dev, struct serio *serio);
43int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout); 43int ps2_sendbyte(struct ps2dev *ps2dev, unsigned char byte, int timeout);
44void ps2_drain(struct ps2dev *ps2dev, int maxbytes, int timeout);
44int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command); 45int ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command);
45int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command); 46int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int command);
46int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); 47int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data);
diff --git a/include/linux/list.h b/include/linux/list.h
index 399b51d17218..aab2db21b013 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -185,7 +185,7 @@ static inline void list_del(struct list_head *entry)
185 * list_for_each_entry_rcu(). 185 * list_for_each_entry_rcu().
186 * 186 *
187 * Note that the caller is not permitted to immediately free 187 * Note that the caller is not permitted to immediately free
188 * the newly deleted entry. Instead, either synchronize_kernel() 188 * the newly deleted entry. Instead, either synchronize_rcu()
189 * or call_rcu() must be used to defer freeing until an RCU 189 * or call_rcu() must be used to defer freeing until an RCU
190 * grace period has elapsed. 190 * grace period has elapsed.
191 */ 191 */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 0d9d22578212..16d4e5a08e1d 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -72,6 +72,8 @@ struct nlm_lockowner {
72 uint32_t pid; 72 uint32_t pid;
73}; 73};
74 74
75struct nlm_wait;
76
75/* 77/*
76 * Memory chunk for NLM client RPC request. 78 * Memory chunk for NLM client RPC request.
77 */ 79 */
@@ -81,6 +83,7 @@ struct nlm_rqst {
81 struct nlm_host * a_host; /* host handle */ 83 struct nlm_host * a_host; /* host handle */
82 struct nlm_args a_args; /* arguments */ 84 struct nlm_args a_args; /* arguments */
83 struct nlm_res a_res; /* result */ 85 struct nlm_res a_res; /* result */
86 struct nlm_wait * a_block;
84 char a_owner[NLMCLNT_OHSIZE]; 87 char a_owner[NLMCLNT_OHSIZE];
85}; 88};
86 89
@@ -142,7 +145,9 @@ extern unsigned long nlmsvc_timeout;
142 * Lockd client functions 145 * Lockd client functions
143 */ 146 */
144struct nlm_rqst * nlmclnt_alloc_call(void); 147struct nlm_rqst * nlmclnt_alloc_call(void);
145int nlmclnt_block(struct nlm_host *, struct file_lock *, u32 *); 148int nlmclnt_prepare_block(struct nlm_rqst *req, struct nlm_host *host, struct file_lock *fl);
149void nlmclnt_finish_block(struct nlm_rqst *req);
150long nlmclnt_block(struct nlm_rqst *req, long timeout);
146int nlmclnt_cancel(struct nlm_host *, struct file_lock *); 151int nlmclnt_cancel(struct nlm_host *, struct file_lock *);
147u32 nlmclnt_grant(struct nlm_lock *); 152u32 nlmclnt_grant(struct nlm_lock *);
148void nlmclnt_recovery(struct nlm_host *, u32); 153void nlmclnt_recovery(struct nlm_host *, u32);
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 8220d9c9da00..53fa51595443 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -61,7 +61,7 @@ struct loop_device {
61 struct semaphore lo_sem; 61 struct semaphore lo_sem;
62 struct semaphore lo_ctl_mutex; 62 struct semaphore lo_ctl_mutex;
63 struct semaphore lo_bh_mutex; 63 struct semaphore lo_bh_mutex;
64 atomic_t lo_pending; 64 int lo_pending;
65 65
66 request_queue_t *lo_queue; 66 request_queue_t *lo_queue;
67}; 67};
diff --git a/include/linux/mbcache.h b/include/linux/mbcache.h
index 8e5a10410a30..9263d2db2d67 100644
--- a/include/linux/mbcache.h
+++ b/include/linux/mbcache.h
@@ -29,7 +29,7 @@ struct mb_cache_op {
29 29
30struct mb_cache * mb_cache_create(const char *, struct mb_cache_op *, size_t, 30struct mb_cache * mb_cache_create(const char *, struct mb_cache_op *, size_t,
31 int, int); 31 int, int);
32void mb_cache_shrink(struct mb_cache *, struct block_device *); 32void mb_cache_shrink(struct block_device *);
33void mb_cache_destroy(struct mb_cache *); 33void mb_cache_destroy(struct mb_cache *);
34 34
35/* Functions on cache entries */ 35/* Functions on cache entries */
diff --git a/include/linux/mempool.h b/include/linux/mempool.h
index 4a36edf1c974..796220ce47cc 100644
--- a/include/linux/mempool.h
+++ b/include/linux/mempool.h
@@ -20,9 +20,14 @@ typedef struct mempool_s {
20 mempool_free_t *free; 20 mempool_free_t *free;
21 wait_queue_head_t wait; 21 wait_queue_head_t wait;
22} mempool_t; 22} mempool_t;
23extern mempool_t * mempool_create(int min_nr, mempool_alloc_t *alloc_fn, 23
24 mempool_free_t *free_fn, void *pool_data); 24extern mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
25extern int mempool_resize(mempool_t *pool, int new_min_nr, unsigned int __nocast gfp_mask); 25 mempool_free_t *free_fn, void *pool_data);
26extern mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
27 mempool_free_t *free_fn, void *pool_data, int nid);
28
29extern int mempool_resize(mempool_t *pool, int new_min_nr,
30 unsigned int __nocast gfp_mask);
26extern void mempool_destroy(mempool_t *pool); 31extern void mempool_destroy(mempool_t *pool);
27extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask); 32extern void * mempool_alloc(mempool_t *pool, unsigned int __nocast gfp_mask);
28extern void mempool_free(void *element, mempool_t *pool); 33extern void mempool_free(void *element, mempool_t *pool);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1813b162b0a8..82d7024f0765 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -395,19 +395,81 @@ static inline void put_page(struct page *page)
395/* 395/*
396 * The zone field is never updated after free_area_init_core() 396 * The zone field is never updated after free_area_init_core()
397 * sets it, so none of the operations on it need to be atomic. 397 * sets it, so none of the operations on it need to be atomic.
398 * We'll have up to (MAX_NUMNODES * MAX_NR_ZONES) zones total,
399 * so we use (MAX_NODES_SHIFT + MAX_ZONES_SHIFT) here to get enough bits.
400 */ 398 */
401#define NODEZONE_SHIFT (sizeof(page_flags_t)*8 - MAX_NODES_SHIFT - MAX_ZONES_SHIFT) 399
402#define NODEZONE(node, zone) ((node << ZONES_SHIFT) | zone) 400
401/*
402 * page->flags layout:
403 *
404 * There are three possibilities for how page->flags get
405 * laid out. The first is for the normal case, without
406 * sparsemem. The second is for sparsemem when there is
407 * plenty of space for node and section. The last is when
408 * we have run out of space and have to fall back to an
409 * alternate (slower) way of determining the node.
410 *
411 * No sparsemem: | NODE | ZONE | ... | FLAGS |
412 * with space for node: | SECTION | NODE | ZONE | ... | FLAGS |
413 * no space for node: | SECTION | ZONE | ... | FLAGS |
414 */
415#ifdef CONFIG_SPARSEMEM
416#define SECTIONS_WIDTH SECTIONS_SHIFT
417#else
418#define SECTIONS_WIDTH 0
419#endif
420
421#define ZONES_WIDTH ZONES_SHIFT
422
423#if SECTIONS_WIDTH+ZONES_WIDTH+NODES_SHIFT <= FLAGS_RESERVED
424#define NODES_WIDTH NODES_SHIFT
425#else
426#define NODES_WIDTH 0
427#endif
428
429/* Page flags: | [SECTION] | [NODE] | ZONE | ... | FLAGS | */
430#define SECTIONS_PGOFF ((sizeof(page_flags_t)*8) - SECTIONS_WIDTH)
431#define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH)
432#define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH)
433
434/*
435 * We are going to use the flags for the page to node mapping if its in
436 * there. This includes the case where there is no node, so it is implicit.
437 */
438#define FLAGS_HAS_NODE (NODES_WIDTH > 0 || NODES_SHIFT == 0)
439
440#ifndef PFN_SECTION_SHIFT
441#define PFN_SECTION_SHIFT 0
442#endif
443
444/*
445 * Define the bit shifts to access each section. For non-existant
446 * sections we define the shift as 0; that plus a 0 mask ensures
447 * the compiler will optimise away reference to them.
448 */
449#define SECTIONS_PGSHIFT (SECTIONS_PGOFF * (SECTIONS_WIDTH != 0))
450#define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0))
451#define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0))
452
453/* NODE:ZONE or SECTION:ZONE is used to lookup the zone from a page. */
454#if FLAGS_HAS_NODE
455#define ZONETABLE_SHIFT (NODES_SHIFT + ZONES_SHIFT)
456#else
457#define ZONETABLE_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT)
458#endif
459#define ZONETABLE_PGSHIFT ZONES_PGSHIFT
460
461#if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
462#error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED
463#endif
464
465#define ZONES_MASK ((1UL << ZONES_WIDTH) - 1)
466#define NODES_MASK ((1UL << NODES_WIDTH) - 1)
467#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
468#define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1)
403 469
404static inline unsigned long page_zonenum(struct page *page) 470static inline unsigned long page_zonenum(struct page *page)
405{ 471{
406 return (page->flags >> NODEZONE_SHIFT) & (~(~0UL << ZONES_SHIFT)); 472 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
407}
408static inline unsigned long page_to_nid(struct page *page)
409{
410 return (page->flags >> (NODEZONE_SHIFT + ZONES_SHIFT));
411} 473}
412 474
413struct zone; 475struct zone;
@@ -415,13 +477,44 @@ extern struct zone *zone_table[];
415 477
416static inline struct zone *page_zone(struct page *page) 478static inline struct zone *page_zone(struct page *page)
417{ 479{
418 return zone_table[page->flags >> NODEZONE_SHIFT]; 480 return zone_table[(page->flags >> ZONETABLE_PGSHIFT) &
481 ZONETABLE_MASK];
482}
483
484static inline unsigned long page_to_nid(struct page *page)
485{
486 if (FLAGS_HAS_NODE)
487 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
488 else
489 return page_zone(page)->zone_pgdat->node_id;
490}
491static inline unsigned long page_to_section(struct page *page)
492{
493 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
419} 494}
420 495
421static inline void set_page_zone(struct page *page, unsigned long nodezone_num) 496static inline void set_page_zone(struct page *page, unsigned long zone)
422{ 497{
423 page->flags &= ~(~0UL << NODEZONE_SHIFT); 498 page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT);
424 page->flags |= nodezone_num << NODEZONE_SHIFT; 499 page->flags |= (zone & ZONES_MASK) << ZONES_PGSHIFT;
500}
501static inline void set_page_node(struct page *page, unsigned long node)
502{
503 page->flags &= ~(NODES_MASK << NODES_PGSHIFT);
504 page->flags |= (node & NODES_MASK) << NODES_PGSHIFT;
505}
506static inline void set_page_section(struct page *page, unsigned long section)
507{
508 page->flags &= ~(SECTIONS_MASK << SECTIONS_PGSHIFT);
509 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
510}
511
512static inline void set_page_links(struct page *page, unsigned long zone,
513 unsigned long node, unsigned long pfn)
514{
515 set_page_zone(page, zone);
516 set_page_node(page, node);
517 set_page_section(page, pfn_to_section_nr(pfn));
425} 518}
426 519
427#ifndef CONFIG_DISCONTIGMEM 520#ifndef CONFIG_DISCONTIGMEM
@@ -532,10 +625,16 @@ static inline int page_mapped(struct page *page)
532 * Used to decide whether a process gets delivered SIGBUS or 625 * Used to decide whether a process gets delivered SIGBUS or
533 * just gets major/minor fault counters bumped up. 626 * just gets major/minor fault counters bumped up.
534 */ 627 */
535#define VM_FAULT_OOM (-1) 628#define VM_FAULT_OOM 0x00
536#define VM_FAULT_SIGBUS 0 629#define VM_FAULT_SIGBUS 0x01
537#define VM_FAULT_MINOR 1 630#define VM_FAULT_MINOR 0x02
538#define VM_FAULT_MAJOR 2 631#define VM_FAULT_MAJOR 0x03
632
633/*
634 * Special case for get_user_pages.
635 * Must be in a distinct bit from the above VM_FAULT_ flags.
636 */
637#define VM_FAULT_WRITE 0x10
539 638
540#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK) 639#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
541 640
@@ -611,7 +710,13 @@ extern pte_t *FASTCALL(pte_alloc_kernel(struct mm_struct *mm, pmd_t *pmd, unsign
611extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address)); 710extern pte_t *FASTCALL(pte_alloc_map(struct mm_struct *mm, pmd_t *pmd, unsigned long address));
612extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); 711extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
613extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); 712extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
614extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access); 713extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
714
715static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access)
716{
717 return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE);
718}
719
615extern int make_pages_present(unsigned long addr, unsigned long end); 720extern int make_pages_present(unsigned long addr, unsigned long end);
616extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 721extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
617void install_arg_page(struct vm_area_struct *, struct page *, unsigned long); 722void install_arg_page(struct vm_area_struct *, struct page *, unsigned long);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 4733d35d8223..6c90461ed99f 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -269,7 +269,9 @@ typedef struct pglist_data {
269 struct zone node_zones[MAX_NR_ZONES]; 269 struct zone node_zones[MAX_NR_ZONES];
270 struct zonelist node_zonelists[GFP_ZONETYPES]; 270 struct zonelist node_zonelists[GFP_ZONETYPES];
271 int nr_zones; 271 int nr_zones;
272#ifdef CONFIG_FLAT_NODE_MEM_MAP
272 struct page *node_mem_map; 273 struct page *node_mem_map;
274#endif
273 struct bootmem_data *bdata; 275 struct bootmem_data *bdata;
274 unsigned long node_start_pfn; 276 unsigned long node_start_pfn;
275 unsigned long node_present_pages; /* total number of physical pages */ 277 unsigned long node_present_pages; /* total number of physical pages */
@@ -284,6 +286,12 @@ typedef struct pglist_data {
284 286
285#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages) 287#define node_present_pages(nid) (NODE_DATA(nid)->node_present_pages)
286#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages) 288#define node_spanned_pages(nid) (NODE_DATA(nid)->node_spanned_pages)
289#ifdef CONFIG_FLAT_NODE_MEM_MAP
290#define pgdat_page_nr(pgdat, pagenr) ((pgdat)->node_mem_map + (pagenr))
291#else
292#define pgdat_page_nr(pgdat, pagenr) pfn_to_page((pgdat)->node_start_pfn + (pagenr))
293#endif
294#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr))
287 295
288extern struct pglist_data *pgdat_list; 296extern struct pglist_data *pgdat_list;
289 297
@@ -400,7 +408,7 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
400/* Returns the number of the current Node. */ 408/* Returns the number of the current Node. */
401#define numa_node_id() (cpu_to_node(raw_smp_processor_id())) 409#define numa_node_id() (cpu_to_node(raw_smp_processor_id()))
402 410
403#ifndef CONFIG_DISCONTIGMEM 411#ifndef CONFIG_NEED_MULTIPLE_NODES
404 412
405extern struct pglist_data contig_page_data; 413extern struct pglist_data contig_page_data;
406#define NODE_DATA(nid) (&contig_page_data) 414#define NODE_DATA(nid) (&contig_page_data)
@@ -408,36 +416,177 @@ extern struct pglist_data contig_page_data;
408#define MAX_NODES_SHIFT 1 416#define MAX_NODES_SHIFT 1
409#define pfn_to_nid(pfn) (0) 417#define pfn_to_nid(pfn) (0)
410 418
411#else /* CONFIG_DISCONTIGMEM */ 419#else /* CONFIG_NEED_MULTIPLE_NODES */
412 420
413#include <asm/mmzone.h> 421#include <asm/mmzone.h>
414 422
423#endif /* !CONFIG_NEED_MULTIPLE_NODES */
424
425#ifdef CONFIG_SPARSEMEM
426#include <asm/sparsemem.h>
427#endif
428
415#if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED) 429#if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED)
416/* 430/*
417 * with 32 bit page->flags field, we reserve 8 bits for node/zone info. 431 * with 32 bit page->flags field, we reserve 8 bits for node/zone info.
418 * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes. 432 * there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes.
419 */ 433 */
420#define MAX_NODES_SHIFT 6 434#define FLAGS_RESERVED 8
435
421#elif BITS_PER_LONG == 64 436#elif BITS_PER_LONG == 64
422/* 437/*
423 * with 64 bit flags field, there's plenty of room. 438 * with 64 bit flags field, there's plenty of room.
424 */ 439 */
425#define MAX_NODES_SHIFT 10 440#define FLAGS_RESERVED 32
441
442#else
443
444#error BITS_PER_LONG not defined
445
446#endif
447
448#ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID
449#define early_pfn_to_nid(nid) (0UL)
426#endif 450#endif
427 451
428#endif /* !CONFIG_DISCONTIGMEM */ 452#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
453#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)
454
455#ifdef CONFIG_SPARSEMEM
456
457/*
458 * SECTION_SHIFT #bits space required to store a section #
459 *
460 * PA_SECTION_SHIFT physical address to/from section number
461 * PFN_SECTION_SHIFT pfn to/from section number
462 */
463#define SECTIONS_SHIFT (MAX_PHYSMEM_BITS - SECTION_SIZE_BITS)
464
465#define PA_SECTION_SHIFT (SECTION_SIZE_BITS)
466#define PFN_SECTION_SHIFT (SECTION_SIZE_BITS - PAGE_SHIFT)
467
468#define NR_MEM_SECTIONS (1UL << SECTIONS_SHIFT)
429 469
430#if NODES_SHIFT > MAX_NODES_SHIFT 470#define PAGES_PER_SECTION (1UL << PFN_SECTION_SHIFT)
431#error NODES_SHIFT > MAX_NODES_SHIFT 471#define PAGE_SECTION_MASK (~(PAGES_PER_SECTION-1))
472
473#if (MAX_ORDER - 1 + PAGE_SHIFT) > SECTION_SIZE_BITS
474#error Allocator MAX_ORDER exceeds SECTION_SIZE
432#endif 475#endif
433 476
434/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */ 477struct page;
435#define MAX_ZONES_SHIFT 2 478struct mem_section {
479 /*
480 * This is, logically, a pointer to an array of struct
481 * pages. However, it is stored with some other magic.
482 * (see sparse.c::sparse_init_one_section())
483 *
484 * Making it a UL at least makes someone do a cast
485 * before using it wrong.
486 */
487 unsigned long section_mem_map;
488};
489
490extern struct mem_section mem_section[NR_MEM_SECTIONS];
436 491
437#if ZONES_SHIFT > MAX_ZONES_SHIFT 492static inline struct mem_section *__nr_to_section(unsigned long nr)
438#error ZONES_SHIFT > MAX_ZONES_SHIFT 493{
494 return &mem_section[nr];
495}
496
497/*
498 * We use the lower bits of the mem_map pointer to store
499 * a little bit of information. There should be at least
500 * 3 bits here due to 32-bit alignment.
501 */
502#define SECTION_MARKED_PRESENT (1UL<<0)
503#define SECTION_HAS_MEM_MAP (1UL<<1)
504#define SECTION_MAP_LAST_BIT (1UL<<2)
505#define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
506
507static inline struct page *__section_mem_map_addr(struct mem_section *section)
508{
509 unsigned long map = section->section_mem_map;
510 map &= SECTION_MAP_MASK;
511 return (struct page *)map;
512}
513
514static inline int valid_section(struct mem_section *section)
515{
516 return (section->section_mem_map & SECTION_MARKED_PRESENT);
517}
518
519static inline int section_has_mem_map(struct mem_section *section)
520{
521 return (section->section_mem_map & SECTION_HAS_MEM_MAP);
522}
523
524static inline int valid_section_nr(unsigned long nr)
525{
526 return valid_section(__nr_to_section(nr));
527}
528
529/*
530 * Given a kernel address, find the home node of the underlying memory.
531 */
532#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
533
534static inline struct mem_section *__pfn_to_section(unsigned long pfn)
535{
536 return __nr_to_section(pfn_to_section_nr(pfn));
537}
538
539#define pfn_to_page(pfn) \
540({ \
541 unsigned long __pfn = (pfn); \
542 __section_mem_map_addr(__pfn_to_section(__pfn)) + __pfn; \
543})
544#define page_to_pfn(page) \
545({ \
546 page - __section_mem_map_addr(__nr_to_section( \
547 page_to_section(page))); \
548})
549
550static inline int pfn_valid(unsigned long pfn)
551{
552 if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS)
553 return 0;
554 return valid_section(__nr_to_section(pfn_to_section_nr(pfn)));
555}
556
557/*
558 * These are _only_ used during initialisation, therefore they
559 * can use __initdata ... They could have names to indicate
560 * this restriction.
561 */
562#ifdef CONFIG_NUMA
563#define pfn_to_nid early_pfn_to_nid
564#endif
565
566#define pfn_to_pgdat(pfn) \
567({ \
568 NODE_DATA(pfn_to_nid(pfn)); \
569})
570
571#define early_pfn_valid(pfn) pfn_valid(pfn)
572void sparse_init(void);
573#else
574#define sparse_init() do {} while (0)
575#endif /* CONFIG_SPARSEMEM */
576
577#ifdef CONFIG_NODES_SPAN_OTHER_NODES
578#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid))
579#else
580#define early_pfn_in_nid(pfn, nid) (1)
581#endif
582
583#ifndef early_pfn_valid
584#define early_pfn_valid(pfn) (1)
439#endif 585#endif
440 586
587void memory_present(int nid, unsigned long start, unsigned long end);
588unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
589
441#endif /* !__ASSEMBLY__ */ 590#endif /* !__ASSEMBLY__ */
442#endif /* __KERNEL__ */ 591#endif /* __KERNEL__ */
443#endif /* _LINUX_MMZONE_H */ 592#endif /* _LINUX_MMZONE_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index d6eb7b2efc04..dce53ac1625d 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -174,5 +174,62 @@ struct serio_device_id {
174 __u8 proto; 174 __u8 proto;
175}; 175};
176 176
177/*
178 * Struct used for matching a device
179 */
180struct of_device_id
181{
182 char name[32];
183 char type[32];
184 char compatible[128];
185 void *data;
186};
187
188
189/* PCMCIA */
190
191struct pcmcia_device_id {
192 __u16 match_flags;
193
194 __u16 manf_id;
195 __u16 card_id;
196
197 __u8 func_id;
198
199 /* for real multi-function devices */
200 __u8 function;
201
202 /* for pseude multi-function devices */
203 __u8 device_no;
204
205 __u32 prod_id_hash[4];
206
207 /* not matched against in kernelspace*/
208#ifdef __KERNEL__
209 const char * prod_id[4];
210#else
211 kernel_ulong_t prod_id[4];
212#endif
213
214 /* not matched against */
215 kernel_ulong_t driver_info;
216#ifdef __KERNEL__
217 char * cisfile;
218#else
219 kernel_ulong_t cisfile;
220#endif
221};
222
223#define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
224#define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002
225#define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004
226#define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008
227#define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010
228#define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020
229#define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040
230#define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080
231#define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100
232#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
233#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
177 234
178#endif /* LINUX_MOD_DEVICETABLE_H */ 235#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 0e432a0f4aee..f05372b7fe77 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -51,6 +51,9 @@ struct module_attribute {
51 ssize_t (*show)(struct module_attribute *, struct module *, char *); 51 ssize_t (*show)(struct module_attribute *, struct module *, char *);
52 ssize_t (*store)(struct module_attribute *, struct module *, 52 ssize_t (*store)(struct module_attribute *, struct module *,
53 const char *, size_t count); 53 const char *, size_t count);
54 void (*setup)(struct module *, const char *);
55 int (*test)(struct module *);
56 void (*free)(struct module *);
54}; 57};
55 58
56struct module_kobject 59struct module_kobject
@@ -239,6 +242,8 @@ struct module
239 /* Sysfs stuff. */ 242 /* Sysfs stuff. */
240 struct module_kobject mkobj; 243 struct module_kobject mkobj;
241 struct module_param_attrs *param_attrs; 244 struct module_param_attrs *param_attrs;
245 const char *version;
246 const char *srcversion;
242 247
243 /* Exported symbols */ 248 /* Exported symbols */
244 const struct kernel_symbol *syms; 249 const struct kernel_symbol *syms;
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 8b8d3b9beefd..f8f39937e301 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -12,6 +12,7 @@
12#define _LINUX_MOUNT_H 12#define _LINUX_MOUNT_H
13#ifdef __KERNEL__ 13#ifdef __KERNEL__
14 14
15#include <linux/types.h>
15#include <linux/list.h> 16#include <linux/list.h>
16#include <linux/spinlock.h> 17#include <linux/spinlock.h>
17#include <asm/atomic.h> 18#include <asm/atomic.h>
@@ -34,7 +35,7 @@ struct vfsmount
34 int mnt_expiry_mark; /* true if marked for expiry */ 35 int mnt_expiry_mark; /* true if marked for expiry */
35 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */ 36 char *mnt_devname; /* Name of device e.g. /dev/dsk/hda1 */
36 struct list_head mnt_list; 37 struct list_head mnt_list;
37 struct list_head mnt_fslink; /* link in fs-specific expiry list */ 38 struct list_head mnt_expire; /* link in fs-specific expiry list */
38 struct namespace *mnt_namespace; /* containing namespace */ 39 struct namespace *mnt_namespace; /* containing namespace */
39}; 40};
40 41
@@ -47,7 +48,7 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
47 48
48extern void __mntput(struct vfsmount *mnt); 49extern void __mntput(struct vfsmount *mnt);
49 50
50static inline void _mntput(struct vfsmount *mnt) 51static inline void mntput_no_expire(struct vfsmount *mnt)
51{ 52{
52 if (mnt) { 53 if (mnt) {
53 if (atomic_dec_and_test(&mnt->mnt_count)) 54 if (atomic_dec_and_test(&mnt->mnt_count))
@@ -59,7 +60,7 @@ static inline void mntput(struct vfsmount *mnt)
59{ 60{
60 if (mnt) { 61 if (mnt) {
61 mnt->mnt_expiry_mark = 0; 62 mnt->mnt_expiry_mark = 0;
62 _mntput(mnt); 63 mntput_no_expire(mnt);
63 } 64 }
64} 65}
65 66
@@ -76,6 +77,7 @@ extern int do_add_mount(struct vfsmount *newmnt, struct nameidata *nd,
76extern void mark_mounts_for_expiry(struct list_head *mounts); 77extern void mark_mounts_for_expiry(struct list_head *mounts);
77 78
78extern spinlock_t vfsmount_lock; 79extern spinlock_t vfsmount_lock;
80extern dev_t name_to_dev_t(char *name);
79 81
80#endif 82#endif
81#endif /* _LINUX_MOUNT_H */ 83#endif /* _LINUX_MOUNT_H */
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 2ed8c585021e..e6b6a1c66bd5 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -1,7 +1,7 @@
1 1
2/* Common Flash Interface structures 2/* Common Flash Interface structures
3 * See http://support.intel.com/design/flash/technote/index.htm 3 * See http://support.intel.com/design/flash/technote/index.htm
4 * $Id: cfi.h,v 1.50 2004/11/20 12:46:51 dwmw2 Exp $ 4 * $Id: cfi.h,v 1.54 2005/06/06 23:04:36 tpoynor Exp $
5 */ 5 */
6 6
7#ifndef __MTD_CFI_H__ 7#ifndef __MTD_CFI_H__
@@ -148,6 +148,14 @@ struct cfi_pri_intelext {
148 uint8_t extra[0]; 148 uint8_t extra[0];
149} __attribute__((packed)); 149} __attribute__((packed));
150 150
151struct cfi_intelext_otpinfo {
152 uint32_t ProtRegAddr;
153 uint16_t FactGroups;
154 uint8_t FactProtRegSize;
155 uint16_t UserGroups;
156 uint8_t UserProtRegSize;
157} __attribute__((packed));
158
151struct cfi_intelext_blockinfo { 159struct cfi_intelext_blockinfo {
152 uint16_t NumIdentBlocks; 160 uint16_t NumIdentBlocks;
153 uint16_t BlockSize; 161 uint16_t BlockSize;
@@ -244,7 +252,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs, int interleave, int
244 * It looks too long to be inline, but in the common case it should almost all 252 * It looks too long to be inline, but in the common case it should almost all
245 * get optimised away. 253 * get optimised away.
246 */ 254 */
247static inline map_word cfi_build_cmd(u_char cmd, struct map_info *map, struct cfi_private *cfi) 255static inline map_word cfi_build_cmd(u_long cmd, struct map_info *map, struct cfi_private *cfi)
248{ 256{
249 map_word val = { {0} }; 257 map_word val = { {0} };
250 int wordwidth, words_per_bus, chip_mode, chips_per_word; 258 int wordwidth, words_per_bus, chip_mode, chips_per_word;
@@ -307,6 +315,69 @@ static inline map_word cfi_build_cmd(u_char cmd, struct map_info *map, struct cf
307} 315}
308#define CMD(x) cfi_build_cmd((x), map, cfi) 316#define CMD(x) cfi_build_cmd((x), map, cfi)
309 317
318
319static inline unsigned char cfi_merge_status(map_word val, struct map_info *map,
320 struct cfi_private *cfi)
321{
322 int wordwidth, words_per_bus, chip_mode, chips_per_word;
323 unsigned long onestat, res = 0;
324 int i;
325
326 /* We do it this way to give the compiler a fighting chance
327 of optimising away all the crap for 'bankwidth' larger than
328 an unsigned long, in the common case where that support is
329 disabled */
330 if (map_bankwidth_is_large(map)) {
331 wordwidth = sizeof(unsigned long);
332 words_per_bus = (map_bankwidth(map)) / wordwidth; // i.e. normally 1
333 } else {
334 wordwidth = map_bankwidth(map);
335 words_per_bus = 1;
336 }
337
338 chip_mode = map_bankwidth(map) / cfi_interleave(cfi);
339 chips_per_word = wordwidth * cfi_interleave(cfi) / map_bankwidth(map);
340
341 onestat = val.x[0];
342 /* Or all status words together */
343 for (i=1; i < words_per_bus; i++) {
344 onestat |= val.x[i];
345 }
346
347 res = onestat;
348 switch(chips_per_word) {
349 default: BUG();
350#if BITS_PER_LONG >= 64
351 case 8:
352 res |= (onestat >> (chip_mode * 32));
353#endif
354 case 4:
355 res |= (onestat >> (chip_mode * 16));
356 case 2:
357 res |= (onestat >> (chip_mode * 8));
358 case 1:
359 ;
360 }
361
362 /* Last, determine what the bit-pattern should be for a single
363 device, according to chip mode and endianness... */
364 switch (chip_mode) {
365 case 1:
366 break;
367 case 2:
368 res = cfi16_to_cpu(res);
369 break;
370 case 4:
371 res = cfi32_to_cpu(res);
372 break;
373 default: BUG();
374 }
375 return res;
376}
377
378#define MERGESTATUS(x) cfi_merge_status((x), map, cfi)
379
380
310/* 381/*
311 * Sends a CFI command to a bank of flash for the given geometry. 382 * Sends a CFI command to a bank of flash for the given geometry.
312 * 383 *
@@ -357,16 +428,6 @@ static inline void cfi_udelay(int us)
357 } 428 }
358} 429}
359 430
360static inline void cfi_spin_lock(spinlock_t *mutex)
361{
362 spin_lock_bh(mutex);
363}
364
365static inline void cfi_spin_unlock(spinlock_t *mutex)
366{
367 spin_unlock_bh(mutex);
368}
369
370struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size, 431struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t size,
371 const char* name); 432 const char* name);
372struct cfi_fixup { 433struct cfi_fixup {
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index c66ba812bf90..675776fa3e27 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * (C) 2000 Red Hat. GPLd. 7 * (C) 2000 Red Hat. GPLd.
8 * 8 *
9 * $Id: flashchip.h,v 1.15 2004/11/05 22:41:06 nico Exp $ 9 * $Id: flashchip.h,v 1.17 2005/03/14 18:27:15 bjd Exp $
10 * 10 *
11 */ 11 */
12 12
@@ -29,6 +29,7 @@ typedef enum {
29 FL_ERASE_SUSPENDED, 29 FL_ERASE_SUSPENDED,
30 FL_WRITING, 30 FL_WRITING,
31 FL_WRITING_TO_BUFFER, 31 FL_WRITING_TO_BUFFER,
32 FL_OTP_WRITE,
32 FL_WRITE_SUSPENDING, 33 FL_WRITE_SUSPENDING,
33 FL_WRITE_SUSPENDED, 34 FL_WRITE_SUSPENDED,
34 FL_PM_SUSPENDED, 35 FL_PM_SUSPENDED,
@@ -62,8 +63,8 @@ struct flchip {
62 flstate_t state; 63 flstate_t state;
63 flstate_t oldstate; 64 flstate_t oldstate;
64 65
65 int write_suspended:1; 66 unsigned int write_suspended:1;
66 int erase_suspended:1; 67 unsigned int erase_suspended:1;
67 unsigned long in_progress_block_addr; 68 unsigned long in_progress_block_addr;
68 69
69 spinlock_t *mutex; 70 spinlock_t *mutex;
diff --git a/include/linux/mtd/inftl.h b/include/linux/mtd/inftl.h
index b52c8cbd235c..0268125a6271 100644
--- a/include/linux/mtd/inftl.h
+++ b/include/linux/mtd/inftl.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com) 4 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
5 * 5 *
6 * $Id: inftl.h,v 1.6 2004/06/30 14:49:00 dbrown Exp $ 6 * $Id: inftl.h,v 1.7 2005/06/13 13:08:45 sean Exp $
7 */ 7 */
8 8
9#ifndef __MTD_INFTL_H__ 9#ifndef __MTD_INFTL_H__
@@ -20,7 +20,7 @@
20#include <mtd/inftl-user.h> 20#include <mtd/inftl-user.h>
21 21
22#ifndef INFTL_MAJOR 22#ifndef INFTL_MAJOR
23#define INFTL_MAJOR 94 23#define INFTL_MAJOR 96
24#endif 24#endif
25#define INFTL_PARTN_BITS 4 25#define INFTL_PARTN_BITS 4
26 26
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index f0268b99c900..142963f01d29 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
1 1
2/* Overhauled routines for dealing with different mmap regions of flash */ 2/* Overhauled routines for dealing with different mmap regions of flash */
3/* $Id: map.h,v 1.46 2005/01/05 17:09:44 dwmw2 Exp $ */ 3/* $Id: map.h,v 1.52 2005/05/25 10:29:41 gleixner Exp $ */
4 4
5#ifndef __LINUX_MTD_MAP_H__ 5#ifndef __LINUX_MTD_MAP_H__
6#define __LINUX_MTD_MAP_H__ 6#define __LINUX_MTD_MAP_H__
@@ -263,6 +263,17 @@ static inline map_word map_word_and(struct map_info *map, map_word val1, map_wor
263 return r; 263 return r;
264} 264}
265 265
266static inline map_word map_word_clr(struct map_info *map, map_word val1, map_word val2)
267{
268 map_word r;
269 int i;
270
271 for (i=0; i<map_words(map); i++) {
272 r.x[i] = val1.x[i] & ~val2.x[i];
273 }
274 return r;
275}
276
266static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2) 277static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2)
267{ 278{
268 map_word r; 279 map_word r;
@@ -273,6 +284,7 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_word
273 } 284 }
274 return r; 285 return r;
275} 286}
287
276#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b)) 288#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
277 289
278static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2) 290static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
@@ -328,16 +340,27 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig
328 return orig; 340 return orig;
329} 341}
330 342
343#if BITS_PER_LONG < 64
344#define MAP_FF_LIMIT 4
345#else
346#define MAP_FF_LIMIT 8
347#endif
348
331static inline map_word map_word_ff(struct map_info *map) 349static inline map_word map_word_ff(struct map_info *map)
332{ 350{
333 map_word r; 351 map_word r;
334 int i; 352 int i;
335 353
336 for (i=0; i<map_words(map); i++) { 354 if (map_bankwidth(map) < MAP_FF_LIMIT) {
337 r.x[i] = ~0UL; 355 int bw = 8 * map_bankwidth(map);
356 r.x[0] = (1 << bw) - 1;
357 } else {
358 for (i=0; i<map_words(map); i++)
359 r.x[i] = ~0UL;
338 } 360 }
339 return r; 361 return r;
340} 362}
363
341static inline map_word inline_map_read(struct map_info *map, unsigned long ofs) 364static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
342{ 365{
343 map_word r; 366 map_word r;
@@ -405,7 +428,7 @@ extern void simple_map_init(struct map_info *);
405 428
406 429
407#define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth)) 430#define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
408#define map_is_linear(map) (1) 431#define map_is_linear(map) ({ (void)(map); 1; })
409 432
410#endif /* !CONFIG_MTD_COMPLEX_MAPPINGS */ 433#endif /* !CONFIG_MTD_COMPLEX_MAPPINGS */
411 434
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index b3d134392b31..c50c3f3927d9 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: mtd.h,v 1.56 2004/08/09 18:46:04 dmarlin Exp $ 2 * $Id: mtd.h,v 1.59 2005/04/11 10:19:02 gleixner Exp $
3 * 3 *
4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al. 4 * Copyright (C) 1999-2003 David Woodhouse <dwmw2@infradead.org> et al.
5 * 5 *
@@ -18,6 +18,7 @@
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/uio.h> 20#include <linux/uio.h>
21#include <linux/notifier.h>
21 22
22#include <linux/mtd/compatmac.h> 23#include <linux/mtd/compatmac.h>
23#include <mtd/mtd-abi.h> 24#include <mtd/mtd-abi.h>
@@ -69,7 +70,6 @@ struct mtd_info {
69 70
70 u_int32_t oobblock; // Size of OOB blocks (e.g. 512) 71 u_int32_t oobblock; // Size of OOB blocks (e.g. 512)
71 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) 72 u_int32_t oobsize; // Amount of OOB data per block (e.g. 16)
72 u_int32_t oobavail; // Number of bytes in OOB area available for fs
73 u_int32_t ecctype; 73 u_int32_t ecctype;
74 u_int32_t eccsize; 74 u_int32_t eccsize;
75 75
@@ -80,6 +80,7 @@ struct mtd_info {
80 80
81 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO) 81 // oobinfo is a nand_oobinfo structure, which can be set by iotcl (MEMSETOOBINFO)
82 struct nand_oobinfo oobinfo; 82 struct nand_oobinfo oobinfo;
83 u_int32_t oobavail; // Number of bytes in OOB area available for fs
83 84
84 /* Data for variable erase regions. If numeraseregions is zero, 85 /* Data for variable erase regions. If numeraseregions is zero,
85 * it means that the whole device has erasesize as given above. 86 * it means that the whole device has erasesize as given above.
@@ -113,12 +114,12 @@ struct mtd_info {
113 * flash devices. The user data is one time programmable but the 114 * flash devices. The user data is one time programmable but the
114 * factory data is read only. 115 * factory data is read only.
115 */ 116 */
116 int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 117 int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
117
118 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 118 int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
119 119 int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
120 /* This function is not yet implemented */ 120 int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
121 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); 121 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
122 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
122 123
123 /* kvec-based read/write methods. We need these especially for NAND flash, 124 /* kvec-based read/write methods. We need these especially for NAND flash,
124 with its limited number of write cycles per erase. 125 with its limited number of write cycles per erase.
@@ -147,6 +148,8 @@ struct mtd_info {
147 int (*block_isbad) (struct mtd_info *mtd, loff_t ofs); 148 int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
148 int (*block_markbad) (struct mtd_info *mtd, loff_t ofs); 149 int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
149 150
151 struct notifier_block reboot_notifier; /* default mode before reboot */
152
150 void *priv; 153 void *priv;
151 154
152 struct module *owner; 155 struct module *owner;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9a19c65abd74..9b5b76217584 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -5,7 +5,7 @@
5 * Steven J. Hill <sjhill@realitydiluted.com> 5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de> 6 * Thomas Gleixner <tglx@linutronix.de>
7 * 7 *
8 * $Id: nand.h,v 1.68 2004/11/12 10:40:37 gleixner Exp $ 8 * $Id: nand.h,v 1.73 2005/05/31 19:39:17 gleixner Exp $
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -48,6 +48,10 @@
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities 48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id 49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description 50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH.
53 * 01-20-2005 dmarlin added optional pointer to hardware specific callback for
54 * extra error status checks.
51 */ 55 */
52#ifndef __LINUX_MTD_NAND_H 56#ifndef __LINUX_MTD_NAND_H
53#define __LINUX_MTD_NAND_H 57#define __LINUX_MTD_NAND_H
@@ -115,6 +119,25 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
115#define NAND_CMD_READSTART 0x30 119#define NAND_CMD_READSTART 0x30
116#define NAND_CMD_CACHEDPROG 0x15 120#define NAND_CMD_CACHEDPROG 0x15
117 121
122/* Extended commands for AG-AND device */
123/*
124 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
125 * there is no way to distinguish that from NAND_CMD_READ0
126 * until the remaining sequence of commands has been completed
127 * so add a high order bit and mask it off in the command.
128 */
129#define NAND_CMD_DEPLETE1 0x100
130#define NAND_CMD_DEPLETE2 0x38
131#define NAND_CMD_STATUS_MULTI 0x71
132#define NAND_CMD_STATUS_ERROR 0x72
133/* multi-bank error status (banks 0-3) */
134#define NAND_CMD_STATUS_ERROR0 0x73
135#define NAND_CMD_STATUS_ERROR1 0x74
136#define NAND_CMD_STATUS_ERROR2 0x75
137#define NAND_CMD_STATUS_ERROR3 0x76
138#define NAND_CMD_STATUS_RESET 0x7f
139#define NAND_CMD_STATUS_CLEAR 0xff
140
118/* Status bits */ 141/* Status bits */
119#define NAND_STATUS_FAIL 0x01 142#define NAND_STATUS_FAIL 0x01
120#define NAND_STATUS_FAIL_N1 0x02 143#define NAND_STATUS_FAIL_N1 0x02
@@ -143,7 +166,7 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
143 166
144/* 167/*
145 * Constants for Hardware ECC 168 * Constants for Hardware ECC
146*/ 169 */
147/* Reset Hardware ECC for read */ 170/* Reset Hardware ECC for read */
148#define NAND_ECC_READ 0 171#define NAND_ECC_READ 0
149/* Reset Hardware ECC for write */ 172/* Reset Hardware ECC for write */
@@ -151,6 +174,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
151/* Enable Hardware ECC before syndrom is read back from flash */ 174/* Enable Hardware ECC before syndrom is read back from flash */
152#define NAND_ECC_READSYN 2 175#define NAND_ECC_READSYN 2
153 176
177/* Bit mask for flags passed to do_nand_read_ecc */
178#define NAND_GET_DEVICE 0x80
179
180
154/* Option constants for bizarre disfunctionality and real 181/* Option constants for bizarre disfunctionality and real
155* features 182* features
156*/ 183*/
@@ -170,6 +197,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
170/* Chip has a array of 4 pages which can be read without 197/* Chip has a array of 4 pages which can be read without
171 * additional ready /busy waits */ 198 * additional ready /busy waits */
172#define NAND_4PAGE_ARRAY 0x00000040 199#define NAND_4PAGE_ARRAY 0x00000040
200/* Chip requires that BBT is periodically rewritten to prevent
201 * bits from adjacent blocks from 'leaking' in altering data.
202 * This happens with the Renesas AG-AND chips, possibly others. */
203#define BBT_AUTO_REFRESH 0x00000080
173 204
174/* Options valid for Samsung large page devices */ 205/* Options valid for Samsung large page devices */
175#define NAND_SAMSUNG_LP_OPTIONS \ 206#define NAND_SAMSUNG_LP_OPTIONS \
@@ -192,7 +223,8 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
192 * This can only work if we have the ecc bytes directly behind the 223 * This can only work if we have the ecc bytes directly behind the
193 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */ 224 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
194#define NAND_HWECC_SYNDROME 0x00020000 225#define NAND_HWECC_SYNDROME 0x00020000
195 226/* This option skips the bbt scan during initialization. */
227#define NAND_SKIP_BBTSCAN 0x00040000
196 228
197/* Options set by nand scan */ 229/* Options set by nand scan */
198/* Nand scan has allocated oob_buf */ 230/* Nand scan has allocated oob_buf */
@@ -221,10 +253,13 @@ struct nand_chip;
221 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices 253 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independend devices
222 * @lock: protection lock 254 * @lock: protection lock
223 * @active: the mtd device which holds the controller currently 255 * @active: the mtd device which holds the controller currently
256 * @wq: wait queue to sleep on if a NAND operation is in progress
257 * used instead of the per chip wait queue when a hw controller is available
224 */ 258 */
225struct nand_hw_control { 259struct nand_hw_control {
226 spinlock_t lock; 260 spinlock_t lock;
227 struct nand_chip *active; 261 struct nand_chip *active;
262 wait_queue_head_t wq;
228}; 263};
229 264
230/** 265/**
@@ -283,6 +318,8 @@ struct nand_hw_control {
283 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan 318 * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for initial bad block scan
284 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices 319 * @controller: [OPTIONAL] a pointer to a hardware controller structure which is shared among multiple independend devices
285 * @priv: [OPTIONAL] pointer to private chip date 320 * @priv: [OPTIONAL] pointer to private chip date
321 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
322 * (determine if errors are correctable)
286 */ 323 */
287 324
288struct nand_chip { 325struct nand_chip {
@@ -338,6 +375,7 @@ struct nand_chip {
338 struct nand_bbt_descr *badblock_pattern; 375 struct nand_bbt_descr *badblock_pattern;
339 struct nand_hw_control *controller; 376 struct nand_hw_control *controller;
340 void *priv; 377 void *priv;
378 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
341}; 379};
342 380
343/* 381/*
@@ -349,6 +387,7 @@ struct nand_chip {
349#define NAND_MFR_NATIONAL 0x8f 387#define NAND_MFR_NATIONAL 0x8f
350#define NAND_MFR_RENESAS 0x07 388#define NAND_MFR_RENESAS 0x07
351#define NAND_MFR_STMICRO 0x20 389#define NAND_MFR_STMICRO 0x20
390#define NAND_MFR_HYNIX 0xad
352 391
353/** 392/**
354 * struct nand_flash_dev - NAND Flash Device ID Structure 393 * struct nand_flash_dev - NAND Flash Device ID Structure
@@ -459,6 +498,9 @@ extern int nand_update_bbt (struct mtd_info *mtd, loff_t offs);
459extern int nand_default_bbt (struct mtd_info *mtd); 498extern int nand_default_bbt (struct mtd_info *mtd);
460extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt); 499extern int nand_isbad_bbt (struct mtd_info *mtd, loff_t offs, int allowbbt);
461extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt); 500extern int nand_erase_nand (struct mtd_info *mtd, struct erase_info *instr, int allowbbt);
501extern int nand_do_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
502 size_t * retlen, u_char * buf, u_char * oob_buf,
503 struct nand_oobinfo *oobsel, int flags);
462 504
463/* 505/*
464* Constants for oob configuration 506* Constants for oob configuration
diff --git a/include/linux/mtd/plat-ram.h b/include/linux/mtd/plat-ram.h
new file mode 100644
index 000000000000..2332eda07e0e
--- /dev/null
+++ b/include/linux/mtd/plat-ram.h
@@ -0,0 +1,35 @@
1/* linux/include/mtd/plat-ram.h
2 *
3 * (c) 2004 Simtec Electronics
4 * http://www.simtec.co.uk/products/SWLINUX/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * Generic platform device based RAM map
8 *
9 * $Id: plat-ram.h,v 1.2 2005/01/24 00:37:40 bjd Exp $
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 *
15 */
16
17#ifndef __LINUX_MTD_PLATRAM_H
18#define __LINUX_MTD_PLATRAM_H __FILE__
19
20#define PLATRAM_RO (0)
21#define PLATRAM_RW (1)
22
23struct platdata_mtd_ram {
24 char *mapname;
25 char **probes;
26 struct mtd_partition *partitions;
27 int nr_partitions;
28 int bankwidth;
29
30 /* control callbacks */
31
32 void (*set_rw)(struct device *dev, int to);
33};
34
35#endif /* __LINUX_MTD_PLATRAM_H */
diff --git a/include/linux/mtd/xip.h b/include/linux/mtd/xip.h
index fc071125cbcc..7b7deef6b180 100644
--- a/include/linux/mtd/xip.h
+++ b/include/linux/mtd/xip.h
@@ -58,22 +58,16 @@
58 * returned value is <= the real elapsed time. 58 * returned value is <= the real elapsed time.
59 * note 2: this should be able to cope with a few seconds without 59 * note 2: this should be able to cope with a few seconds without
60 * overflowing. 60 * overflowing.
61 *
62 * xip_iprefetch()
63 *
64 * Macro to fill instruction prefetch
65 * e.g. a series of nops: asm volatile (".rep 8; nop; .endr");
61 */ 66 */
62 67
63#if defined(CONFIG_ARCH_SA1100) || defined(CONFIG_ARCH_PXA) 68#include <asm/mtd-xip.h>
64
65#include <asm/hardware.h>
66#ifdef CONFIG_ARCH_PXA
67#include <asm/arch/pxa-regs.h>
68#endif
69
70#define xip_irqpending() (ICIP & ICMR)
71
72/* we sample OSCR and convert desired delta to usec (1/4 ~= 1000000/3686400) */
73#define xip_currtime() (OSCR)
74#define xip_elapsed_since(x) (signed)((OSCR - (x)) / 4)
75 69
76#else 70#ifndef xip_irqpending
77 71
78#warning "missing IRQ and timer primitives for XIP MTD support" 72#warning "missing IRQ and timer primitives for XIP MTD support"
79#warning "some of the XIP MTD support code will be disabled" 73#warning "some of the XIP MTD support code will be disabled"
@@ -85,16 +79,17 @@
85 79
86#endif 80#endif
87 81
82#ifndef xip_iprefetch
83#define xip_iprefetch() do { } while (0)
84#endif
85
88/* 86/*
89 * xip_cpu_idle() is used when waiting for a delay equal or larger than 87 * xip_cpu_idle() is used when waiting for a delay equal or larger than
90 * the system timer tick period. This should put the CPU into idle mode 88 * the system timer tick period. This should put the CPU into idle mode
91 * to save power and to be woken up only when some interrupts are pending. 89 * to save power and to be woken up only when some interrupts are pending.
92 * As above, this should not rely upon standard kernel code. 90 * This should not rely upon standard kernel code.
93 */ 91 */
94 92#ifndef xip_cpu_idle
95#if defined(CONFIG_CPU_XSCALE)
96#define xip_cpu_idle() asm volatile ("mcr p14, 0, %0, c7, c0, 0" :: "r" (1))
97#else
98#define xip_cpu_idle() do { } while (0) 93#define xip_cpu_idle() do { } while (0)
99#endif 94#endif
100 95
diff --git a/include/linux/namespace.h b/include/linux/namespace.h
index 9eca1558d72f..0e5a86f13b2f 100644
--- a/include/linux/namespace.h
+++ b/include/linux/namespace.h
@@ -12,13 +12,13 @@ struct namespace {
12 struct rw_semaphore sem; 12 struct rw_semaphore sem;
13}; 13};
14 14
15extern void umount_tree(struct vfsmount *);
16extern int copy_namespace(int, struct task_struct *); 15extern int copy_namespace(int, struct task_struct *);
17extern void __put_namespace(struct namespace *namespace); 16extern void __put_namespace(struct namespace *namespace);
18 17
19static inline void put_namespace(struct namespace *namespace) 18static inline void put_namespace(struct namespace *namespace)
20{ 19{
21 if (atomic_dec_and_test(&namespace->count)) 20 if (atomic_dec_and_lock(&namespace->count, &vfsmount_lock))
21 /* releases vfsmount_lock */
22 __put_namespace(namespace); 22 __put_namespace(namespace);
23} 23}
24 24
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ba5d1236aa17..3a0ed7f9e801 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -41,7 +41,7 @@
41struct divert_blk; 41struct divert_blk;
42struct vlan_group; 42struct vlan_group;
43struct ethtool_ops; 43struct ethtool_ops;
44struct netpoll; 44struct netpoll_info;
45 /* source back-compat hooks */ 45 /* source back-compat hooks */
46#define SET_ETHTOOL_OPS(netdev,ops) \ 46#define SET_ETHTOOL_OPS(netdev,ops) \
47 ( (netdev)->ethtool_ops = (ops) ) 47 ( (netdev)->ethtool_ops = (ops) )
@@ -164,12 +164,6 @@ struct netif_rx_stats
164 unsigned total; 164 unsigned total;
165 unsigned dropped; 165 unsigned dropped;
166 unsigned time_squeeze; 166 unsigned time_squeeze;
167 unsigned throttled;
168 unsigned fastroute_hit;
169 unsigned fastroute_success;
170 unsigned fastroute_defer;
171 unsigned fastroute_deferred_out;
172 unsigned fastroute_latency_reduction;
173 unsigned cpu_collision; 167 unsigned cpu_collision;
174}; 168};
175 169
@@ -468,7 +462,7 @@ struct net_device
468 unsigned char *haddr); 462 unsigned char *haddr);
469 int (*neigh_setup)(struct net_device *dev, struct neigh_parms *); 463 int (*neigh_setup)(struct net_device *dev, struct neigh_parms *);
470#ifdef CONFIG_NETPOLL 464#ifdef CONFIG_NETPOLL
471 struct netpoll *np; 465 struct netpoll_info *npinfo;
472#endif 466#endif
473#ifdef CONFIG_NET_POLL_CONTROLLER 467#ifdef CONFIG_NET_POLL_CONTROLLER
474 void (*poll_controller)(struct net_device *dev); 468 void (*poll_controller)(struct net_device *dev);
@@ -562,12 +556,9 @@ static inline int unregister_gifconf(unsigned int family)
562 556
563struct softnet_data 557struct softnet_data
564{ 558{
565 int throttle; 559 struct net_device *output_queue;
566 int cng_level;
567 int avg_blog;
568 struct sk_buff_head input_pkt_queue; 560 struct sk_buff_head input_pkt_queue;
569 struct list_head poll_list; 561 struct list_head poll_list;
570 struct net_device *output_queue;
571 struct sk_buff *completion_queue; 562 struct sk_buff *completion_queue;
572 563
573 struct net_device backlog_dev; /* Sorry. 8) */ 564 struct net_device backlog_dev; /* Sorry. 8) */
@@ -925,10 +916,6 @@ extern int skb_checksum_help(struct sk_buff *skb, int inward);
925extern void net_enable_timestamp(void); 916extern void net_enable_timestamp(void);
926extern void net_disable_timestamp(void); 917extern void net_disable_timestamp(void);
927 918
928#ifdef CONFIG_SYSCTL
929extern char *net_sysctl_strdup(const char *s);
930#endif
931
932#endif /* __KERNEL__ */ 919#endif /* __KERNEL__ */
933 920
934#endif /* _LINUX_DEV_H */ 921#endif /* _LINUX_DEV_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 3781192ce159..08fe5f7d14a0 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -197,6 +197,9 @@ struct ip_conntrack_expect
197 /* Timer function; deletes the expectation. */ 197 /* Timer function; deletes the expectation. */
198 struct timer_list timeout; 198 struct timer_list timeout;
199 199
200 /* Usage count. */
201 atomic_t use;
202
200#ifdef CONFIG_IP_NF_NAT_NEEDED 203#ifdef CONFIG_IP_NF_NAT_NEEDED
201 /* This is the original per-proto part, used to map the 204 /* This is the original per-proto part, used to map the
202 * expected connection the way the recipient expects. */ 205 * expected connection the way the recipient expects. */
@@ -236,7 +239,7 @@ ip_conntrack_get(const struct sk_buff *skb, enum ip_conntrack_info *ctinfo)
236} 239}
237 240
238/* decrement reference count on a conntrack */ 241/* decrement reference count on a conntrack */
239extern inline void ip_conntrack_put(struct ip_conntrack *ct); 242extern void ip_conntrack_put(struct ip_conntrack *ct);
240 243
241/* call to create an explicit dependency on ip_conntrack. */ 244/* call to create an explicit dependency on ip_conntrack. */
242extern void need_ip_conntrack(void); 245extern void need_ip_conntrack(void);
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h
index b1bbba0a12cb..3692daa93dec 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper.h
@@ -30,9 +30,10 @@ extern int ip_conntrack_helper_register(struct ip_conntrack_helper *);
30extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *); 30extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *);
31 31
32/* Allocate space for an expectation: this is mandatory before calling 32/* Allocate space for an expectation: this is mandatory before calling
33 ip_conntrack_expect_related. */ 33 ip_conntrack_expect_related. You will have to call put afterwards. */
34extern struct ip_conntrack_expect *ip_conntrack_expect_alloc(void); 34extern struct ip_conntrack_expect *
35extern void ip_conntrack_expect_free(struct ip_conntrack_expect *exp); 35ip_conntrack_expect_alloc(struct ip_conntrack *master);
36extern void ip_conntrack_expect_put(struct ip_conntrack_expect *exp);
36 37
37/* Add an expected connection: can have more than one per connection */ 38/* Add an expected connection: can have more than one per connection */
38extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp); 39extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp);
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index baa83e757156..d9bceedfb3dc 100644
--- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -18,7 +18,6 @@ struct clusterip_config;
18struct ipt_clusterip_tgt_info { 18struct ipt_clusterip_tgt_info {
19 19
20 u_int32_t flags; 20 u_int32_t flags;
21 struct clusterip_config *config;
22 21
23 /* only relevant for new ones */ 22 /* only relevant for new ones */
24 u_int8_t clustermac[6]; 23 u_int8_t clustermac[6];
@@ -27,6 +26,8 @@ struct ipt_clusterip_tgt_info {
27 u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; 26 u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
28 enum clusterip_hashmode hash_mode; 27 enum clusterip_hashmode hash_mode;
29 u_int32_t hash_initval; 28 u_int32_t hash_initval;
29
30 struct clusterip_config *config;
30}; 31};
31 32
32#endif /*_IPT_CLUSTERIP_H_target*/ 33#endif /*_IPT_CLUSTERIP_H_target*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 3029cad63a01..6552b71bfa73 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -5,21 +5,20 @@
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
8#define NETLINK_SKIP 1 /* Reserved for ENskip */ 8#define NETLINK_W1 1 /* 1-wire subsystem */
9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ 9#define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */
10#define NETLINK_FIREWALL 3 /* Firewalling hook */ 10#define NETLINK_FIREWALL 3 /* Firewalling hook */
11#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ 11#define NETLINK_TCPDIAG 4 /* TCP socket monitoring */
12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ 12#define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */
13#define NETLINK_XFRM 6 /* ipsec */ 13#define NETLINK_XFRM 6 /* ipsec */
14#define NETLINK_SELINUX 7 /* SELinux event notifications */ 14#define NETLINK_SELINUX 7 /* SELinux event notifications */
15#define NETLINK_ARPD 8 15#define NETLINK_ISCSI 8 /* Open-iSCSI */
16#define NETLINK_AUDIT 9 /* auditing */ 16#define NETLINK_AUDIT 9 /* auditing */
17#define NETLINK_FIB_LOOKUP 10 17#define NETLINK_FIB_LOOKUP 10
18#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ 18#define NETLINK_NETFILTER 12 /* netfilter subsystem */
19#define NETLINK_IP6_FW 13 19#define NETLINK_IP6_FW 13
20#define NETLINK_DNRTMSG 14 /* DECnet routing messages */ 20#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
21#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ 21#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
22#define NETLINK_TAPBASE 16 /* 16 to 31 are ethertap */
23 22
24#define MAX_LINKS 32 23#define MAX_LINKS 32
25 24
@@ -168,6 +167,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
168 nlh->nlmsg_flags = flags; 167 nlh->nlmsg_flags = flags;
169 nlh->nlmsg_pid = pid; 168 nlh->nlmsg_pid = pid;
170 nlh->nlmsg_seq = seq; 169 nlh->nlmsg_seq = seq;
170 memset(NLMSG_DATA(nlh) + len, 0, NLMSG_ALIGN(size) - size);
171 return nlh; 171 return nlh;
172} 172}
173 173
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index c0d8b90c5202..5ade54a78dbb 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -9,6 +9,7 @@
9 9
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/rcupdate.h>
12#include <linux/list.h> 13#include <linux/list.h>
13 14
14struct netpoll; 15struct netpoll;
@@ -16,14 +17,20 @@ struct netpoll;
16struct netpoll { 17struct netpoll {
17 struct net_device *dev; 18 struct net_device *dev;
18 char dev_name[16], *name; 19 char dev_name[16], *name;
19 int rx_flags;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 20 void (*rx_hook)(struct netpoll *, int, char *, int);
21 void (*drop)(struct sk_buff *skb); 21 void (*drop)(struct sk_buff *skb);
22 u32 local_ip, remote_ip; 22 u32 local_ip, remote_ip;
23 u16 local_port, remote_port; 23 u16 local_port, remote_port;
24 unsigned char local_mac[6], remote_mac[6]; 24 unsigned char local_mac[6], remote_mac[6];
25};
26
27struct netpoll_info {
25 spinlock_t poll_lock; 28 spinlock_t poll_lock;
26 int poll_owner; 29 int poll_owner;
30 int tries;
31 int rx_flags;
32 spinlock_t rx_lock;
33 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
27}; 34};
28 35
29void netpoll_poll(struct netpoll *np); 36void netpoll_poll(struct netpoll *np);
@@ -39,28 +46,47 @@ void netpoll_queue(struct sk_buff *skb);
39#ifdef CONFIG_NETPOLL 46#ifdef CONFIG_NETPOLL
40static inline int netpoll_rx(struct sk_buff *skb) 47static inline int netpoll_rx(struct sk_buff *skb)
41{ 48{
42 return skb->dev->np && skb->dev->np->rx_flags && __netpoll_rx(skb); 49 struct netpoll_info *npinfo = skb->dev->npinfo;
50 unsigned long flags;
51 int ret = 0;
52
53 if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags))
54 return 0;
55
56 spin_lock_irqsave(&npinfo->rx_lock, flags);
57 /* check rx_flags again with the lock held */
58 if (npinfo->rx_flags && __netpoll_rx(skb))
59 ret = 1;
60 spin_unlock_irqrestore(&npinfo->rx_lock, flags);
61
62 return ret;
43} 63}
44 64
45static inline void netpoll_poll_lock(struct net_device *dev) 65static inline void *netpoll_poll_lock(struct net_device *dev)
46{ 66{
47 if (dev->np) { 67 rcu_read_lock(); /* deal with race on ->npinfo */
48 spin_lock(&dev->np->poll_lock); 68 if (dev->npinfo) {
49 dev->np->poll_owner = smp_processor_id(); 69 spin_lock(&dev->npinfo->poll_lock);
70 dev->npinfo->poll_owner = smp_processor_id();
71 return dev->npinfo;
50 } 72 }
73 return NULL;
51} 74}
52 75
53static inline void netpoll_poll_unlock(struct net_device *dev) 76static inline void netpoll_poll_unlock(void *have)
54{ 77{
55 if (dev->np) { 78 struct netpoll_info *npi = have;
56 spin_unlock(&dev->np->poll_lock); 79
57 dev->np->poll_owner = -1; 80 if (npi) {
81 npi->poll_owner = -1;
82 spin_unlock(&npi->poll_lock);
58 } 83 }
84 rcu_read_unlock();
59} 85}
60 86
61#else 87#else
62#define netpoll_rx(a) 0 88#define netpoll_rx(a) 0
63#define netpoll_poll_lock(a) 89#define netpoll_poll_lock(a) 0
64#define netpoll_poll_unlock(a) 90#define netpoll_poll_unlock(a)
65#endif 91#endif
66 92
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 5ca8a8d8ccdf..0c1c306cdaec 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -28,7 +28,7 @@
28#define NFS4_ACCESS_DELETE 0x0010 28#define NFS4_ACCESS_DELETE 0x0010
29#define NFS4_ACCESS_EXECUTE 0x0020 29#define NFS4_ACCESS_EXECUTE 0x0020
30 30
31#define NFS4_FH_PERISTENT 0x0000 31#define NFS4_FH_PERSISTENT 0x0000
32#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001 32#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
33#define NFS4_FH_VOLATILE_ANY 0x0002 33#define NFS4_FH_VOLATILE_ANY 0x0002
34#define NFS4_FH_VOL_MIGRATION 0x0004 34#define NFS4_FH_VOL_MIGRATION 0x0004
@@ -382,6 +382,8 @@ enum {
382 NFSPROC4_CLNT_READDIR, 382 NFSPROC4_CLNT_READDIR,
383 NFSPROC4_CLNT_SERVER_CAPS, 383 NFSPROC4_CLNT_SERVER_CAPS,
384 NFSPROC4_CLNT_DELEGRETURN, 384 NFSPROC4_CLNT_DELEGRETURN,
385 NFSPROC4_CLNT_GETACL,
386 NFSPROC4_CLNT_SETACL,
385}; 387};
386 388
387#endif 389#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index dbac7f363e5d..9a6047ff1b25 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -15,7 +15,6 @@
15#include <linux/pagemap.h> 15#include <linux/pagemap.h>
16#include <linux/rwsem.h> 16#include <linux/rwsem.h>
17#include <linux/wait.h> 17#include <linux/wait.h>
18#include <linux/uio.h>
19 18
20#include <linux/nfs_fs_sb.h> 19#include <linux/nfs_fs_sb.h>
21 20
@@ -29,7 +28,6 @@
29#include <linux/nfs4.h> 28#include <linux/nfs4.h>
30#include <linux/nfs_xdr.h> 29#include <linux/nfs_xdr.h>
31#include <linux/rwsem.h> 30#include <linux/rwsem.h>
32#include <linux/workqueue.h>
33#include <linux/mempool.h> 31#include <linux/mempool.h>
34 32
35/* 33/*
@@ -44,13 +42,6 @@
44#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096 42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
45 43
46/* 44/*
47 * The upper limit on timeouts for the exponential backoff algorithm.
48 */
49#define NFS_WRITEBACK_DELAY (5*HZ)
50#define NFS_WRITEBACK_LOCKDELAY (60*HZ)
51#define NFS_COMMIT_DELAY (5*HZ)
52
53/*
54 * superblock magic number for NFS 45 * superblock magic number for NFS
55 */ 46 */
56#define NFS_SUPER_MAGIC 0x6969 47#define NFS_SUPER_MAGIC 0x6969
@@ -60,9 +51,6 @@
60 */ 51 */
61#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS) 52#define NFS_RPC_SWAPFLAGS (RPC_TASK_SWAPPER|RPC_TASK_ROOTCREDS)
62 53
63#define NFS_RW_SYNC 0x0001 /* O_SYNC handling */
64#define NFS_RW_SWAP 0x0002 /* This is a swap request */
65
66/* 54/*
67 * When flushing a cluster of dirty pages, there can be different 55 * When flushing a cluster of dirty pages, there can be different
68 * strategies: 56 * strategies:
@@ -96,7 +84,8 @@ struct nfs_open_context {
96 int error; 84 int error;
97 85
98 struct list_head list; 86 struct list_head list;
99 wait_queue_head_t waitq; 87
88 __u64 dir_cookie;
100}; 89};
101 90
102/* 91/*
@@ -104,6 +93,8 @@ struct nfs_open_context {
104 */ 93 */
105struct nfs_delegation; 94struct nfs_delegation;
106 95
96struct posix_acl;
97
107/* 98/*
108 * nfs fs inode data in memory 99 * nfs fs inode data in memory
109 */ 100 */
@@ -121,7 +112,8 @@ struct nfs_inode {
121 /* 112 /*
122 * Various flags 113 * Various flags
123 */ 114 */
124 unsigned int flags; 115 unsigned long flags; /* atomic bit ops */
116 unsigned long cache_validity; /* bit mask */
125 117
126 /* 118 /*
127 * read_cache_jiffies is when we started read-caching this inode, 119 * read_cache_jiffies is when we started read-caching this inode,
@@ -140,7 +132,6 @@ struct nfs_inode {
140 * 132 *
141 * mtime != read_cache_mtime 133 * mtime != read_cache_mtime
142 */ 134 */
143 unsigned long readdir_timestamp;
144 unsigned long read_cache_jiffies; 135 unsigned long read_cache_jiffies;
145 unsigned long attrtimeo; 136 unsigned long attrtimeo;
146 unsigned long attrtimeo_timestamp; 137 unsigned long attrtimeo_timestamp;
@@ -158,6 +149,10 @@ struct nfs_inode {
158 atomic_t data_updates; 149 atomic_t data_updates;
159 150
160 struct nfs_access_entry cache_access; 151 struct nfs_access_entry cache_access;
152#ifdef CONFIG_NFS_V3_ACL
153 struct posix_acl *acl_access;
154 struct posix_acl *acl_default;
155#endif
161 156
162 /* 157 /*
163 * This is the cookie verifier used for NFSv3 readdir 158 * This is the cookie verifier used for NFSv3 readdir
@@ -180,29 +175,33 @@ struct nfs_inode {
180 /* Open contexts for shared mmap writes */ 175 /* Open contexts for shared mmap writes */
181 struct list_head open_files; 176 struct list_head open_files;
182 177
183 wait_queue_head_t nfs_i_wait;
184
185#ifdef CONFIG_NFS_V4 178#ifdef CONFIG_NFS_V4
179 struct nfs4_cached_acl *nfs4_acl;
186 /* NFSv4 state */ 180 /* NFSv4 state */
187 struct list_head open_states; 181 struct list_head open_states;
188 struct nfs_delegation *delegation; 182 struct nfs_delegation *delegation;
189 int delegation_state; 183 int delegation_state;
190 struct rw_semaphore rwsem; 184 struct rw_semaphore rwsem;
191#endif /* CONFIG_NFS_V4*/ 185#endif /* CONFIG_NFS_V4*/
192
193 struct inode vfs_inode; 186 struct inode vfs_inode;
194}; 187};
195 188
196/* 189/*
197 * Legal inode flag values 190 * Cache validity bit flags
191 */
192#define NFS_INO_INVALID_ATTR 0x0001 /* cached attrs are invalid */
193#define NFS_INO_INVALID_DATA 0x0002 /* cached data is invalid */
194#define NFS_INO_INVALID_ATIME 0x0004 /* cached atime is invalid */
195#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */
196#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
197#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
198
199/*
200 * Bit offsets in flags field
198 */ 201 */
199#define NFS_INO_STALE 0x0001 /* possible stale inode */ 202#define NFS_INO_REVALIDATING (0) /* revalidating attrs */
200#define NFS_INO_ADVISE_RDPLUS 0x0002 /* advise readdirplus */ 203#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */
201#define NFS_INO_REVALIDATING 0x0004 /* revalidating attrs */ 204#define NFS_INO_STALE (2) /* possible stale inode */
202#define NFS_INO_INVALID_ATTR 0x0008 /* cached attrs are invalid */
203#define NFS_INO_INVALID_DATA 0x0010 /* cached data is invalid */
204#define NFS_INO_INVALID_ATIME 0x0020 /* cached atime is invalid */
205#define NFS_INO_INVALID_ACCESS 0x0040 /* cached access cred invalid */
206 205
207static inline struct nfs_inode *NFS_I(struct inode *inode) 206static inline struct nfs_inode *NFS_I(struct inode *inode)
208{ 207{
@@ -228,8 +227,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
228#define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp) 227#define NFS_ATTRTIMEO_UPDATE(inode) (NFS_I(inode)->attrtimeo_timestamp)
229 228
230#define NFS_FLAGS(inode) (NFS_I(inode)->flags) 229#define NFS_FLAGS(inode) (NFS_I(inode)->flags)
231#define NFS_REVALIDATING(inode) (NFS_FLAGS(inode) & NFS_INO_REVALIDATING) 230#define NFS_STALE(inode) (test_bit(NFS_INO_STALE, &NFS_FLAGS(inode)))
232#define NFS_STALE(inode) (NFS_FLAGS(inode) & NFS_INO_STALE)
233 231
234#define NFS_FILEID(inode) (NFS_I(inode)->fileid) 232#define NFS_FILEID(inode) (NFS_I(inode)->fileid)
235 233
@@ -240,8 +238,11 @@ static inline int nfs_caches_unstable(struct inode *inode)
240 238
241static inline void NFS_CACHEINV(struct inode *inode) 239static inline void NFS_CACHEINV(struct inode *inode)
242{ 240{
243 if (!nfs_caches_unstable(inode)) 241 if (!nfs_caches_unstable(inode)) {
244 NFS_FLAGS(inode) |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS; 242 spin_lock(&inode->i_lock);
243 NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR | NFS_INO_INVALID_ACCESS;
244 spin_unlock(&inode->i_lock);
245 }
245} 246}
246 247
247static inline int nfs_server_capable(struct inode *inode, int cap) 248static inline int nfs_server_capable(struct inode *inode, int cap)
@@ -251,7 +252,7 @@ static inline int nfs_server_capable(struct inode *inode, int cap)
251 252
252static inline int NFS_USE_READDIRPLUS(struct inode *inode) 253static inline int NFS_USE_READDIRPLUS(struct inode *inode)
253{ 254{
254 return NFS_FLAGS(inode) & NFS_INO_ADVISE_RDPLUS; 255 return test_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode));
255} 256}
256 257
257/** 258/**
@@ -294,12 +295,13 @@ extern int nfs_release(struct inode *, struct file *);
294extern int nfs_attribute_timeout(struct inode *inode); 295extern int nfs_attribute_timeout(struct inode *inode);
295extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); 296extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
296extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); 297extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
298extern void nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
297extern int nfs_setattr(struct dentry *, struct iattr *); 299extern int nfs_setattr(struct dentry *, struct iattr *);
300extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
298extern void nfs_begin_attr_update(struct inode *); 301extern void nfs_begin_attr_update(struct inode *);
299extern void nfs_end_attr_update(struct inode *); 302extern void nfs_end_attr_update(struct inode *);
300extern void nfs_begin_data_update(struct inode *); 303extern void nfs_begin_data_update(struct inode *);
301extern void nfs_end_data_update(struct inode *); 304extern void nfs_end_data_update(struct inode *);
302extern void nfs_end_data_update_defer(struct inode *);
303extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred); 305extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred);
304extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 306extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
305extern void put_nfs_open_context(struct nfs_open_context *ctx); 307extern void put_nfs_open_context(struct nfs_open_context *ctx);
@@ -314,6 +316,9 @@ extern u32 root_nfs_parse_addr(char *name); /*__init*/
314 * linux/fs/nfs/file.c 316 * linux/fs/nfs/file.c
315 */ 317 */
316extern struct inode_operations nfs_file_inode_operations; 318extern struct inode_operations nfs_file_inode_operations;
319#ifdef CONFIG_NFS_V3
320extern struct inode_operations nfs3_file_inode_operations;
321#endif /* CONFIG_NFS_V3 */
317extern struct file_operations nfs_file_operations; 322extern struct file_operations nfs_file_operations;
318extern struct address_space_operations nfs_file_aops; 323extern struct address_space_operations nfs_file_aops;
319 324
@@ -329,6 +334,22 @@ static inline struct rpc_cred *nfs_file_cred(struct file *file)
329} 334}
330 335
331/* 336/*
337 * linux/fs/nfs/xattr.c
338 */
339#ifdef CONFIG_NFS_V3_ACL
340extern ssize_t nfs3_listxattr(struct dentry *, char *, size_t);
341extern ssize_t nfs3_getxattr(struct dentry *, const char *, void *, size_t);
342extern int nfs3_setxattr(struct dentry *, const char *,
343 const void *, size_t, int);
344extern int nfs3_removexattr (struct dentry *, const char *name);
345#else
346# define nfs3_listxattr NULL
347# define nfs3_getxattr NULL
348# define nfs3_setxattr NULL
349# define nfs3_removexattr NULL
350#endif
351
352/*
332 * linux/fs/nfs/direct.c 353 * linux/fs/nfs/direct.c
333 */ 354 */
334extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, 355extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t,
@@ -342,6 +363,9 @@ extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf,
342 * linux/fs/nfs/dir.c 363 * linux/fs/nfs/dir.c
343 */ 364 */
344extern struct inode_operations nfs_dir_inode_operations; 365extern struct inode_operations nfs_dir_inode_operations;
366#ifdef CONFIG_NFS_V3
367extern struct inode_operations nfs3_dir_inode_operations;
368#endif /* CONFIG_NFS_V3 */
345extern struct file_operations nfs_dir_operations; 369extern struct file_operations nfs_dir_operations;
346extern struct dentry_operations nfs_dentry_operations; 370extern struct dentry_operations nfs_dentry_operations;
347 371
@@ -377,10 +401,10 @@ extern void nfs_commit_done(struct rpc_task *);
377 */ 401 */
378extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int); 402extern int nfs_sync_inode(struct inode *, unsigned long, unsigned int, int);
379#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 403#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
380extern int nfs_commit_inode(struct inode *, unsigned long, unsigned int, int); 404extern int nfs_commit_inode(struct inode *, int);
381#else 405#else
382static inline int 406static inline int
383nfs_commit_inode(struct inode *inode, unsigned long idx_start, unsigned int npages, int how) 407nfs_commit_inode(struct inode *inode, int how)
384{ 408{
385 return 0; 409 return 0;
386} 410}
@@ -434,11 +458,6 @@ static inline void nfs_writedata_free(struct nfs_write_data *p)
434 mempool_free(p, nfs_wdata_mempool); 458 mempool_free(p, nfs_wdata_mempool);
435} 459}
436 460
437/* Hack for future NFS swap support */
438#ifndef IS_SWAPFILE
439# define IS_SWAPFILE(inode) (0)
440#endif
441
442/* 461/*
443 * linux/fs/nfs/read.c 462 * linux/fs/nfs/read.c
444 */ 463 */
@@ -468,6 +487,29 @@ static inline void nfs_readdata_free(struct nfs_read_data *p)
468extern void nfs_readdata_release(struct rpc_task *task); 487extern void nfs_readdata_release(struct rpc_task *task);
469 488
470/* 489/*
490 * linux/fs/nfs3proc.c
491 */
492#ifdef CONFIG_NFS_V3_ACL
493extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
494extern int nfs3_proc_setacl(struct inode *inode, int type,
495 struct posix_acl *acl);
496extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
497 mode_t mode);
498extern void nfs3_forget_cached_acls(struct inode *inode);
499#else
500static inline int nfs3_proc_set_default_acl(struct inode *dir,
501 struct inode *inode,
502 mode_t mode)
503{
504 return 0;
505}
506
507static inline void nfs3_forget_cached_acls(struct inode *inode)
508{
509}
510#endif /* CONFIG_NFS_V3_ACL */
511
512/*
471 * linux/fs/mount_clnt.c 513 * linux/fs/mount_clnt.c
472 * (Used only by nfsroot module) 514 * (Used only by nfsroot module)
473 */ 515 */
@@ -515,230 +557,6 @@ extern void * nfs_root_data(void);
515 557
516#define NFS_JUKEBOX_RETRY_TIME (5 * HZ) 558#define NFS_JUKEBOX_RETRY_TIME (5 * HZ)
517 559
518#ifdef CONFIG_NFS_V4
519
520struct idmap;
521
522/*
523 * In a seqid-mutating op, this macro controls which error return
524 * values trigger incrementation of the seqid.
525 *
526 * from rfc 3010:
527 * The client MUST monotonically increment the sequence number for the
528 * CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
529 * operations. This is true even in the event that the previous
530 * operation that used the sequence number received an error. The only
531 * exception to this rule is if the previous operation received one of
532 * the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID,
533 * NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR,
534 * NFSERR_RESOURCE, NFSERR_NOFILEHANDLE.
535 *
536 */
537#define seqid_mutating_err(err) \
538(((err) != NFSERR_STALE_CLIENTID) && \
539 ((err) != NFSERR_STALE_STATEID) && \
540 ((err) != NFSERR_BAD_STATEID) && \
541 ((err) != NFSERR_BAD_SEQID) && \
542 ((err) != NFSERR_BAD_XDR) && \
543 ((err) != NFSERR_RESOURCE) && \
544 ((err) != NFSERR_NOFILEHANDLE))
545
546enum nfs4_client_state {
547 NFS4CLNT_OK = 0,
548};
549
550/*
551 * The nfs4_client identifies our client state to the server.
552 */
553struct nfs4_client {
554 struct list_head cl_servers; /* Global list of servers */
555 struct in_addr cl_addr; /* Server identifier */
556 u64 cl_clientid; /* constant */
557 nfs4_verifier cl_confirm;
558 unsigned long cl_state;
559
560 u32 cl_lockowner_id;
561
562 /*
563 * The following rwsem ensures exclusive access to the server
564 * while we recover the state following a lease expiration.
565 */
566 struct rw_semaphore cl_sem;
567
568 struct list_head cl_delegations;
569 struct list_head cl_state_owners;
570 struct list_head cl_unused;
571 int cl_nunused;
572 spinlock_t cl_lock;
573 atomic_t cl_count;
574
575 struct rpc_clnt * cl_rpcclient;
576 struct rpc_cred * cl_cred;
577
578 struct list_head cl_superblocks; /* List of nfs_server structs */
579
580 unsigned long cl_lease_time;
581 unsigned long cl_last_renewal;
582 struct work_struct cl_renewd;
583 struct work_struct cl_recoverd;
584
585 wait_queue_head_t cl_waitq;
586 struct rpc_wait_queue cl_rpcwaitq;
587
588 /* used for the setclientid verifier */
589 struct timespec cl_boot_time;
590
591 /* idmapper */
592 struct idmap * cl_idmap;
593
594 /* Our own IP address, as a null-terminated string.
595 * This is used to generate the clientid, and the callback address.
596 */
597 char cl_ipaddr[16];
598 unsigned char cl_id_uniquifier;
599};
600
601/*
602 * NFS4 state_owners and lock_owners are simply labels for ordered
603 * sequences of RPC calls. Their sole purpose is to provide once-only
604 * semantics by allowing the server to identify replayed requests.
605 *
606 * The ->so_sema is held during all state_owner seqid-mutating operations:
607 * OPEN, OPEN_DOWNGRADE, and CLOSE. Its purpose is to properly serialize
608 * so_seqid.
609 */
610struct nfs4_state_owner {
611 struct list_head so_list; /* per-clientid list of state_owners */
612 struct nfs4_client *so_client;
613 u32 so_id; /* 32-bit identifier, unique */
614 struct semaphore so_sema;
615 u32 so_seqid; /* protected by so_sema */
616 atomic_t so_count;
617
618 struct rpc_cred *so_cred; /* Associated cred */
619 struct list_head so_states;
620 struct list_head so_delegations;
621};
622
623/*
624 * struct nfs4_state maintains the client-side state for a given
625 * (state_owner,inode) tuple (OPEN) or state_owner (LOCK).
626 *
627 * OPEN:
628 * In order to know when to OPEN_DOWNGRADE or CLOSE the state on the server,
629 * we need to know how many files are open for reading or writing on a
630 * given inode. This information too is stored here.
631 *
632 * LOCK: one nfs4_state (LOCK) to hold the lock stateid nfs4_state(OPEN)
633 */
634
635struct nfs4_lock_state {
636 struct list_head ls_locks; /* Other lock stateids */
637 fl_owner_t ls_owner; /* POSIX lock owner */
638#define NFS_LOCK_INITIALIZED 1
639 int ls_flags;
640 u32 ls_seqid;
641 u32 ls_id;
642 nfs4_stateid ls_stateid;
643 atomic_t ls_count;
644};
645
646/* bits for nfs4_state->flags */
647enum {
648 LK_STATE_IN_USE,
649 NFS_DELEGATED_STATE,
650};
651
652struct nfs4_state {
653 struct list_head open_states; /* List of states for the same state_owner */
654 struct list_head inode_states; /* List of states for the same inode */
655 struct list_head lock_states; /* List of subservient lock stateids */
656
657 struct nfs4_state_owner *owner; /* Pointer to the open owner */
658 struct inode *inode; /* Pointer to the inode */
659
660 unsigned long flags; /* Do we hold any locks? */
661 struct semaphore lock_sema; /* Serializes file locking operations */
662 rwlock_t state_lock; /* Protects the lock_states list */
663
664 nfs4_stateid stateid;
665
666 unsigned int nreaders;
667 unsigned int nwriters;
668 int state; /* State on the server (R,W, or RW) */
669 atomic_t count;
670};
671
672
673struct nfs4_exception {
674 long timeout;
675 int retry;
676};
677
678struct nfs4_state_recovery_ops {
679 int (*recover_open)(struct nfs4_state_owner *, struct nfs4_state *);
680 int (*recover_lock)(struct nfs4_state *, struct file_lock *);
681};
682
683extern struct dentry_operations nfs4_dentry_operations;
684extern struct inode_operations nfs4_dir_inode_operations;
685
686/* nfs4proc.c */
687extern int nfs4_map_errors(int err);
688extern int nfs4_proc_setclientid(struct nfs4_client *, u32, unsigned short);
689extern int nfs4_proc_setclientid_confirm(struct nfs4_client *);
690extern int nfs4_proc_async_renew(struct nfs4_client *);
691extern int nfs4_proc_renew(struct nfs4_client *);
692extern int nfs4_do_close(struct inode *inode, struct nfs4_state *state, mode_t mode);
693extern struct inode *nfs4_atomic_open(struct inode *, struct dentry *, struct nameidata *);
694extern int nfs4_open_revalidate(struct inode *, struct dentry *, int);
695
696extern struct nfs4_state_recovery_ops nfs4_reboot_recovery_ops;
697extern struct nfs4_state_recovery_ops nfs4_network_partition_recovery_ops;
698
699/* nfs4renewd.c */
700extern void nfs4_schedule_state_renewal(struct nfs4_client *);
701extern void nfs4_renewd_prepare_shutdown(struct nfs_server *);
702extern void nfs4_kill_renewd(struct nfs4_client *);
703
704/* nfs4state.c */
705extern void init_nfsv4_state(struct nfs_server *);
706extern void destroy_nfsv4_state(struct nfs_server *);
707extern struct nfs4_client *nfs4_get_client(struct in_addr *);
708extern void nfs4_put_client(struct nfs4_client *clp);
709extern int nfs4_init_client(struct nfs4_client *clp);
710extern struct nfs4_client *nfs4_find_client(struct in_addr *);
711extern u32 nfs4_alloc_lockowner_id(struct nfs4_client *);
712
713extern struct nfs4_state_owner * nfs4_get_state_owner(struct nfs_server *, struct rpc_cred *);
714extern void nfs4_put_state_owner(struct nfs4_state_owner *);
715extern void nfs4_drop_state_owner(struct nfs4_state_owner *);
716extern struct nfs4_state * nfs4_get_open_state(struct inode *, struct nfs4_state_owner *);
717extern void nfs4_put_open_state(struct nfs4_state *);
718extern void nfs4_close_state(struct nfs4_state *, mode_t);
719extern struct nfs4_state *nfs4_find_state(struct inode *, struct rpc_cred *, mode_t mode);
720extern void nfs4_increment_seqid(int status, struct nfs4_state_owner *sp);
721extern void nfs4_schedule_state_recovery(struct nfs4_client *);
722extern struct nfs4_lock_state *nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t);
723extern struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t);
724extern void nfs4_put_lock_state(struct nfs4_lock_state *state);
725extern void nfs4_increment_lock_seqid(int status, struct nfs4_lock_state *ls);
726extern void nfs4_notify_setlk(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *);
727extern void nfs4_notify_unlck(struct nfs4_state *, struct file_lock *, struct nfs4_lock_state *);
728extern void nfs4_copy_stateid(nfs4_stateid *, struct nfs4_state *, fl_owner_t);
729
730
731
732struct nfs4_mount_data;
733#else
734#define init_nfsv4_state(server) do { } while (0)
735#define destroy_nfsv4_state(server) do { } while (0)
736#define nfs4_put_state_owner(inode, owner) do { } while (0)
737#define nfs4_put_open_state(state) do { } while (0)
738#define nfs4_close_state(a, b) do { } while (0)
739#define nfs4_renewd_prepare_shutdown(server) do { } while (0)
740#endif
741
742#endif /* __KERNEL__ */ 560#endif /* __KERNEL__ */
743 561
744/* 562/*
diff --git a/include/linux/nfs_fs_i.h b/include/linux/nfs_fs_i.h
index e9a749588a7b..e2c18dabff86 100644
--- a/include/linux/nfs_fs_i.h
+++ b/include/linux/nfs_fs_i.h
@@ -16,6 +16,11 @@ struct nfs_lock_info {
16 struct nlm_lockowner *owner; 16 struct nlm_lockowner *owner;
17}; 17};
18 18
19struct nfs4_lock_state;
20struct nfs4_lock_info {
21 struct nfs4_lock_state *owner;
22};
23
19/* 24/*
20 * Lock flag values 25 * Lock flag values
21 */ 26 */
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index fc51645d61ee..3d3a305488cf 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -10,6 +10,7 @@
10struct nfs_server { 10struct nfs_server {
11 struct rpc_clnt * client; /* RPC client handle */ 11 struct rpc_clnt * client; /* RPC client handle */
12 struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */ 12 struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */
13 struct rpc_clnt * client_acl; /* ACL RPC client handle */
13 struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */ 14 struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */
14 struct backing_dev_info backing_dev_info; 15 struct backing_dev_info backing_dev_info;
15 int flags; /* various flags */ 16 int flags; /* various flags */
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index 0071428231f9..659c75438454 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -58,6 +58,7 @@ struct nfs_mount_data {
58#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */ 58#define NFS_MOUNT_KERBEROS 0x0100 /* 3 */
59#define NFS_MOUNT_NONLM 0x0200 /* 3 */ 59#define NFS_MOUNT_NONLM 0x0200 /* 3 */
60#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ 60#define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */
61#define NFS_MOUNT_NOACL 0x0800 /* 4 */
61#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ 62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
62#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ 63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
63#define NFS_MOUNT_FLAGMASK 0xFFFF 64#define NFS_MOUNT_FLAGMASK 0xFFFF
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 39e4895bcdb4..da2e077b65e2 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -20,12 +20,19 @@
20#include <asm/atomic.h> 20#include <asm/atomic.h>
21 21
22/* 22/*
23 * Valid flags for the radix tree
24 */
25#define NFS_PAGE_TAG_DIRTY 0
26#define NFS_PAGE_TAG_WRITEBACK 1
27
28/*
23 * Valid flags for a dirty buffer 29 * Valid flags for a dirty buffer
24 */ 30 */
25#define PG_BUSY 0 31#define PG_BUSY 0
26#define PG_NEED_COMMIT 1 32#define PG_NEED_COMMIT 1
27#define PG_NEED_RESCHED 2 33#define PG_NEED_RESCHED 2
28 34
35struct nfs_inode;
29struct nfs_page { 36struct nfs_page {
30 struct list_head wb_list, /* Defines state of page: */ 37 struct list_head wb_list, /* Defines state of page: */
31 *wb_list_head; /* read/write/commit */ 38 *wb_list_head; /* read/write/commit */
@@ -54,14 +61,17 @@ extern void nfs_clear_request(struct nfs_page *req);
54extern void nfs_release_request(struct nfs_page *req); 61extern void nfs_release_request(struct nfs_page *req);
55 62
56 63
57extern void nfs_list_add_request(struct nfs_page *, struct list_head *); 64extern int nfs_scan_lock_dirty(struct nfs_inode *nfsi, struct list_head *dst,
58 65 unsigned long idx_start, unsigned int npages);
59extern int nfs_scan_list(struct list_head *, struct list_head *, 66extern int nfs_scan_list(struct list_head *, struct list_head *,
60 unsigned long, unsigned int); 67 unsigned long, unsigned int);
61extern int nfs_coalesce_requests(struct list_head *, struct list_head *, 68extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
62 unsigned int); 69 unsigned int);
63extern int nfs_wait_on_request(struct nfs_page *); 70extern int nfs_wait_on_request(struct nfs_page *);
64extern void nfs_unlock_request(struct nfs_page *req); 71extern void nfs_unlock_request(struct nfs_page *req);
72extern int nfs_set_page_writeback_locked(struct nfs_page *req);
73extern void nfs_clear_page_writeback(struct nfs_page *req);
74
65 75
66/* 76/*
67 * Lock the page of an asynchronous request without incrementing the wb_count 77 * Lock the page of an asynchronous request without incrementing the wb_count
@@ -86,6 +96,18 @@ nfs_lock_request(struct nfs_page *req)
86 return 1; 96 return 1;
87} 97}
88 98
99/**
100 * nfs_list_add_request - Insert a request into a list
101 * @req: request
102 * @head: head of list into which to insert the request.
103 */
104static inline void
105nfs_list_add_request(struct nfs_page *req, struct list_head *head)
106{
107 list_add_tail(&req->wb_list, head);
108 req->wb_list_head = head;
109}
110
89 111
90/** 112/**
91 * nfs_list_remove_request - Remove a request from its wb_list 113 * nfs_list_remove_request - Remove a request from its wb_list
@@ -96,10 +118,6 @@ nfs_list_remove_request(struct nfs_page *req)
96{ 118{
97 if (list_empty(&req->wb_list)) 119 if (list_empty(&req->wb_list))
98 return; 120 return;
99 if (!NFS_WBACK_BUSY(req)) {
100 printk(KERN_ERR "NFS: unlocked request attempted removed from list!\n");
101 BUG();
102 }
103 list_del_init(&req->wb_list); 121 list_del_init(&req->wb_list);
104 req->wb_list_head = NULL; 122 req->wb_list_head = NULL;
105} 123}
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 47037d9521cb..a2bf6914ff1b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -2,6 +2,7 @@
2#define _LINUX_NFS_XDR_H 2#define _LINUX_NFS_XDR_H
3 3
4#include <linux/sunrpc/xprt.h> 4#include <linux/sunrpc/xprt.h>
5#include <linux/nfsacl.h>
5 6
6struct nfs4_fsid { 7struct nfs4_fsid {
7 __u64 major; 8 __u64 major;
@@ -326,6 +327,20 @@ struct nfs_setattrargs {
326 const u32 * bitmask; 327 const u32 * bitmask;
327}; 328};
328 329
330struct nfs_setaclargs {
331 struct nfs_fh * fh;
332 size_t acl_len;
333 unsigned int acl_pgbase;
334 struct page ** acl_pages;
335};
336
337struct nfs_getaclargs {
338 struct nfs_fh * fh;
339 size_t acl_len;
340 unsigned int acl_pgbase;
341 struct page ** acl_pages;
342};
343
329struct nfs_setattrres { 344struct nfs_setattrres {
330 struct nfs_fattr * fattr; 345 struct nfs_fattr * fattr;
331 const struct nfs_server * server; 346 const struct nfs_server * server;
@@ -354,6 +369,20 @@ struct nfs_readdirargs {
354 struct page ** pages; 369 struct page ** pages;
355}; 370};
356 371
372struct nfs3_getaclargs {
373 struct nfs_fh * fh;
374 int mask;
375 struct page ** pages;
376};
377
378struct nfs3_setaclargs {
379 struct inode * inode;
380 int mask;
381 struct posix_acl * acl_access;
382 struct posix_acl * acl_default;
383 struct page ** pages;
384};
385
357struct nfs_diropok { 386struct nfs_diropok {
358 struct nfs_fh * fh; 387 struct nfs_fh * fh;
359 struct nfs_fattr * fattr; 388 struct nfs_fattr * fattr;
@@ -477,6 +506,15 @@ struct nfs3_readdirres {
477 int plus; 506 int plus;
478}; 507};
479 508
509struct nfs3_getaclres {
510 struct nfs_fattr * fattr;
511 int mask;
512 unsigned int acl_access_count;
513 unsigned int acl_default_count;
514 struct posix_acl * acl_access;
515 struct posix_acl * acl_default;
516};
517
480#ifdef CONFIG_NFS_V4 518#ifdef CONFIG_NFS_V4
481 519
482typedef u64 clientid4; 520typedef u64 clientid4;
@@ -667,6 +705,7 @@ struct nfs_rpc_ops {
667 int version; /* Protocol version */ 705 int version; /* Protocol version */
668 struct dentry_operations *dentry_ops; 706 struct dentry_operations *dentry_ops;
669 struct inode_operations *dir_inode_ops; 707 struct inode_operations *dir_inode_ops;
708 struct inode_operations *file_inode_ops;
670 709
671 int (*getroot) (struct nfs_server *, struct nfs_fh *, 710 int (*getroot) (struct nfs_server *, struct nfs_fh *,
672 struct nfs_fsinfo *); 711 struct nfs_fsinfo *);
@@ -713,6 +752,7 @@ struct nfs_rpc_ops {
713 int (*file_open) (struct inode *, struct file *); 752 int (*file_open) (struct inode *, struct file *);
714 int (*file_release) (struct inode *, struct file *); 753 int (*file_release) (struct inode *, struct file *);
715 int (*lock)(struct file *, int, struct file_lock *); 754 int (*lock)(struct file *, int, struct file_lock *);
755 void (*clear_acl_cache)(struct inode *);
716}; 756};
717 757
718/* 758/*
@@ -732,4 +772,7 @@ extern struct rpc_version nfs_version2;
732extern struct rpc_version nfs_version3; 772extern struct rpc_version nfs_version3;
733extern struct rpc_version nfs_version4; 773extern struct rpc_version nfs_version4;
734 774
775extern struct rpc_version nfsacl_version3;
776extern struct rpc_program nfsacl_program;
777
735#endif 778#endif
diff --git a/include/linux/nfsacl.h b/include/linux/nfsacl.h
new file mode 100644
index 000000000000..54487a99beb8
--- /dev/null
+++ b/include/linux/nfsacl.h
@@ -0,0 +1,58 @@
1/*
2 * File: linux/nfsacl.h
3 *
4 * (C) 2003 Andreas Gruenbacher <agruen@suse.de>
5 */
6#ifndef __LINUX_NFSACL_H
7#define __LINUX_NFSACL_H
8
9#define NFS_ACL_PROGRAM 100227
10
11#define ACLPROC2_GETACL 1
12#define ACLPROC2_SETACL 2
13#define ACLPROC2_GETATTR 3
14#define ACLPROC2_ACCESS 4
15
16#define ACLPROC3_GETACL 1
17#define ACLPROC3_SETACL 2
18
19
20/* Flags for the getacl/setacl mode */
21#define NFS_ACL 0x0001
22#define NFS_ACLCNT 0x0002
23#define NFS_DFACL 0x0004
24#define NFS_DFACLCNT 0x0008
25
26/* Flag for Default ACL entries */
27#define NFS_ACL_DEFAULT 0x1000
28
29#ifdef __KERNEL__
30
31#include <linux/posix_acl.h>
32
33/* Maximum number of ACL entries over NFS */
34#define NFS_ACL_MAX_ENTRIES 1024
35
36#define NFSACL_MAXWORDS (2*(2+3*NFS_ACL_MAX_ENTRIES))
37#define NFSACL_MAXPAGES ((2*(8+12*NFS_ACL_MAX_ENTRIES) + PAGE_SIZE-1) \
38 >> PAGE_SHIFT)
39
40static inline unsigned int
41nfsacl_size(struct posix_acl *acl_access, struct posix_acl *acl_default)
42{
43 unsigned int w = 16;
44 w += max(acl_access ? (int)acl_access->a_count : 3, 4) * 12;
45 if (acl_default)
46 w += max((int)acl_default->a_count, 4) * 12;
47 return w;
48}
49
50extern unsigned int
51nfsacl_encode(struct xdr_buf *buf, unsigned int base, struct inode *inode,
52 struct posix_acl *acl, int encode_entries, int typeflag);
53extern unsigned int
54nfsacl_decode(struct xdr_buf *buf, unsigned int base, unsigned int *aclcnt,
55 struct posix_acl **pacl);
56
57#endif /* __KERNEL__ */
58#endif /* __LINUX_NFSACL_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 8f85d9a59607..6d5a24f3fc6d 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -15,6 +15,7 @@
15#include <linux/unistd.h> 15#include <linux/unistd.h>
16#include <linux/dirent.h> 16#include <linux/dirent.h>
17#include <linux/fs.h> 17#include <linux/fs.h>
18#include <linux/posix_acl.h>
18#include <linux/mount.h> 19#include <linux/mount.h>
19 20
20#include <linux/nfsd/debug.h> 21#include <linux/nfsd/debug.h>
@@ -123,21 +124,41 @@ int nfsd_statfs(struct svc_rqst *, struct svc_fh *,
123 124
124int nfsd_notify_change(struct inode *, struct iattr *); 125int nfsd_notify_change(struct inode *, struct iattr *);
125int nfsd_permission(struct svc_export *, struct dentry *, int); 126int nfsd_permission(struct svc_export *, struct dentry *, int);
127void nfsd_sync_dir(struct dentry *dp);
128
129#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
130#ifdef CONFIG_NFSD_V2_ACL
131extern struct svc_version nfsd_acl_version2;
132#else
133#define nfsd_acl_version2 NULL
134#endif
135#ifdef CONFIG_NFSD_V3_ACL
136extern struct svc_version nfsd_acl_version3;
137#else
138#define nfsd_acl_version3 NULL
139#endif
140struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int);
141int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *);
142#endif
126 143
127 144
128/* 145/*
129 * NFSv4 State 146 * NFSv4 State
130 */ 147 */
131#ifdef CONFIG_NFSD_V4 148#ifdef CONFIG_NFSD_V4
132int nfs4_state_init(void); 149void nfs4_state_init(void);
150int nfs4_state_start(void);
133void nfs4_state_shutdown(void); 151void nfs4_state_shutdown(void);
134time_t nfs4_lease_time(void); 152time_t nfs4_lease_time(void);
135void nfs4_reset_lease(time_t leasetime); 153void nfs4_reset_lease(time_t leasetime);
154int nfs4_reset_recoverydir(char *recdir);
136#else 155#else
137static inline int nfs4_state_init(void){return 0;} 156static inline void nfs4_state_init(void){};
157static inline int nfs4_state_start(void){return 0;}
138static inline void nfs4_state_shutdown(void){} 158static inline void nfs4_state_shutdown(void){}
139static inline time_t nfs4_lease_time(void){return 0;} 159static inline time_t nfs4_lease_time(void){return 0;}
140static inline void nfs4_reset_lease(time_t leasetime){} 160static inline void nfs4_reset_lease(time_t leasetime){}
161static inline int nfs4_reset_recoverydir(char *recdir) {return 0;}
141#endif 162#endif
142 163
143/* 164/*
@@ -210,6 +231,7 @@ void nfsd_lockd_shutdown(void);
210#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD) 231#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD)
211#define nfserr_badname __constant_htonl(NFSERR_BADNAME) 232#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
212#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) 233#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
234#define nfserr_locked __constant_htonl(NFSERR_LOCKED)
213 235
214/* error codes for internal use */ 236/* error codes for internal use */
215/* if a request fails due to kmalloc failure, it gets dropped. 237/* if a request fails due to kmalloc failure, it gets dropped.
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index b6b2fe1e7c63..8bf23cf8b603 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -61,11 +61,6 @@ typedef struct {
61#define si_stateownerid si_opaque.so_stateownerid 61#define si_stateownerid si_opaque.so_stateownerid
62#define si_fileid si_opaque.so_fileid 62#define si_fileid si_opaque.so_fileid
63 63
64extern stateid_t zerostateid;
65extern stateid_t onestateid;
66
67#define ZERO_STATEID(stateid) (!memcmp((stateid), &zerostateid, sizeof(stateid_t)))
68#define ONE_STATEID(stateid) (!memcmp((stateid), &onestateid, sizeof(stateid_t)))
69 64
70struct nfs4_cb_recall { 65struct nfs4_cb_recall {
71 u32 cbr_ident; 66 u32 cbr_ident;
@@ -77,8 +72,8 @@ struct nfs4_cb_recall {
77}; 72};
78 73
79struct nfs4_delegation { 74struct nfs4_delegation {
80 struct list_head dl_del_perfile; /* nfs4_file->fi_del_perfile */ 75 struct list_head dl_perfile;
81 struct list_head dl_del_perclnt; /* nfs4_client->cl_del_perclnt*/ 76 struct list_head dl_perclnt;
82 struct list_head dl_recall_lru; /* delegation recalled */ 77 struct list_head dl_recall_lru; /* delegation recalled */
83 atomic_t dl_count; /* ref count */ 78 atomic_t dl_count; /* ref count */
84 struct nfs4_client *dl_client; 79 struct nfs4_client *dl_client;
@@ -97,7 +92,6 @@ struct nfs4_delegation {
97/* client delegation callback info */ 92/* client delegation callback info */
98struct nfs4_callback { 93struct nfs4_callback {
99 /* SETCLIENTID info */ 94 /* SETCLIENTID info */
100 u32 cb_parsed; /* addr parsed */
101 u32 cb_addr; 95 u32 cb_addr;
102 unsigned short cb_port; 96 unsigned short cb_port;
103 u32 cb_prog; 97 u32 cb_prog;
@@ -109,6 +103,8 @@ struct nfs4_callback {
109 struct rpc_clnt * cb_client; 103 struct rpc_clnt * cb_client;
110}; 104};
111 105
106#define HEXDIR_LEN 33 /* hex version of 16 byte md5 of cl_name plus '\0' */
107
112/* 108/*
113 * struct nfs4_client - one per client. Clientids live here. 109 * struct nfs4_client - one per client. Clientids live here.
114 * o Each nfs4_client is hashed by clientid. 110 * o Each nfs4_client is hashed by clientid.
@@ -122,10 +118,11 @@ struct nfs4_callback {
122struct nfs4_client { 118struct nfs4_client {
123 struct list_head cl_idhash; /* hash by cl_clientid.id */ 119 struct list_head cl_idhash; /* hash by cl_clientid.id */
124 struct list_head cl_strhash; /* hash by cl_name */ 120 struct list_head cl_strhash; /* hash by cl_name */
125 struct list_head cl_perclient; /* list: stateowners */ 121 struct list_head cl_openowners;
126 struct list_head cl_del_perclnt; /* list: delegations */ 122 struct list_head cl_delegations;
127 struct list_head cl_lru; /* tail queue */ 123 struct list_head cl_lru; /* tail queue */
128 struct xdr_netobj cl_name; /* id generated by client */ 124 struct xdr_netobj cl_name; /* id generated by client */
125 char cl_recdir[HEXDIR_LEN]; /* recovery dir */
129 nfs4_verifier cl_verifier; /* generated by client */ 126 nfs4_verifier cl_verifier; /* generated by client */
130 time_t cl_time; /* time of last lease renewal */ 127 time_t cl_time; /* time of last lease renewal */
131 u32 cl_addr; /* client ipaddress */ 128 u32 cl_addr; /* client ipaddress */
@@ -134,6 +131,7 @@ struct nfs4_client {
134 nfs4_verifier cl_confirm; /* generated by server */ 131 nfs4_verifier cl_confirm; /* generated by server */
135 struct nfs4_callback cl_callback; /* callback info */ 132 struct nfs4_callback cl_callback; /* callback info */
136 atomic_t cl_count; /* ref count */ 133 atomic_t cl_count; /* ref count */
134 u32 cl_firststate; /* recovery dir creation */
137}; 135};
138 136
139/* struct nfs4_client_reset 137/* struct nfs4_client_reset
@@ -143,7 +141,7 @@ struct nfs4_client {
143 */ 141 */
144struct nfs4_client_reclaim { 142struct nfs4_client_reclaim {
145 struct list_head cr_strhash; /* hash by cr_name */ 143 struct list_head cr_strhash; /* hash by cr_name */
146 struct xdr_netobj cr_name; /* id generated by client */ 144 char cr_recdir[HEXDIR_LEN]; /* recover dir */
147}; 145};
148 146
149static inline void 147static inline void
@@ -197,15 +195,17 @@ struct nfs4_stateowner {
197 struct kref so_ref; 195 struct kref so_ref;
198 struct list_head so_idhash; /* hash by so_id */ 196 struct list_head so_idhash; /* hash by so_id */
199 struct list_head so_strhash; /* hash by op_name */ 197 struct list_head so_strhash; /* hash by op_name */
200 struct list_head so_perclient; /* nfs4_client->cl_perclient */ 198 struct list_head so_perclient;
201 struct list_head so_perfilestate; /* list: nfs4_stateid */ 199 struct list_head so_stateids;
202 struct list_head so_perlockowner; /* nfs4_stateid->st_perlockowner */ 200 struct list_head so_perstateid; /* for lockowners only */
203 struct list_head so_close_lru; /* tail queue */ 201 struct list_head so_close_lru; /* tail queue */
204 time_t so_time; /* time of placement on so_close_lru */ 202 time_t so_time; /* time of placement on so_close_lru */
205 int so_is_open_owner; /* 1=openowner,0=lockowner */ 203 int so_is_open_owner; /* 1=openowner,0=lockowner */
206 u32 so_id; 204 u32 so_id;
207 struct nfs4_client * so_client; 205 struct nfs4_client * so_client;
208 u32 so_seqid; 206 /* after increment in ENCODE_SEQID_OP_TAIL, represents the next
207 * sequence id expected from the client: */
208 u32 so_seqid;
209 struct xdr_netobj so_owner; /* open owner name */ 209 struct xdr_netobj so_owner; /* open owner name */
210 int so_confirmed; /* successful OPEN_CONFIRM? */ 210 int so_confirmed; /* successful OPEN_CONFIRM? */
211 struct nfs4_replay so_replay; 211 struct nfs4_replay so_replay;
@@ -217,9 +217,10 @@ struct nfs4_stateowner {
217* share_acces, share_deny on the file. 217* share_acces, share_deny on the file.
218*/ 218*/
219struct nfs4_file { 219struct nfs4_file {
220 struct kref fi_ref;
220 struct list_head fi_hash; /* hash by "struct inode *" */ 221 struct list_head fi_hash; /* hash by "struct inode *" */
221 struct list_head fi_perfile; /* list: nfs4_stateid */ 222 struct list_head fi_stateids;
222 struct list_head fi_del_perfile; /* list: nfs4_delegation */ 223 struct list_head fi_delegations;
223 struct inode *fi_inode; 224 struct inode *fi_inode;
224 u32 fi_id; /* used with stateowner->so_id 225 u32 fi_id; /* used with stateowner->so_id
225 * for stateid_hashtbl hash */ 226 * for stateid_hashtbl hash */
@@ -236,19 +237,24 @@ struct nfs4_file {
236* st_perlockowner: (open stateid) list of lock nfs4_stateowners 237* st_perlockowner: (open stateid) list of lock nfs4_stateowners
237* st_access_bmap: used only for open stateid 238* st_access_bmap: used only for open stateid
238* st_deny_bmap: used only for open stateid 239* st_deny_bmap: used only for open stateid
240* st_openstp: open stateid lock stateid was derived from
241*
242* XXX: open stateids and lock stateids have diverged sufficiently that
243* we should consider defining separate structs for the two cases.
239*/ 244*/
240 245
241struct nfs4_stateid { 246struct nfs4_stateid {
242 struct list_head st_hash; 247 struct list_head st_hash;
243 struct list_head st_perfile; 248 struct list_head st_perfile;
244 struct list_head st_perfilestate; 249 struct list_head st_perstateowner;
245 struct list_head st_perlockowner; 250 struct list_head st_lockowners;
246 struct nfs4_stateowner * st_stateowner; 251 struct nfs4_stateowner * st_stateowner;
247 struct nfs4_file * st_file; 252 struct nfs4_file * st_file;
248 stateid_t st_stateid; 253 stateid_t st_stateid;
249 struct file * st_vfs_file; 254 struct file * st_vfs_file;
250 unsigned long st_access_bmap; 255 unsigned long st_access_bmap;
251 unsigned long st_deny_bmap; 256 unsigned long st_deny_bmap;
257 struct nfs4_stateid * st_openstp;
252}; 258};
253 259
254/* flags for preprocess_seqid_op() */ 260/* flags for preprocess_seqid_op() */
@@ -267,12 +273,9 @@ struct nfs4_stateid {
267 ((err) != nfserr_stale_stateid) && \ 273 ((err) != nfserr_stale_stateid) && \
268 ((err) != nfserr_bad_stateid)) 274 ((err) != nfserr_bad_stateid))
269 275
270extern time_t nfs4_laundromat(void);
271extern int nfsd4_renew(clientid_t *clid); 276extern int nfsd4_renew(clientid_t *clid);
272extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 277extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
273 stateid_t *stateid, int flags, struct file **filp); 278 stateid_t *stateid, int flags, struct file **filp);
274extern int nfs4_share_conflict(struct svc_fh *current_fh,
275 unsigned int deny_type);
276extern void nfs4_lock_state(void); 279extern void nfs4_lock_state(void);
277extern void nfs4_unlock_state(void); 280extern void nfs4_unlock_state(void);
278extern int nfs4_in_grace(void); 281extern int nfs4_in_grace(void);
@@ -282,6 +285,15 @@ extern void nfs4_free_stateowner(struct kref *kref);
282extern void nfsd4_probe_callback(struct nfs4_client *clp); 285extern void nfsd4_probe_callback(struct nfs4_client *clp);
283extern void nfsd4_cb_recall(struct nfs4_delegation *dp); 286extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
284extern void nfs4_put_delegation(struct nfs4_delegation *dp); 287extern void nfs4_put_delegation(struct nfs4_delegation *dp);
288extern int nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
289extern void nfsd4_init_recdir(char *recdir_name);
290extern int nfsd4_recdir_load(void);
291extern void nfsd4_shutdown_recdir(void);
292extern int nfs4_client_to_reclaim(const char *name);
293extern int nfs4_has_reclaimed_state(const char *name);
294extern void nfsd4_recdir_purge_old(void);
295extern int nfsd4_create_clid_dir(struct nfs4_client *clp);
296extern void nfsd4_remove_clid_dir(struct nfs4_client *clp);
285 297
286static inline void 298static inline void
287nfs4_put_stateowner(struct nfs4_stateowner *so) 299nfs4_put_stateowner(struct nfs4_stateowner *so)
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index ecccef777dae..130d4f588a37 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -169,4 +169,8 @@ int nfssvc_encode_entry(struct readdir_cd *, const char *name,
169 169
170int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); 170int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *);
171 171
172/* Helper functions for NFSv2 ACL code */
173u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp);
174u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp);
175
172#endif /* LINUX_NFSD_H */ 176#endif /* LINUX_NFSD_H */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 0ae9e0ef5f68..21e18ce7ca63 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -110,6 +110,19 @@ struct nfsd3_commitargs {
110 __u32 count; 110 __u32 count;
111}; 111};
112 112
113struct nfsd3_getaclargs {
114 struct svc_fh fh;
115 int mask;
116};
117
118struct posix_acl;
119struct nfsd3_setaclargs {
120 struct svc_fh fh;
121 int mask;
122 struct posix_acl *acl_access;
123 struct posix_acl *acl_default;
124};
125
113struct nfsd3_attrstat { 126struct nfsd3_attrstat {
114 __u32 status; 127 __u32 status;
115 struct svc_fh fh; 128 struct svc_fh fh;
@@ -209,6 +222,14 @@ struct nfsd3_commitres {
209 struct svc_fh fh; 222 struct svc_fh fh;
210}; 223};
211 224
225struct nfsd3_getaclres {
226 __u32 status;
227 struct svc_fh fh;
228 int mask;
229 struct posix_acl *acl_access;
230 struct posix_acl *acl_default;
231};
232
212/* dummy type for release */ 233/* dummy type for release */
213struct nfsd3_fhandle_pair { 234struct nfsd3_fhandle_pair {
214 __u32 dummy; 235 __u32 dummy;
@@ -241,6 +262,7 @@ union nfsd3_xdrstore {
241 struct nfsd3_fsinfores fsinfores; 262 struct nfsd3_fsinfores fsinfores;
242 struct nfsd3_pathconfres pathconfres; 263 struct nfsd3_pathconfres pathconfres;
243 struct nfsd3_commitres commitres; 264 struct nfsd3_commitres commitres;
265 struct nfsd3_getaclres getaclres;
244}; 266};
245 267
246#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) 268#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
@@ -316,6 +338,10 @@ int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
316int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name, 338int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name,
317 int namlen, loff_t offset, ino_t ino, 339 int namlen, loff_t offset, ino_t ino,
318 unsigned int); 340 unsigned int);
341/* Helper functions for NFSv3 ACL code */
342u32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p,
343 struct svc_fh *fhp);
344u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp);
319 345
320 346
321#endif /* _LINUX_NFSD_XDR3_H */ 347#endif /* _LINUX_NFSD_XDR3_H */
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index a1f5ad0be1bf..4d24d65c0e88 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -210,6 +210,7 @@ struct nfsd4_open {
210 u32 op_share_access; /* request */ 210 u32 op_share_access; /* request */
211 u32 op_share_deny; /* request */ 211 u32 op_share_deny; /* request */
212 stateid_t op_stateid; /* response */ 212 stateid_t op_stateid; /* response */
213 u32 op_recall; /* recall */
213 struct nfsd4_change_info op_cinfo; /* response */ 214 struct nfsd4_change_info op_cinfo; /* response */
214 u32 op_rflags; /* response */ 215 u32 op_rflags; /* response */
215 int op_truncate; /* used during processing */ 216 int op_truncate; /* used during processing */
diff --git a/include/linux/nfsd_idmap.h b/include/linux/nfsd_idmap.h
index 9bb7f30e923b..e82746fcad14 100644
--- a/include/linux/nfsd_idmap.h
+++ b/include/linux/nfsd_idmap.h
@@ -43,8 +43,13 @@
43/* XXX from linux/nfs_idmap.h */ 43/* XXX from linux/nfs_idmap.h */
44#define IDMAP_NAMESZ 128 44#define IDMAP_NAMESZ 128
45 45
46#ifdef CONFIG_NFSD_V4
46void nfsd_idmap_init(void); 47void nfsd_idmap_init(void);
47void nfsd_idmap_shutdown(void); 48void nfsd_idmap_shutdown(void);
49#else
50static inline void nfsd_idmap_init(void) {};
51static inline void nfsd_idmap_shutdown(void) {};
52#endif
48 53
49int nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, __u32 *); 54int nfsd_map_name_to_uid(struct svc_rqst *, const char *, size_t, __u32 *);
50int nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, __u32 *); 55int nfsd_map_name_to_gid(struct svc_rqst *, const char *, size_t, __u32 *);
diff --git a/include/linux/numa.h b/include/linux/numa.h
index bd0c8c4e9a95..f0c539bd3cfc 100644
--- a/include/linux/numa.h
+++ b/include/linux/numa.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/config.h> 4#include <linux/config.h>
5 5
6#ifdef CONFIG_DISCONTIGMEM 6#ifndef CONFIG_FLATMEM
7#include <asm/numnodes.h> 7#include <asm/numnodes.h>
8#endif 8#endif
9 9
diff --git a/include/linux/nvram.h b/include/linux/nvram.h
index b031e41b5e0d..9189829c131c 100644
--- a/include/linux/nvram.h
+++ b/include/linux/nvram.h
@@ -20,8 +20,6 @@ extern void __nvram_write_byte(unsigned char c, int i);
20extern void nvram_write_byte(unsigned char c, int i); 20extern void nvram_write_byte(unsigned char c, int i);
21extern int __nvram_check_checksum(void); 21extern int __nvram_check_checksum(void);
22extern int nvram_check_checksum(void); 22extern int nvram_check_checksum(void);
23extern void __nvram_set_checksum(void);
24extern void nvram_set_checksum(void);
25#endif 23#endif
26 24
27#endif /* _LINUX_NVRAM_H */ 25#endif /* _LINUX_NVRAM_H */
diff --git a/include/linux/pci-dynids.h b/include/linux/pci-dynids.h
deleted file mode 100644
index 183b6b0de81c..000000000000
--- a/include/linux/pci-dynids.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * PCI defines and function prototypes
3 * Copyright 2003 Dell Inc.
4 * by Matt Domsch <Matt_Domsch@dell.com>
5 */
6
7#ifndef LINUX_PCI_DYNIDS_H
8#define LINUX_PCI_DYNIDS_H
9
10#include <linux/list.h>
11#include <linux/mod_devicetable.h>
12
13struct dynid {
14 struct list_head node;
15 struct pci_device_id id;
16};
17
18#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b5238bd18830..bc4c40000c0d 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -556,7 +556,8 @@ struct pci_dev {
556 /* keep track of device state */ 556 /* keep track of device state */
557 unsigned int is_enabled:1; /* pci_enable_device has been called */ 557 unsigned int is_enabled:1; /* pci_enable_device has been called */
558 unsigned int is_busmaster:1; /* device is busmaster */ 558 unsigned int is_busmaster:1; /* device is busmaster */
559 559 unsigned int no_msi:1; /* device may not use msi */
560
560 u32 saved_config_space[16]; /* config space saved at suspend time */ 561 u32 saved_config_space[16]; /* config space saved at suspend time */
561 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */ 562 struct bin_attribute *rom_attr; /* attribute descriptor for sysfs ROM entry */
562 int rom_attr_enabled; /* has display of the rom attribute been enabled? */ 563 int rom_attr_enabled; /* has display of the rom attribute been enabled? */
@@ -586,7 +587,7 @@ struct pci_dev {
586#define PCI_NUM_RESOURCES 11 587#define PCI_NUM_RESOURCES 11
587 588
588#ifndef PCI_BUS_NUM_RESOURCES 589#ifndef PCI_BUS_NUM_RESOURCES
589#define PCI_BUS_NUM_RESOURCES 4 590#define PCI_BUS_NUM_RESOURCES 8
590#endif 591#endif
591 592
592#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 593#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
@@ -734,16 +735,20 @@ void pcibios_update_irq(struct pci_dev *, int irq);
734/* Generic PCI functions used internally */ 735/* Generic PCI functions used internally */
735 736
736extern struct pci_bus *pci_find_bus(int domain, int busnr); 737extern struct pci_bus *pci_find_bus(int domain, int busnr);
738void pci_bus_add_devices(struct pci_bus *bus);
737struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata); 739struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
738static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata) 740static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
739{ 741{
740 return pci_scan_bus_parented(NULL, bus, ops, sysdata); 742 struct pci_bus *root_bus;
743 root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata);
744 if (root_bus)
745 pci_bus_add_devices(root_bus);
746 return root_bus;
741} 747}
742int pci_scan_slot(struct pci_bus *bus, int devfn); 748int pci_scan_slot(struct pci_bus *bus, int devfn);
743struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); 749struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
744unsigned int pci_scan_child_bus(struct pci_bus *bus); 750unsigned int pci_scan_child_bus(struct pci_bus *bus);
745void pci_bus_add_device(struct pci_dev *dev); 751void pci_bus_add_device(struct pci_dev *dev);
746void pci_bus_add_devices(struct pci_bus *bus);
747void pci_name_device(struct pci_dev *dev); 752void pci_name_device(struct pci_dev *dev);
748char *pci_class_name(u32 class); 753char *pci_class_name(u32 class);
749void pci_read_bridge_bases(struct pci_bus *child); 754void pci_read_bridge_bases(struct pci_bus *child);
@@ -856,7 +861,8 @@ int pci_register_driver(struct pci_driver *);
856void pci_unregister_driver(struct pci_driver *); 861void pci_unregister_driver(struct pci_driver *);
857void pci_remove_behind_bridge(struct pci_dev *); 862void pci_remove_behind_bridge(struct pci_dev *);
858struct pci_driver *pci_dev_driver(const struct pci_dev *); 863struct pci_driver *pci_dev_driver(const struct pci_dev *);
859const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); 864const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev);
865const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
860int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 866int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
861 867
862/* kmem_cache style wrapper around pci_alloc_consistent() */ 868/* kmem_cache style wrapper around pci_alloc_consistent() */
@@ -870,6 +876,15 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass
870#define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle) 876#define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle)
871#define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr) 877#define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr)
872 878
879enum pci_dma_burst_strategy {
880 PCI_DMA_BURST_INFINITY, /* make bursts as large as possible,
881 strategy_parameter is N/A */
882 PCI_DMA_BURST_BOUNDARY, /* disconnect at every strategy_parameter
883 byte boundaries */
884 PCI_DMA_BURST_MULTIPLE, /* disconnect at some multiple of
885 strategy_parameter byte boundaries */
886};
887
873#if defined(CONFIG_ISA) || defined(CONFIG_EISA) 888#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
874extern struct pci_dev *isa_bridge; 889extern struct pci_dev *isa_bridge;
875#endif 890#endif
@@ -957,6 +972,8 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
957 972
958#define isa_bridge ((struct pci_dev *)NULL) 973#define isa_bridge ((struct pci_dev *)NULL)
959 974
975#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
976
960#else 977#else
961 978
962/* 979/*
@@ -971,7 +988,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
971 return 0; 988 return 0;
972} 989}
973#endif 990#endif
974
975#endif /* !CONFIG_PCI */ 991#endif /* !CONFIG_PCI */
976 992
977/* these helpers provide future and backwards compatibility 993/* these helpers provide future and backwards compatibility
@@ -1016,6 +1032,20 @@ static inline char *pci_name(struct pci_dev *pdev)
1016#define pci_pretty_name(dev) "" 1032#define pci_pretty_name(dev) ""
1017#endif 1033#endif
1018 1034
1035
1036/* Some archs don't want to expose struct resource to userland as-is
1037 * in sysfs and /proc
1038 */
1039#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
1040static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
1041 const struct resource *rsrc, u64 *start, u64 *end)
1042{
1043 *start = rsrc->start;
1044 *end = rsrc->end;
1045}
1046#endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */
1047
1048
1019/* 1049/*
1020 * The world is not perfect and supplies us with broken PCI devices. 1050 * The world is not perfect and supplies us with broken PCI devices.
1021 * For at least a part of these bugs we need a work-around, so both 1051 * For at least a part of these bugs we need a work-around, so both
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 63e89e47b8e9..927ed487630d 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -62,6 +62,8 @@
62 62
63#define PCI_BASE_CLASS_SYSTEM 0x08 63#define PCI_BASE_CLASS_SYSTEM 0x08
64#define PCI_CLASS_SYSTEM_PIC 0x0800 64#define PCI_CLASS_SYSTEM_PIC 0x0800
65#define PCI_CLASS_SYSTEM_PIC_IOAPIC 0x080010
66#define PCI_CLASS_SYSTEM_PIC_IOXAPIC 0x080020
65#define PCI_CLASS_SYSTEM_DMA 0x0801 67#define PCI_CLASS_SYSTEM_DMA 0x0801
66#define PCI_CLASS_SYSTEM_TIMER 0x0802 68#define PCI_CLASS_SYSTEM_TIMER 0x0802
67#define PCI_CLASS_SYSTEM_RTC 0x0803 69#define PCI_CLASS_SYSTEM_RTC 0x0803
@@ -712,8 +714,9 @@
712#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290 714#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
713#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301 715#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
714#define PCI_DEVICE_ID_HP_CISSA 0x3220 716#define PCI_DEVICE_ID_HP_CISSA 0x3220
715#define PCI_DEVICE_ID_HP_CISSB 0x3230 717#define PCI_DEVICE_ID_HP_CISSB 0x3222
716#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 718#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
719#define PCI_DEVICE_ID_HP_CISSC 0x3230
717 720
718#define PCI_VENDOR_ID_PCTECH 0x1042 721#define PCI_VENDOR_ID_PCTECH 0x1042
719#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000 722#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
@@ -878,7 +881,7 @@
878#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e 881#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
879#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 882#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
880#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 883#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
881#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 884#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033
882#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034 885#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
883#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b 886#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
884#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e 887#define PCI_DEVICE_ID_APPLE_KEYLARGO_I 0x003e
@@ -908,6 +911,15 @@
908#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022 911#define PCI_DEVICE_ID_QLOGIC_ISP1022 0x1022
909#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100 912#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
910#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200 913#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
914#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
915#define PCI_DEVICE_ID_QLOGIC_ISP2312 0x2312
916#define PCI_DEVICE_ID_QLOGIC_ISP2322 0x2322
917#define PCI_DEVICE_ID_QLOGIC_ISP6312 0x6312
918#define PCI_DEVICE_ID_QLOGIC_ISP6322 0x6322
919#define PCI_DEVICE_ID_QLOGIC_ISP2422 0x2422
920#define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432
921#define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512
922#define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522
911 923
912#define PCI_VENDOR_ID_CYRIX 0x1078 924#define PCI_VENDOR_ID_CYRIX 0x1078
913#define PCI_DEVICE_ID_CYRIX_5510 0x0000 925#define PCI_DEVICE_ID_CYRIX_5510 0x0000
@@ -1008,6 +1020,7 @@
1008#define PCI_DEVICE_ID_PLX_SPCOM200 0x1103 1020#define PCI_DEVICE_ID_PLX_SPCOM200 0x1103
1009#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 1021#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
1010#define PCI_DEVICE_ID_PLX_R753 0x1152 1022#define PCI_DEVICE_ID_PLX_R753 0x1152
1023#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
1011#define PCI_DEVICE_ID_PLX_9030 0x9030 1024#define PCI_DEVICE_ID_PLX_9030 0x9030
1012#define PCI_DEVICE_ID_PLX_9050 0x9050 1025#define PCI_DEVICE_ID_PLX_9050 0x9050
1013#define PCI_DEVICE_ID_PLX_9060 0x9060 1026#define PCI_DEVICE_ID_PLX_9060 0x9060
@@ -1235,6 +1248,7 @@
1235#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265 1248#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1236#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 1249#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1237#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 1250#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1251#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
1238#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 1252#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
1239#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 1253#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
1240#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B 1254#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
@@ -1284,6 +1298,8 @@
1284#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 1298#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
1285#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C 1299#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
1286#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1300#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1301#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1302#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1287 1303
1288#define PCI_VENDOR_ID_IMS 0x10e0 1304#define PCI_VENDOR_ID_IMS 0x10e0
1289#define PCI_DEVICE_ID_IMS_8849 0x8849 1305#define PCI_DEVICE_ID_IMS_8849 0x8849
@@ -1564,10 +1580,12 @@
1564#define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 1580#define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211
1565#define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 1581#define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212
1566#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 1582#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
1583#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214
1567#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217 1584#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
1568#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220 1585#define PCI_DEVICE_ID_SERVERWORKS_OSB4USB 0x0220
1569#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB 1586#define PCI_DEVICE_ID_SERVERWORKS_CSB5USB PCI_DEVICE_ID_SERVERWORKS_OSB4USB
1570#define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221 1587#define PCI_DEVICE_ID_SERVERWORKS_CSB6USB 0x0221
1588#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
1571#define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225 1589#define PCI_DEVICE_ID_SERVERWORKS_GCLE 0x0225
1572#define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227 1590#define PCI_DEVICE_ID_SERVERWORKS_GCLE2 0x0227
1573#define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230 1591#define PCI_DEVICE_ID_SERVERWORKS_CSB5ISA 0x0230
@@ -1811,6 +1829,8 @@
1811#define PCI_VENDOR_ID_ITE 0x1283 1829#define PCI_VENDOR_ID_ITE 0x1283
1812#define PCI_DEVICE_ID_ITE_IT8172G 0x8172 1830#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
1813#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801 1831#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
1832#define PCI_DEVICE_ID_ITE_8211 0x8211
1833#define PCI_DEVICE_ID_ITE_8212 0x8212
1814#define PCI_DEVICE_ID_ITE_8872 0x8872 1834#define PCI_DEVICE_ID_ITE_8872 0x8872
1815#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 1835#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
1816 1836
@@ -1863,6 +1883,7 @@
1863#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001 1883#define PCI_DEVICE_ID_CBOARDS_DAS1602_16 0x0001
1864 1884
1865#define PCI_VENDOR_ID_SIIG 0x131f 1885#define PCI_VENDOR_ID_SIIG 0x131f
1886#define PCI_SUBVENDOR_ID_SIIG 0x131f
1866#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000 1887#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000
1867#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001 1888#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001
1868#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002 1889#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002
@@ -1900,6 +1921,7 @@
1900#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060 1921#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060
1901#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061 1922#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061
1902#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062 1923#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062
1924#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
1903 1925
1904#define PCI_VENDOR_ID_RADISYS 0x1331 1926#define PCI_VENDOR_ID_RADISYS 0x1331
1905#define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030 1927#define PCI_DEVICE_ID_RADISYS_ENP2611 0x0030
@@ -2087,6 +2109,8 @@
2087#define PCI_DEVICE_ID_TIGON3_5721 0x1659 2109#define PCI_DEVICE_ID_TIGON3_5721 0x1659
2088#define PCI_DEVICE_ID_TIGON3_5705M 0x165d 2110#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
2089#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e 2111#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
2112#define PCI_DEVICE_ID_TIGON3_5780 0x166a
2113#define PCI_DEVICE_ID_TIGON3_5780S 0x166b
2090#define PCI_DEVICE_ID_TIGON3_5705F 0x166e 2114#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
2091#define PCI_DEVICE_ID_TIGON3_5750 0x1676 2115#define PCI_DEVICE_ID_TIGON3_5750 0x1676
2092#define PCI_DEVICE_ID_TIGON3_5751 0x1677 2116#define PCI_DEVICE_ID_TIGON3_5751 0x1677
@@ -2161,6 +2185,9 @@
2161#define PCI_VENDOR_ID_SIBYTE 0x166d 2185#define PCI_VENDOR_ID_SIBYTE 0x166d
2162#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2186#define PCI_DEVICE_ID_BCM1250_HT 0x0002
2163 2187
2188#define PCI_VENDOR_ID_NETCELL 0x169c
2189#define PCI_DEVICE_ID_REVOLUTION 0x0044
2190
2164#define PCI_VENDOR_ID_LINKSYS 0x1737 2191#define PCI_VENDOR_ID_LINKSYS 0x1737
2165#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032 2192#define PCI_DEVICE_ID_LINKSYS_EG1032 0x1032
2166#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064 2193#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
@@ -2258,6 +2285,11 @@
2258#define PCI_VENDOR_ID_INTEL 0x8086 2285#define PCI_VENDOR_ID_INTEL 0x8086
2259#define PCI_DEVICE_ID_INTEL_EESSC 0x0008 2286#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
2260#define PCI_DEVICE_ID_INTEL_21145 0x0039 2287#define PCI_DEVICE_ID_INTEL_21145 0x0039
2288#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320
2289#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321
2290#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329
2291#define PCI_DEVICE_ID_INTEL_PXH_1 0x032A
2292#define PCI_DEVICE_ID_INTEL_PXHV 0x032C
2261#define PCI_DEVICE_ID_INTEL_82375 0x0482 2293#define PCI_DEVICE_ID_INTEL_82375 0x0482
2262#define PCI_DEVICE_ID_INTEL_82424 0x0483 2294#define PCI_DEVICE_ID_INTEL_82424 0x0483
2263#define PCI_DEVICE_ID_INTEL_82378 0x0484 2295#define PCI_DEVICE_ID_INTEL_82378 0x0484
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index d2aa214d6803..bd2c5a2bbbf5 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -276,6 +276,7 @@ struct tc_rsvp_pinfo
276 __u8 protocol; 276 __u8 protocol;
277 __u8 tunnelid; 277 __u8 tunnelid;
278 __u8 tunnelhdr; 278 __u8 tunnelhdr;
279 __u8 pad;
279}; 280};
280 281
281/* ROUTE filter */ 282/* ROUTE filter */
@@ -408,6 +409,7 @@ enum
408 TCF_EM_NBYTE, 409 TCF_EM_NBYTE,
409 TCF_EM_U32, 410 TCF_EM_U32,
410 TCF_EM_META, 411 TCF_EM_META,
412 TCF_EM_TEXT,
411 __TCF_EM_MAX 413 __TCF_EM_MAX
412}; 414};
413 415
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 1d9da36eb9db..60ffcb9c5791 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -221,9 +221,11 @@ struct tc_gred_qopt
221/* gred setup */ 221/* gred setup */
222struct tc_gred_sopt 222struct tc_gred_sopt
223{ 223{
224 __u32 DPs; 224 __u32 DPs;
225 __u32 def_DP; 225 __u32 def_DP;
226 __u8 grio; 226 __u8 grio;
227 __u8 pad1;
228 __u16 pad2;
227}; 229};
228 230
229/* HTB section */ 231/* HTB section */
@@ -351,6 +353,7 @@ struct tc_cbq_ovl
351#define TC_CBQ_OVL_DROP 3 353#define TC_CBQ_OVL_DROP 3
352#define TC_CBQ_OVL_RCLASSIC 4 354#define TC_CBQ_OVL_RCLASSIC 4
353 unsigned char priority2; 355 unsigned char priority2;
356 __u16 pad;
354 __u32 penalty; 357 __u32 penalty;
355}; 358};
356 359
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 4e2d2a942ecb..4b32bce9a289 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -159,7 +159,7 @@ struct packet_iosched
159 struct bio *read_queue_tail; 159 struct bio *read_queue_tail;
160 struct bio *write_queue; 160 struct bio *write_queue;
161 struct bio *write_queue_tail; 161 struct bio *write_queue_tail;
162 int high_prio_read; /* An important read request has been queued */ 162 sector_t last_write; /* The sector where the last write ended */
163 int successive_reads; 163 int successive_reads;
164}; 164};
165 165
diff --git a/include/linux/pm.h b/include/linux/pm.h
index ed2b76e75199..7aeb208ed713 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -103,7 +103,8 @@ extern int pm_active;
103/* 103/*
104 * Register a device with power management 104 * Register a device with power management
105 */ 105 */
106struct pm_dev __deprecated *pm_register(pm_dev_t type, unsigned long id, pm_callback callback); 106struct pm_dev __deprecated *
107pm_register(pm_dev_t type, unsigned long id, pm_callback callback);
107 108
108/* 109/*
109 * Unregister a device with power management 110 * Unregister a device with power management
@@ -175,7 +176,7 @@ struct pm_ops {
175}; 176};
176 177
177extern void pm_set_ops(struct pm_ops *); 178extern void pm_set_ops(struct pm_ops *);
178 179extern struct pm_ops *pm_ops;
179extern int pm_suspend(suspend_state_t state); 180extern int pm_suspend(suspend_state_t state);
180 181
181 182
@@ -190,17 +191,18 @@ typedef u32 __bitwise pm_message_t;
190/* 191/*
191 * There are 4 important states driver can be in: 192 * There are 4 important states driver can be in:
192 * ON -- driver is working 193 * ON -- driver is working
193 * FREEZE -- stop operations and apply whatever policy is applicable to a suspended driver 194 * FREEZE -- stop operations and apply whatever policy is applicable to a
194 * of that class, freeze queues for block like IDE does, drop packets for 195 * suspended driver of that class, freeze queues for block like IDE
195 * ethernet, etc... stop DMA engine too etc... so a consistent image can be 196 * does, drop packets for ethernet, etc... stop DMA engine too etc...
196 * saved; but do not power any hardware down. 197 * so a consistent image can be saved; but do not power any hardware
197 * SUSPEND - like FREEZE, but hardware is doing as much powersaving as possible. Roughly 198 * down.
198 * pci D3. 199 * SUSPEND - like FREEZE, but hardware is doing as much powersaving as
200 * possible. Roughly pci D3.
199 * 201 *
200 * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 (SUSPEND). 202 * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3
201 * We'll need to fix the drivers. So yes, putting 3 to all diferent defines is intentional, 203 * (SUSPEND). We'll need to fix the drivers. So yes, putting 3 to all different
202 * and will go away as soon as drivers are fixed. Also note that typedef is neccessary, 204 * defines is intentional, and will go away as soon as drivers are fixed. Also
203 * we'll probably want to switch to 205 * note that typedef is neccessary, we'll probably want to switch to
204 * typedef struct pm_message_t { int event; int flags; } pm_message_t 206 * typedef struct pm_message_t { int event; int flags; } pm_message_t
205 * or something similar soon. 207 * or something similar soon.
206 */ 208 */
@@ -222,11 +224,18 @@ struct dev_pm_info {
222 224
223extern void device_pm_set_parent(struct device * dev, struct device * parent); 225extern void device_pm_set_parent(struct device * dev, struct device * parent);
224 226
225extern int device_suspend(pm_message_t state);
226extern int device_power_down(pm_message_t state); 227extern int device_power_down(pm_message_t state);
227extern void device_power_up(void); 228extern void device_power_up(void);
228extern void device_resume(void); 229extern void device_resume(void);
229 230
231#ifdef CONFIG_PM
232extern int device_suspend(pm_message_t state);
233#else
234static inline int device_suspend(pm_message_t state)
235{
236 return 0;
237}
238#endif
230 239
231#endif /* __KERNEL__ */ 240#endif /* __KERNEL__ */
232 241
diff --git a/include/linux/pmu.h b/include/linux/pmu.h
index 6d73eada277e..373bd3b9b330 100644
--- a/include/linux/pmu.h
+++ b/include/linux/pmu.h
@@ -166,7 +166,7 @@ extern int pmu_i2c_simple_read(int bus, int addr, u8* data, int len);
166extern int pmu_i2c_simple_write(int bus, int addr, u8* data, int len); 166extern int pmu_i2c_simple_write(int bus, int addr, u8* data, int len);
167 167
168 168
169#ifdef CONFIG_PMAC_PBOOK 169#ifdef CONFIG_PM
170/* 170/*
171 * Stuff for putting the powerbook to sleep and waking it again. 171 * Stuff for putting the powerbook to sleep and waking it again.
172 * 172 *
@@ -208,6 +208,8 @@ struct pmu_sleep_notifier
208int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier); 208int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
209int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier); 209int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
210 210
211#endif /* CONFIG_PM */
212
211#define PMU_MAX_BATTERIES 2 213#define PMU_MAX_BATTERIES 2
212 214
213/* values for pmu_power_flags */ 215/* values for pmu_power_flags */
@@ -235,6 +237,4 @@ extern int pmu_battery_count;
235extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES]; 237extern struct pmu_battery_info pmu_batteries[PMU_MAX_BATTERIES];
236extern unsigned int pmu_power_flags; 238extern unsigned int pmu_power_flags;
237 239
238#endif /* CONFIG_PMAC_PBOOK */
239
240#endif /* __KERNEL__ */ 240#endif /* __KERNEL__ */
diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h
index 5efd0a6dad94..6e53c34035cd 100644
--- a/include/linux/posix_acl_xattr.h
+++ b/include/linux/posix_acl_xattr.h
@@ -23,13 +23,13 @@
23#define ACL_UNDEFINED_ID (-1) 23#define ACL_UNDEFINED_ID (-1)
24 24
25typedef struct { 25typedef struct {
26 __u16 e_tag; 26 __le16 e_tag;
27 __u16 e_perm; 27 __le16 e_perm;
28 __u32 e_id; 28 __le32 e_id;
29} posix_acl_xattr_entry; 29} posix_acl_xattr_entry;
30 30
31typedef struct { 31typedef struct {
32 __u32 a_version; 32 __le32 a_version;
33 posix_acl_xattr_entry a_entries[0]; 33 posix_acl_xattr_entry a_entries[0];
34} posix_acl_xattr_header; 34} posix_acl_xattr_header;
35 35
@@ -52,4 +52,7 @@ posix_acl_xattr_count(size_t size)
52 return size / sizeof(posix_acl_xattr_entry); 52 return size / sizeof(posix_acl_xattr_entry);
53} 53}
54 54
55struct posix_acl *posix_acl_from_xattr(const void *value, size_t size);
56int posix_acl_to_xattr(const struct posix_acl *acl, void *buffer, size_t size);
57
55#endif /* _POSIX_ACL_XATTR_H */ 58#endif /* _POSIX_ACL_XATTR_H */
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 59e505261fd6..0563581e3a02 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -74,6 +74,13 @@ struct kcore_list {
74 size_t size; 74 size_t size;
75}; 75};
76 76
77struct vmcore {
78 struct list_head list;
79 unsigned long long paddr;
80 unsigned long size;
81 loff_t offset;
82};
83
77#ifdef CONFIG_PROC_FS 84#ifdef CONFIG_PROC_FS
78 85
79extern struct proc_dir_entry proc_root; 86extern struct proc_dir_entry proc_root;
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 22ba580b0ae8..fc610bb0f733 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -46,11 +46,11 @@ struct qnx4_inode_entry {
46 char di_fname[QNX4_SHORT_NAME_MAX]; 46 char di_fname[QNX4_SHORT_NAME_MAX];
47 qnx4_off_t di_size; 47 qnx4_off_t di_size;
48 qnx4_xtnt_t di_first_xtnt; 48 qnx4_xtnt_t di_first_xtnt;
49 __u32 di_xblk; 49 __le32 di_xblk;
50 __s32 di_ftime; 50 __le32 di_ftime;
51 __s32 di_mtime; 51 __le32 di_mtime;
52 __s32 di_atime; 52 __le32 di_atime;
53 __s32 di_ctime; 53 __le32 di_ctime;
54 qnx4_nxtnt_t di_num_xtnts; 54 qnx4_nxtnt_t di_num_xtnts;
55 qnx4_mode_t di_mode; 55 qnx4_mode_t di_mode;
56 qnx4_muid_t di_uid; 56 qnx4_muid_t di_uid;
@@ -63,18 +63,18 @@ struct qnx4_inode_entry {
63 63
64struct qnx4_link_info { 64struct qnx4_link_info {
65 char dl_fname[QNX4_NAME_MAX]; 65 char dl_fname[QNX4_NAME_MAX];
66 __u32 dl_inode_blk; 66 __le32 dl_inode_blk;
67 __u8 dl_inode_ndx; 67 __u8 dl_inode_ndx;
68 __u8 dl_spare[10]; 68 __u8 dl_spare[10];
69 __u8 dl_status; 69 __u8 dl_status;
70}; 70};
71 71
72struct qnx4_xblk { 72struct qnx4_xblk {
73 __u32 xblk_next_xblk; 73 __le32 xblk_next_xblk;
74 __u32 xblk_prev_xblk; 74 __le32 xblk_prev_xblk;
75 __u8 xblk_num_xtnts; 75 __u8 xblk_num_xtnts;
76 __u8 xblk_spare[3]; 76 __u8 xblk_spare[3];
77 __s32 xblk_num_blocks; 77 __le32 xblk_num_blocks;
78 qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK]; 78 qnx4_xtnt_t xblk_xtnts[QNX4_MAX_XTNTS_PER_XBLK];
79 char xblk_signature[8]; 79 char xblk_signature[8];
80 qnx4_xtnt_t xblk_first_xtnt; 80 qnx4_xtnt_t xblk_first_xtnt;
diff --git a/include/linux/qnxtypes.h b/include/linux/qnxtypes.h
index fb518e318c7c..a3eb1137857b 100644
--- a/include/linux/qnxtypes.h
+++ b/include/linux/qnxtypes.h
@@ -12,18 +12,18 @@
12#ifndef _QNX4TYPES_H 12#ifndef _QNX4TYPES_H
13#define _QNX4TYPES_H 13#define _QNX4TYPES_H
14 14
15typedef __u16 qnx4_nxtnt_t; 15typedef __le16 qnx4_nxtnt_t;
16typedef __u8 qnx4_ftype_t; 16typedef __u8 qnx4_ftype_t;
17 17
18typedef struct { 18typedef struct {
19 __u32 xtnt_blk; 19 __le32 xtnt_blk;
20 __u32 xtnt_size; 20 __le32 xtnt_size;
21} qnx4_xtnt_t; 21} qnx4_xtnt_t;
22 22
23typedef __u16 qnx4_mode_t; 23typedef __le16 qnx4_mode_t;
24typedef __u16 qnx4_muid_t; 24typedef __le16 qnx4_muid_t;
25typedef __u16 qnx4_mgid_t; 25typedef __le16 qnx4_mgid_t;
26typedef __u32 qnx4_off_t; 26typedef __le32 qnx4_off_t;
27typedef __u16 qnx4_nlink_t; 27typedef __le16 qnx4_nlink_t;
28 28
29#endif 29#endif
diff --git a/include/linux/quota.h b/include/linux/quota.h
index ac5b90f4f256..700ead45084f 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -138,8 +138,11 @@ struct if_dqinfo {
138#include <linux/dqblk_v2.h> 138#include <linux/dqblk_v2.h>
139 139
140/* Maximal numbers of writes for quota operation (insert/delete/update) 140/* Maximal numbers of writes for quota operation (insert/delete/update)
141 * (over all formats) - info block, 4 pointer blocks, data block */ 141 * (over VFS all formats) */
142#define DQUOT_MAX_WRITES 6 142#define DQUOT_INIT_ALLOC max(V1_INIT_ALLOC, V2_INIT_ALLOC)
143#define DQUOT_INIT_REWRITE max(V1_INIT_REWRITE, V2_INIT_REWRITE)
144#define DQUOT_DEL_ALLOC max(V1_DEL_ALLOC, V2_DEL_ALLOC)
145#define DQUOT_DEL_REWRITE max(V1_DEL_REWRITE, V2_DEL_REWRITE)
143 146
144/* 147/*
145 * Data for one user/group kept in memory 148 * Data for one user/group kept in memory
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index e57baa85e744..d211507ab246 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -39,7 +39,8 @@ extern int dquot_commit_info(struct super_block *sb, int type);
39extern int dquot_mark_dquot_dirty(struct dquot *dquot); 39extern int dquot_mark_dquot_dirty(struct dquot *dquot);
40 40
41extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path); 41extern int vfs_quota_on(struct super_block *sb, int type, int format_id, char *path);
42extern int vfs_quota_on_mount(int type, int format_id, struct dentry *dentry); 42extern int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
43 int format_id, int type);
43extern int vfs_quota_off(struct super_block *sb, int type); 44extern int vfs_quota_off(struct super_block *sb, int type);
44#define vfs_quota_off_mount(sb, type) vfs_quota_off(sb, type) 45#define vfs_quota_off_mount(sb, type) vfs_quota_off(sb, type)
45extern int vfs_quota_sync(struct super_block *sb, int type); 46extern int vfs_quota_sync(struct super_block *sb, int type);
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index e24b74b11150..4bf1659f8aa8 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -248,6 +248,7 @@ struct bitmap {
248 248
249/* these are used only by md/bitmap */ 249/* these are used only by md/bitmap */
250int bitmap_create(mddev_t *mddev); 250int bitmap_create(mddev_t *mddev);
251void bitmap_flush(mddev_t *mddev);
251void bitmap_destroy(mddev_t *mddev); 252void bitmap_destroy(mddev_t *mddev);
252int bitmap_active(struct bitmap *bitmap); 253int bitmap_active(struct bitmap *bitmap);
253 254
@@ -262,7 +263,7 @@ void bitmap_write_all(struct bitmap *bitmap);
262int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); 263int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors);
263void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, 264void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors,
264 int success); 265 int success);
265int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks); 266int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
266void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 267void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
267void bitmap_close_sync(struct bitmap *bitmap); 268void bitmap_close_sync(struct bitmap *bitmap);
268 269
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index d60fafc8bdc5..3b3266ff1a95 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -51,6 +51,26 @@ extern void machine_restart(char *cmd);
51extern void machine_halt(void); 51extern void machine_halt(void);
52extern void machine_power_off(void); 52extern void machine_power_off(void);
53 53
54extern void machine_shutdown(void);
55struct pt_regs;
56extern void machine_crash_shutdown(struct pt_regs *);
57
58/*
59 * Architecture independent implemenations of sys_reboot commands.
60 */
61
62extern void kernel_restart(char *cmd);
63extern void kernel_halt(void);
64extern void kernel_power_off(void);
65extern void kernel_kexec(void);
66
67/*
68 * Emergency restart, callable from an interrupt handler.
69 */
70
71extern void emergency_restart(void);
72#include <asm/emergency-restart.h>
73
54#endif 74#endif
55 75
56#endif /* _LINUX_REBOOT_H */ 76#endif /* _LINUX_REBOOT_H */
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 2aef9c3f5ce8..0a3605099c44 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -1,33 +1,32 @@
1#include <linux/init.h> 1#include <linux/init.h>
2#include <linux/posix_acl.h> 2#include <linux/posix_acl.h>
3#include <linux/xattr_acl.h>
4 3
5#define REISERFS_ACL_VERSION 0x0001 4#define REISERFS_ACL_VERSION 0x0001
6 5
7typedef struct { 6typedef struct {
8 __le16 e_tag; 7 __le16 e_tag;
9 __le16 e_perm; 8 __le16 e_perm;
10 __le32 e_id; 9 __le32 e_id;
11} reiserfs_acl_entry; 10} reiserfs_acl_entry;
12 11
13typedef struct { 12typedef struct {
14 __le16 e_tag; 13 __le16 e_tag;
15 __le16 e_perm; 14 __le16 e_perm;
16} reiserfs_acl_entry_short; 15} reiserfs_acl_entry_short;
17 16
18typedef struct { 17typedef struct {
19 __le32 a_version; 18 __le32 a_version;
20} reiserfs_acl_header; 19} reiserfs_acl_header;
21 20
22static inline size_t reiserfs_acl_size(int count) 21static inline size_t reiserfs_acl_size(int count)
23{ 22{
24 if (count <= 4) { 23 if (count <= 4) {
25 return sizeof(reiserfs_acl_header) + 24 return sizeof(reiserfs_acl_header) +
26 count * sizeof(reiserfs_acl_entry_short); 25 count * sizeof(reiserfs_acl_entry_short);
27 } else { 26 } else {
28 return sizeof(reiserfs_acl_header) + 27 return sizeof(reiserfs_acl_header) +
29 4 * sizeof(reiserfs_acl_entry_short) + 28 4 * sizeof(reiserfs_acl_entry_short) +
30 (count - 4) * sizeof(reiserfs_acl_entry); 29 (count - 4) * sizeof(reiserfs_acl_entry);
31 } 30 }
32} 31}
33 32
@@ -47,14 +46,14 @@ static inline int reiserfs_acl_count(size_t size)
47 } 46 }
48} 47}
49 48
50
51#ifdef CONFIG_REISERFS_FS_POSIX_ACL 49#ifdef CONFIG_REISERFS_FS_POSIX_ACL
52struct posix_acl * reiserfs_get_acl(struct inode *inode, int type); 50struct posix_acl *reiserfs_get_acl(struct inode *inode, int type);
53int reiserfs_acl_chmod (struct inode *inode); 51int reiserfs_acl_chmod(struct inode *inode);
54int reiserfs_inherit_default_acl (struct inode *dir, struct dentry *dentry, struct inode *inode); 52int reiserfs_inherit_default_acl(struct inode *dir, struct dentry *dentry,
55int reiserfs_cache_default_acl (struct inode *dir); 53 struct inode *inode);
56extern int reiserfs_xattr_posix_acl_init (void) __init; 54int reiserfs_cache_default_acl(struct inode *dir);
57extern int reiserfs_xattr_posix_acl_exit (void); 55extern int reiserfs_xattr_posix_acl_init(void) __init;
56extern int reiserfs_xattr_posix_acl_exit(void);
58extern struct reiserfs_xattr_handler posix_acl_default_handler; 57extern struct reiserfs_xattr_handler posix_acl_default_handler;
59extern struct reiserfs_xattr_handler posix_acl_access_handler; 58extern struct reiserfs_xattr_handler posix_acl_access_handler;
60#else 59#else
@@ -62,28 +61,26 @@ extern struct reiserfs_xattr_handler posix_acl_access_handler;
62#define reiserfs_get_acl NULL 61#define reiserfs_get_acl NULL
63#define reiserfs_cache_default_acl(inode) 0 62#define reiserfs_cache_default_acl(inode) 0
64 63
65static inline int 64static inline int reiserfs_xattr_posix_acl_init(void)
66reiserfs_xattr_posix_acl_init (void)
67{ 65{
68 return 0; 66 return 0;
69} 67}
70 68
71static inline int 69static inline int reiserfs_xattr_posix_acl_exit(void)
72reiserfs_xattr_posix_acl_exit (void)
73{ 70{
74 return 0; 71 return 0;
75} 72}
76 73
77static inline int 74static inline int reiserfs_acl_chmod(struct inode *inode)
78reiserfs_acl_chmod (struct inode *inode)
79{ 75{
80 return 0; 76 return 0;
81} 77}
82 78
83static inline int 79static inline int
84reiserfs_inherit_default_acl (const struct inode *dir, struct dentry *dentry, struct inode *inode) 80reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry,
81 struct inode *inode)
85{ 82{
86 return 0; 83 return 0;
87} 84}
88 85
89#endif 86#endif
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 32148625fc2f..17e458e17e2b 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -3,11 +3,10 @@
3 */ 3 */
4 4
5 /* this file has an amazingly stupid 5 /* this file has an amazingly stupid
6 name, yura please fix it to be 6 name, yura please fix it to be
7 reiserfs.h, and merge all the rest 7 reiserfs.h, and merge all the rest
8 of our .h files that are in this 8 of our .h files that are in this
9 directory into it. */ 9 directory into it. */
10
11 10
12#ifndef _LINUX_REISER_FS_H 11#ifndef _LINUX_REISER_FS_H
13#define _LINUX_REISER_FS_H 12#define _LINUX_REISER_FS_H
@@ -74,9 +73,9 @@
74/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug 73/* debug levels. Right now, CONFIG_REISERFS_CHECK means print all debug
75** messages. 74** messages.
76*/ 75*/
77#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */ 76#define REISERFS_DEBUG_CODE 5 /* extra messages to help find/debug errors */
78 77
79void reiserfs_warning (struct super_block *s, const char * fmt, ...); 78void reiserfs_warning(struct super_block *s, const char *fmt, ...);
80/* assertions handling */ 79/* assertions handling */
81 80
82/** always check a condition and panic if it's false. */ 81/** always check a condition and panic if it's false. */
@@ -105,82 +104,78 @@ if( !( cond ) ) \
105 * Structure of super block on disk, a version of which in RAM is often accessed as REISERFS_SB(s)->s_rs 104 * Structure of super block on disk, a version of which in RAM is often accessed as REISERFS_SB(s)->s_rs
106 * the version in RAM is part of a larger structure containing fields never written to disk. 105 * the version in RAM is part of a larger structure containing fields never written to disk.
107 */ 106 */
108#define UNSET_HASH 0 // read_super will guess about, what hash names 107#define UNSET_HASH 0 // read_super will guess about, what hash names
109 // in directories were sorted with 108 // in directories were sorted with
110#define TEA_HASH 1 109#define TEA_HASH 1
111#define YURA_HASH 2 110#define YURA_HASH 2
112#define R5_HASH 3 111#define R5_HASH 3
113#define DEFAULT_HASH R5_HASH 112#define DEFAULT_HASH R5_HASH
114 113
115
116struct journal_params { 114struct journal_params {
117 __le32 jp_journal_1st_block; /* where does journal start from on its 115 __le32 jp_journal_1st_block; /* where does journal start from on its
118 * device */ 116 * device */
119 __le32 jp_journal_dev; /* journal device st_rdev */ 117 __le32 jp_journal_dev; /* journal device st_rdev */
120 __le32 jp_journal_size; /* size of the journal */ 118 __le32 jp_journal_size; /* size of the journal */
121 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */ 119 __le32 jp_journal_trans_max; /* max number of blocks in a transaction. */
122 __le32 jp_journal_magic; /* random value made on fs creation (this 120 __le32 jp_journal_magic; /* random value made on fs creation (this
123 * was sb_journal_block_count) */ 121 * was sb_journal_block_count) */
124 __le32 jp_journal_max_batch; /* max number of blocks to batch into a 122 __le32 jp_journal_max_batch; /* max number of blocks to batch into a
125 * trans */ 123 * trans */
126 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async 124 __le32 jp_journal_max_commit_age; /* in seconds, how old can an async
127 * commit be */ 125 * commit be */
128 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction 126 __le32 jp_journal_max_trans_age; /* in seconds, how old can a transaction
129 * be */ 127 * be */
130}; 128};
131 129
132/* this is the super from 3.5.X, where X >= 10 */ 130/* this is the super from 3.5.X, where X >= 10 */
133struct reiserfs_super_block_v1 131struct reiserfs_super_block_v1 {
134{ 132 __le32 s_block_count; /* blocks count */
135 __le32 s_block_count; /* blocks count */ 133 __le32 s_free_blocks; /* free blocks count */
136 __le32 s_free_blocks; /* free blocks count */ 134 __le32 s_root_block; /* root block number */
137 __le32 s_root_block; /* root block number */ 135 struct journal_params s_journal;
138 struct journal_params s_journal; 136 __le16 s_blocksize; /* block size */
139 __le16 s_blocksize; /* block size */ 137 __le16 s_oid_maxsize; /* max size of object id array, see
140 __le16 s_oid_maxsize; /* max size of object id array, see 138 * get_objectid() commentary */
141 * get_objectid() commentary */ 139 __le16 s_oid_cursize; /* current size of object id array */
142 __le16 s_oid_cursize; /* current size of object id array */ 140 __le16 s_umount_state; /* this is set to 1 when filesystem was
143 __le16 s_umount_state; /* this is set to 1 when filesystem was 141 * umounted, to 2 - when not */
144 * umounted, to 2 - when not */ 142 char s_magic[10]; /* reiserfs magic string indicates that
145 char s_magic[10]; /* reiserfs magic string indicates that 143 * file system is reiserfs:
146 * file system is reiserfs: 144 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */
147 * "ReIsErFs" or "ReIsEr2Fs" or "ReIsEr3Fs" */ 145 __le16 s_fs_state; /* it is set to used by fsck to mark which
148 __le16 s_fs_state; /* it is set to used by fsck to mark which 146 * phase of rebuilding is done */
149 * phase of rebuilding is done */ 147 __le32 s_hash_function_code; /* indicate, what hash function is being use
150 __le32 s_hash_function_code; /* indicate, what hash function is being use 148 * to sort names in a directory*/
151 * to sort names in a directory*/ 149 __le16 s_tree_height; /* height of disk tree */
152 __le16 s_tree_height; /* height of disk tree */ 150 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address
153 __le16 s_bmap_nr; /* amount of bitmap blocks needed to address 151 * each block of file system */
154 * each block of file system */ 152 __le16 s_version; /* this field is only reliable on filesystem
155 __le16 s_version; /* this field is only reliable on filesystem 153 * with non-standard journal */
156 * with non-standard journal */ 154 __le16 s_reserved_for_journal; /* size in blocks of journal area on main
157 __le16 s_reserved_for_journal; /* size in blocks of journal area on main 155 * device, we need to keep after
158 * device, we need to keep after 156 * making fs with non-standard journal */
159 * making fs with non-standard journal */
160} __attribute__ ((__packed__)); 157} __attribute__ ((__packed__));
161 158
162#define SB_SIZE_V1 (sizeof(struct reiserfs_super_block_v1)) 159#define SB_SIZE_V1 (sizeof(struct reiserfs_super_block_v1))
163 160
164/* this is the on disk super block */ 161/* this is the on disk super block */
165struct reiserfs_super_block 162struct reiserfs_super_block {
166{ 163 struct reiserfs_super_block_v1 s_v1;
167 struct reiserfs_super_block_v1 s_v1; 164 __le32 s_inode_generation;
168 __le32 s_inode_generation; 165 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */
169 __le32 s_flags; /* Right now used only by inode-attributes, if enabled */ 166 unsigned char s_uuid[16]; /* filesystem unique identifier */
170 unsigned char s_uuid[16]; /* filesystem unique identifier */ 167 unsigned char s_label[16]; /* filesystem volume label */
171 unsigned char s_label[16]; /* filesystem volume label */ 168 char s_unused[88]; /* zero filled by mkreiserfs and
172 char s_unused[88] ; /* zero filled by mkreiserfs and 169 * reiserfs_convert_objectid_map_v1()
173 * reiserfs_convert_objectid_map_v1() 170 * so any additions must be updated
174 * so any additions must be updated 171 * there as well. */
175 * there as well. */ 172} __attribute__ ((__packed__));
176} __attribute__ ((__packed__));
177 173
178#define SB_SIZE (sizeof(struct reiserfs_super_block)) 174#define SB_SIZE (sizeof(struct reiserfs_super_block))
179 175
180#define REISERFS_VERSION_1 0 176#define REISERFS_VERSION_1 0
181#define REISERFS_VERSION_2 2 177#define REISERFS_VERSION_2 2
182 178
183
184// on-disk super block fields converted to cpu form 179// on-disk super block fields converted to cpu form
185#define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs) 180#define SB_DISK_SUPER_BLOCK(s) (REISERFS_SB(s)->s_rs)
186#define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1)) 181#define SB_V1_DISK_SUPER_BLOCK(s) (&(SB_DISK_SUPER_BLOCK(s)->s_v1))
@@ -210,13 +205,12 @@ struct reiserfs_super_block
210#define PUT_SB_TREE_HEIGHT(s, val) \ 205#define PUT_SB_TREE_HEIGHT(s, val) \
211 do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0) 206 do { SB_V1_DISK_SUPER_BLOCK(s)->s_tree_height = cpu_to_le16(val); } while (0)
212#define PUT_SB_REISERFS_STATE(s, val) \ 207#define PUT_SB_REISERFS_STATE(s, val) \
213 do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0) 208 do { SB_V1_DISK_SUPER_BLOCK(s)->s_umount_state = cpu_to_le16(val); } while (0)
214#define PUT_SB_VERSION(s, val) \ 209#define PUT_SB_VERSION(s, val) \
215 do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0) 210 do { SB_V1_DISK_SUPER_BLOCK(s)->s_version = cpu_to_le16(val); } while (0)
216#define PUT_SB_BMAP_NR(s, val) \ 211#define PUT_SB_BMAP_NR(s, val) \
217 do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0) 212 do { SB_V1_DISK_SUPER_BLOCK(s)->s_bmap_nr = cpu_to_le16 (val); } while (0)
218 213
219
220#define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal) 214#define SB_ONDISK_JP(s) (&SB_V1_DISK_SUPER_BLOCK(s)->s_journal)
221#define SB_ONDISK_JOURNAL_SIZE(s) \ 215#define SB_ONDISK_JOURNAL_SIZE(s) \
222 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size)) 216 le32_to_cpu ((SB_ONDISK_JP(s)->jp_journal_size))
@@ -231,21 +225,19 @@ struct reiserfs_super_block
231 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \ 225 block >= SB_JOURNAL_1st_RESERVED_BLOCK(s) \
232 && block < SB_JOURNAL_1st_RESERVED_BLOCK(s) + \ 226 && block < SB_JOURNAL_1st_RESERVED_BLOCK(s) + \
233 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ 227 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \
234 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) 228 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s)))
235
236
237 229
238 /* used by gcc */ 230 /* used by gcc */
239#define REISERFS_SUPER_MAGIC 0x52654973 231#define REISERFS_SUPER_MAGIC 0x52654973
240 /* used by file system utilities that 232 /* used by file system utilities that
241 look at the superblock, etc. */ 233 look at the superblock, etc. */
242#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs" 234#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
243#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs" 235#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
244#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs" 236#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
245 237
246int is_reiserfs_3_5 (struct reiserfs_super_block * rs); 238int is_reiserfs_3_5(struct reiserfs_super_block *rs);
247int is_reiserfs_3_6 (struct reiserfs_super_block * rs); 239int is_reiserfs_3_6(struct reiserfs_super_block *rs);
248int is_reiserfs_jr (struct reiserfs_super_block * rs); 240int is_reiserfs_jr(struct reiserfs_super_block *rs);
249 241
250/* ReiserFS leaves the first 64k unused, so that partition labels have 242/* ReiserFS leaves the first 64k unused, so that partition labels have
251 enough space. If someone wants to write a fancy bootloader that 243 enough space. If someone wants to write a fancy bootloader that
@@ -272,8 +264,8 @@ typedef __u32 b_blocknr_t;
272typedef __le32 unp_t; 264typedef __le32 unp_t;
273 265
274struct unfm_nodeinfo { 266struct unfm_nodeinfo {
275 unp_t unfm_nodenum; 267 unp_t unfm_nodenum;
276 unsigned short unfm_freespace; 268 unsigned short unfm_freespace;
277}; 269};
278 270
279/* there are two formats of keys: 3.5 and 3.6 271/* there are two formats of keys: 3.5 and 3.6
@@ -285,7 +277,6 @@ struct unfm_nodeinfo {
285#define STAT_DATA_V1 0 277#define STAT_DATA_V1 0
286#define STAT_DATA_V2 1 278#define STAT_DATA_V2 1
287 279
288
289static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode) 280static inline struct reiserfs_inode_info *REISERFS_I(const struct inode *inode)
290{ 281{
291 return container_of(inode, struct reiserfs_inode_info, vfs_inode); 282 return container_of(inode, struct reiserfs_inode_info, vfs_inode);
@@ -343,15 +334,13 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
343 file would fit into one DIRECT item. 334 file would fit into one DIRECT item.
344 Primary intention for this one is to increase performance by decreasing 335 Primary intention for this one is to increase performance by decreasing
345 seeking. 336 seeking.
346*/ 337*/
347#define STORE_TAIL_IN_UNFM_S2(n_file_size,n_tail_size,n_block_size) \ 338#define STORE_TAIL_IN_UNFM_S2(n_file_size,n_tail_size,n_block_size) \
348(\ 339(\
349 (!(n_tail_size)) || \ 340 (!(n_tail_size)) || \
350 (((n_file_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) ) \ 341 (((n_file_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) ) \
351) 342)
352 343
353
354
355/* 344/*
356 * values for s_umount_state field 345 * values for s_umount_state field
357 */ 346 */
@@ -364,9 +353,9 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
364#define TYPE_STAT_DATA 0 353#define TYPE_STAT_DATA 0
365#define TYPE_INDIRECT 1 354#define TYPE_INDIRECT 1
366#define TYPE_DIRECT 2 355#define TYPE_DIRECT 2
367#define TYPE_DIRENTRY 3 356#define TYPE_DIRENTRY 3
368#define TYPE_MAXTYPE 3 357#define TYPE_MAXTYPE 3
369#define TYPE_ANY 15 // FIXME: comment is required 358#define TYPE_ANY 15 // FIXME: comment is required
370 359
371/***************************************************************************/ 360/***************************************************************************/
372/* KEY & ITEM HEAD */ 361/* KEY & ITEM HEAD */
@@ -376,60 +365,62 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb)
376// directories use this key as well as old files 365// directories use this key as well as old files
377// 366//
378struct offset_v1 { 367struct offset_v1 {
379 __le32 k_offset; 368 __le32 k_offset;
380 __le32 k_uniqueness; 369 __le32 k_uniqueness;
381} __attribute__ ((__packed__)); 370} __attribute__ ((__packed__));
382 371
383struct offset_v2 { 372struct offset_v2 {
384 __le64 v; 373 __le64 v;
385} __attribute__ ((__packed__)); 374} __attribute__ ((__packed__));
386 375
387static inline __u16 offset_v2_k_type( const struct offset_v2 *v2 ) 376static inline __u16 offset_v2_k_type(const struct offset_v2 *v2)
388{ 377{
389 __u8 type = le64_to_cpu(v2->v) >> 60; 378 __u8 type = le64_to_cpu(v2->v) >> 60;
390 return (type <= TYPE_MAXTYPE)?type:TYPE_ANY; 379 return (type <= TYPE_MAXTYPE) ? type : TYPE_ANY;
391} 380}
392 381
393static inline void set_offset_v2_k_type( struct offset_v2 *v2, int type ) 382static inline void set_offset_v2_k_type(struct offset_v2 *v2, int type)
394{ 383{
395 v2->v = (v2->v & cpu_to_le64(~0ULL>>4)) | cpu_to_le64((__u64)type<<60); 384 v2->v =
385 (v2->v & cpu_to_le64(~0ULL >> 4)) | cpu_to_le64((__u64) type << 60);
396} 386}
397 387
398static inline loff_t offset_v2_k_offset( const struct offset_v2 *v2 ) 388static inline loff_t offset_v2_k_offset(const struct offset_v2 *v2)
399{ 389{
400 return le64_to_cpu(v2->v) & (~0ULL>>4); 390 return le64_to_cpu(v2->v) & (~0ULL >> 4);
401} 391}
402 392
403static inline void set_offset_v2_k_offset( struct offset_v2 *v2, loff_t offset ){ 393static inline void set_offset_v2_k_offset(struct offset_v2 *v2, loff_t offset)
404 offset &= (~0ULL>>4); 394{
405 v2->v = (v2->v & cpu_to_le64(15ULL<<60)) | cpu_to_le64(offset); 395 offset &= (~0ULL >> 4);
396 v2->v = (v2->v & cpu_to_le64(15ULL << 60)) | cpu_to_le64(offset);
406} 397}
407 398
408/* Key of an item determines its location in the S+tree, and 399/* Key of an item determines its location in the S+tree, and
409 is composed of 4 components */ 400 is composed of 4 components */
410struct reiserfs_key { 401struct reiserfs_key {
411 __le32 k_dir_id; /* packing locality: by default parent 402 __le32 k_dir_id; /* packing locality: by default parent
412 directory object id */ 403 directory object id */
413 __le32 k_objectid; /* object identifier */ 404 __le32 k_objectid; /* object identifier */
414 union { 405 union {
415 struct offset_v1 k_offset_v1; 406 struct offset_v1 k_offset_v1;
416 struct offset_v2 k_offset_v2; 407 struct offset_v2 k_offset_v2;
417 } __attribute__ ((__packed__)) u; 408 } __attribute__ ((__packed__)) u;
418} __attribute__ ((__packed__)); 409} __attribute__ ((__packed__));
419 410
420struct in_core_key { 411struct in_core_key {
421 __u32 k_dir_id; /* packing locality: by default parent 412 __u32 k_dir_id; /* packing locality: by default parent
422 directory object id */ 413 directory object id */
423 __u32 k_objectid; /* object identifier */ 414 __u32 k_objectid; /* object identifier */
424 __u64 k_offset; 415 __u64 k_offset;
425 __u8 k_type; 416 __u8 k_type;
426}; 417};
427 418
428struct cpu_key { 419struct cpu_key {
429 struct in_core_key on_disk_key; 420 struct in_core_key on_disk_key;
430 int version; 421 int version;
431 int key_length; /* 3 in all cases but direct2indirect and 422 int key_length; /* 3 in all cases but direct2indirect and
432 indirect2direct conversion */ 423 indirect2direct conversion */
433}; 424};
434 425
435/* Our function for comparing keys can compare keys of different 426/* Our function for comparing keys can compare keys of different
@@ -475,8 +466,7 @@ struct cpu_key {
475 indirect items) and specifies the location of the item itself 466 indirect items) and specifies the location of the item itself
476 within the block. */ 467 within the block. */
477 468
478struct item_head 469struct item_head {
479{
480 /* Everything in the tree is found by searching for it based on 470 /* Everything in the tree is found by searching for it based on
481 * its key.*/ 471 * its key.*/
482 struct reiserfs_key ih_key; 472 struct reiserfs_key ih_key;
@@ -492,13 +482,13 @@ struct item_head
492 number of directory entries in the directory item. */ 482 number of directory entries in the directory item. */
493 __le16 ih_entry_count; 483 __le16 ih_entry_count;
494 } __attribute__ ((__packed__)) u; 484 } __attribute__ ((__packed__)) u;
495 __le16 ih_item_len; /* total size of the item body */ 485 __le16 ih_item_len; /* total size of the item body */
496 __le16 ih_item_location; /* an offset to the item body 486 __le16 ih_item_location; /* an offset to the item body
497 * within the block */ 487 * within the block */
498 __le16 ih_version; /* 0 for all old items, 2 for new 488 __le16 ih_version; /* 0 for all old items, 2 for new
499 ones. Highest bit is set by fsck 489 ones. Highest bit is set by fsck
500 temporary, cleaned after all 490 temporary, cleaned after all
501 done */ 491 done */
502} __attribute__ ((__packed__)); 492} __attribute__ ((__packed__));
503/* size of item header */ 493/* size of item header */
504#define IH_SIZE (sizeof(struct item_head)) 494#define IH_SIZE (sizeof(struct item_head))
@@ -515,7 +505,6 @@ struct item_head
515#define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0) 505#define put_ih_location(ih, val) do { (ih)->ih_item_location = cpu_to_le16(val); } while (0)
516#define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0) 506#define put_ih_item_len(ih, val) do { (ih)->ih_item_len = cpu_to_le16(val); } while (0)
517 507
518
519#define unreachable_item(ih) (ih_version(ih) & (1 << 15)) 508#define unreachable_item(ih) (ih_version(ih) & (1 << 15))
520 509
521#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih)) 510#define get_ih_free_space(ih) (ih_version (ih) == KEY_FORMAT_3_6 ? 0 : ih_free_space (ih))
@@ -537,40 +526,48 @@ struct item_head
537#define V1_INDIRECT_UNIQUENESS 0xfffffffe 526#define V1_INDIRECT_UNIQUENESS 0xfffffffe
538#define V1_DIRECT_UNIQUENESS 0xffffffff 527#define V1_DIRECT_UNIQUENESS 0xffffffff
539#define V1_DIRENTRY_UNIQUENESS 500 528#define V1_DIRENTRY_UNIQUENESS 500
540#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required 529#define V1_ANY_UNIQUENESS 555 // FIXME: comment is required
541 530
542// 531//
543// here are conversion routines 532// here are conversion routines
544// 533//
545static inline int uniqueness2type (__u32 uniqueness) CONSTF; 534static inline int uniqueness2type(__u32 uniqueness) CONSTF;
546static inline int uniqueness2type (__u32 uniqueness) 535static inline int uniqueness2type(__u32 uniqueness)
547{ 536{
548 switch ((int)uniqueness) { 537 switch ((int)uniqueness) {
549 case V1_SD_UNIQUENESS: return TYPE_STAT_DATA; 538 case V1_SD_UNIQUENESS:
550 case V1_INDIRECT_UNIQUENESS: return TYPE_INDIRECT; 539 return TYPE_STAT_DATA;
551 case V1_DIRECT_UNIQUENESS: return TYPE_DIRECT; 540 case V1_INDIRECT_UNIQUENESS:
552 case V1_DIRENTRY_UNIQUENESS: return TYPE_DIRENTRY; 541 return TYPE_INDIRECT;
553 default: 542 case V1_DIRECT_UNIQUENESS:
554 reiserfs_warning (NULL, "vs-500: unknown uniqueness %d", 543 return TYPE_DIRECT;
555 uniqueness); 544 case V1_DIRENTRY_UNIQUENESS:
545 return TYPE_DIRENTRY;
546 default:
547 reiserfs_warning(NULL, "vs-500: unknown uniqueness %d",
548 uniqueness);
556 case V1_ANY_UNIQUENESS: 549 case V1_ANY_UNIQUENESS:
557 return TYPE_ANY; 550 return TYPE_ANY;
558 } 551 }
559} 552}
560 553
561static inline __u32 type2uniqueness (int type) CONSTF; 554static inline __u32 type2uniqueness(int type) CONSTF;
562static inline __u32 type2uniqueness (int type) 555static inline __u32 type2uniqueness(int type)
563{ 556{
564 switch (type) { 557 switch (type) {
565 case TYPE_STAT_DATA: return V1_SD_UNIQUENESS; 558 case TYPE_STAT_DATA:
566 case TYPE_INDIRECT: return V1_INDIRECT_UNIQUENESS; 559 return V1_SD_UNIQUENESS;
567 case TYPE_DIRECT: return V1_DIRECT_UNIQUENESS; 560 case TYPE_INDIRECT:
568 case TYPE_DIRENTRY: return V1_DIRENTRY_UNIQUENESS; 561 return V1_INDIRECT_UNIQUENESS;
569 default: 562 case TYPE_DIRECT:
570 reiserfs_warning (NULL, "vs-501: unknown type %d", type); 563 return V1_DIRECT_UNIQUENESS;
564 case TYPE_DIRENTRY:
565 return V1_DIRENTRY_UNIQUENESS;
566 default:
567 reiserfs_warning(NULL, "vs-501: unknown type %d", type);
571 case TYPE_ANY: 568 case TYPE_ANY:
572 return V1_ANY_UNIQUENESS; 569 return V1_ANY_UNIQUENESS;
573 } 570 }
574} 571}
575 572
576// 573//
@@ -578,57 +575,56 @@ static inline __u32 type2uniqueness (int type)
578// there is no way to get version of object from key, so, provide 575// there is no way to get version of object from key, so, provide
579// version to these defines 576// version to these defines
580// 577//
581static inline loff_t le_key_k_offset (int version, const struct reiserfs_key * key) 578static inline loff_t le_key_k_offset(int version,
579 const struct reiserfs_key *key)
582{ 580{
583 return (version == KEY_FORMAT_3_5) ? 581 return (version == KEY_FORMAT_3_5) ?
584 le32_to_cpu( key->u.k_offset_v1.k_offset ) : 582 le32_to_cpu(key->u.k_offset_v1.k_offset) :
585 offset_v2_k_offset( &(key->u.k_offset_v2) ); 583 offset_v2_k_offset(&(key->u.k_offset_v2));
586} 584}
587 585
588static inline loff_t le_ih_k_offset (const struct item_head * ih) 586static inline loff_t le_ih_k_offset(const struct item_head *ih)
589{ 587{
590 return le_key_k_offset (ih_version (ih), &(ih->ih_key)); 588 return le_key_k_offset(ih_version(ih), &(ih->ih_key));
591} 589}
592 590
593static inline loff_t le_key_k_type (int version, const struct reiserfs_key * key) 591static inline loff_t le_key_k_type(int version, const struct reiserfs_key *key)
594{ 592{
595 return (version == KEY_FORMAT_3_5) ? 593 return (version == KEY_FORMAT_3_5) ?
596 uniqueness2type( le32_to_cpu( key->u.k_offset_v1.k_uniqueness)) : 594 uniqueness2type(le32_to_cpu(key->u.k_offset_v1.k_uniqueness)) :
597 offset_v2_k_type( &(key->u.k_offset_v2) ); 595 offset_v2_k_type(&(key->u.k_offset_v2));
598} 596}
599 597
600static inline loff_t le_ih_k_type (const struct item_head * ih) 598static inline loff_t le_ih_k_type(const struct item_head *ih)
601{ 599{
602 return le_key_k_type (ih_version (ih), &(ih->ih_key)); 600 return le_key_k_type(ih_version(ih), &(ih->ih_key));
603} 601}
604 602
605 603static inline void set_le_key_k_offset(int version, struct reiserfs_key *key,
606static inline void set_le_key_k_offset (int version, struct reiserfs_key * key, loff_t offset) 604 loff_t offset)
607{ 605{
608 (version == KEY_FORMAT_3_5) ? 606 (version == KEY_FORMAT_3_5) ? (void)(key->u.k_offset_v1.k_offset = cpu_to_le32(offset)) : /* jdm check */
609 (void)(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */ 607 (void)(set_offset_v2_k_offset(&(key->u.k_offset_v2), offset));
610 (void)(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
611} 608}
612 609
613 610static inline void set_le_ih_k_offset(struct item_head *ih, loff_t offset)
614static inline void set_le_ih_k_offset (struct item_head * ih, loff_t offset)
615{ 611{
616 set_le_key_k_offset (ih_version (ih), &(ih->ih_key), offset); 612 set_le_key_k_offset(ih_version(ih), &(ih->ih_key), offset);
617} 613}
618 614
619 615static inline void set_le_key_k_type(int version, struct reiserfs_key *key,
620static inline void set_le_key_k_type (int version, struct reiserfs_key * key, int type) 616 int type)
621{ 617{
622 (version == KEY_FORMAT_3_5) ? 618 (version == KEY_FORMAT_3_5) ?
623 (void)(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))): 619 (void)(key->u.k_offset_v1.k_uniqueness =
624 (void)(set_offset_v2_k_type( &(key->u.k_offset_v2), type )); 620 cpu_to_le32(type2uniqueness(type)))
621 : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type));
625} 622}
626static inline void set_le_ih_k_type (struct item_head * ih, int type) 623static inline void set_le_ih_k_type(struct item_head *ih, int type)
627{ 624{
628 set_le_key_k_type (ih_version (ih), &(ih->ih_key), type); 625 set_le_key_k_type(ih_version(ih), &(ih->ih_key), type);
629} 626}
630 627
631
632#define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY) 628#define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY)
633#define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT) 629#define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT)
634#define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT) 630#define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT)
@@ -642,34 +638,32 @@ static inline void set_le_ih_k_type (struct item_head * ih, int type)
642#define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key)) 638#define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key))
643#define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key)) 639#define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key))
644 640
645
646
647// 641//
648// key is pointer to cpu key, result is cpu 642// key is pointer to cpu key, result is cpu
649// 643//
650static inline loff_t cpu_key_k_offset (const struct cpu_key * key) 644static inline loff_t cpu_key_k_offset(const struct cpu_key *key)
651{ 645{
652 return key->on_disk_key.k_offset; 646 return key->on_disk_key.k_offset;
653} 647}
654 648
655static inline loff_t cpu_key_k_type (const struct cpu_key * key) 649static inline loff_t cpu_key_k_type(const struct cpu_key *key)
656{ 650{
657 return key->on_disk_key.k_type; 651 return key->on_disk_key.k_type;
658} 652}
659 653
660static inline void set_cpu_key_k_offset (struct cpu_key * key, loff_t offset) 654static inline void set_cpu_key_k_offset(struct cpu_key *key, loff_t offset)
661{ 655{
662 key->on_disk_key.k_offset = offset; 656 key->on_disk_key.k_offset = offset;
663} 657}
664 658
665static inline void set_cpu_key_k_type (struct cpu_key * key, int type) 659static inline void set_cpu_key_k_type(struct cpu_key *key, int type)
666{ 660{
667 key->on_disk_key.k_type = type; 661 key->on_disk_key.k_type = type;
668} 662}
669 663
670static inline void cpu_key_k_offset_dec (struct cpu_key * key) 664static inline void cpu_key_k_offset_dec(struct cpu_key *key)
671{ 665{
672 key->on_disk_key.k_offset --; 666 key->on_disk_key.k_offset--;
673} 667}
674 668
675#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY) 669#define is_direntry_cpu_key(key) (cpu_key_k_type (key) == TYPE_DIRENTRY)
@@ -677,34 +671,25 @@ static inline void cpu_key_k_offset_dec (struct cpu_key * key)
677#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT) 671#define is_indirect_cpu_key(key) (cpu_key_k_type (key) == TYPE_INDIRECT)
678#define is_statdata_cpu_key(key) (cpu_key_k_type (key) == TYPE_STAT_DATA) 672#define is_statdata_cpu_key(key) (cpu_key_k_type (key) == TYPE_STAT_DATA)
679 673
680
681/* are these used ? */ 674/* are these used ? */
682#define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key))) 675#define is_direntry_cpu_ih(ih) (is_direntry_cpu_key (&((ih)->ih_key)))
683#define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key))) 676#define is_direct_cpu_ih(ih) (is_direct_cpu_key (&((ih)->ih_key)))
684#define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key))) 677#define is_indirect_cpu_ih(ih) (is_indirect_cpu_key (&((ih)->ih_key)))
685#define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key))) 678#define is_statdata_cpu_ih(ih) (is_statdata_cpu_key (&((ih)->ih_key)))
686 679
687
688
689
690
691#define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \ 680#define I_K_KEY_IN_ITEM(p_s_ih, p_s_key, n_blocksize) \
692 ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \ 681 ( ! COMP_SHORT_KEYS(p_s_ih, p_s_key) && \
693 I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) ) 682 I_OFF_BYTE_IN_ITEM(p_s_ih, k_offset (p_s_key), n_blocksize) )
694 683
695/* maximal length of item */ 684/* maximal length of item */
696#define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE) 685#define MAX_ITEM_LEN(block_size) (block_size - BLKH_SIZE - IH_SIZE)
697#define MIN_ITEM_LEN 1 686#define MIN_ITEM_LEN 1
698 687
699
700/* object identifier for root dir */ 688/* object identifier for root dir */
701#define REISERFS_ROOT_OBJECTID 2 689#define REISERFS_ROOT_OBJECTID 2
702#define REISERFS_ROOT_PARENT_OBJECTID 1 690#define REISERFS_ROOT_PARENT_OBJECTID 1
703extern struct reiserfs_key root_key; 691extern struct reiserfs_key root_key;
704 692
705
706
707
708/* 693/*
709 * Picture represents a leaf of the S+tree 694 * Picture represents a leaf of the S+tree
710 * ______________________________________________________ 695 * ______________________________________________________
@@ -716,13 +701,13 @@ extern struct reiserfs_key root_key;
716 701
717/* Header of a disk block. More precisely, header of a formatted leaf 702/* Header of a disk block. More precisely, header of a formatted leaf
718 or internal node, and not the header of an unformatted node. */ 703 or internal node, and not the header of an unformatted node. */
719struct block_head { 704struct block_head {
720 __le16 blk_level; /* Level of a block in the tree. */ 705 __le16 blk_level; /* Level of a block in the tree. */
721 __le16 blk_nr_item; /* Number of keys/items in a block. */ 706 __le16 blk_nr_item; /* Number of keys/items in a block. */
722 __le16 blk_free_space; /* Block free space in bytes. */ 707 __le16 blk_free_space; /* Block free space in bytes. */
723 __le16 blk_reserved; 708 __le16 blk_reserved;
724 /* dump this in v4/planA */ 709 /* dump this in v4/planA */
725 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */ 710 struct reiserfs_key blk_right_delim_key; /* kept only for compatibility */
726}; 711};
727 712
728#define BLKH_SIZE (sizeof(struct block_head)) 713#define BLKH_SIZE (sizeof(struct block_head))
@@ -741,12 +726,12 @@ struct block_head {
741 * values for blk_level field of the struct block_head 726 * values for blk_level field of the struct block_head
742 */ 727 */
743 728
744#define FREE_LEVEL 0 /* when node gets removed from the tree its 729#define FREE_LEVEL 0 /* when node gets removed from the tree its
745 blk_level is set to FREE_LEVEL. It is then 730 blk_level is set to FREE_LEVEL. It is then
746 used to see whether the node is still in the 731 used to see whether the node is still in the
747 tree */ 732 tree */
748 733
749#define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level.*/ 734#define DISK_LEAF_NODE_LEVEL 1 /* Leaf node level. */
750 735
751/* Given the buffer head of a formatted node, resolve to the block head of that node. */ 736/* Given the buffer head of a formatted node, resolve to the block head of that node. */
752#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data)) 737#define B_BLK_HEAD(p_s_bh) ((struct block_head *)((p_s_bh)->b_data))
@@ -759,7 +744,6 @@ struct block_head {
759#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0) 744#define PUT_B_LEVEL(p_s_bh,val) do { set_blkh_level(B_BLK_HEAD(p_s_bh),val); } while (0)
760#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0) 745#define PUT_B_FREE_SPACE(p_s_bh,val) do { set_blkh_free_space(B_BLK_HEAD(p_s_bh),val); } while (0)
761 746
762
763/* Get right delimiting key. -- little endian */ 747/* Get right delimiting key. -- little endian */
764#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh)) 748#define B_PRIGHT_DELIM_KEY(p_s_bh) (&(blk_right_delim_key(B_BLK_HEAD(p_s_bh))
765 749
@@ -770,41 +754,36 @@ struct block_head {
770#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \ 754#define B_IS_KEYS_LEVEL(p_s_bh) (B_LEVEL(p_s_bh) > DISK_LEAF_NODE_LEVEL \
771 && B_LEVEL(p_s_bh) <= MAX_HEIGHT) 755 && B_LEVEL(p_s_bh) <= MAX_HEIGHT)
772 756
773
774
775
776/***************************************************************************/ 757/***************************************************************************/
777/* STAT DATA */ 758/* STAT DATA */
778/***************************************************************************/ 759/***************************************************************************/
779 760
780
781// 761//
782// old stat data is 32 bytes long. We are going to distinguish new one by 762// old stat data is 32 bytes long. We are going to distinguish new one by
783// different size 763// different size
784// 764//
785struct stat_data_v1 765struct stat_data_v1 {
786{ 766 __le16 sd_mode; /* file type, permissions */
787 __le16 sd_mode; /* file type, permissions */ 767 __le16 sd_nlink; /* number of hard links */
788 __le16 sd_nlink; /* number of hard links */ 768 __le16 sd_uid; /* owner */
789 __le16 sd_uid; /* owner */ 769 __le16 sd_gid; /* group */
790 __le16 sd_gid; /* group */ 770 __le32 sd_size; /* file size */
791 __le32 sd_size; /* file size */ 771 __le32 sd_atime; /* time of last access */
792 __le32 sd_atime; /* time of last access */ 772 __le32 sd_mtime; /* time file was last modified */
793 __le32 sd_mtime; /* time file was last modified */ 773 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
794 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 774 union {
795 union { 775 __le32 sd_rdev;
796 __le32 sd_rdev; 776 __le32 sd_blocks; /* number of blocks file uses */
797 __le32 sd_blocks; /* number of blocks file uses */ 777 } __attribute__ ((__packed__)) u;
798 } __attribute__ ((__packed__)) u; 778 __le32 sd_first_direct_byte; /* first byte of file which is stored
799 __le32 sd_first_direct_byte; /* first byte of file which is stored 779 in a direct item: except that if it
800 in a direct item: except that if it 780 equals 1 it is a symlink and if it
801 equals 1 it is a symlink and if it 781 equals ~(__u32)0 there is no
802 equals ~(__u32)0 there is no 782 direct item. The existence of this
803 direct item. The existence of this 783 field really grates on me. Let's
804 field really grates on me. Let's 784 replace it with a macro based on
805 replace it with a macro based on 785 sd_size and our tail suppression
806 sd_size and our tail suppression 786 policy. Someday. -Hans */
807 policy. Someday. -Hans */
808} __attribute__ ((__packed__)); 787} __attribute__ ((__packed__));
809 788
810#define SD_V1_SIZE (sizeof(struct stat_data_v1)) 789#define SD_V1_SIZE (sizeof(struct stat_data_v1))
@@ -862,29 +841,29 @@ struct stat_data_v1
862/* Stat Data on disk (reiserfs version of UFS disk inode minus the 841/* Stat Data on disk (reiserfs version of UFS disk inode minus the
863 address blocks) */ 842 address blocks) */
864struct stat_data { 843struct stat_data {
865 __le16 sd_mode; /* file type, permissions */ 844 __le16 sd_mode; /* file type, permissions */
866 __le16 sd_attrs; /* persistent inode flags */ 845 __le16 sd_attrs; /* persistent inode flags */
867 __le32 sd_nlink; /* number of hard links */ 846 __le32 sd_nlink; /* number of hard links */
868 __le64 sd_size; /* file size */ 847 __le64 sd_size; /* file size */
869 __le32 sd_uid; /* owner */ 848 __le32 sd_uid; /* owner */
870 __le32 sd_gid; /* group */ 849 __le32 sd_gid; /* group */
871 __le32 sd_atime; /* time of last access */ 850 __le32 sd_atime; /* time of last access */
872 __le32 sd_mtime; /* time file was last modified */ 851 __le32 sd_mtime; /* time file was last modified */
873 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */ 852 __le32 sd_ctime; /* time inode (stat data) was last changed (except changes to sd_atime and sd_mtime) */
874 __le32 sd_blocks; 853 __le32 sd_blocks;
875 union { 854 union {
876 __le32 sd_rdev; 855 __le32 sd_rdev;
877 __le32 sd_generation; 856 __le32 sd_generation;
878 //__le32 sd_first_direct_byte; 857 //__le32 sd_first_direct_byte;
879 /* first byte of file which is stored in a 858 /* first byte of file which is stored in a
880 direct item: except that if it equals 1 859 direct item: except that if it equals 1
881 it is a symlink and if it equals 860 it is a symlink and if it equals
882 ~(__u32)0 there is no direct item. The 861 ~(__u32)0 there is no direct item. The
883 existence of this field really grates 862 existence of this field really grates
884 on me. Let's replace it with a macro 863 on me. Let's replace it with a macro
885 based on sd_size and our tail 864 based on sd_size and our tail
886 suppression policy? */ 865 suppression policy? */
887 } __attribute__ ((__packed__)) u; 866 } __attribute__ ((__packed__)) u;
888} __attribute__ ((__packed__)); 867} __attribute__ ((__packed__));
889// 868//
890// this is 44 bytes long 869// this is 44 bytes long
@@ -919,7 +898,6 @@ struct stat_data {
919#define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs)) 898#define sd_v2_attrs(sdp) (le16_to_cpu((sdp)->sd_attrs))
920#define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v)) 899#define set_sd_v2_attrs(sdp,v) ((sdp)->sd_attrs = cpu_to_le16(v))
921 900
922
923/***************************************************************************/ 901/***************************************************************************/
924/* DIRECTORY STRUCTURE */ 902/* DIRECTORY STRUCTURE */
925/***************************************************************************/ 903/***************************************************************************/
@@ -954,17 +932,14 @@ struct stat_data {
954/* NOT IMPLEMENTED: 932/* NOT IMPLEMENTED:
955 Directory will someday contain stat data of object */ 933 Directory will someday contain stat data of object */
956 934
957 935struct reiserfs_de_head {
958 936 __le32 deh_offset; /* third component of the directory entry key */
959struct reiserfs_de_head 937 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced
960{ 938 by directory entry */
961 __le32 deh_offset; /* third component of the directory entry key */ 939 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */
962 __le32 deh_dir_id; /* objectid of the parent directory of the object, that is referenced 940 __le16 deh_location; /* offset of name in the whole item */
963 by directory entry */ 941 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
964 __le32 deh_objectid; /* objectid of the object, that is referenced by directory entry */ 942 entry is hidden (unlinked) */
965 __le16 deh_location; /* offset of name in the whole item */
966 __le16 deh_state; /* whether 1) entry contains stat data (for future), and 2) whether
967 entry is hidden (unlinked) */
968} __attribute__ ((__packed__)); 943} __attribute__ ((__packed__));
969#define DEH_SIZE sizeof(struct reiserfs_de_head) 944#define DEH_SIZE sizeof(struct reiserfs_de_head)
970#define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset)) 945#define deh_offset(p_deh) (le32_to_cpu((p_deh)->deh_offset))
@@ -986,7 +961,7 @@ struct reiserfs_de_head
986/* old format directories have this size when empty */ 961/* old format directories have this size when empty */
987#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3) 962#define EMPTY_DIR_SIZE_V1 (DEH_SIZE * 2 + 3)
988 963
989#define DEH_Statdata 0 /* not used now */ 964#define DEH_Statdata 0 /* not used now */
990#define DEH_Visible 2 965#define DEH_Visible 2
991 966
992/* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */ 967/* 64 bit systems (and the S/390) need to be aligned explicitly -jdm */
@@ -1023,10 +998,10 @@ struct reiserfs_de_head
1023#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 998#define de_visible(deh) test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1024#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state)) 999#define de_hidden(deh) !test_bit_unaligned (DEH_Visible, &((deh)->deh_state))
1025 1000
1026extern void make_empty_dir_item_v1 (char * body, __le32 dirid, __le32 objid, 1001extern void make_empty_dir_item_v1(char *body, __le32 dirid, __le32 objid,
1027 __le32 par_dirid, __le32 par_objid); 1002 __le32 par_dirid, __le32 par_objid);
1028extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid, 1003extern void make_empty_dir_item(char *body, __le32 dirid, __le32 objid,
1029 __le32 par_dirid, __le32 par_objid); 1004 __le32 par_dirid, __le32 par_objid);
1030 1005
1031/* array of the entry headers */ 1006/* array of the entry headers */
1032 /* get item body */ 1007 /* get item body */
@@ -1043,53 +1018,48 @@ extern void make_empty_dir_item (char * body, __le32 dirid, __le32 objid,
1043#define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \ 1018#define I_DEH_N_ENTRY_LENGTH(ih,deh,i) \
1044((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh)))) 1019((i) ? (deh_location((deh)-1) - deh_location((deh))) : (ih_item_len((ih)) - deh_location((deh))))
1045*/ 1020*/
1046static inline int entry_length (const struct buffer_head * bh, 1021static inline int entry_length(const struct buffer_head *bh,
1047 const struct item_head * ih, int pos_in_item) 1022 const struct item_head *ih, int pos_in_item)
1048{ 1023{
1049 struct reiserfs_de_head * deh; 1024 struct reiserfs_de_head *deh;
1050 1025
1051 deh = B_I_DEH (bh, ih) + pos_in_item; 1026 deh = B_I_DEH(bh, ih) + pos_in_item;
1052 if (pos_in_item) 1027 if (pos_in_item)
1053 return deh_location(deh-1) - deh_location(deh); 1028 return deh_location(deh - 1) - deh_location(deh);
1054 1029
1055 return ih_item_len(ih) - deh_location(deh); 1030 return ih_item_len(ih) - deh_location(deh);
1056} 1031}
1057 1032
1058
1059
1060/* number of entries in the directory item, depends on ENTRY_COUNT being at the start of directory dynamic data. */ 1033/* number of entries in the directory item, depends on ENTRY_COUNT being at the start of directory dynamic data. */
1061#define I_ENTRY_COUNT(ih) (ih_entry_count((ih))) 1034#define I_ENTRY_COUNT(ih) (ih_entry_count((ih)))
1062 1035
1063
1064/* name by bh, ih and entry_num */ 1036/* name by bh, ih and entry_num */
1065#define B_I_E_NAME(bh,ih,entry_num) ((char *)(bh->b_data + ih_location(ih) + deh_location(B_I_DEH(bh,ih)+(entry_num)))) 1037#define B_I_E_NAME(bh,ih,entry_num) ((char *)(bh->b_data + ih_location(ih) + deh_location(B_I_DEH(bh,ih)+(entry_num))))
1066 1038
1067// two entries per block (at least) 1039// two entries per block (at least)
1068#define REISERFS_MAX_NAME(block_size) 255 1040#define REISERFS_MAX_NAME(block_size) 255
1069 1041
1070
1071/* this structure is used for operations on directory entries. It is 1042/* this structure is used for operations on directory entries. It is
1072 not a disk structure. */ 1043 not a disk structure. */
1073/* When reiserfs_find_entry or search_by_entry_key find directory 1044/* When reiserfs_find_entry or search_by_entry_key find directory
1074 entry, they return filled reiserfs_dir_entry structure */ 1045 entry, they return filled reiserfs_dir_entry structure */
1075struct reiserfs_dir_entry 1046struct reiserfs_dir_entry {
1076{ 1047 struct buffer_head *de_bh;
1077 struct buffer_head * de_bh; 1048 int de_item_num;
1078 int de_item_num; 1049 struct item_head *de_ih;
1079 struct item_head * de_ih; 1050 int de_entry_num;
1080 int de_entry_num; 1051 struct reiserfs_de_head *de_deh;
1081 struct reiserfs_de_head * de_deh; 1052 int de_entrylen;
1082 int de_entrylen; 1053 int de_namelen;
1083 int de_namelen; 1054 char *de_name;
1084 char * de_name; 1055 char *de_gen_number_bit_string;
1085 char * de_gen_number_bit_string; 1056
1086 1057 __u32 de_dir_id;
1087 __u32 de_dir_id; 1058 __u32 de_objectid;
1088 __u32 de_objectid; 1059
1089 1060 struct cpu_key de_entry_key;
1090 struct cpu_key de_entry_key;
1091}; 1061};
1092 1062
1093/* these defines are useful when a particular member of a reiserfs_dir_entry is needed */ 1063/* these defines are useful when a particular member of a reiserfs_dir_entry is needed */
1094 1064
1095/* pointer to file name, stored in entry */ 1065/* pointer to file name, stored in entry */
@@ -1099,8 +1069,6 @@ struct reiserfs_dir_entry
1099#define I_DEH_N_ENTRY_FILE_NAME_LENGTH(ih,deh,entry_num) \ 1069#define I_DEH_N_ENTRY_FILE_NAME_LENGTH(ih,deh,entry_num) \
1100(I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0)) 1070(I_DEH_N_ENTRY_LENGTH (ih, deh, entry_num) - (de_with_sd (deh) ? SD_SIZE : 0))
1101 1071
1102
1103
1104/* hash value occupies bits from 7 up to 30 */ 1072/* hash value occupies bits from 7 up to 30 */
1105#define GET_HASH_VALUE(offset) ((offset) & 0x7fffff80LL) 1073#define GET_HASH_VALUE(offset) ((offset) & 0x7fffff80LL)
1106/* generation number occupies 7 bits starting from 0 up to 6 */ 1074/* generation number occupies 7 bits starting from 0 up to 6 */
@@ -1109,7 +1077,6 @@ struct reiserfs_dir_entry
1109 1077
1110#define SET_GENERATION_NUMBER(offset,gen_number) (GET_HASH_VALUE(offset)|(gen_number)) 1078#define SET_GENERATION_NUMBER(offset,gen_number) (GET_HASH_VALUE(offset)|(gen_number))
1111 1079
1112
1113/* 1080/*
1114 * Picture represents an internal node of the reiserfs tree 1081 * Picture represents an internal node of the reiserfs tree
1115 * ______________________________________________________ 1082 * ______________________________________________________
@@ -1125,9 +1092,9 @@ struct reiserfs_dir_entry
1125/* Disk child pointer: The pointer from an internal node of the tree 1092/* Disk child pointer: The pointer from an internal node of the tree
1126 to a node that is on disk. */ 1093 to a node that is on disk. */
1127struct disk_child { 1094struct disk_child {
1128 __le32 dc_block_number; /* Disk child's block number. */ 1095 __le32 dc_block_number; /* Disk child's block number. */
1129 __le16 dc_size; /* Disk child's used space. */ 1096 __le16 dc_size; /* Disk child's used space. */
1130 __le16 dc_reserved; 1097 __le16 dc_reserved;
1131}; 1098};
1132 1099
1133#define DC_SIZE (sizeof(struct disk_child)) 1100#define DC_SIZE (sizeof(struct disk_child))
@@ -1144,7 +1111,7 @@ struct disk_child {
1144#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos))) 1111#define B_N_CHILD_NUM(p_s_bh,n_pos) (dc_block_number(B_N_CHILD(p_s_bh,n_pos)))
1145#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val )) 1112#define PUT_B_N_CHILD_NUM(p_s_bh,n_pos, val) (put_dc_block_number(B_N_CHILD(p_s_bh,n_pos), val ))
1146 1113
1147 /* maximal value of field child_size in structure disk_child */ 1114 /* maximal value of field child_size in structure disk_child */
1148 /* child size is the combined size of all items and their headers */ 1115 /* child size is the combined size of all items and their headers */
1149#define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE )) 1116#define MAX_CHILD_SIZE(bh) ((int)( (bh)->b_size - BLKH_SIZE ))
1150 1117
@@ -1159,7 +1126,6 @@ struct disk_child {
1159/* PATH STRUCTURES AND DEFINES */ 1126/* PATH STRUCTURES AND DEFINES */
1160/***************************************************************************/ 1127/***************************************************************************/
1161 1128
1162
1163/* Search_by_key fills up the path from the root to the leaf as it descends the tree looking for the 1129/* Search_by_key fills up the path from the root to the leaf as it descends the tree looking for the
1164 key. It uses reiserfs_bread to try to find buffers in the cache given their block number. If it 1130 key. It uses reiserfs_bread to try to find buffers in the cache given their block number. If it
1165 does not find them in the cache it reads them from disk. For each node search_by_key finds using 1131 does not find them in the cache it reads them from disk. For each node search_by_key finds using
@@ -1168,20 +1134,18 @@ struct disk_child {
1168 is looking through a leaf node bin_search will find the position of the item which has key either 1134 is looking through a leaf node bin_search will find the position of the item which has key either
1169 equal to given key, or which is the maximal key less than the given key. */ 1135 equal to given key, or which is the maximal key less than the given key. */
1170 1136
1171struct path_element { 1137struct path_element {
1172 struct buffer_head * pe_buffer; /* Pointer to the buffer at the path in the tree. */ 1138 struct buffer_head *pe_buffer; /* Pointer to the buffer at the path in the tree. */
1173 int pe_position; /* Position in the tree node which is placed in the */ 1139 int pe_position; /* Position in the tree node which is placed in the */
1174 /* buffer above. */ 1140 /* buffer above. */
1175}; 1141};
1176 1142
1177#define MAX_HEIGHT 5 /* maximal height of a tree. don't change this without changing JOURNAL_PER_BALANCE_CNT */ 1143#define MAX_HEIGHT 5 /* maximal height of a tree. don't change this without changing JOURNAL_PER_BALANCE_CNT */
1178#define EXTENDED_MAX_HEIGHT 7 /* Must be equals MAX_HEIGHT + FIRST_PATH_ELEMENT_OFFSET */ 1144#define EXTENDED_MAX_HEIGHT 7 /* Must be equals MAX_HEIGHT + FIRST_PATH_ELEMENT_OFFSET */
1179#define FIRST_PATH_ELEMENT_OFFSET 2 /* Must be equal to at least 2. */ 1145#define FIRST_PATH_ELEMENT_OFFSET 2 /* Must be equal to at least 2. */
1180
1181#define ILLEGAL_PATH_ELEMENT_OFFSET 1 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
1182#define MAX_FEB_SIZE 6 /* this MUST be MAX_HEIGHT + 1. See about FEB below */
1183
1184 1146
1147#define ILLEGAL_PATH_ELEMENT_OFFSET 1 /* Must be equal to FIRST_PATH_ELEMENT_OFFSET - 1 */
1148#define MAX_FEB_SIZE 6 /* this MUST be MAX_HEIGHT + 1. See about FEB below */
1185 1149
1186/* We need to keep track of who the ancestors of nodes are. When we 1150/* We need to keep track of who the ancestors of nodes are. When we
1187 perform a search we record which nodes were visited while 1151 perform a search we record which nodes were visited while
@@ -1200,14 +1164,14 @@ excessive effort to avoid disturbing the precious VFS code.:-( The
1200gods only know how we are going to SMP the code that uses them. 1164gods only know how we are going to SMP the code that uses them.
1201znodes are the way! */ 1165znodes are the way! */
1202 1166
1203#define PATH_READA 0x1 /* do read ahead */ 1167#define PATH_READA 0x1 /* do read ahead */
1204#define PATH_READA_BACK 0x2 /* read backwards */ 1168#define PATH_READA_BACK 0x2 /* read backwards */
1205 1169
1206struct path { 1170struct path {
1207 int path_length; /* Length of the array above. */ 1171 int path_length; /* Length of the array above. */
1208 int reada; 1172 int reada;
1209 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */ 1173 struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
1210 int pos_in_item; 1174 int pos_in_item;
1211}; 1175};
1212 1176
1213#define pos_in_item(path) ((path)->pos_in_item) 1177#define pos_in_item(path) ((path)->pos_in_item)
@@ -1224,25 +1188,23 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1224/* Get position in the element at the path by path and path position. */ 1188/* Get position in the element at the path by path and path position. */
1225#define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position) 1189#define PATH_OFFSET_POSITION(p_s_path,n_offset) (PATH_OFFSET_PELEMENT(p_s_path,n_offset)->pe_position)
1226 1190
1227
1228#define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length)) 1191#define PATH_PLAST_BUFFER(p_s_path) (PATH_OFFSET_PBUFFER((p_s_path), (p_s_path)->path_length))
1229 /* you know, to the person who didn't 1192 /* you know, to the person who didn't
1230 write this the macro name does not 1193 write this the macro name does not
1231 at first suggest what it does. 1194 at first suggest what it does.
1232 Maybe POSITION_FROM_PATH_END? Or 1195 Maybe POSITION_FROM_PATH_END? Or
1233 maybe we should just focus on 1196 maybe we should just focus on
1234 dumping paths... -Hans */ 1197 dumping paths... -Hans */
1235#define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length)) 1198#define PATH_LAST_POSITION(p_s_path) (PATH_OFFSET_POSITION((p_s_path), (p_s_path)->path_length))
1236 1199
1237
1238#define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path)) 1200#define PATH_PITEM_HEAD(p_s_path) B_N_PITEM_HEAD(PATH_PLAST_BUFFER(p_s_path),PATH_LAST_POSITION(p_s_path))
1239 1201
1240/* in do_balance leaf has h == 0 in contrast with path structure, 1202/* in do_balance leaf has h == 0 in contrast with path structure,
1241 where root has level == 0. That is why we need these defines */ 1203 where root has level == 0. That is why we need these defines */
1242#define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */ 1204#define PATH_H_PBUFFER(p_s_path, h) PATH_OFFSET_PBUFFER (p_s_path, p_s_path->path_length - (h)) /* tb->S[h] */
1243#define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */ 1205#define PATH_H_PPARENT(path, h) PATH_H_PBUFFER (path, (h) + 1) /* tb->F[h] or tb->S[0]->b_parent */
1244#define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h)) 1206#define PATH_H_POSITION(path, h) PATH_OFFSET_POSITION (path, path->path_length - (h))
1245#define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */ 1207#define PATH_H_B_ITEM_ORDER(path, h) PATH_H_POSITION(path, h + 1) /* tb->S[h]->b_item_order */
1246 1208
1247#define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h)) 1209#define PATH_H_PATH_OFFSET(p_s_path, n_h) ((p_s_path)->path_length - (n_h))
1248 1210
@@ -1253,7 +1215,6 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1253#define item_moved(ih,path) comp_items(ih, path) 1215#define item_moved(ih,path) comp_items(ih, path)
1254#define path_changed(ih,path) comp_items (ih, path) 1216#define path_changed(ih,path) comp_items (ih, path)
1255 1217
1256
1257/***************************************************************************/ 1218/***************************************************************************/
1258/* MISC */ 1219/* MISC */
1259/***************************************************************************/ 1220/***************************************************************************/
@@ -1272,30 +1233,26 @@ struct path var = {.path_length = ILLEGAL_PATH_ELEMENT_OFFSET, .reada = 0,}
1272// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset 1233// reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
1273#define U32_MAX (~(__u32)0) 1234#define U32_MAX (~(__u32)0)
1274 1235
1275static inline loff_t max_reiserfs_offset (struct inode * inode) 1236static inline loff_t max_reiserfs_offset(struct inode *inode)
1276{ 1237{
1277 if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5) 1238 if (get_inode_item_key_version(inode) == KEY_FORMAT_3_5)
1278 return (loff_t)U32_MAX; 1239 return (loff_t) U32_MAX;
1279 1240
1280 return (loff_t)((~(__u64)0) >> 4); 1241 return (loff_t) ((~(__u64) 0) >> 4);
1281} 1242}
1282 1243
1283
1284/*#define MAX_KEY_UNIQUENESS MAX_UL_INT*/ 1244/*#define MAX_KEY_UNIQUENESS MAX_UL_INT*/
1285#define MAX_KEY_OBJECTID MAX_UL_INT 1245#define MAX_KEY_OBJECTID MAX_UL_INT
1286 1246
1287
1288#define MAX_B_NUM MAX_UL_INT 1247#define MAX_B_NUM MAX_UL_INT
1289#define MAX_FC_NUM MAX_US_INT 1248#define MAX_FC_NUM MAX_US_INT
1290 1249
1291
1292/* the purpose is to detect overflow of an unsigned short */ 1250/* the purpose is to detect overflow of an unsigned short */
1293#define REISERFS_LINK_MAX (MAX_US_INT - 1000) 1251#define REISERFS_LINK_MAX (MAX_US_INT - 1000)
1294 1252
1295
1296/* The following defines are used in reiserfs_insert_item and reiserfs_append_item */ 1253/* The following defines are used in reiserfs_insert_item and reiserfs_append_item */
1297#define REISERFS_KERNEL_MEM 0 /* reiserfs kernel memory mode */ 1254#define REISERFS_KERNEL_MEM 0 /* reiserfs kernel memory mode */
1298#define REISERFS_USER_MEM 1 /* reiserfs user memory mode */ 1255#define REISERFS_USER_MEM 1 /* reiserfs user memory mode */
1299 1256
1300#define fs_generation(s) (REISERFS_SB(s)->s_generation_counter) 1257#define fs_generation(s) (REISERFS_SB(s)->s_generation_counter)
1301#define get_generation(s) atomic_read (&fs_generation(s)) 1258#define get_generation(s) atomic_read (&fs_generation(s))
@@ -1303,7 +1260,6 @@ static inline loff_t max_reiserfs_offset (struct inode * inode)
1303#define __fs_changed(gen,s) (gen != get_generation (s)) 1260#define __fs_changed(gen,s) (gen != get_generation (s))
1304#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);}) 1261#define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);})
1305 1262
1306
1307/***************************************************************************/ 1263/***************************************************************************/
1308/* FIXATE NODES */ 1264/* FIXATE NODES */
1309/***************************************************************************/ 1265/***************************************************************************/
@@ -1324,38 +1280,34 @@ static inline loff_t max_reiserfs_offset (struct inode * inode)
1324 calculating what we can shift to neighbors and how many nodes we 1280 calculating what we can shift to neighbors and how many nodes we
1325 have to have if we do not any shiftings, if we shift to left/right 1281 have to have if we do not any shiftings, if we shift to left/right
1326 neighbor or to both. */ 1282 neighbor or to both. */
1327struct virtual_item 1283struct virtual_item {
1328{ 1284 int vi_index; // index in the array of item operations
1329 int vi_index; // index in the array of item operations 1285 unsigned short vi_type; // left/right mergeability
1330 unsigned short vi_type; // left/right mergeability 1286 unsigned short vi_item_len; /* length of item that it will have after balancing */
1331 unsigned short vi_item_len; /* length of item that it will have after balancing */ 1287 struct item_head *vi_ih;
1332 struct item_head * vi_ih; 1288 const char *vi_item; // body of item (old or new)
1333 const char * vi_item; // body of item (old or new) 1289 const void *vi_new_data; // 0 always but paste mode
1334 const void * vi_new_data; // 0 always but paste mode 1290 void *vi_uarea; // item specific area
1335 void * vi_uarea; // item specific area
1336}; 1291};
1337 1292
1338 1293struct virtual_node {
1339struct virtual_node 1294 char *vn_free_ptr; /* this is a pointer to the free space in the buffer */
1340{ 1295 unsigned short vn_nr_item; /* number of items in virtual node */
1341 char * vn_free_ptr; /* this is a pointer to the free space in the buffer */ 1296 short vn_size; /* size of node , that node would have if it has unlimited size and no balancing is performed */
1342 unsigned short vn_nr_item; /* number of items in virtual node */ 1297 short vn_mode; /* mode of balancing (paste, insert, delete, cut) */
1343 short vn_size; /* size of node , that node would have if it has unlimited size and no balancing is performed */ 1298 short vn_affected_item_num;
1344 short vn_mode; /* mode of balancing (paste, insert, delete, cut) */ 1299 short vn_pos_in_item;
1345 short vn_affected_item_num; 1300 struct item_head *vn_ins_ih; /* item header of inserted item, 0 for other modes */
1346 short vn_pos_in_item; 1301 const void *vn_data;
1347 struct item_head * vn_ins_ih; /* item header of inserted item, 0 for other modes */ 1302 struct virtual_item *vn_vi; /* array of items (including a new one, excluding item to be deleted) */
1348 const void * vn_data;
1349 struct virtual_item * vn_vi; /* array of items (including a new one, excluding item to be deleted) */
1350}; 1303};
1351 1304
1352/* used by directory items when creating virtual nodes */ 1305/* used by directory items when creating virtual nodes */
1353struct direntry_uarea { 1306struct direntry_uarea {
1354 int flags; 1307 int flags;
1355 __u16 entry_count; 1308 __u16 entry_count;
1356 __u16 entry_sizes[1]; 1309 __u16 entry_sizes[1];
1357} __attribute__ ((__packed__)) ; 1310} __attribute__ ((__packed__));
1358
1359 1311
1360/***************************************************************************/ 1312/***************************************************************************/
1361/* TREE BALANCE */ 1313/* TREE BALANCE */
@@ -1378,73 +1330,72 @@ struct direntry_uarea {
1378#define MAX_AMOUNT_NEEDED 2 1330#define MAX_AMOUNT_NEEDED 2
1379 1331
1380/* someday somebody will prefix every field in this struct with tb_ */ 1332/* someday somebody will prefix every field in this struct with tb_ */
1381struct tree_balance 1333struct tree_balance {
1382{ 1334 int tb_mode;
1383 int tb_mode; 1335 int need_balance_dirty;
1384 int need_balance_dirty; 1336 struct super_block *tb_sb;
1385 struct super_block * tb_sb; 1337 struct reiserfs_transaction_handle *transaction_handle;
1386 struct reiserfs_transaction_handle *transaction_handle ; 1338 struct path *tb_path;
1387 struct path * tb_path; 1339 struct buffer_head *L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
1388 struct buffer_head * L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */ 1340 struct buffer_head *R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path */
1389 struct buffer_head * R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path*/ 1341 struct buffer_head *FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
1390 struct buffer_head * FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */ 1342 struct buffer_head *FR[MAX_HEIGHT]; /* array of fathers of the right neighbors */
1391 struct buffer_head * FR[MAX_HEIGHT]; /* array of fathers of the right neighbors */ 1343 struct buffer_head *CFL[MAX_HEIGHT]; /* array of common parents of center node and its left neighbor */
1392 struct buffer_head * CFL[MAX_HEIGHT]; /* array of common parents of center node and its left neighbor */ 1344 struct buffer_head *CFR[MAX_HEIGHT]; /* array of common parents of center node and its right neighbor */
1393 struct buffer_head * CFR[MAX_HEIGHT]; /* array of common parents of center node and its right neighbor */ 1345
1394 1346 struct buffer_head *FEB[MAX_FEB_SIZE]; /* array of empty buffers. Number of buffers in array equals
1395 struct buffer_head * FEB[MAX_FEB_SIZE]; /* array of empty buffers. Number of buffers in array equals 1347 cur_blknum. */
1396 cur_blknum. */ 1348 struct buffer_head *used[MAX_FEB_SIZE];
1397 struct buffer_head * used[MAX_FEB_SIZE]; 1349 struct buffer_head *thrown[MAX_FEB_SIZE];
1398 struct buffer_head * thrown[MAX_FEB_SIZE]; 1350 int lnum[MAX_HEIGHT]; /* array of number of items which must be
1399 int lnum[MAX_HEIGHT]; /* array of number of items which must be 1351 shifted to the left in order to balance the
1400 shifted to the left in order to balance the 1352 current node; for leaves includes item that
1401 current node; for leaves includes item that 1353 will be partially shifted; for internal
1402 will be partially shifted; for internal 1354 nodes, it is the number of child pointers
1403 nodes, it is the number of child pointers 1355 rather than items. It includes the new item
1404 rather than items. It includes the new item 1356 being created. The code sometimes subtracts
1405 being created. The code sometimes subtracts 1357 one to get the number of wholly shifted
1406 one to get the number of wholly shifted 1358 items for other purposes. */
1407 items for other purposes. */ 1359 int rnum[MAX_HEIGHT]; /* substitute right for left in comment above */
1408 int rnum[MAX_HEIGHT]; /* substitute right for left in comment above */ 1360 int lkey[MAX_HEIGHT]; /* array indexed by height h mapping the key delimiting L[h] and
1409 int lkey[MAX_HEIGHT]; /* array indexed by height h mapping the key delimiting L[h] and 1361 S[h] to its item number within the node CFL[h] */
1410 S[h] to its item number within the node CFL[h] */ 1362 int rkey[MAX_HEIGHT]; /* substitute r for l in comment above */
1411 int rkey[MAX_HEIGHT]; /* substitute r for l in comment above */ 1363 int insert_size[MAX_HEIGHT]; /* the number of bytes by we are trying to add or remove from
1412 int insert_size[MAX_HEIGHT]; /* the number of bytes by we are trying to add or remove from 1364 S[h]. A negative value means removing. */
1413 S[h]. A negative value means removing. */ 1365 int blknum[MAX_HEIGHT]; /* number of nodes that will replace node S[h] after
1414 int blknum[MAX_HEIGHT]; /* number of nodes that will replace node S[h] after 1366 balancing on the level h of the tree. If 0 then S is
1415 balancing on the level h of the tree. If 0 then S is 1367 being deleted, if 1 then S is remaining and no new nodes
1416 being deleted, if 1 then S is remaining and no new nodes 1368 are being created, if 2 or 3 then 1 or 2 new nodes is
1417 are being created, if 2 or 3 then 1 or 2 new nodes is 1369 being created */
1418 being created */ 1370
1419 1371 /* fields that are used only for balancing leaves of the tree */
1420 /* fields that are used only for balancing leaves of the tree */ 1372 int cur_blknum; /* number of empty blocks having been already allocated */
1421 int cur_blknum; /* number of empty blocks having been already allocated */ 1373 int s0num; /* number of items that fall into left most node when S[0] splits */
1422 int s0num; /* number of items that fall into left most node when S[0] splits */ 1374 int s1num; /* number of items that fall into first new node when S[0] splits */
1423 int s1num; /* number of items that fall into first new node when S[0] splits */ 1375 int s2num; /* number of items that fall into second new node when S[0] splits */
1424 int s2num; /* number of items that fall into second new node when S[0] splits */ 1376 int lbytes; /* number of bytes which can flow to the left neighbor from the left */
1425 int lbytes; /* number of bytes which can flow to the left neighbor from the left */ 1377 /* most liquid item that cannot be shifted from S[0] entirely */
1426 /* most liquid item that cannot be shifted from S[0] entirely */ 1378 /* if -1 then nothing will be partially shifted */
1427 /* if -1 then nothing will be partially shifted */ 1379 int rbytes; /* number of bytes which will flow to the right neighbor from the right */
1428 int rbytes; /* number of bytes which will flow to the right neighbor from the right */ 1380 /* most liquid item that cannot be shifted from S[0] entirely */
1429 /* most liquid item that cannot be shifted from S[0] entirely */ 1381 /* if -1 then nothing will be partially shifted */
1430 /* if -1 then nothing will be partially shifted */ 1382 int s1bytes; /* number of bytes which flow to the first new node when S[0] splits */
1431 int s1bytes; /* number of bytes which flow to the first new node when S[0] splits */ 1383 /* note: if S[0] splits into 3 nodes, then items do not need to be cut */
1432 /* note: if S[0] splits into 3 nodes, then items do not need to be cut */ 1384 int s2bytes;
1433 int s2bytes; 1385 struct buffer_head *buf_to_free[MAX_FREE_BLOCK]; /* buffers which are to be freed after do_balance finishes by unfix_nodes */
1434 struct buffer_head * buf_to_free[MAX_FREE_BLOCK]; /* buffers which are to be freed after do_balance finishes by unfix_nodes */ 1386 char *vn_buf; /* kmalloced memory. Used to create
1435 char * vn_buf; /* kmalloced memory. Used to create
1436 virtual node and keep map of 1387 virtual node and keep map of
1437 dirtied bitmap blocks */ 1388 dirtied bitmap blocks */
1438 int vn_buf_size; /* size of the vn_buf */ 1389 int vn_buf_size; /* size of the vn_buf */
1439 struct virtual_node * tb_vn; /* VN starts after bitmap of bitmap blocks */ 1390 struct virtual_node *tb_vn; /* VN starts after bitmap of bitmap blocks */
1440 1391
1441 int fs_gen; /* saved value of `reiserfs_generation' counter 1392 int fs_gen; /* saved value of `reiserfs_generation' counter
1442 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */ 1393 see FILESYSTEM_CHANGED() macro in reiserfs_fs.h */
1443#ifdef DISPLACE_NEW_PACKING_LOCALITIES 1394#ifdef DISPLACE_NEW_PACKING_LOCALITIES
1444 struct in_core_key key; /* key pointer, to pass to block allocator or 1395 struct in_core_key key; /* key pointer, to pass to block allocator or
1445 another low-level subsystem */ 1396 another low-level subsystem */
1446#endif 1397#endif
1447} ; 1398};
1448 1399
1449/* These are modes of balancing */ 1400/* These are modes of balancing */
1450 1401
@@ -1479,13 +1430,12 @@ struct tree_balance
1479/* used in do_balance for passing parent of node information that has 1430/* used in do_balance for passing parent of node information that has
1480 been gotten from tb struct */ 1431 been gotten from tb struct */
1481struct buffer_info { 1432struct buffer_info {
1482 struct tree_balance * tb; 1433 struct tree_balance *tb;
1483 struct buffer_head * bi_bh; 1434 struct buffer_head *bi_bh;
1484 struct buffer_head * bi_parent; 1435 struct buffer_head *bi_parent;
1485 int bi_position; 1436 int bi_position;
1486}; 1437};
1487 1438
1488
1489/* there are 4 types of items: stat data, directory item, indirect, direct. 1439/* there are 4 types of items: stat data, directory item, indirect, direct.
1490+-------------------+------------+--------------+------------+ 1440+-------------------+------------+--------------+------------+
1491| | k_offset | k_uniqueness | mergeable? | 1441| | k_offset | k_uniqueness | mergeable? |
@@ -1503,24 +1453,24 @@ struct buffer_info {
1503*/ 1453*/
1504 1454
1505struct item_operations { 1455struct item_operations {
1506 int (*bytes_number) (struct item_head * ih, int block_size); 1456 int (*bytes_number) (struct item_head * ih, int block_size);
1507 void (*decrement_key) (struct cpu_key *); 1457 void (*decrement_key) (struct cpu_key *);
1508 int (*is_left_mergeable) (struct reiserfs_key * ih, unsigned long bsize); 1458 int (*is_left_mergeable) (struct reiserfs_key * ih,
1509 void (*print_item) (struct item_head *, char * item); 1459 unsigned long bsize);
1510 void (*check_item) (struct item_head *, char * item); 1460 void (*print_item) (struct item_head *, char *item);
1511 1461 void (*check_item) (struct item_head *, char *item);
1512 int (*create_vi) (struct virtual_node * vn, struct virtual_item * vi, 1462
1513 int is_affected, int insert_size); 1463 int (*create_vi) (struct virtual_node * vn, struct virtual_item * vi,
1514 int (*check_left) (struct virtual_item * vi, int free, 1464 int is_affected, int insert_size);
1515 int start_skip, int end_skip); 1465 int (*check_left) (struct virtual_item * vi, int free,
1516 int (*check_right) (struct virtual_item * vi, int free); 1466 int start_skip, int end_skip);
1517 int (*part_size) (struct virtual_item * vi, int from, int to); 1467 int (*check_right) (struct virtual_item * vi, int free);
1518 int (*unit_num) (struct virtual_item * vi); 1468 int (*part_size) (struct virtual_item * vi, int from, int to);
1519 void (*print_vi) (struct virtual_item * vi); 1469 int (*unit_num) (struct virtual_item * vi);
1470 void (*print_vi) (struct virtual_item * vi);
1520}; 1471};
1521 1472
1522 1473extern struct item_operations *item_ops[TYPE_ANY + 1];
1523extern struct item_operations * item_ops [TYPE_ANY + 1];
1524 1474
1525#define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize) 1475#define op_bytes_number(ih,bsize) item_ops[le_ih_k_type (ih)]->bytes_number (ih, bsize)
1526#define op_is_left_mergeable(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (key, bsize) 1476#define op_is_left_mergeable(key,bsize) item_ops[le_key_k_type (le_key_version (key), key)]->is_left_mergeable (key, bsize)
@@ -1533,8 +1483,6 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1533#define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi) 1483#define op_unit_num(vi) item_ops[(vi)->vi_index]->unit_num (vi)
1534#define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi) 1484#define op_print_vi(vi) item_ops[(vi)->vi_index]->print_vi (vi)
1535 1485
1536
1537
1538#define COMP_SHORT_KEYS comp_short_keys 1486#define COMP_SHORT_KEYS comp_short_keys
1539 1487
1540/* number of blocks pointed to by the indirect item */ 1488/* number of blocks pointed to by the indirect item */
@@ -1545,8 +1493,7 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1545 1493
1546/* number of bytes contained by the direct item or the unformatted nodes the indirect item points to */ 1494/* number of bytes contained by the direct item or the unformatted nodes the indirect item points to */
1547 1495
1548 1496/* get the item header */
1549/* get the item header */
1550#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) ) 1497#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
1551 1498
1552/* get key */ 1499/* get key */
@@ -1577,9 +1524,9 @@ extern struct item_operations * item_ops [TYPE_ANY + 1];
1577#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0) 1524#define PUT_B_I_POS_UNFM_POINTER(bh,ih,pos, val) do {*(((unp_t *)B_I_PITEM(bh,ih)) + (pos)) = cpu_to_le32(val); } while (0)
1578 1525
1579struct reiserfs_iget_args { 1526struct reiserfs_iget_args {
1580 __u32 objectid ; 1527 __u32 objectid;
1581 __u32 dirid ; 1528 __u32 dirid;
1582} ; 1529};
1583 1530
1584/***************************************************************************/ 1531/***************************************************************************/
1585/* FUNCTION DECLARATIONS */ 1532/* FUNCTION DECLARATIONS */
@@ -1595,11 +1542,11 @@ struct reiserfs_iget_args {
1595 1542
1596/* first block written in a commit. */ 1543/* first block written in a commit. */
1597struct reiserfs_journal_desc { 1544struct reiserfs_journal_desc {
1598 __le32 j_trans_id ; /* id of commit */ 1545 __le32 j_trans_id; /* id of commit */
1599 __le32 j_len ; /* length of commit. len +1 is the commit block */ 1546 __le32 j_len; /* length of commit. len +1 is the commit block */
1600 __le32 j_mount_id ; /* mount id of this trans*/ 1547 __le32 j_mount_id; /* mount id of this trans */
1601 __le32 j_realblock[1] ; /* real locations for each block */ 1548 __le32 j_realblock[1]; /* real locations for each block */
1602} ; 1549};
1603 1550
1604#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id) 1551#define get_desc_trans_id(d) le32_to_cpu((d)->j_trans_id)
1605#define get_desc_trans_len(d) le32_to_cpu((d)->j_len) 1552#define get_desc_trans_len(d) le32_to_cpu((d)->j_len)
@@ -1611,10 +1558,10 @@ struct reiserfs_journal_desc {
1611 1558
1612/* last block written in a commit */ 1559/* last block written in a commit */
1613struct reiserfs_journal_commit { 1560struct reiserfs_journal_commit {
1614 __le32 j_trans_id ; /* must match j_trans_id from the desc block */ 1561 __le32 j_trans_id; /* must match j_trans_id from the desc block */
1615 __le32 j_len ; /* ditto */ 1562 __le32 j_len; /* ditto */
1616 __le32 j_realblock[1] ; /* real locations for each block */ 1563 __le32 j_realblock[1]; /* real locations for each block */
1617} ; 1564};
1618 1565
1619#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id) 1566#define get_commit_trans_id(c) le32_to_cpu((c)->j_trans_id)
1620#define get_commit_trans_len(c) le32_to_cpu((c)->j_len) 1567#define get_commit_trans_len(c) le32_to_cpu((c)->j_len)
@@ -1628,27 +1575,34 @@ struct reiserfs_journal_commit {
1628** and this transaction does not need to be replayed. 1575** and this transaction does not need to be replayed.
1629*/ 1576*/
1630struct reiserfs_journal_header { 1577struct reiserfs_journal_header {
1631 __le32 j_last_flush_trans_id ; /* id of last fully flushed transaction */ 1578 __le32 j_last_flush_trans_id; /* id of last fully flushed transaction */
1632 __le32 j_first_unflushed_offset ; /* offset in the log of where to start replay after a crash */ 1579 __le32 j_first_unflushed_offset; /* offset in the log of where to start replay after a crash */
1633 __le32 j_mount_id ; 1580 __le32 j_mount_id;
1634 /* 12 */ struct journal_params jh_journal; 1581 /* 12 */ struct journal_params jh_journal;
1635} ; 1582};
1636 1583
1637/* biggest tunable defines are right here */ 1584/* biggest tunable defines are right here */
1638#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */ 1585#define JOURNAL_BLOCK_COUNT 8192 /* number of blocks in the journal */
1639#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */ 1586#define JOURNAL_TRANS_MAX_DEFAULT 1024 /* biggest possible single transaction, don't change for now (8/3/99) */
1640#define JOURNAL_TRANS_MIN_DEFAULT 256 1587#define JOURNAL_TRANS_MIN_DEFAULT 256
1641#define JOURNAL_MAX_BATCH_DEFAULT 900 /* max blocks to batch into one transaction, don't make this any bigger than 900 */ 1588#define JOURNAL_MAX_BATCH_DEFAULT 900 /* max blocks to batch into one transaction, don't make this any bigger than 900 */
1642#define JOURNAL_MIN_RATIO 2 1589#define JOURNAL_MIN_RATIO 2
1643#define JOURNAL_MAX_COMMIT_AGE 30 1590#define JOURNAL_MAX_COMMIT_AGE 30
1644#define JOURNAL_MAX_TRANS_AGE 30 1591#define JOURNAL_MAX_TRANS_AGE 30
1645#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9) 1592#define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
1646#ifdef CONFIG_QUOTA 1593#ifdef CONFIG_QUOTA
1647#define REISERFS_QUOTA_TRANS_BLOCKS 2 /* We need to update data and inode (atime) */ 1594/* We need to update data and inode (atime) */
1648#define REISERFS_QUOTA_INIT_BLOCKS (DQUOT_MAX_WRITES*(JOURNAL_PER_BALANCE_CNT+2)+1) /* 1 balancing, 1 bitmap, 1 data per write + stat data update */ 1595#define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0)
1596/* 1 balancing, 1 bitmap, 1 data per write + stat data update */
1597#define REISERFS_QUOTA_INIT_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \
1598(DQUOT_INIT_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_INIT_REWRITE+1) : 0)
1599/* same as with INIT */
1600#define REISERFS_QUOTA_DEL_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? \
1601(DQUOT_DEL_ALLOC*(JOURNAL_PER_BALANCE_CNT+2)+DQUOT_DEL_REWRITE+1) : 0)
1649#else 1602#else
1650#define REISERFS_QUOTA_TRANS_BLOCKS 0 1603#define REISERFS_QUOTA_TRANS_BLOCKS(s) 0
1651#define REISERFS_QUOTA_INIT_BLOCKS 0 1604#define REISERFS_QUOTA_INIT_BLOCKS(s) 0
1605#define REISERFS_QUOTA_DEL_BLOCKS(s) 0
1652#endif 1606#endif
1653 1607
1654/* both of these can be as low as 1, or as high as you want. The min is the 1608/* both of these can be as low as 1, or as high as you want. The min is the
@@ -1657,10 +1611,10 @@ struct reiserfs_journal_header {
1657** the current number of nodes is > max, the node is freed, otherwise, 1611** the current number of nodes is > max, the node is freed, otherwise,
1658** it is put on a free list for faster use later. 1612** it is put on a free list for faster use later.
1659*/ 1613*/
1660#define REISERFS_MIN_BITMAP_NODES 10 1614#define REISERFS_MIN_BITMAP_NODES 10
1661#define REISERFS_MAX_BITMAP_NODES 100 1615#define REISERFS_MAX_BITMAP_NODES 100
1662 1616
1663#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */ 1617#define JBH_HASH_SHIFT 13 /* these are based on journal hash size of 8192 */
1664#define JBH_HASH_MASK 8191 1618#define JBH_HASH_MASK 8191
1665 1619
1666#define _jhashfn(sb,block) \ 1620#define _jhashfn(sb,block) \
@@ -1674,14 +1628,14 @@ struct reiserfs_journal_header {
1674#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize) 1628#define journal_bread(s, block) __bread(SB_JOURNAL(s)->j_dev_bd, block, s->s_blocksize)
1675 1629
1676enum reiserfs_bh_state_bits { 1630enum reiserfs_bh_state_bits {
1677 BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */ 1631 BH_JDirty = BH_PrivateStart, /* buffer is in current transaction */
1678 BH_JDirty_wait, 1632 BH_JDirty_wait,
1679 BH_JNew, /* disk block was taken off free list before 1633 BH_JNew, /* disk block was taken off free list before
1680 * being in a finished transaction, or 1634 * being in a finished transaction, or
1681 * written to disk. Can be reused immed. */ 1635 * written to disk. Can be reused immed. */
1682 BH_JPrepared, 1636 BH_JPrepared,
1683 BH_JRestore_dirty, 1637 BH_JRestore_dirty,
1684 BH_JTest, // debugging only will go away 1638 BH_JTest, // debugging only will go away
1685}; 1639};
1686 1640
1687BUFFER_FNS(JDirty, journaled); 1641BUFFER_FNS(JDirty, journaled);
@@ -1701,175 +1655,192 @@ TAS_BUFFER_FNS(JTest, journal_test);
1701** transaction handle which is passed around for all journal calls 1655** transaction handle which is passed around for all journal calls
1702*/ 1656*/
1703struct reiserfs_transaction_handle { 1657struct reiserfs_transaction_handle {
1704 struct super_block *t_super ; /* super for this FS when journal_begin was 1658 struct super_block *t_super; /* super for this FS when journal_begin was
1705 called. saves calls to reiserfs_get_super 1659 called. saves calls to reiserfs_get_super
1706 also used by nested transactions to make 1660 also used by nested transactions to make
1707 sure they are nesting on the right FS 1661 sure they are nesting on the right FS
1708 _must_ be first in the handle 1662 _must_ be first in the handle
1709 */ 1663 */
1710 int t_refcount; 1664 int t_refcount;
1711 int t_blocks_logged ; /* number of blocks this writer has logged */ 1665 int t_blocks_logged; /* number of blocks this writer has logged */
1712 int t_blocks_allocated ; /* number of blocks this writer allocated */ 1666 int t_blocks_allocated; /* number of blocks this writer allocated */
1713 unsigned long t_trans_id ; /* sanity check, equals the current trans id */ 1667 unsigned long t_trans_id; /* sanity check, equals the current trans id */
1714 void *t_handle_save ; /* save existing current->journal_info */ 1668 void *t_handle_save; /* save existing current->journal_info */
1715 unsigned displace_new_blocks:1; /* if new block allocation occurres, that block 1669 unsigned displace_new_blocks:1; /* if new block allocation occurres, that block
1716 should be displaced from others */ 1670 should be displaced from others */
1717 struct list_head t_list; 1671 struct list_head t_list;
1718} ; 1672};
1719 1673
1720/* used to keep track of ordered and tail writes, attached to the buffer 1674/* used to keep track of ordered and tail writes, attached to the buffer
1721 * head through b_journal_head. 1675 * head through b_journal_head.
1722 */ 1676 */
1723struct reiserfs_jh { 1677struct reiserfs_jh {
1724 struct reiserfs_journal_list *jl; 1678 struct reiserfs_journal_list *jl;
1725 struct buffer_head *bh; 1679 struct buffer_head *bh;
1726 struct list_head list; 1680 struct list_head list;
1727}; 1681};
1728 1682
1729void reiserfs_free_jh(struct buffer_head *bh); 1683void reiserfs_free_jh(struct buffer_head *bh);
1730int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh); 1684int reiserfs_add_tail_list(struct inode *inode, struct buffer_head *bh);
1731int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh); 1685int reiserfs_add_ordered_list(struct inode *inode, struct buffer_head *bh);
1732int journal_mark_dirty(struct reiserfs_transaction_handle *, struct super_block *, struct buffer_head *bh) ; 1686int journal_mark_dirty(struct reiserfs_transaction_handle *,
1733 1687 struct super_block *, struct buffer_head *bh);
1734static inline int 1688
1735reiserfs_file_data_log(struct inode *inode) { 1689static inline int reiserfs_file_data_log(struct inode *inode)
1736 if (reiserfs_data_log(inode->i_sb) || 1690{
1737 (REISERFS_I(inode)->i_flags & i_data_log)) 1691 if (reiserfs_data_log(inode->i_sb) ||
1738 return 1 ; 1692 (REISERFS_I(inode)->i_flags & i_data_log))
1739 return 0 ; 1693 return 1;
1694 return 0;
1740} 1695}
1741 1696
1742static inline int reiserfs_transaction_running(struct super_block *s) { 1697static inline int reiserfs_transaction_running(struct super_block *s)
1743 struct reiserfs_transaction_handle *th = current->journal_info ; 1698{
1744 if (th && th->t_super == s) 1699 struct reiserfs_transaction_handle *th = current->journal_info;
1745 return 1 ; 1700 if (th && th->t_super == s)
1746 if (th && th->t_super == NULL) 1701 return 1;
1747 BUG(); 1702 if (th && th->t_super == NULL)
1748 return 0 ; 1703 BUG();
1704 return 0;
1749} 1705}
1750 1706
1751int reiserfs_async_progress_wait(struct super_block *s); 1707int reiserfs_async_progress_wait(struct super_block *s);
1752 1708
1753struct reiserfs_transaction_handle * 1709struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
1754reiserfs_persistent_transaction(struct super_block *, int count); 1710 super_block
1711 *,
1712 int count);
1755int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *); 1713int reiserfs_end_persistent_transaction(struct reiserfs_transaction_handle *);
1756int reiserfs_commit_page(struct inode *inode, struct page *page, 1714int reiserfs_commit_page(struct inode *inode, struct page *page,
1757 unsigned from, unsigned to); 1715 unsigned from, unsigned to);
1758int reiserfs_flush_old_commits(struct super_block *); 1716int reiserfs_flush_old_commits(struct super_block *);
1759int reiserfs_commit_for_inode(struct inode *) ; 1717int reiserfs_commit_for_inode(struct inode *);
1760int reiserfs_inode_needs_commit(struct inode *) ; 1718int reiserfs_inode_needs_commit(struct inode *);
1761void reiserfs_update_inode_transaction(struct inode *) ; 1719void reiserfs_update_inode_transaction(struct inode *);
1762void reiserfs_wait_on_write_block(struct super_block *s) ; 1720void reiserfs_wait_on_write_block(struct super_block *s);
1763void reiserfs_block_writes(struct reiserfs_transaction_handle *th) ; 1721void reiserfs_block_writes(struct reiserfs_transaction_handle *th);
1764void reiserfs_allow_writes(struct super_block *s) ; 1722void reiserfs_allow_writes(struct super_block *s);
1765void reiserfs_check_lock_depth(struct super_block *s, char *caller) ; 1723void reiserfs_check_lock_depth(struct super_block *s, char *caller);
1766int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh, int wait) ; 1724int reiserfs_prepare_for_journal(struct super_block *, struct buffer_head *bh,
1767void reiserfs_restore_prepared_buffer(struct super_block *, struct buffer_head *bh) ; 1725 int wait);
1768int journal_init(struct super_block *, const char * j_dev_name, int old_format, unsigned int) ; 1726void reiserfs_restore_prepared_buffer(struct super_block *,
1769int journal_release(struct reiserfs_transaction_handle*, struct super_block *) ; 1727 struct buffer_head *bh);
1770int journal_release_error(struct reiserfs_transaction_handle*, struct super_block *) ; 1728int journal_init(struct super_block *, const char *j_dev_name, int old_format,
1771int journal_end(struct reiserfs_transaction_handle *, struct super_block *, unsigned long) ; 1729 unsigned int);
1772int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, unsigned long) ; 1730int journal_release(struct reiserfs_transaction_handle *, struct super_block *);
1773int journal_mark_freed(struct reiserfs_transaction_handle *, struct super_block *, b_blocknr_t blocknr) ; 1731int journal_release_error(struct reiserfs_transaction_handle *,
1774int journal_transaction_should_end(struct reiserfs_transaction_handle *, int) ; 1732 struct super_block *);
1775int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr, int searchall, b_blocknr_t *next) ; 1733int journal_end(struct reiserfs_transaction_handle *, struct super_block *,
1776int journal_begin(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; 1734 unsigned long);
1777int journal_join_abort(struct reiserfs_transaction_handle *, struct super_block *p_s_sb, unsigned long) ; 1735int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *,
1778void reiserfs_journal_abort (struct super_block *sb, int errno); 1736 unsigned long);
1779void reiserfs_abort (struct super_block *sb, int errno, const char *fmt, ...); 1737int journal_mark_freed(struct reiserfs_transaction_handle *,
1780int reiserfs_allocate_list_bitmaps(struct super_block *s, struct reiserfs_list_bitmap *, int) ; 1738 struct super_block *, b_blocknr_t blocknr);
1781 1739int journal_transaction_should_end(struct reiserfs_transaction_handle *, int);
1782void add_save_link (struct reiserfs_transaction_handle * th, 1740int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr,
1783 struct inode * inode, int truncate); 1741 int searchall, b_blocknr_t * next);
1784int remove_save_link (struct inode * inode, int truncate); 1742int journal_begin(struct reiserfs_transaction_handle *,
1743 struct super_block *p_s_sb, unsigned long);
1744int journal_join_abort(struct reiserfs_transaction_handle *,
1745 struct super_block *p_s_sb, unsigned long);
1746void reiserfs_journal_abort(struct super_block *sb, int errno);
1747void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
1748int reiserfs_allocate_list_bitmaps(struct super_block *s,
1749 struct reiserfs_list_bitmap *, int);
1750
1751void add_save_link(struct reiserfs_transaction_handle *th,
1752 struct inode *inode, int truncate);
1753int remove_save_link(struct inode *inode, int truncate);
1785 1754
1786/* objectid.c */ 1755/* objectid.c */
1787__u32 reiserfs_get_unused_objectid (struct reiserfs_transaction_handle *th); 1756__u32 reiserfs_get_unused_objectid(struct reiserfs_transaction_handle *th);
1788void reiserfs_release_objectid (struct reiserfs_transaction_handle *th, __u32 objectid_to_release); 1757void reiserfs_release_objectid(struct reiserfs_transaction_handle *th,
1789int reiserfs_convert_objectid_map_v1(struct super_block *) ; 1758 __u32 objectid_to_release);
1759int reiserfs_convert_objectid_map_v1(struct super_block *);
1790 1760
1791/* stree.c */ 1761/* stree.c */
1792int B_IS_IN_TREE(const struct buffer_head *); 1762int B_IS_IN_TREE(const struct buffer_head *);
1793extern void copy_item_head(struct item_head * p_v_to, 1763extern void copy_item_head(struct item_head *p_v_to,
1794 const struct item_head * p_v_from); 1764 const struct item_head *p_v_from);
1795 1765
1796// first key is in cpu form, second - le 1766// first key is in cpu form, second - le
1797extern int comp_short_keys (const struct reiserfs_key * le_key, 1767extern int comp_short_keys(const struct reiserfs_key *le_key,
1798 const struct cpu_key * cpu_key); 1768 const struct cpu_key *cpu_key);
1799extern void le_key2cpu_key (struct cpu_key * to, const struct reiserfs_key * from); 1769extern void le_key2cpu_key(struct cpu_key *to, const struct reiserfs_key *from);
1800 1770
1801// both are in le form 1771// both are in le form
1802extern int comp_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); 1772extern int comp_le_keys(const struct reiserfs_key *,
1803extern int comp_short_le_keys (const struct reiserfs_key *, const struct reiserfs_key *); 1773 const struct reiserfs_key *);
1774extern int comp_short_le_keys(const struct reiserfs_key *,
1775 const struct reiserfs_key *);
1804 1776
1805// 1777//
1806// get key version from on disk key - kludge 1778// get key version from on disk key - kludge
1807// 1779//
1808static inline int le_key_version (const struct reiserfs_key * key) 1780static inline int le_key_version(const struct reiserfs_key *key)
1809{ 1781{
1810 int type; 1782 int type;
1811
1812 type = offset_v2_k_type( &(key->u.k_offset_v2));
1813 if (type != TYPE_DIRECT && type != TYPE_INDIRECT && type != TYPE_DIRENTRY)
1814 return KEY_FORMAT_3_5;
1815
1816 return KEY_FORMAT_3_6;
1817
1818}
1819 1783
1784 type = offset_v2_k_type(&(key->u.k_offset_v2));
1785 if (type != TYPE_DIRECT && type != TYPE_INDIRECT
1786 && type != TYPE_DIRENTRY)
1787 return KEY_FORMAT_3_5;
1788
1789 return KEY_FORMAT_3_6;
1820 1790
1821static inline void copy_key (struct reiserfs_key *to, const struct reiserfs_key *from)
1822{
1823 memcpy (to, from, KEY_SIZE);
1824} 1791}
1825 1792
1793static inline void copy_key(struct reiserfs_key *to,
1794 const struct reiserfs_key *from)
1795{
1796 memcpy(to, from, KEY_SIZE);
1797}
1826 1798
1827int comp_items (const struct item_head * stored_ih, const struct path * p_s_path); 1799int comp_items(const struct item_head *stored_ih, const struct path *p_s_path);
1828const struct reiserfs_key * get_rkey (const struct path * p_s_chk_path, 1800const struct reiserfs_key *get_rkey(const struct path *p_s_chk_path,
1829 const struct super_block * p_s_sb); 1801 const struct super_block *p_s_sb);
1830int search_by_key (struct super_block *, const struct cpu_key *, 1802int search_by_key(struct super_block *, const struct cpu_key *,
1831 struct path *, int); 1803 struct path *, int);
1832#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL) 1804#define search_item(s,key,path) search_by_key (s, key, path, DISK_LEAF_NODE_LEVEL)
1833int search_for_position_by_key (struct super_block * p_s_sb, 1805int search_for_position_by_key(struct super_block *p_s_sb,
1834 const struct cpu_key * p_s_cpu_key, 1806 const struct cpu_key *p_s_cpu_key,
1835 struct path * p_s_search_path); 1807 struct path *p_s_search_path);
1836extern void decrement_bcount (struct buffer_head * p_s_bh); 1808extern void decrement_bcount(struct buffer_head *p_s_bh);
1837void decrement_counters_in_path (struct path * p_s_search_path); 1809void decrement_counters_in_path(struct path *p_s_search_path);
1838void pathrelse (struct path * p_s_search_path); 1810void pathrelse(struct path *p_s_search_path);
1839int reiserfs_check_path(struct path *p) ; 1811int reiserfs_check_path(struct path *p);
1840void pathrelse_and_restore (struct super_block *s, struct path * p_s_search_path); 1812void pathrelse_and_restore(struct super_block *s, struct path *p_s_search_path);
1841 1813
1842int reiserfs_insert_item (struct reiserfs_transaction_handle *th, 1814int reiserfs_insert_item(struct reiserfs_transaction_handle *th,
1843 struct path * path, 1815 struct path *path,
1844 const struct cpu_key * key, 1816 const struct cpu_key *key,
1845 struct item_head * ih, 1817 struct item_head *ih,
1846 struct inode *inode, const char * body); 1818 struct inode *inode, const char *body);
1847 1819
1848int reiserfs_paste_into_item (struct reiserfs_transaction_handle *th, 1820int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th,
1849 struct path * path, 1821 struct path *path,
1850 const struct cpu_key * key, 1822 const struct cpu_key *key,
1851 struct inode *inode, 1823 struct inode *inode,
1852 const char * body, int paste_size); 1824 const char *body, int paste_size);
1853 1825
1854int reiserfs_cut_from_item (struct reiserfs_transaction_handle *th, 1826int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th,
1855 struct path * path, 1827 struct path *path,
1856 struct cpu_key * key, 1828 struct cpu_key *key,
1857 struct inode * inode, 1829 struct inode *inode,
1858 struct page *page, 1830 struct page *page, loff_t new_file_size);
1859 loff_t new_file_size); 1831
1860 1832int reiserfs_delete_item(struct reiserfs_transaction_handle *th,
1861int reiserfs_delete_item (struct reiserfs_transaction_handle *th, 1833 struct path *path,
1862 struct path * path, 1834 const struct cpu_key *key,
1863 const struct cpu_key * key, 1835 struct inode *inode, struct buffer_head *p_s_un_bh);
1864 struct inode * inode, 1836
1865 struct buffer_head * p_s_un_bh); 1837void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th,
1866 1838 struct inode *inode, struct reiserfs_key *key);
1867void reiserfs_delete_solid_item (struct reiserfs_transaction_handle *th, 1839int reiserfs_delete_object(struct reiserfs_transaction_handle *th,
1868 struct inode *inode, struct reiserfs_key * key); 1840 struct inode *p_s_inode);
1869int reiserfs_delete_object (struct reiserfs_transaction_handle *th, struct inode * p_s_inode); 1841int reiserfs_do_truncate(struct reiserfs_transaction_handle *th,
1870int reiserfs_do_truncate (struct reiserfs_transaction_handle *th, 1842 struct inode *p_s_inode, struct page *,
1871 struct inode * p_s_inode, struct page *, 1843 int update_timestamps);
1872 int update_timestamps);
1873 1844
1874#define i_block_size(inode) ((inode)->i_sb->s_blocksize) 1845#define i_block_size(inode) ((inode)->i_sb->s_blocksize)
1875#define file_size(inode) ((inode)->i_size) 1846#define file_size(inode) ((inode)->i_size)
@@ -1878,66 +1849,67 @@ int reiserfs_do_truncate (struct reiserfs_transaction_handle *th,
1878#define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\ 1849#define tail_has_to_be_packed(inode) (have_large_tails ((inode)->i_sb)?\
1879!STORE_TAIL_IN_UNFM_S1(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):0 ) 1850!STORE_TAIL_IN_UNFM_S1(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):have_small_tails ((inode)->i_sb)?!STORE_TAIL_IN_UNFM_S2(file_size (inode), tail_size(inode), inode->i_sb->s_blocksize):0 )
1880 1851
1881void padd_item (char * item, int total_length, int length); 1852void padd_item(char *item, int total_length, int length);
1882 1853
1883/* inode.c */ 1854/* inode.c */
1884/* args for the create parameter of reiserfs_get_block */ 1855/* args for the create parameter of reiserfs_get_block */
1885#define GET_BLOCK_NO_CREATE 0 /* don't create new blocks or convert tails */ 1856#define GET_BLOCK_NO_CREATE 0 /* don't create new blocks or convert tails */
1886#define GET_BLOCK_CREATE 1 /* add anything you need to find block */ 1857#define GET_BLOCK_CREATE 1 /* add anything you need to find block */
1887#define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */ 1858#define GET_BLOCK_NO_HOLE 2 /* return -ENOENT for file holes */
1888#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */ 1859#define GET_BLOCK_READ_DIRECT 4 /* read the tail if indirect item not found */
1889#define GET_BLOCK_NO_ISEM 8 /* i_sem is not held, don't preallocate */ 1860#define GET_BLOCK_NO_ISEM 8 /* i_sem is not held, don't preallocate */
1890#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1861#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1891 1862
1892int restart_transaction(struct reiserfs_transaction_handle *th, struct inode *inode, struct path *path); 1863int restart_transaction(struct reiserfs_transaction_handle *th,
1893void reiserfs_read_locked_inode(struct inode * inode, struct reiserfs_iget_args *args) ; 1864 struct inode *inode, struct path *path);
1894int reiserfs_find_actor(struct inode * inode, void *p) ; 1865void reiserfs_read_locked_inode(struct inode *inode,
1895int reiserfs_init_locked_inode(struct inode * inode, void *p) ; 1866 struct reiserfs_iget_args *args);
1896void reiserfs_delete_inode (struct inode * inode); 1867int reiserfs_find_actor(struct inode *inode, void *p);
1897int reiserfs_write_inode (struct inode * inode, int) ; 1868int reiserfs_init_locked_inode(struct inode *inode, void *p);
1898int reiserfs_get_block (struct inode * inode, sector_t block, struct buffer_head * bh_result, int create); 1869void reiserfs_delete_inode(struct inode *inode);
1899struct dentry *reiserfs_get_dentry(struct super_block *, void *) ; 1870int reiserfs_write_inode(struct inode *inode, int);
1900struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 *data, 1871int reiserfs_get_block(struct inode *inode, sector_t block,
1901 int len, int fhtype, 1872 struct buffer_head *bh_result, int create);
1902 int (*acceptable)(void *contect, struct dentry *de), 1873struct dentry *reiserfs_get_dentry(struct super_block *, void *);
1903 void *context) ; 1874struct dentry *reiserfs_decode_fh(struct super_block *sb, __u32 * data,
1904int reiserfs_encode_fh( struct dentry *dentry, __u32 *data, int *lenp, 1875 int len, int fhtype,
1905 int connectable ); 1876 int (*acceptable) (void *contect,
1906 1877 struct dentry * de),
1907int reiserfs_truncate_file(struct inode *, int update_timestamps) ; 1878 void *context);
1908void make_cpu_key (struct cpu_key * cpu_key, struct inode * inode, loff_t offset, 1879int reiserfs_encode_fh(struct dentry *dentry, __u32 * data, int *lenp,
1909 int type, int key_length); 1880 int connectable);
1910void make_le_item_head (struct item_head * ih, const struct cpu_key * key, 1881
1911 int version, 1882int reiserfs_truncate_file(struct inode *, int update_timestamps);
1912 loff_t offset, int type, int length, int entry_count); 1883void make_cpu_key(struct cpu_key *cpu_key, struct inode *inode, loff_t offset,
1913struct inode * reiserfs_iget (struct super_block * s, 1884 int type, int key_length);
1914 const struct cpu_key * key); 1885void make_le_item_head(struct item_head *ih, const struct cpu_key *key,
1915 1886 int version,
1916 1887 loff_t offset, int type, int length, int entry_count);
1917int reiserfs_new_inode (struct reiserfs_transaction_handle *th, 1888struct inode *reiserfs_iget(struct super_block *s, const struct cpu_key *key);
1918 struct inode * dir, int mode, 1889
1919 const char * symname, loff_t i_size, 1890int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1920 struct dentry *dentry, struct inode *inode); 1891 struct inode *dir, int mode,
1921 1892 const char *symname, loff_t i_size,
1922void reiserfs_update_sd_size (struct reiserfs_transaction_handle *th, 1893 struct dentry *dentry, struct inode *inode);
1923 struct inode * inode, loff_t size); 1894
1895void reiserfs_update_sd_size(struct reiserfs_transaction_handle *th,
1896 struct inode *inode, loff_t size);
1924 1897
1925static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th, 1898static inline void reiserfs_update_sd(struct reiserfs_transaction_handle *th,
1926 struct inode *inode) 1899 struct inode *inode)
1927{ 1900{
1928 reiserfs_update_sd_size(th, inode, inode->i_size) ; 1901 reiserfs_update_sd_size(th, inode, inode->i_size);
1929} 1902}
1930 1903
1931void sd_attrs_to_i_attrs( __u16 sd_attrs, struct inode *inode ); 1904void sd_attrs_to_i_attrs(__u16 sd_attrs, struct inode *inode);
1932void i_attrs_to_sd_attrs( struct inode *inode, __u16 *sd_attrs ); 1905void i_attrs_to_sd_attrs(struct inode *inode, __u16 * sd_attrs);
1933int reiserfs_setattr(struct dentry *dentry, struct iattr *attr); 1906int reiserfs_setattr(struct dentry *dentry, struct iattr *attr);
1934 1907
1935/* namei.c */ 1908/* namei.c */
1936void set_de_name_and_namelen (struct reiserfs_dir_entry * de); 1909void set_de_name_and_namelen(struct reiserfs_dir_entry *de);
1937int search_by_entry_key (struct super_block * sb, const struct cpu_key * key, 1910int search_by_entry_key(struct super_block *sb, const struct cpu_key *key,
1938 struct path * path, 1911 struct path *path, struct reiserfs_dir_entry *de);
1939 struct reiserfs_dir_entry * de); 1912struct dentry *reiserfs_get_parent(struct dentry *);
1940struct dentry *reiserfs_get_parent(struct dentry *) ;
1941/* procfs.c */ 1913/* procfs.c */
1942 1914
1943#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) 1915#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
@@ -1946,15 +1918,15 @@ struct dentry *reiserfs_get_parent(struct dentry *) ;
1946#undef REISERFS_PROC_INFO 1918#undef REISERFS_PROC_INFO
1947#endif 1919#endif
1948 1920
1949int reiserfs_proc_info_init( struct super_block *sb ); 1921int reiserfs_proc_info_init(struct super_block *sb);
1950int reiserfs_proc_info_done( struct super_block *sb ); 1922int reiserfs_proc_info_done(struct super_block *sb);
1951struct proc_dir_entry *reiserfs_proc_register_global( char *name, 1923struct proc_dir_entry *reiserfs_proc_register_global(char *name,
1952 read_proc_t *func ); 1924 read_proc_t * func);
1953void reiserfs_proc_unregister_global( const char *name ); 1925void reiserfs_proc_unregister_global(const char *name);
1954int reiserfs_proc_info_global_init( void ); 1926int reiserfs_proc_info_global_init(void);
1955int reiserfs_proc_info_global_done( void ); 1927int reiserfs_proc_info_global_done(void);
1956int reiserfs_global_version_in_proc( char *buffer, char **start, off_t offset, 1928int reiserfs_global_version_in_proc(char *buffer, char **start, off_t offset,
1957 int count, int *eof, void *data ); 1929 int count, int *eof, void *data);
1958 1930
1959#if defined( REISERFS_PROC_INFO ) 1931#if defined( REISERFS_PROC_INFO )
1960 1932
@@ -1986,123 +1958,132 @@ extern struct inode_operations reiserfs_special_inode_operations;
1986extern struct file_operations reiserfs_dir_operations; 1958extern struct file_operations reiserfs_dir_operations;
1987 1959
1988/* tail_conversion.c */ 1960/* tail_conversion.c */
1989int direct2indirect (struct reiserfs_transaction_handle *, struct inode *, struct path *, struct buffer_head *, loff_t); 1961int direct2indirect(struct reiserfs_transaction_handle *, struct inode *,
1990int indirect2direct (struct reiserfs_transaction_handle *, struct inode *, struct page *, struct path *, const struct cpu_key *, loff_t, char *); 1962 struct path *, struct buffer_head *, loff_t);
1991void reiserfs_unmap_buffer(struct buffer_head *) ; 1963int indirect2direct(struct reiserfs_transaction_handle *, struct inode *,
1992 1964 struct page *, struct path *, const struct cpu_key *,
1965 loff_t, char *);
1966void reiserfs_unmap_buffer(struct buffer_head *);
1993 1967
1994/* file.c */ 1968/* file.c */
1995extern struct inode_operations reiserfs_file_inode_operations; 1969extern struct inode_operations reiserfs_file_inode_operations;
1996extern struct file_operations reiserfs_file_operations; 1970extern struct file_operations reiserfs_file_operations;
1997extern struct address_space_operations reiserfs_address_space_operations ; 1971extern struct address_space_operations reiserfs_address_space_operations;
1998 1972
1999/* fix_nodes.c */ 1973/* fix_nodes.c */
2000#ifdef CONFIG_REISERFS_CHECK 1974#ifdef CONFIG_REISERFS_CHECK
2001void * reiserfs_kmalloc (size_t size, int flags, struct super_block * s); 1975void *reiserfs_kmalloc(size_t size, int flags, struct super_block *s);
2002void reiserfs_kfree (const void * vp, size_t size, struct super_block * s); 1976void reiserfs_kfree(const void *vp, size_t size, struct super_block *s);
2003#else 1977#else
2004static inline void *reiserfs_kmalloc(size_t size, int flags, 1978static inline void *reiserfs_kmalloc(size_t size, int flags,
2005 struct super_block *s) 1979 struct super_block *s)
2006{ 1980{
2007 return kmalloc(size, flags); 1981 return kmalloc(size, flags);
2008} 1982}
2009 1983
2010static inline void reiserfs_kfree(const void *vp, size_t size, 1984static inline void reiserfs_kfree(const void *vp, size_t size,
2011 struct super_block *s) 1985 struct super_block *s)
2012{ 1986{
2013 kfree(vp); 1987 kfree(vp);
2014} 1988}
2015#endif 1989#endif
2016 1990
2017int fix_nodes (int n_op_mode, struct tree_balance * p_s_tb, 1991int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
2018 struct item_head * p_s_ins_ih, const void *); 1992 struct item_head *p_s_ins_ih, const void *);
2019void unfix_nodes (struct tree_balance *); 1993void unfix_nodes(struct tree_balance *);
2020
2021 1994
2022/* prints.c */ 1995/* prints.c */
2023void reiserfs_panic (struct super_block * s, const char * fmt, ...) __attribute__ ( ( noreturn ) ); 1996void reiserfs_panic(struct super_block *s, const char *fmt, ...)
2024void reiserfs_info (struct super_block *s, const char * fmt, ...); 1997 __attribute__ ((noreturn));
2025void reiserfs_debug (struct super_block *s, int level, const char * fmt, ...); 1998void reiserfs_info(struct super_block *s, const char *fmt, ...);
2026void print_indirect_item (struct buffer_head * bh, int item_num); 1999void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...);
2027void store_print_tb (struct tree_balance * tb); 2000void print_indirect_item(struct buffer_head *bh, int item_num);
2028void print_cur_tb (char * mes); 2001void store_print_tb(struct tree_balance *tb);
2029void print_de (struct reiserfs_dir_entry * de); 2002void print_cur_tb(char *mes);
2030void print_bi (struct buffer_info * bi, char * mes); 2003void print_de(struct reiserfs_dir_entry *de);
2031#define PRINT_LEAF_ITEMS 1 /* print all items */ 2004void print_bi(struct buffer_info *bi, char *mes);
2032#define PRINT_DIRECTORY_ITEMS 2 /* print directory items */ 2005#define PRINT_LEAF_ITEMS 1 /* print all items */
2033#define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */ 2006#define PRINT_DIRECTORY_ITEMS 2 /* print directory items */
2034void print_block (struct buffer_head * bh, ...); 2007#define PRINT_DIRECT_ITEMS 4 /* print contents of direct items */
2035void print_bmap (struct super_block * s, int silent); 2008void print_block(struct buffer_head *bh, ...);
2036void print_bmap_block (int i, char * data, int size, int silent); 2009void print_bmap(struct super_block *s, int silent);
2010void print_bmap_block(int i, char *data, int size, int silent);
2037/*void print_super_block (struct super_block * s, char * mes);*/ 2011/*void print_super_block (struct super_block * s, char * mes);*/
2038void print_objectid_map (struct super_block * s); 2012void print_objectid_map(struct super_block *s);
2039void print_block_head (struct buffer_head * bh, char * mes); 2013void print_block_head(struct buffer_head *bh, char *mes);
2040void check_leaf (struct buffer_head * bh); 2014void check_leaf(struct buffer_head *bh);
2041void check_internal (struct buffer_head * bh); 2015void check_internal(struct buffer_head *bh);
2042void print_statistics (struct super_block * s); 2016void print_statistics(struct super_block *s);
2043char * reiserfs_hashname(int code); 2017char *reiserfs_hashname(int code);
2044 2018
2045/* lbalance.c */ 2019/* lbalance.c */
2046int leaf_move_items (int shift_mode, struct tree_balance * tb, int mov_num, int mov_bytes, struct buffer_head * Snew); 2020int leaf_move_items(int shift_mode, struct tree_balance *tb, int mov_num,
2047int leaf_shift_left (struct tree_balance * tb, int shift_num, int shift_bytes); 2021 int mov_bytes, struct buffer_head *Snew);
2048int leaf_shift_right (struct tree_balance * tb, int shift_num, int shift_bytes); 2022int leaf_shift_left(struct tree_balance *tb, int shift_num, int shift_bytes);
2049void leaf_delete_items (struct buffer_info * cur_bi, int last_first, int first, int del_num, int del_bytes); 2023int leaf_shift_right(struct tree_balance *tb, int shift_num, int shift_bytes);
2050void leaf_insert_into_buf (struct buffer_info * bi, int before, 2024void leaf_delete_items(struct buffer_info *cur_bi, int last_first, int first,
2051 struct item_head * inserted_item_ih, const char * inserted_item_body, int zeros_number); 2025 int del_num, int del_bytes);
2052void leaf_paste_in_buffer (struct buffer_info * bi, int pasted_item_num, 2026void leaf_insert_into_buf(struct buffer_info *bi, int before,
2053 int pos_in_item, int paste_size, const char * body, int zeros_number); 2027 struct item_head *inserted_item_ih,
2054void leaf_cut_from_buffer (struct buffer_info * bi, int cut_item_num, int pos_in_item, 2028 const char *inserted_item_body, int zeros_number);
2055 int cut_size); 2029void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num,
2056void leaf_paste_entries (struct buffer_head * bh, int item_num, int before, 2030 int pos_in_item, int paste_size, const char *body,
2057 int new_entry_count, struct reiserfs_de_head * new_dehs, const char * records, int paste_size); 2031 int zeros_number);
2032void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
2033 int pos_in_item, int cut_size);
2034void leaf_paste_entries(struct buffer_head *bh, int item_num, int before,
2035 int new_entry_count, struct reiserfs_de_head *new_dehs,
2036 const char *records, int paste_size);
2058/* ibalance.c */ 2037/* ibalance.c */
2059int balance_internal (struct tree_balance * , int, int, struct item_head * , 2038int balance_internal(struct tree_balance *, int, int, struct item_head *,
2060 struct buffer_head **); 2039 struct buffer_head **);
2061 2040
2062/* do_balance.c */ 2041/* do_balance.c */
2063void do_balance_mark_leaf_dirty (struct tree_balance * tb, 2042void do_balance_mark_leaf_dirty(struct tree_balance *tb,
2064 struct buffer_head * bh, int flag); 2043 struct buffer_head *bh, int flag);
2065#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty 2044#define do_balance_mark_internal_dirty do_balance_mark_leaf_dirty
2066#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty 2045#define do_balance_mark_sb_dirty do_balance_mark_leaf_dirty
2067 2046
2068void do_balance (struct tree_balance * tb, struct item_head * ih, 2047void do_balance(struct tree_balance *tb, struct item_head *ih,
2069 const char * body, int flag); 2048 const char *body, int flag);
2070void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * bh); 2049void reiserfs_invalidate_buffer(struct tree_balance *tb,
2050 struct buffer_head *bh);
2071 2051
2072int get_left_neighbor_position (struct tree_balance * tb, int h); 2052int get_left_neighbor_position(struct tree_balance *tb, int h);
2073int get_right_neighbor_position (struct tree_balance * tb, int h); 2053int get_right_neighbor_position(struct tree_balance *tb, int h);
2074void replace_key (struct tree_balance * tb, struct buffer_head *, int, struct buffer_head *, int); 2054void replace_key(struct tree_balance *tb, struct buffer_head *, int,
2075void make_empty_node (struct buffer_info *); 2055 struct buffer_head *, int);
2076struct buffer_head * get_FEB (struct tree_balance *); 2056void make_empty_node(struct buffer_info *);
2057struct buffer_head *get_FEB(struct tree_balance *);
2077 2058
2078/* bitmap.c */ 2059/* bitmap.c */
2079 2060
2080/* structure contains hints for block allocator, and it is a container for 2061/* structure contains hints for block allocator, and it is a container for
2081 * arguments, such as node, search path, transaction_handle, etc. */ 2062 * arguments, such as node, search path, transaction_handle, etc. */
2082 struct __reiserfs_blocknr_hint { 2063struct __reiserfs_blocknr_hint {
2083 struct inode * inode; /* inode passed to allocator, if we allocate unf. nodes */ 2064 struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */
2084 long block; /* file offset, in blocks */ 2065 long block; /* file offset, in blocks */
2085 struct in_core_key key; 2066 struct in_core_key key;
2086 struct path * path; /* search path, used by allocator to deternine search_start by 2067 struct path *path; /* search path, used by allocator to deternine search_start by
2087 * various ways */ 2068 * various ways */
2088 struct reiserfs_transaction_handle * th; /* transaction handle is needed to log super blocks and 2069 struct reiserfs_transaction_handle *th; /* transaction handle is needed to log super blocks and
2089 * bitmap blocks changes */ 2070 * bitmap blocks changes */
2090 b_blocknr_t beg, end; 2071 b_blocknr_t beg, end;
2091 b_blocknr_t search_start; /* a field used to transfer search start value (block number) 2072 b_blocknr_t search_start; /* a field used to transfer search start value (block number)
2092 * between different block allocator procedures 2073 * between different block allocator procedures
2093 * (determine_search_start() and others) */ 2074 * (determine_search_start() and others) */
2094 int prealloc_size; /* is set in determine_prealloc_size() function, used by underlayed 2075 int prealloc_size; /* is set in determine_prealloc_size() function, used by underlayed
2095 * function that do actual allocation */ 2076 * function that do actual allocation */
2096 2077
2097 unsigned formatted_node:1; /* the allocator uses different polices for getting disk space for 2078 unsigned formatted_node:1; /* the allocator uses different polices for getting disk space for
2098 * formatted/unformatted blocks with/without preallocation */ 2079 * formatted/unformatted blocks with/without preallocation */
2099 unsigned preallocate:1; 2080 unsigned preallocate:1;
2100}; 2081};
2101 2082
2102typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t; 2083typedef struct __reiserfs_blocknr_hint reiserfs_blocknr_hint_t;
2103 2084
2104int reiserfs_parse_alloc_options (struct super_block *, char *); 2085int reiserfs_parse_alloc_options(struct super_block *, char *);
2105void reiserfs_init_alloc_options (struct super_block *s); 2086void reiserfs_init_alloc_options(struct super_block *s);
2106 2087
2107/* 2088/*
2108 * given a directory, this will tell you what packing locality 2089 * given a directory, this will tell you what packing locality
@@ -2111,68 +2092,72 @@ void reiserfs_init_alloc_options (struct super_block *s);
2111 */ 2092 */
2112__le32 reiserfs_choose_packing(struct inode *dir); 2093__le32 reiserfs_choose_packing(struct inode *dir);
2113 2094
2114int is_reusable (struct super_block * s, b_blocknr_t block, int bit_value); 2095int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value);
2115void reiserfs_free_block (struct reiserfs_transaction_handle *th, struct inode *, b_blocknr_t, int for_unformatted); 2096void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *,
2116int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t * , int, int); 2097 b_blocknr_t, int for_unformatted);
2117extern inline int reiserfs_new_form_blocknrs (struct tree_balance * tb, 2098int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t *, b_blocknr_t *, int,
2118 b_blocknr_t *new_blocknrs, int amount_needed) 2099 int);
2100extern inline int reiserfs_new_form_blocknrs(struct tree_balance *tb,
2101 b_blocknr_t * new_blocknrs,
2102 int amount_needed)
2119{ 2103{
2120 reiserfs_blocknr_hint_t hint = { 2104 reiserfs_blocknr_hint_t hint = {
2121 .th = tb->transaction_handle, 2105 .th = tb->transaction_handle,
2122 .path = tb->tb_path, 2106 .path = tb->tb_path,
2123 .inode = NULL, 2107 .inode = NULL,
2124 .key = tb->key, 2108 .key = tb->key,
2125 .block = 0, 2109 .block = 0,
2126 .formatted_node = 1 2110 .formatted_node = 1
2127 }; 2111 };
2128 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, amount_needed, 0); 2112 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, amount_needed,
2113 0);
2129} 2114}
2130 2115
2131extern inline int reiserfs_new_unf_blocknrs (struct reiserfs_transaction_handle *th, 2116extern inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle
2132 struct inode *inode, 2117 *th, struct inode *inode,
2133 b_blocknr_t *new_blocknrs, 2118 b_blocknr_t * new_blocknrs,
2134 struct path * path, long block) 2119 struct path *path, long block)
2135{ 2120{
2136 reiserfs_blocknr_hint_t hint = { 2121 reiserfs_blocknr_hint_t hint = {
2137 .th = th, 2122 .th = th,
2138 .path = path, 2123 .path = path,
2139 .inode = inode, 2124 .inode = inode,
2140 .block = block, 2125 .block = block,
2141 .formatted_node = 0, 2126 .formatted_node = 0,
2142 .preallocate = 0 2127 .preallocate = 0
2143 }; 2128 };
2144 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0); 2129 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
2145} 2130}
2146 2131
2147#ifdef REISERFS_PREALLOCATE 2132#ifdef REISERFS_PREALLOCATE
2148extern inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle *th, 2133extern inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle
2149 struct inode * inode, 2134 *th, struct inode *inode,
2150 b_blocknr_t *new_blocknrs, 2135 b_blocknr_t * new_blocknrs,
2151 struct path * path, long block) 2136 struct path *path, long block)
2152{ 2137{
2153 reiserfs_blocknr_hint_t hint = { 2138 reiserfs_blocknr_hint_t hint = {
2154 .th = th, 2139 .th = th,
2155 .path = path, 2140 .path = path,
2156 .inode = inode, 2141 .inode = inode,
2157 .block = block, 2142 .block = block,
2158 .formatted_node = 0, 2143 .formatted_node = 0,
2159 .preallocate = 1 2144 .preallocate = 1
2160 }; 2145 };
2161 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0); 2146 return reiserfs_allocate_blocknrs(&hint, new_blocknrs, 1, 0);
2162} 2147}
2163 2148
2164void reiserfs_discard_prealloc (struct reiserfs_transaction_handle *th, 2149void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
2165 struct inode * inode); 2150 struct inode *inode);
2166void reiserfs_discard_all_prealloc (struct reiserfs_transaction_handle *th); 2151void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
2167#endif 2152#endif
2168void reiserfs_claim_blocks_to_be_allocated( struct super_block *sb, int blocks); 2153void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks);
2169void reiserfs_release_claimed_blocks( struct super_block *sb, int blocks); 2154void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks);
2170int reiserfs_can_fit_pages(struct super_block *sb); 2155int reiserfs_can_fit_pages(struct super_block *sb);
2171 2156
2172/* hashes.c */ 2157/* hashes.c */
2173__u32 keyed_hash (const signed char *msg, int len); 2158__u32 keyed_hash(const signed char *msg, int len);
2174__u32 yura_hash (const signed char *msg, int len); 2159__u32 yura_hash(const signed char *msg, int len);
2175__u32 r5_hash (const signed char *msg, int len); 2160__u32 r5_hash(const signed char *msg, int len);
2176 2161
2177/* the ext2 bit routines adjust for big or little endian as 2162/* the ext2 bit routines adjust for big or little endian as
2178** appropriate for the arch, so in our laziness we use them rather 2163** appropriate for the arch, so in our laziness we use them rather
@@ -2192,11 +2177,10 @@ __u32 r5_hash (const signed char *msg, int len);
2192 absolutely safe */ 2177 absolutely safe */
2193#define SPARE_SPACE 500 2178#define SPARE_SPACE 500
2194 2179
2195
2196/* prototypes from ioctl.c */ 2180/* prototypes from ioctl.c */
2197int reiserfs_ioctl (struct inode * inode, struct file * filp, 2181int reiserfs_ioctl(struct inode *inode, struct file *filp,
2198 unsigned int cmd, unsigned long arg); 2182 unsigned int cmd, unsigned long arg);
2199 2183
2200/* ioctl's command */ 2184/* ioctl's command */
2201#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) 2185#define REISERFS_IOC_UNPACK _IOW(0xCD,1,long)
2202/* define following flags to be the same as in ext2, so that chattr(1), 2186/* define following flags to be the same as in ext2, so that chattr(1),
@@ -2211,10 +2195,8 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp,
2211 would evolve into real per-fs locks */ 2195 would evolve into real per-fs locks */
2212#define reiserfs_write_lock( sb ) lock_kernel() 2196#define reiserfs_write_lock( sb ) lock_kernel()
2213#define reiserfs_write_unlock( sb ) unlock_kernel() 2197#define reiserfs_write_unlock( sb ) unlock_kernel()
2214 2198
2215/* xattr stuff */ 2199/* xattr stuff */
2216#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem) 2200#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
2217 2201
2218#endif /* _LINUX_REISER_FS_H */ 2202#endif /* _LINUX_REISER_FS_H */
2219
2220
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h
index e321eb050d65..149be8d9a0c9 100644
--- a/include/linux/reiserfs_fs_i.h
+++ b/include/linux/reiserfs_fs_i.h
@@ -10,54 +10,53 @@ typedef enum {
10 /** this says what format of key do all items (but stat data) of 10 /** this says what format of key do all items (but stat data) of
11 an object have. If this is set, that format is 3.6 otherwise 11 an object have. If this is set, that format is 3.6 otherwise
12 - 3.5 */ 12 - 3.5 */
13 i_item_key_version_mask = 0x0001, 13 i_item_key_version_mask = 0x0001,
14 /** If this is unset, object has 3.5 stat data, otherwise, it has 14 /** If this is unset, object has 3.5 stat data, otherwise, it has
15 3.6 stat data with 64bit size, 32bit nlink etc. */ 15 3.6 stat data with 64bit size, 32bit nlink etc. */
16 i_stat_data_version_mask = 0x0002, 16 i_stat_data_version_mask = 0x0002,
17 /** file might need tail packing on close */ 17 /** file might need tail packing on close */
18 i_pack_on_close_mask = 0x0004, 18 i_pack_on_close_mask = 0x0004,
19 /** don't pack tail of file */ 19 /** don't pack tail of file */
20 i_nopack_mask = 0x0008, 20 i_nopack_mask = 0x0008,
21 /** If those is set, "safe link" was created for this file during 21 /** If those is set, "safe link" was created for this file during
22 truncate or unlink. Safe link is used to avoid leakage of disk 22 truncate or unlink. Safe link is used to avoid leakage of disk
23 space on crash with some files open, but unlinked. */ 23 space on crash with some files open, but unlinked. */
24 i_link_saved_unlink_mask = 0x0010, 24 i_link_saved_unlink_mask = 0x0010,
25 i_link_saved_truncate_mask = 0x0020, 25 i_link_saved_truncate_mask = 0x0020,
26 i_has_xattr_dir = 0x0040, 26 i_has_xattr_dir = 0x0040,
27 i_data_log = 0x0080, 27 i_data_log = 0x0080,
28} reiserfs_inode_flags; 28} reiserfs_inode_flags;
29 29
30
31struct reiserfs_inode_info { 30struct reiserfs_inode_info {
32 __u32 i_key [4];/* key is still 4 32 bit integers */ 31 __u32 i_key[4]; /* key is still 4 32 bit integers */
33 /** transient inode flags that are never stored on disk. Bitmasks 32 /** transient inode flags that are never stored on disk. Bitmasks
34 for this field are defined above. */ 33 for this field are defined above. */
35 __u32 i_flags; 34 __u32 i_flags;
36 35
37 __u32 i_first_direct_byte; // offset of first byte stored in direct item. 36 __u32 i_first_direct_byte; // offset of first byte stored in direct item.
38 37
39 /* copy of persistent inode flags read from sd_attrs. */ 38 /* copy of persistent inode flags read from sd_attrs. */
40 __u32 i_attrs; 39 __u32 i_attrs;
41 40
42 int i_prealloc_block; /* first unused block of a sequence of unused blocks */ 41 int i_prealloc_block; /* first unused block of a sequence of unused blocks */
43 int i_prealloc_count; /* length of that sequence */ 42 int i_prealloc_count; /* length of that sequence */
44 struct list_head i_prealloc_list; /* per-transaction list of inodes which 43 struct list_head i_prealloc_list; /* per-transaction list of inodes which
45 * have preallocated blocks */ 44 * have preallocated blocks */
46 45
47 unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks 46 unsigned new_packing_locality:1; /* new_packig_locality is created; new blocks
48 * for the contents of this directory should be 47 * for the contents of this directory should be
49 * displaced */ 48 * displaced */
50 49
51 /* we use these for fsync or O_SYNC to decide which transaction 50 /* we use these for fsync or O_SYNC to decide which transaction
52 ** needs to be committed in order for this inode to be properly 51 ** needs to be committed in order for this inode to be properly
53 ** flushed */ 52 ** flushed */
54 unsigned long i_trans_id ; 53 unsigned long i_trans_id;
55 struct reiserfs_journal_list *i_jl; 54 struct reiserfs_journal_list *i_jl;
56 55
57 struct posix_acl *i_acl_access; 56 struct posix_acl *i_acl_access;
58 struct posix_acl *i_acl_default; 57 struct posix_acl *i_acl_default;
59 struct rw_semaphore xattr_sem; 58 struct rw_semaphore xattr_sem;
60 struct inode vfs_inode; 59 struct inode vfs_inode;
61}; 60};
62 61
63#endif 62#endif
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 37a3a7afbec7..3e68592e52e9 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -10,7 +10,7 @@
10#endif 10#endif
11 11
12typedef enum { 12typedef enum {
13 reiserfs_attrs_cleared = 0x00000001, 13 reiserfs_attrs_cleared = 0x00000001,
14} reiserfs_super_block_flags; 14} reiserfs_super_block_flags;
15 15
16/* struct reiserfs_super_block accessors/mutators 16/* struct reiserfs_super_block accessors/mutators
@@ -61,7 +61,7 @@ typedef enum {
61#define sb_umount_state(sbp) (le16_to_cpu((sbp)->s_v1.s_umount_state)) 61#define sb_umount_state(sbp) (le16_to_cpu((sbp)->s_v1.s_umount_state))
62#define set_sb_umount_state(sbp,v) ((sbp)->s_v1.s_umount_state = cpu_to_le16(v)) 62#define set_sb_umount_state(sbp,v) ((sbp)->s_v1.s_umount_state = cpu_to_le16(v))
63#define sb_fs_state(sbp) (le16_to_cpu((sbp)->s_v1.s_fs_state)) 63#define sb_fs_state(sbp) (le16_to_cpu((sbp)->s_v1.s_fs_state))
64#define set_sb_fs_state(sbp,v) ((sbp)->s_v1.s_fs_state = cpu_to_le16(v)) 64#define set_sb_fs_state(sbp,v) ((sbp)->s_v1.s_fs_state = cpu_to_le16(v))
65#define sb_hash_function_code(sbp) \ 65#define sb_hash_function_code(sbp) \
66 (le32_to_cpu((sbp)->s_v1.s_hash_function_code)) 66 (le32_to_cpu((sbp)->s_v1.s_hash_function_code))
67#define set_sb_hash_function_code(sbp,v) \ 67#define set_sb_hash_function_code(sbp,v) \
@@ -103,10 +103,10 @@ typedef enum {
103 103
104/* don't mess with these for a while */ 104/* don't mess with these for a while */
105 /* we have a node size define somewhere in reiserfs_fs.h. -Hans */ 105 /* we have a node size define somewhere in reiserfs_fs.h. -Hans */
106#define JOURNAL_BLOCK_SIZE 4096 /* BUG gotta get rid of this */ 106#define JOURNAL_BLOCK_SIZE 4096 /* BUG gotta get rid of this */
107#define JOURNAL_MAX_CNODE 1500 /* max cnodes to allocate. */ 107#define JOURNAL_MAX_CNODE 1500 /* max cnodes to allocate. */
108#define JOURNAL_HASH_SIZE 8192 108#define JOURNAL_HASH_SIZE 8192
109#define JOURNAL_NUM_BITMAPS 5 /* number of copies of the bitmaps to have floating. Must be >= 2 */ 109#define JOURNAL_NUM_BITMAPS 5 /* number of copies of the bitmaps to have floating. Must be >= 2 */
110 110
111/* One of these for every block in every transaction 111/* One of these for every block in every transaction
112** Each one is in two hash tables. First, a hash of the current transaction, and after journal_end, a 112** Each one is in two hash tables. First, a hash of the current transaction, and after journal_end, a
@@ -117,27 +117,27 @@ typedef enum {
117** to a given transaction. 117** to a given transaction.
118*/ 118*/
119struct reiserfs_journal_cnode { 119struct reiserfs_journal_cnode {
120 struct buffer_head *bh ; /* real buffer head */ 120 struct buffer_head *bh; /* real buffer head */
121 struct super_block *sb ; /* dev of real buffer head */ 121 struct super_block *sb; /* dev of real buffer head */
122 __u32 blocknr ; /* block number of real buffer head, == 0 when buffer on disk */ 122 __u32 blocknr; /* block number of real buffer head, == 0 when buffer on disk */
123 long state ; 123 long state;
124 struct reiserfs_journal_list *jlist ; /* journal list this cnode lives in */ 124 struct reiserfs_journal_list *jlist; /* journal list this cnode lives in */
125 struct reiserfs_journal_cnode *next ; /* next in transaction list */ 125 struct reiserfs_journal_cnode *next; /* next in transaction list */
126 struct reiserfs_journal_cnode *prev ; /* prev in transaction list */ 126 struct reiserfs_journal_cnode *prev; /* prev in transaction list */
127 struct reiserfs_journal_cnode *hprev ; /* prev in hash list */ 127 struct reiserfs_journal_cnode *hprev; /* prev in hash list */
128 struct reiserfs_journal_cnode *hnext ; /* next in hash list */ 128 struct reiserfs_journal_cnode *hnext; /* next in hash list */
129}; 129};
130 130
131struct reiserfs_bitmap_node { 131struct reiserfs_bitmap_node {
132 int id ; 132 int id;
133 char *data ; 133 char *data;
134 struct list_head list ; 134 struct list_head list;
135} ; 135};
136 136
137struct reiserfs_list_bitmap { 137struct reiserfs_list_bitmap {
138 struct reiserfs_journal_list *journal_list ; 138 struct reiserfs_journal_list *journal_list;
139 struct reiserfs_bitmap_node **bitmaps ; 139 struct reiserfs_bitmap_node **bitmaps;
140} ; 140};
141 141
142/* 142/*
143** one of these for each transaction. The most important part here is the j_realblock. 143** one of these for each transaction. The most important part here is the j_realblock.
@@ -146,273 +146,269 @@ struct reiserfs_list_bitmap {
146** and to make sure every real block in a transaction is on disk before allowing the log area 146** and to make sure every real block in a transaction is on disk before allowing the log area
147** to be overwritten */ 147** to be overwritten */
148struct reiserfs_journal_list { 148struct reiserfs_journal_list {
149 unsigned long j_start ; 149 unsigned long j_start;
150 unsigned long j_state; 150 unsigned long j_state;
151 unsigned long j_len ; 151 unsigned long j_len;
152 atomic_t j_nonzerolen ; 152 atomic_t j_nonzerolen;
153 atomic_t j_commit_left ; 153 atomic_t j_commit_left;
154 atomic_t j_older_commits_done ; /* all commits older than this on disk*/ 154 atomic_t j_older_commits_done; /* all commits older than this on disk */
155 struct semaphore j_commit_lock; 155 struct semaphore j_commit_lock;
156 unsigned long j_trans_id ; 156 unsigned long j_trans_id;
157 time_t j_timestamp ; 157 time_t j_timestamp;
158 struct reiserfs_list_bitmap *j_list_bitmap ; 158 struct reiserfs_list_bitmap *j_list_bitmap;
159 struct buffer_head *j_commit_bh ; /* commit buffer head */ 159 struct buffer_head *j_commit_bh; /* commit buffer head */
160 struct reiserfs_journal_cnode *j_realblock ; 160 struct reiserfs_journal_cnode *j_realblock;
161 struct reiserfs_journal_cnode *j_freedlist ; /* list of buffers that were freed during this trans. free each of these on flush */ 161 struct reiserfs_journal_cnode *j_freedlist; /* list of buffers that were freed during this trans. free each of these on flush */
162 /* time ordered list of all active transactions */ 162 /* time ordered list of all active transactions */
163 struct list_head j_list; 163 struct list_head j_list;
164 164
165 /* time ordered list of all transactions we haven't tried to flush yet */ 165 /* time ordered list of all transactions we haven't tried to flush yet */
166 struct list_head j_working_list; 166 struct list_head j_working_list;
167 167
168 /* list of tail conversion targets in need of flush before commit */ 168 /* list of tail conversion targets in need of flush before commit */
169 struct list_head j_tail_bh_list; 169 struct list_head j_tail_bh_list;
170 /* list of data=ordered buffers in need of flush before commit */ 170 /* list of data=ordered buffers in need of flush before commit */
171 struct list_head j_bh_list; 171 struct list_head j_bh_list;
172 int j_refcount; 172 int j_refcount;
173} ; 173};
174 174
175struct reiserfs_journal { 175struct reiserfs_journal {
176 struct buffer_head ** j_ap_blocks ; /* journal blocks on disk */ 176 struct buffer_head **j_ap_blocks; /* journal blocks on disk */
177 struct reiserfs_journal_cnode *j_last ; /* newest journal block */ 177 struct reiserfs_journal_cnode *j_last; /* newest journal block */
178 struct reiserfs_journal_cnode *j_first ; /* oldest journal block. start here for traverse */ 178 struct reiserfs_journal_cnode *j_first; /* oldest journal block. start here for traverse */
179 179
180 struct file *j_dev_file; 180 struct file *j_dev_file;
181 struct block_device *j_dev_bd; 181 struct block_device *j_dev_bd;
182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */ 182 int j_1st_reserved_block; /* first block on s_dev of reserved area journal */
183 183
184 long j_state ; 184 long j_state;
185 unsigned long j_trans_id ; 185 unsigned long j_trans_id;
186 unsigned long j_mount_id ; 186 unsigned long j_mount_id;
187 unsigned long j_start ; /* start of current waiting commit (index into j_ap_blocks) */ 187 unsigned long j_start; /* start of current waiting commit (index into j_ap_blocks) */
188 unsigned long j_len ; /* lenght of current waiting commit */ 188 unsigned long j_len; /* lenght of current waiting commit */
189 unsigned long j_len_alloc ; /* number of buffers requested by journal_begin() */ 189 unsigned long j_len_alloc; /* number of buffers requested by journal_begin() */
190 atomic_t j_wcount ; /* count of writers for current commit */ 190 atomic_t j_wcount; /* count of writers for current commit */
191 unsigned long j_bcount ; /* batch count. allows turning X transactions into 1 */ 191 unsigned long j_bcount; /* batch count. allows turning X transactions into 1 */
192 unsigned long j_first_unflushed_offset ; /* first unflushed transactions offset */ 192 unsigned long j_first_unflushed_offset; /* first unflushed transactions offset */
193 unsigned long j_last_flush_trans_id ; /* last fully flushed journal timestamp */ 193 unsigned long j_last_flush_trans_id; /* last fully flushed journal timestamp */
194 struct buffer_head *j_header_bh ; 194 struct buffer_head *j_header_bh;
195 195
196 time_t j_trans_start_time ; /* time this transaction started */ 196 time_t j_trans_start_time; /* time this transaction started */
197 struct semaphore j_lock; 197 struct semaphore j_lock;
198 struct semaphore j_flush_sem; 198 struct semaphore j_flush_sem;
199 wait_queue_head_t j_join_wait ; /* wait for current transaction to finish before starting new one */ 199 wait_queue_head_t j_join_wait; /* wait for current transaction to finish before starting new one */
200 atomic_t j_jlock ; /* lock for j_join_wait */ 200 atomic_t j_jlock; /* lock for j_join_wait */
201 int j_list_bitmap_index ; /* number of next list bitmap to use */ 201 int j_list_bitmap_index; /* number of next list bitmap to use */
202 int j_must_wait ; /* no more journal begins allowed. MUST sleep on j_join_wait */ 202 int j_must_wait; /* no more journal begins allowed. MUST sleep on j_join_wait */
203 int j_next_full_flush ; /* next journal_end will flush all journal list */ 203 int j_next_full_flush; /* next journal_end will flush all journal list */
204 int j_next_async_flush ; /* next journal_end will flush all async commits */ 204 int j_next_async_flush; /* next journal_end will flush all async commits */
205 205
206 int j_cnode_used ; /* number of cnodes on the used list */ 206 int j_cnode_used; /* number of cnodes on the used list */
207 int j_cnode_free ; /* number of cnodes on the free list */ 207 int j_cnode_free; /* number of cnodes on the free list */
208 208
209 unsigned int j_trans_max ; /* max number of blocks in a transaction. */ 209 unsigned int j_trans_max; /* max number of blocks in a transaction. */
210 unsigned int j_max_batch ; /* max number of blocks to batch into a trans */ 210 unsigned int j_max_batch; /* max number of blocks to batch into a trans */
211 unsigned int j_max_commit_age ; /* in seconds, how old can an async commit be */ 211 unsigned int j_max_commit_age; /* in seconds, how old can an async commit be */
212 unsigned int j_max_trans_age ; /* in seconds, how old can a transaction be */ 212 unsigned int j_max_trans_age; /* in seconds, how old can a transaction be */
213 unsigned int j_default_max_commit_age ; /* the default for the max commit age */ 213 unsigned int j_default_max_commit_age; /* the default for the max commit age */
214 214
215 struct reiserfs_journal_cnode *j_cnode_free_list ; 215 struct reiserfs_journal_cnode *j_cnode_free_list;
216 struct reiserfs_journal_cnode *j_cnode_free_orig ; /* orig pointer returned from vmalloc */ 216 struct reiserfs_journal_cnode *j_cnode_free_orig; /* orig pointer returned from vmalloc */
217 217
218 struct reiserfs_journal_list *j_current_jl; 218 struct reiserfs_journal_list *j_current_jl;
219 int j_free_bitmap_nodes ; 219 int j_free_bitmap_nodes;
220 int j_used_bitmap_nodes ; 220 int j_used_bitmap_nodes;
221 221
222 int j_num_lists; /* total number of active transactions */ 222 int j_num_lists; /* total number of active transactions */
223 int j_num_work_lists; /* number that need attention from kreiserfsd */ 223 int j_num_work_lists; /* number that need attention from kreiserfsd */
224 224
225 /* debugging to make sure things are flushed in order */ 225 /* debugging to make sure things are flushed in order */
226 int j_last_flush_id; 226 int j_last_flush_id;
227 227
228 /* debugging to make sure things are committed in order */ 228 /* debugging to make sure things are committed in order */
229 int j_last_commit_id; 229 int j_last_commit_id;
230 230
231 struct list_head j_bitmap_nodes ; 231 struct list_head j_bitmap_nodes;
232 struct list_head j_dirty_buffers ; 232 struct list_head j_dirty_buffers;
233 spinlock_t j_dirty_buffers_lock ; /* protects j_dirty_buffers */ 233 spinlock_t j_dirty_buffers_lock; /* protects j_dirty_buffers */
234 234
235 /* list of all active transactions */ 235 /* list of all active transactions */
236 struct list_head j_journal_list; 236 struct list_head j_journal_list;
237 /* lists that haven't been touched by writeback attempts */ 237 /* lists that haven't been touched by writeback attempts */
238 struct list_head j_working_list; 238 struct list_head j_working_list;
239 239
240 struct reiserfs_list_bitmap j_list_bitmap[JOURNAL_NUM_BITMAPS] ; /* array of bitmaps to record the deleted blocks */ 240 struct reiserfs_list_bitmap j_list_bitmap[JOURNAL_NUM_BITMAPS]; /* array of bitmaps to record the deleted blocks */
241 struct reiserfs_journal_cnode *j_hash_table[JOURNAL_HASH_SIZE] ; /* hash table for real buffer heads in current trans */ 241 struct reiserfs_journal_cnode *j_hash_table[JOURNAL_HASH_SIZE]; /* hash table for real buffer heads in current trans */
242 struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE] ; /* hash table for all the real buffer heads in all 242 struct reiserfs_journal_cnode *j_list_hash_table[JOURNAL_HASH_SIZE]; /* hash table for all the real buffer heads in all
243 the transactions */ 243 the transactions */
244 struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */ 244 struct list_head j_prealloc_list; /* list of inodes which have preallocated blocks */
245 int j_persistent_trans; 245 int j_persistent_trans;
246 unsigned long j_max_trans_size ; 246 unsigned long j_max_trans_size;
247 unsigned long j_max_batch_size ; 247 unsigned long j_max_batch_size;
248 248
249 int j_errno; 249 int j_errno;
250 250
251 /* when flushing ordered buffers, throttle new ordered writers */ 251 /* when flushing ordered buffers, throttle new ordered writers */
252 struct work_struct j_work; 252 struct work_struct j_work;
253 atomic_t j_async_throttle; 253 atomic_t j_async_throttle;
254}; 254};
255 255
256enum journal_state_bits { 256enum journal_state_bits {
257 J_WRITERS_BLOCKED = 1, /* set when new writers not allowed */ 257 J_WRITERS_BLOCKED = 1, /* set when new writers not allowed */
258 J_WRITERS_QUEUED, /* set when log is full due to too many writers */ 258 J_WRITERS_QUEUED, /* set when log is full due to too many writers */
259 J_ABORTED, /* set when log is aborted */ 259 J_ABORTED, /* set when log is aborted */
260}; 260};
261 261
262#define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */
262 263
263#define JOURNAL_DESC_MAGIC "ReIsErLB" /* ick. magic string to find desc blocks in the journal */ 264typedef __u32(*hashf_t) (const signed char *, int);
264 265
265typedef __u32 (*hashf_t) (const signed char *, int); 266struct reiserfs_bitmap_info {
266 267 // FIXME: Won't work with block sizes > 8K
267struct reiserfs_bitmap_info 268 __u16 first_zero_hint;
268{ 269 __u16 free_count;
269 // FIXME: Won't work with block sizes > 8K 270 struct buffer_head *bh; /* the actual bitmap */
270 __u16 first_zero_hint;
271 __u16 free_count;
272 struct buffer_head *bh; /* the actual bitmap */
273}; 271};
274 272
275struct proc_dir_entry; 273struct proc_dir_entry;
276 274
277#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO ) 275#if defined( CONFIG_PROC_FS ) && defined( CONFIG_REISERFS_PROC_INFO )
278typedef unsigned long int stat_cnt_t; 276typedef unsigned long int stat_cnt_t;
279typedef struct reiserfs_proc_info_data 277typedef struct reiserfs_proc_info_data {
280{ 278 spinlock_t lock;
281 spinlock_t lock; 279 int exiting;
282 int exiting; 280 int max_hash_collisions;
283 int max_hash_collisions; 281
284 282 stat_cnt_t breads;
285 stat_cnt_t breads; 283 stat_cnt_t bread_miss;
286 stat_cnt_t bread_miss; 284 stat_cnt_t search_by_key;
287 stat_cnt_t search_by_key; 285 stat_cnt_t search_by_key_fs_changed;
288 stat_cnt_t search_by_key_fs_changed; 286 stat_cnt_t search_by_key_restarted;
289 stat_cnt_t search_by_key_restarted; 287
290 288 stat_cnt_t insert_item_restarted;
291 stat_cnt_t insert_item_restarted; 289 stat_cnt_t paste_into_item_restarted;
292 stat_cnt_t paste_into_item_restarted; 290 stat_cnt_t cut_from_item_restarted;
293 stat_cnt_t cut_from_item_restarted; 291 stat_cnt_t delete_solid_item_restarted;
294 stat_cnt_t delete_solid_item_restarted; 292 stat_cnt_t delete_item_restarted;
295 stat_cnt_t delete_item_restarted; 293
296 294 stat_cnt_t leaked_oid;
297 stat_cnt_t leaked_oid; 295 stat_cnt_t leaves_removable;
298 stat_cnt_t leaves_removable; 296
299 297 /* balances per level. Use explicit 5 as MAX_HEIGHT is not visible yet. */
300 /* balances per level. Use explicit 5 as MAX_HEIGHT is not visible yet. */ 298 stat_cnt_t balance_at[5]; /* XXX */
301 stat_cnt_t balance_at[ 5 ]; /* XXX */ 299 /* sbk == search_by_key */
302 /* sbk == search_by_key */ 300 stat_cnt_t sbk_read_at[5]; /* XXX */
303 stat_cnt_t sbk_read_at[ 5 ]; /* XXX */ 301 stat_cnt_t sbk_fs_changed[5];
304 stat_cnt_t sbk_fs_changed[ 5 ]; 302 stat_cnt_t sbk_restarted[5];
305 stat_cnt_t sbk_restarted[ 5 ]; 303 stat_cnt_t items_at[5]; /* XXX */
306 stat_cnt_t items_at[ 5 ]; /* XXX */ 304 stat_cnt_t free_at[5]; /* XXX */
307 stat_cnt_t free_at[ 5 ]; /* XXX */ 305 stat_cnt_t can_node_be_removed[5]; /* XXX */
308 stat_cnt_t can_node_be_removed[ 5 ]; /* XXX */ 306 long int lnum[5]; /* XXX */
309 long int lnum[ 5 ]; /* XXX */ 307 long int rnum[5]; /* XXX */
310 long int rnum[ 5 ]; /* XXX */ 308 long int lbytes[5]; /* XXX */
311 long int lbytes[ 5 ]; /* XXX */ 309 long int rbytes[5]; /* XXX */
312 long int rbytes[ 5 ]; /* XXX */ 310 stat_cnt_t get_neighbors[5];
313 stat_cnt_t get_neighbors[ 5 ]; 311 stat_cnt_t get_neighbors_restart[5];
314 stat_cnt_t get_neighbors_restart[ 5 ]; 312 stat_cnt_t need_l_neighbor[5];
315 stat_cnt_t need_l_neighbor[ 5 ]; 313 stat_cnt_t need_r_neighbor[5];
316 stat_cnt_t need_r_neighbor[ 5 ]; 314
317 315 stat_cnt_t free_block;
318 stat_cnt_t free_block; 316 struct __scan_bitmap_stats {
319 struct __scan_bitmap_stats { 317 stat_cnt_t call;
320 stat_cnt_t call; 318 stat_cnt_t wait;
321 stat_cnt_t wait; 319 stat_cnt_t bmap;
322 stat_cnt_t bmap; 320 stat_cnt_t retry;
323 stat_cnt_t retry; 321 stat_cnt_t in_journal_hint;
324 stat_cnt_t in_journal_hint; 322 stat_cnt_t in_journal_nohint;
325 stat_cnt_t in_journal_nohint; 323 stat_cnt_t stolen;
326 stat_cnt_t stolen; 324 } scan_bitmap;
327 } scan_bitmap; 325 struct __journal_stats {
328 struct __journal_stats { 326 stat_cnt_t in_journal;
329 stat_cnt_t in_journal; 327 stat_cnt_t in_journal_bitmap;
330 stat_cnt_t in_journal_bitmap; 328 stat_cnt_t in_journal_reusable;
331 stat_cnt_t in_journal_reusable; 329 stat_cnt_t lock_journal;
332 stat_cnt_t lock_journal; 330 stat_cnt_t lock_journal_wait;
333 stat_cnt_t lock_journal_wait; 331 stat_cnt_t journal_being;
334 stat_cnt_t journal_being; 332 stat_cnt_t journal_relock_writers;
335 stat_cnt_t journal_relock_writers; 333 stat_cnt_t journal_relock_wcount;
336 stat_cnt_t journal_relock_wcount; 334 stat_cnt_t mark_dirty;
337 stat_cnt_t mark_dirty; 335 stat_cnt_t mark_dirty_already;
338 stat_cnt_t mark_dirty_already; 336 stat_cnt_t mark_dirty_notjournal;
339 stat_cnt_t mark_dirty_notjournal; 337 stat_cnt_t restore_prepared;
340 stat_cnt_t restore_prepared; 338 stat_cnt_t prepare;
341 stat_cnt_t prepare; 339 stat_cnt_t prepare_retry;
342 stat_cnt_t prepare_retry; 340 } journal;
343 } journal;
344} reiserfs_proc_info_data_t; 341} reiserfs_proc_info_data_t;
345#else 342#else
346typedef struct reiserfs_proc_info_data 343typedef struct reiserfs_proc_info_data {
347{} reiserfs_proc_info_data_t; 344} reiserfs_proc_info_data_t;
348#endif 345#endif
349 346
350/* reiserfs union of in-core super block data */ 347/* reiserfs union of in-core super block data */
351struct reiserfs_sb_info 348struct reiserfs_sb_info {
352{ 349 struct buffer_head *s_sbh; /* Buffer containing the super block */
353 struct buffer_head * s_sbh; /* Buffer containing the super block */ 350 /* both the comment and the choice of
354 /* both the comment and the choice of 351 name are unclear for s_rs -Hans */
355 name are unclear for s_rs -Hans */ 352 struct reiserfs_super_block *s_rs; /* Pointer to the super block in the buffer */
356 struct reiserfs_super_block * s_rs; /* Pointer to the super block in the buffer */ 353 struct reiserfs_bitmap_info *s_ap_bitmap;
357 struct reiserfs_bitmap_info * s_ap_bitmap; 354 struct reiserfs_journal *s_journal; /* pointer to journal information */
358 struct reiserfs_journal *s_journal ; /* pointer to journal information */ 355 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */
359 unsigned short s_mount_state; /* reiserfs state (valid, invalid) */ 356
360 357 /* Comment? -Hans */
361 /* Comment? -Hans */ 358 void (*end_io_handler) (struct buffer_head *, int);
362 void (*end_io_handler)(struct buffer_head *, int); 359 hashf_t s_hash_function; /* pointer to function which is used
363 hashf_t s_hash_function; /* pointer to function which is used 360 to sort names in directory. Set on
364 to sort names in directory. Set on 361 mount */
365 mount */ 362 unsigned long s_mount_opt; /* reiserfs's mount options are set
366 unsigned long s_mount_opt; /* reiserfs's mount options are set 363 here (currently - NOTAIL, NOLOG,
367 here (currently - NOTAIL, NOLOG, 364 REPLAYONLY) */
368 REPLAYONLY) */ 365
369 366 struct { /* This is a structure that describes block allocator options */
370 struct { /* This is a structure that describes block allocator options */ 367 unsigned long bits; /* Bitfield for enable/disable kind of options */
371 unsigned long bits; /* Bitfield for enable/disable kind of options */ 368 unsigned long large_file_size; /* size started from which we consider file to be a large one(in blocks) */
372 unsigned long large_file_size; /* size started from which we consider file to be a large one(in blocks) */ 369 int border; /* percentage of disk, border takes */
373 int border; /* percentage of disk, border takes */ 370 int preallocmin; /* Minimal file size (in blocks) starting from which we do preallocations */
374 int preallocmin; /* Minimal file size (in blocks) starting from which we do preallocations */ 371 int preallocsize; /* Number of blocks we try to prealloc when file
375 int preallocsize; /* Number of blocks we try to prealloc when file 372 reaches preallocmin size (in blocks) or
376 reaches preallocmin size (in blocks) or 373 prealloc_list is empty. */
377 prealloc_list is empty. */ 374 } s_alloc_options;
378 } s_alloc_options; 375
379 376 /* Comment? -Hans */
380 /* Comment? -Hans */ 377 wait_queue_head_t s_wait;
381 wait_queue_head_t s_wait; 378 /* To be obsoleted soon by per buffer seals.. -Hans */
382 /* To be obsoleted soon by per buffer seals.. -Hans */ 379 atomic_t s_generation_counter; // increased by one every time the
383 atomic_t s_generation_counter; // increased by one every time the 380 // tree gets re-balanced
384 // tree gets re-balanced 381 unsigned long s_properties; /* File system properties. Currently holds
385 unsigned long s_properties; /* File system properties. Currently holds 382 on-disk FS format */
386 on-disk FS format */ 383
387 384 /* session statistics */
388 /* session statistics */ 385 int s_kmallocs;
389 int s_kmallocs; 386 int s_disk_reads;
390 int s_disk_reads; 387 int s_disk_writes;
391 int s_disk_writes; 388 int s_fix_nodes;
392 int s_fix_nodes; 389 int s_do_balance;
393 int s_do_balance; 390 int s_unneeded_left_neighbor;
394 int s_unneeded_left_neighbor; 391 int s_good_search_by_key_reada;
395 int s_good_search_by_key_reada; 392 int s_bmaps;
396 int s_bmaps; 393 int s_bmaps_without_search;
397 int s_bmaps_without_search; 394 int s_direct2indirect;
398 int s_direct2indirect; 395 int s_indirect2direct;
399 int s_indirect2direct;
400 /* set up when it's ok for reiserfs_read_inode2() to read from 396 /* set up when it's ok for reiserfs_read_inode2() to read from
401 disk inode with nlink==0. Currently this is only used during 397 disk inode with nlink==0. Currently this is only used during
402 finish_unfinished() processing at mount time */ 398 finish_unfinished() processing at mount time */
403 int s_is_unlinked_ok; 399 int s_is_unlinked_ok;
404 reiserfs_proc_info_data_t s_proc_info_data; 400 reiserfs_proc_info_data_t s_proc_info_data;
405 struct proc_dir_entry *procdir; 401 struct proc_dir_entry *procdir;
406 int reserved_blocks; /* amount of blocks reserved for further allocations */ 402 int reserved_blocks; /* amount of blocks reserved for further allocations */
407 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */ 403 spinlock_t bitmap_lock; /* this lock on now only used to protect reserved_blocks variable */
408 struct dentry *priv_root; /* root of /.reiserfs_priv */ 404 struct dentry *priv_root; /* root of /.reiserfs_priv */
409 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */ 405 struct dentry *xattr_root; /* root of /.reiserfs_priv/.xa */
410 struct rw_semaphore xattr_dir_sem; 406 struct rw_semaphore xattr_dir_sem;
411 407
412 int j_errno; 408 int j_errno;
413#ifdef CONFIG_QUOTA 409#ifdef CONFIG_QUOTA
414 char *s_qf_names[MAXQUOTAS]; 410 char *s_qf_names[MAXQUOTAS];
415 int s_jquota_fmt; 411 int s_jquota_fmt;
416#endif 412#endif
417}; 413};
418 414
@@ -422,14 +418,14 @@ struct reiserfs_sb_info
422 418
423enum reiserfs_mount_options { 419enum reiserfs_mount_options {
424/* Mount options */ 420/* Mount options */
425 REISERFS_LARGETAIL, /* large tails will be created in a session */ 421 REISERFS_LARGETAIL, /* large tails will be created in a session */
426 REISERFS_SMALLTAIL, /* small (for files less than block size) tails will be created in a session */ 422 REISERFS_SMALLTAIL, /* small (for files less than block size) tails will be created in a session */
427 REPLAYONLY, /* replay journal and return 0. Use by fsck */ 423 REPLAYONLY, /* replay journal and return 0. Use by fsck */
428 REISERFS_CONVERT, /* -o conv: causes conversion of old 424 REISERFS_CONVERT, /* -o conv: causes conversion of old
429 format super block to the new 425 format super block to the new
430 format. If not specified - old 426 format. If not specified - old
431 partition will be dealt with in a 427 partition will be dealt with in a
432 manner of 3.5.x */ 428 manner of 3.5.x */
433 429
434/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting 430/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting
435** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option 431** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option
@@ -439,39 +435,41 @@ enum reiserfs_mount_options {
439** the existing hash on the FS, so if you have a tea hash disk, and mount 435** the existing hash on the FS, so if you have a tea hash disk, and mount
440** with -o hash=rupasov, the mount will fail. 436** with -o hash=rupasov, the mount will fail.
441*/ 437*/
442 FORCE_TEA_HASH, /* try to force tea hash on mount */ 438 FORCE_TEA_HASH, /* try to force tea hash on mount */
443 FORCE_RUPASOV_HASH, /* try to force rupasov hash on mount */ 439 FORCE_RUPASOV_HASH, /* try to force rupasov hash on mount */
444 FORCE_R5_HASH, /* try to force rupasov hash on mount */ 440 FORCE_R5_HASH, /* try to force rupasov hash on mount */
445 FORCE_HASH_DETECT, /* try to detect hash function on mount */ 441 FORCE_HASH_DETECT, /* try to detect hash function on mount */
446 442
447 REISERFS_DATA_LOG, 443 REISERFS_DATA_LOG,
448 REISERFS_DATA_ORDERED, 444 REISERFS_DATA_ORDERED,
449 REISERFS_DATA_WRITEBACK, 445 REISERFS_DATA_WRITEBACK,
450 446
451/* used for testing experimental features, makes benchmarking new 447/* used for testing experimental features, makes benchmarking new
452 features with and without more convenient, should never be used by 448 features with and without more convenient, should never be used by
453 users in any code shipped to users (ideally) */ 449 users in any code shipped to users (ideally) */
454 450
455 REISERFS_NO_BORDER, 451 REISERFS_NO_BORDER,
456 REISERFS_NO_UNHASHED_RELOCATION, 452 REISERFS_NO_UNHASHED_RELOCATION,
457 REISERFS_HASHED_RELOCATION, 453 REISERFS_HASHED_RELOCATION,
458 REISERFS_ATTRS, 454 REISERFS_ATTRS,
459 REISERFS_XATTRS, 455 REISERFS_XATTRS,
460 REISERFS_XATTRS_USER, 456 REISERFS_XATTRS_USER,
461 REISERFS_POSIXACL, 457 REISERFS_POSIXACL,
462 REISERFS_BARRIER_NONE, 458 REISERFS_BARRIER_NONE,
463 REISERFS_BARRIER_FLUSH, 459 REISERFS_BARRIER_FLUSH,
464 460
465 /* Actions on error */ 461 /* Actions on error */
466 REISERFS_ERROR_PANIC, 462 REISERFS_ERROR_PANIC,
467 REISERFS_ERROR_RO, 463 REISERFS_ERROR_RO,
468 REISERFS_ERROR_CONTINUE, 464 REISERFS_ERROR_CONTINUE,
469 465
470 REISERFS_TEST1, 466 REISERFS_QUOTA, /* Some quota option specified */
471 REISERFS_TEST2, 467
472 REISERFS_TEST3, 468 REISERFS_TEST1,
473 REISERFS_TEST4, 469 REISERFS_TEST2,
474 REISERFS_UNSUPPORTED_OPT, 470 REISERFS_TEST3,
471 REISERFS_TEST4,
472 REISERFS_UNSUPPORTED_OPT,
475}; 473};
476 474
477#define reiserfs_r5_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_R5_HASH)) 475#define reiserfs_r5_hash(s) (REISERFS_SB(s)->s_mount_opt & (1 << FORCE_R5_HASH))
@@ -502,18 +500,17 @@ enum reiserfs_mount_options {
502#define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC)) 500#define reiserfs_error_panic(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_PANIC))
503#define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO)) 501#define reiserfs_error_ro(s) (REISERFS_SB(s)->s_mount_opt & (1 << REISERFS_ERROR_RO))
504 502
505void reiserfs_file_buffer (struct buffer_head * bh, int list); 503void reiserfs_file_buffer(struct buffer_head *bh, int list);
506extern struct file_system_type reiserfs_fs_type; 504extern struct file_system_type reiserfs_fs_type;
507int reiserfs_resize(struct super_block *, unsigned long) ; 505int reiserfs_resize(struct super_block *, unsigned long);
508 506
509#define CARRY_ON 0 507#define CARRY_ON 0
510#define SCHEDULE_OCCURRED 1 508#define SCHEDULE_OCCURRED 1
511 509
512
513#define SB_BUFFER_WITH_SB(s) (REISERFS_SB(s)->s_sbh) 510#define SB_BUFFER_WITH_SB(s) (REISERFS_SB(s)->s_sbh)
514#define SB_JOURNAL(s) (REISERFS_SB(s)->s_journal) 511#define SB_JOURNAL(s) (REISERFS_SB(s)->s_journal)
515#define SB_JOURNAL_1st_RESERVED_BLOCK(s) (SB_JOURNAL(s)->j_1st_reserved_block) 512#define SB_JOURNAL_1st_RESERVED_BLOCK(s) (SB_JOURNAL(s)->j_1st_reserved_block)
516#define SB_JOURNAL_LEN_FREE(s) (SB_JOURNAL(s)->j_journal_len_free) 513#define SB_JOURNAL_LEN_FREE(s) (SB_JOURNAL(s)->j_journal_len_free)
517#define SB_AP_BITMAP(s) (REISERFS_SB(s)->s_ap_bitmap) 514#define SB_AP_BITMAP(s) (REISERFS_SB(s)->s_ap_bitmap)
518 515
519#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->) 516#define SB_DISK_JOURNAL_HEAD(s) (SB_JOURNAL(s)->j_header_bh->)
@@ -523,13 +520,14 @@ int reiserfs_resize(struct super_block *, unsigned long) ;
523 */ 520 */
524static inline char *reiserfs_bdevname(struct super_block *s) 521static inline char *reiserfs_bdevname(struct super_block *s)
525{ 522{
526 return (s == NULL) ? "Null superblock" : s -> s_id; 523 return (s == NULL) ? "Null superblock" : s->s_id;
527} 524}
528 525
529#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal))) 526#define reiserfs_is_journal_aborted(journal) (unlikely (__reiserfs_is_journal_aborted (journal)))
530static inline int __reiserfs_is_journal_aborted (struct reiserfs_journal *journal) 527static inline int __reiserfs_is_journal_aborted(struct reiserfs_journal
528 *journal)
531{ 529{
532 return test_bit (J_ABORTED, &journal->j_state); 530 return test_bit(J_ABORTED, &journal->j_state);
533} 531}
534 532
535#endif /* _LINUX_REISER_FS_SB */ 533#endif /* _LINUX_REISER_FS_SB */
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 9244c5748820..c84354e8374c 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -7,48 +7,48 @@
7#include <linux/xattr.h> 7#include <linux/xattr.h>
8 8
9/* Magic value in header */ 9/* Magic value in header */
10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */ 10#define REISERFS_XATTR_MAGIC 0x52465841 /* "RFXA" */
11 11
12struct reiserfs_xattr_header { 12struct reiserfs_xattr_header {
13 __le32 h_magic; /* magic number for identification */ 13 __le32 h_magic; /* magic number for identification */
14 __le32 h_hash; /* hash of the value */ 14 __le32 h_hash; /* hash of the value */
15}; 15};
16 16
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19struct reiserfs_xattr_handler { 19struct reiserfs_xattr_handler {
20 char *prefix; 20 char *prefix;
21 int (*init)(void); 21 int (*init) (void);
22 void (*exit)(void); 22 void (*exit) (void);
23 int (*get)(struct inode *inode, const char *name, void *buffer, 23 int (*get) (struct inode * inode, const char *name, void *buffer,
24 size_t size); 24 size_t size);
25 int (*set)(struct inode *inode, const char *name, const void *buffer, 25 int (*set) (struct inode * inode, const char *name, const void *buffer,
26 size_t size, int flags); 26 size_t size, int flags);
27 int (*del)(struct inode *inode, const char *name); 27 int (*del) (struct inode * inode, const char *name);
28 int (*list)(struct inode *inode, const char *name, int namelen, char *out); 28 int (*list) (struct inode * inode, const char *name, int namelen,
29 struct list_head handlers; 29 char *out);
30 struct list_head handlers;
30}; 31};
31 32
32
33#ifdef CONFIG_REISERFS_FS_XATTR 33#ifdef CONFIG_REISERFS_FS_XATTR
34#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode) 34#define is_reiserfs_priv_object(inode) IS_PRIVATE(inode)
35#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 35#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
36ssize_t reiserfs_getxattr (struct dentry *dentry, const char *name, 36ssize_t reiserfs_getxattr(struct dentry *dentry, const char *name,
37 void *buffer, size_t size); 37 void *buffer, size_t size);
38int reiserfs_setxattr (struct dentry *dentry, const char *name, 38int reiserfs_setxattr(struct dentry *dentry, const char *name,
39 const void *value, size_t size, int flags); 39 const void *value, size_t size, int flags);
40ssize_t reiserfs_listxattr (struct dentry *dentry, char *buffer, size_t size); 40ssize_t reiserfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
41int reiserfs_removexattr (struct dentry *dentry, const char *name); 41int reiserfs_removexattr(struct dentry *dentry, const char *name);
42int reiserfs_delete_xattrs (struct inode *inode); 42int reiserfs_delete_xattrs(struct inode *inode);
43int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs); 43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
44int reiserfs_xattr_init (struct super_block *sb, int mount_flags); 44int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
45int reiserfs_permission (struct inode *inode, int mask, struct nameidata *nd); 45int reiserfs_permission(struct inode *inode, int mask, struct nameidata *nd);
46int reiserfs_permission_locked (struct inode *inode, int mask, struct nameidata *nd); 46int reiserfs_permission_locked(struct inode *inode, int mask,
47 47 struct nameidata *nd);
48int reiserfs_xattr_del (struct inode *, const char *); 48
49int reiserfs_xattr_get (const struct inode *, const char *, void *, size_t); 49int reiserfs_xattr_del(struct inode *, const char *);
50int reiserfs_xattr_set (struct inode *, const char *, const void *, 50int reiserfs_xattr_get(const struct inode *, const char *, void *, size_t);
51 size_t, int); 51int reiserfs_xattr_set(struct inode *, const char *, const void *, size_t, int);
52 52
53extern struct reiserfs_xattr_handler user_handler; 53extern struct reiserfs_xattr_handler user_handler;
54extern struct reiserfs_xattr_handler trusted_handler; 54extern struct reiserfs_xattr_handler trusted_handler;
@@ -56,57 +56,48 @@ extern struct reiserfs_xattr_handler trusted_handler;
56extern struct reiserfs_xattr_handler security_handler; 56extern struct reiserfs_xattr_handler security_handler;
57#endif 57#endif
58 58
59int reiserfs_xattr_register_handlers (void) __init; 59int reiserfs_xattr_register_handlers(void) __init;
60void reiserfs_xattr_unregister_handlers (void); 60void reiserfs_xattr_unregister_handlers(void);
61 61
62static inline void 62static inline void reiserfs_write_lock_xattrs(struct super_block *sb)
63reiserfs_write_lock_xattrs(struct super_block *sb)
64{ 63{
65 down_write (&REISERFS_XATTR_DIR_SEM(sb)); 64 down_write(&REISERFS_XATTR_DIR_SEM(sb));
66} 65}
67static inline void 66static inline void reiserfs_write_unlock_xattrs(struct super_block *sb)
68reiserfs_write_unlock_xattrs(struct super_block *sb)
69{ 67{
70 up_write (&REISERFS_XATTR_DIR_SEM(sb)); 68 up_write(&REISERFS_XATTR_DIR_SEM(sb));
71} 69}
72static inline void 70static inline void reiserfs_read_lock_xattrs(struct super_block *sb)
73reiserfs_read_lock_xattrs(struct super_block *sb)
74{ 71{
75 down_read (&REISERFS_XATTR_DIR_SEM(sb)); 72 down_read(&REISERFS_XATTR_DIR_SEM(sb));
76} 73}
77 74
78static inline void 75static inline void reiserfs_read_unlock_xattrs(struct super_block *sb)
79reiserfs_read_unlock_xattrs(struct super_block *sb)
80{ 76{
81 up_read (&REISERFS_XATTR_DIR_SEM(sb)); 77 up_read(&REISERFS_XATTR_DIR_SEM(sb));
82} 78}
83 79
84static inline void 80static inline void reiserfs_write_lock_xattr_i(struct inode *inode)
85reiserfs_write_lock_xattr_i(struct inode *inode)
86{ 81{
87 down_write (&REISERFS_I(inode)->xattr_sem); 82 down_write(&REISERFS_I(inode)->xattr_sem);
88} 83}
89static inline void 84static inline void reiserfs_write_unlock_xattr_i(struct inode *inode)
90reiserfs_write_unlock_xattr_i(struct inode *inode)
91{ 85{
92 up_write (&REISERFS_I(inode)->xattr_sem); 86 up_write(&REISERFS_I(inode)->xattr_sem);
93} 87}
94static inline void 88static inline void reiserfs_read_lock_xattr_i(struct inode *inode)
95reiserfs_read_lock_xattr_i(struct inode *inode)
96{ 89{
97 down_read (&REISERFS_I(inode)->xattr_sem); 90 down_read(&REISERFS_I(inode)->xattr_sem);
98} 91}
99 92
100static inline void 93static inline void reiserfs_read_unlock_xattr_i(struct inode *inode)
101reiserfs_read_unlock_xattr_i(struct inode *inode)
102{ 94{
103 up_read (&REISERFS_I(inode)->xattr_sem); 95 up_read(&REISERFS_I(inode)->xattr_sem);
104} 96}
105 97
106static inline void 98static inline void reiserfs_mark_inode_private(struct inode *inode)
107reiserfs_mark_inode_private(struct inode *inode)
108{ 99{
109 inode->i_flags |= S_PRIVATE; 100 inode->i_flags |= S_PRIVATE;
110} 101}
111 102
112#else 103#else
@@ -127,13 +118,20 @@ reiserfs_mark_inode_private(struct inode *inode)
127#define reiserfs_xattr_register_handlers() 0 118#define reiserfs_xattr_register_handlers() 0
128#define reiserfs_xattr_unregister_handlers() 119#define reiserfs_xattr_unregister_handlers()
129 120
130static inline int reiserfs_delete_xattrs (struct inode *inode) { return 0; }; 121static inline int reiserfs_delete_xattrs(struct inode *inode)
131static inline int reiserfs_chown_xattrs (struct inode *inode, struct iattr *attrs) { return 0; }; 122{
132static inline int reiserfs_xattr_init (struct super_block *sb, int mount_flags) 123 return 0;
124};
125static inline int reiserfs_chown_xattrs(struct inode *inode,
126 struct iattr *attrs)
127{
128 return 0;
129};
130static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags)
133{ 131{
134 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ 132 sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */
135 return 0; 133 return 0;
136}; 134};
137#endif 135#endif
138 136
139#endif /* __KERNEL__ */ 137#endif /* __KERNEL__ */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 11b484e37ac9..e80fb7ee6efd 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -93,6 +93,12 @@ int page_referenced(struct page *, int is_locked, int ignore_token);
93int try_to_unmap(struct page *); 93int try_to_unmap(struct page *);
94 94
95/* 95/*
96 * Called from mm/filemap_xip.c to unmap empty zero page
97 */
98pte_t *page_check_address(struct page *, struct mm_struct *, unsigned long);
99
100
101/*
96 * Used by swapoff to help locate where page is expected in vma. 102 * Used by swapoff to help locate where page is expected in vma.
97 */ 103 */
98unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); 104unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index e68dbf0bf579..657c05ab8f9e 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -363,6 +363,8 @@ enum
363struct rta_session 363struct rta_session
364{ 364{
365 __u8 proto; 365 __u8 proto;
366 __u8 pad1;
367 __u16 pad2;
366 368
367 union { 369 union {
368 struct { 370 struct {
@@ -635,10 +637,13 @@ struct ifinfomsg
635struct prefixmsg 637struct prefixmsg
636{ 638{
637 unsigned char prefix_family; 639 unsigned char prefix_family;
640 unsigned char prefix_pad1;
641 unsigned short prefix_pad2;
638 int prefix_ifindex; 642 int prefix_ifindex;
639 unsigned char prefix_type; 643 unsigned char prefix_type;
640 unsigned char prefix_len; 644 unsigned char prefix_len;
641 unsigned char prefix_flags; 645 unsigned char prefix_flags;
646 unsigned char prefix_pad3;
642}; 647};
643 648
644enum 649enum
@@ -892,10 +897,15 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
892 goto rtattr_failure; \ 897 goto rtattr_failure; \
893 __rta_fill(skb, attrtype, attrlen, data); }) 898 __rta_fill(skb, attrtype, attrlen, data); })
894 899
895#define RTA_PUT_NOHDR(skb, attrlen, data) \ 900#define RTA_APPEND(skb, attrlen, data) \
896({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ 901({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
897 goto rtattr_failure; \ 902 goto rtattr_failure; \
898 memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) 903 memcpy(skb_put(skb, attrlen), data, attrlen); })
904
905#define RTA_PUT_NOHDR(skb, attrlen, data) \
906({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \
907 memset(skb->tail - (RTA_ALIGN(attrlen) - attrlen), 0, \
908 RTA_ALIGN(attrlen) - attrlen); })
899 909
900#define RTA_PUT_U8(skb, attrtype, value) \ 910#define RTA_PUT_U8(skb, attrtype, value) \
901({ u8 _tmp = (value); \ 911({ u8 _tmp = (value); \
@@ -975,6 +985,7 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
975 rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size)); 985 rta = (struct rtattr*)skb_put(skb, RTA_ALIGN(size));
976 rta->rta_type = attrtype; 986 rta->rta_type = attrtype;
977 rta->rta_len = size; 987 rta->rta_len = size;
988 memset(RTA_DATA(rta) + attrlen, 0, RTA_ALIGN(size) - size);
978 return rta; 989 return rta;
979} 990}
980 991
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b58afd97a180..dec5827c7742 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -246,7 +246,7 @@ struct mm_struct {
246 246
247 unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ 247 unsigned long saved_auxv[42]; /* for /proc/PID/auxv */
248 248
249 unsigned dumpable:1; 249 unsigned dumpable:2;
250 cpumask_t cpu_vm_mask; 250 cpumask_t cpu_vm_mask;
251 251
252 /* Architecture-specific MM context */ 252 /* Architecture-specific MM context */
@@ -368,6 +368,11 @@ struct signal_struct {
368#endif 368#endif
369}; 369};
370 370
371/* Context switch must be unlocked if interrupts are to be enabled */
372#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
373# define __ARCH_WANT_UNLOCKED_CTXSW
374#endif
375
371/* 376/*
372 * Bits in flags field of signal_struct. 377 * Bits in flags field of signal_struct.
373 */ 378 */
@@ -405,6 +410,10 @@ struct user_struct {
405 atomic_t processes; /* How many processes does this user have? */ 410 atomic_t processes; /* How many processes does this user have? */
406 atomic_t files; /* How many open files does this user have? */ 411 atomic_t files; /* How many open files does this user have? */
407 atomic_t sigpending; /* How many pending signals does this user have? */ 412 atomic_t sigpending; /* How many pending signals does this user have? */
413#ifdef CONFIG_INOTIFY
414 atomic_t inotify_watches; /* How many inotify watches does this user have? */
415 atomic_t inotify_devs; /* How many inotify devs does this user have opened? */
416#endif
408 /* protected by mq_lock */ 417 /* protected by mq_lock */
409 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */ 418 unsigned long mq_bytes; /* How many bytes can be allocated to mqueue? */
410 unsigned long locked_shm; /* How many pages of mlocked shm ? */ 419 unsigned long locked_shm; /* How many pages of mlocked shm ? */
@@ -460,10 +469,11 @@ enum idle_type
460#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 469#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
461#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ 470#define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */
462#define SD_BALANCE_EXEC 4 /* Balance on exec */ 471#define SD_BALANCE_EXEC 4 /* Balance on exec */
463#define SD_WAKE_IDLE 8 /* Wake to idle CPU on task wakeup */ 472#define SD_BALANCE_FORK 8 /* Balance on fork, clone */
464#define SD_WAKE_AFFINE 16 /* Wake task to waking CPU */ 473#define SD_WAKE_IDLE 16 /* Wake to idle CPU on task wakeup */
465#define SD_WAKE_BALANCE 32 /* Perform balancing at task wakeup */ 474#define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */
466#define SD_SHARE_CPUPOWER 64 /* Domain members share cpu power */ 475#define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */
476#define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */
467 477
468struct sched_group { 478struct sched_group {
469 struct sched_group *next; /* Must be a circular list */ 479 struct sched_group *next; /* Must be a circular list */
@@ -488,6 +498,11 @@ struct sched_domain {
488 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ 498 unsigned long long cache_hot_time; /* Task considered cache hot (ns) */
489 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ 499 unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */
490 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ 500 unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */
501 unsigned int busy_idx;
502 unsigned int idle_idx;
503 unsigned int newidle_idx;
504 unsigned int wake_idx;
505 unsigned int forkexec_idx;
491 int flags; /* See SD_* */ 506 int flags; /* See SD_* */
492 507
493 /* Runtime fields. */ 508 /* Runtime fields. */
@@ -511,10 +526,16 @@ struct sched_domain {
511 unsigned long alb_failed; 526 unsigned long alb_failed;
512 unsigned long alb_pushed; 527 unsigned long alb_pushed;
513 528
514 /* sched_balance_exec() stats */ 529 /* SD_BALANCE_EXEC stats */
515 unsigned long sbe_attempts; 530 unsigned long sbe_cnt;
531 unsigned long sbe_balanced;
516 unsigned long sbe_pushed; 532 unsigned long sbe_pushed;
517 533
534 /* SD_BALANCE_FORK stats */
535 unsigned long sbf_cnt;
536 unsigned long sbf_balanced;
537 unsigned long sbf_pushed;
538
518 /* try_to_wake_up() stats */ 539 /* try_to_wake_up() stats */
519 unsigned long ttwu_wake_remote; 540 unsigned long ttwu_wake_remote;
520 unsigned long ttwu_move_affine; 541 unsigned long ttwu_move_affine;
@@ -522,6 +543,8 @@ struct sched_domain {
522#endif 543#endif
523}; 544};
524 545
546extern void partition_sched_domains(cpumask_t *partition1,
547 cpumask_t *partition2);
525#ifdef ARCH_HAS_SCHED_DOMAIN 548#ifdef ARCH_HAS_SCHED_DOMAIN
526/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */ 549/* Useful helpers that arch setup code may use. Defined in kernel/sched.c */
527extern cpumask_t cpu_isolated_map; 550extern cpumask_t cpu_isolated_map;
@@ -561,9 +584,10 @@ struct group_info {
561 groups_free(group_info); \ 584 groups_free(group_info); \
562} while (0) 585} while (0)
563 586
564struct group_info *groups_alloc(int gidsetsize); 587extern struct group_info *groups_alloc(int gidsetsize);
565void groups_free(struct group_info *group_info); 588extern void groups_free(struct group_info *group_info);
566int set_current_groups(struct group_info *group_info); 589extern int set_current_groups(struct group_info *group_info);
590extern int groups_search(struct group_info *group_info, gid_t grp);
567/* access the groups "array" with this macro */ 591/* access the groups "array" with this macro */
568#define GROUP_AT(gi, i) \ 592#define GROUP_AT(gi, i) \
569 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK]) 593 ((gi)->blocks[(i)/NGROUPS_PER_BLOCK][(i)%NGROUPS_PER_BLOCK])
@@ -581,10 +605,15 @@ struct task_struct {
581 605
582 int lock_depth; /* BKL lock depth */ 606 int lock_depth; /* BKL lock depth */
583 607
608#if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
609 int oncpu;
610#endif
584 int prio, static_prio; 611 int prio, static_prio;
585 struct list_head run_list; 612 struct list_head run_list;
586 prio_array_t *array; 613 prio_array_t *array;
587 614
615 unsigned short ioprio;
616
588 unsigned long sleep_avg; 617 unsigned long sleep_avg;
589 unsigned long long timestamp, last_ran; 618 unsigned long long timestamp, last_ran;
590 unsigned long long sched_time; /* sched_clock time spent running */ 619 unsigned long long sched_time; /* sched_clock time spent running */
@@ -660,6 +689,7 @@ struct task_struct {
660 struct user_struct *user; 689 struct user_struct *user;
661#ifdef CONFIG_KEYS 690#ifdef CONFIG_KEYS
662 struct key *thread_keyring; /* keyring private to this thread */ 691 struct key *thread_keyring; /* keyring private to this thread */
692 unsigned char jit_keyring; /* default keyring to attach requested keys to */
663#endif 693#endif
664 int oomkilladj; /* OOM kill score adjustment (bit shift). */ 694 int oomkilladj; /* OOM kill score adjustment (bit shift). */
665 char comm[TASK_COMM_LEN]; /* executable name excluding path 695 char comm[TASK_COMM_LEN]; /* executable name excluding path
@@ -702,8 +732,6 @@ struct task_struct {
702 spinlock_t alloc_lock; 732 spinlock_t alloc_lock;
703/* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */ 733/* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
704 spinlock_t proc_lock; 734 spinlock_t proc_lock;
705/* context-switch lock */
706 spinlock_t switch_lock;
707 735
708/* journalling filesystem info */ 736/* journalling filesystem info */
709 void *journal_info; 737 void *journal_info;
@@ -741,6 +769,7 @@ struct task_struct {
741 nodemask_t mems_allowed; 769 nodemask_t mems_allowed;
742 int cpuset_mems_generation; 770 int cpuset_mems_generation;
743#endif 771#endif
772 atomic_t fs_excl; /* holding fs exclusive resources */
744}; 773};
745 774
746static inline pid_t process_group(struct task_struct *tsk) 775static inline pid_t process_group(struct task_struct *tsk)
@@ -910,7 +939,7 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
910#else 939#else
911 static inline void kick_process(struct task_struct *tsk) { } 940 static inline void kick_process(struct task_struct *tsk) { }
912#endif 941#endif
913extern void FASTCALL(sched_fork(task_t * p)); 942extern void FASTCALL(sched_fork(task_t * p, int clone_flags));
914extern void FASTCALL(sched_exit(task_t * p)); 943extern void FASTCALL(sched_exit(task_t * p));
915 944
916extern int in_group_p(gid_t); 945extern int in_group_p(gid_t);
@@ -1090,7 +1119,8 @@ extern void unhash_process(struct task_struct *p);
1090 1119
1091/* 1120/*
1092 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring 1121 * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm, keyring
1093 * subscriptions and synchronises with wait4(). Also used in procfs. 1122 * subscriptions and synchronises with wait4(). Also used in procfs. Also
1123 * pins the final release of task.io_context.
1094 * 1124 *
1095 * Nests both inside and outside of read_lock(&tasklist_lock). 1125 * Nests both inside and outside of read_lock(&tasklist_lock).
1096 * It must not be nested with write_lock_irq(&tasklist_lock), 1126 * It must not be nested with write_lock_irq(&tasklist_lock),
@@ -1243,33 +1273,78 @@ extern void normalize_rt_tasks(void);
1243 1273
1244#endif 1274#endif
1245 1275
1246/* try_to_freeze
1247 *
1248 * Checks whether we need to enter the refrigerator
1249 * and returns 1 if we did so.
1250 */
1251#ifdef CONFIG_PM 1276#ifdef CONFIG_PM
1252extern void refrigerator(unsigned long); 1277/*
1278 * Check if a process has been frozen
1279 */
1280static inline int frozen(struct task_struct *p)
1281{
1282 return p->flags & PF_FROZEN;
1283}
1284
1285/*
1286 * Check if there is a request to freeze a process
1287 */
1288static inline int freezing(struct task_struct *p)
1289{
1290 return p->flags & PF_FREEZE;
1291}
1292
1293/*
1294 * Request that a process be frozen
1295 * FIXME: SMP problem. We may not modify other process' flags!
1296 */
1297static inline void freeze(struct task_struct *p)
1298{
1299 p->flags |= PF_FREEZE;
1300}
1301
1302/*
1303 * Wake up a frozen process
1304 */
1305static inline int thaw_process(struct task_struct *p)
1306{
1307 if (frozen(p)) {
1308 p->flags &= ~PF_FROZEN;
1309 wake_up_process(p);
1310 return 1;
1311 }
1312 return 0;
1313}
1314
1315/*
1316 * freezing is complete, mark process as frozen
1317 */
1318static inline void frozen_process(struct task_struct *p)
1319{
1320 p->flags = (p->flags & ~PF_FREEZE) | PF_FROZEN;
1321}
1322
1323extern void refrigerator(void);
1253extern int freeze_processes(void); 1324extern int freeze_processes(void);
1254extern void thaw_processes(void); 1325extern void thaw_processes(void);
1255 1326
1256static inline int try_to_freeze(unsigned long refrigerator_flags) 1327static inline int try_to_freeze(void)
1257{ 1328{
1258 if (unlikely(current->flags & PF_FREEZE)) { 1329 if (freezing(current)) {
1259 refrigerator(refrigerator_flags); 1330 refrigerator();
1260 return 1; 1331 return 1;
1261 } else 1332 } else
1262 return 0; 1333 return 0;
1263} 1334}
1264#else 1335#else
1265static inline void refrigerator(unsigned long flag) {} 1336static inline int frozen(struct task_struct *p) { return 0; }
1337static inline int freezing(struct task_struct *p) { return 0; }
1338static inline void freeze(struct task_struct *p) { BUG(); }
1339static inline int thaw_process(struct task_struct *p) { return 1; }
1340static inline void frozen_process(struct task_struct *p) { BUG(); }
1341
1342static inline void refrigerator(void) {}
1266static inline int freeze_processes(void) { BUG(); return 0; } 1343static inline int freeze_processes(void) { BUG(); return 0; }
1267static inline void thaw_processes(void) {} 1344static inline void thaw_processes(void) {}
1268 1345
1269static inline int try_to_freeze(unsigned long refrigerator_flags) 1346static inline int try_to_freeze(void) { return 0; }
1270{ 1347
1271 return 0;
1272}
1273#endif /* CONFIG_PM */ 1348#endif /* CONFIG_PM */
1274#endif /* __KERNEL__ */ 1349#endif /* __KERNEL__ */
1275 1350
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 3a2702bbb1d6..dc89116bb1ca 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall)
19 __secure_computing(this_syscall); 19 __secure_computing(this_syscall);
20} 20}
21 21
22static inline int has_secure_computing(struct thread_info *ti)
23{
24 return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP));
25}
26
22#else /* CONFIG_SECCOMP */ 27#else /* CONFIG_SECCOMP */
23 28
24#if (__GNUC__ > 2) 29#if (__GNUC__ > 2)
@@ -28,6 +33,11 @@ static inline void secure_computing(int this_syscall)
28#endif 33#endif
29 34
30#define secure_computing(x) do { } while (0) 35#define secure_computing(x) do { } while (0)
36/* static inline to preserve typechecking */
37static inline int has_secure_computing(struct thread_info *ti)
38{
39 return 0;
40}
31 41
32#endif /* CONFIG_SECCOMP */ 42#endif /* CONFIG_SECCOMP */
33 43
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 00145822fb74..9f2d85284d0b 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -174,9 +174,11 @@ struct serial_icounter_struct {
174 174
175 175
176#ifdef __KERNEL__ 176#ifdef __KERNEL__
177#include <linux/compiler.h>
178
177/* Export to allow PCMCIA to use this - Dave Hinds */ 179/* Export to allow PCMCIA to use this - Dave Hinds */
178extern int register_serial(struct serial_struct *req); 180extern int __deprecated register_serial(struct serial_struct *req);
179extern void unregister_serial(int line); 181extern void __deprecated unregister_serial(int line);
180 182
181/* Allow architectures to override entries in serial8250_ports[] at run time: */ 183/* Allow architectures to override entries in serial8250_ports[] at run time: */
182struct uart_port; /* forward declaration */ 184struct uart_port; /* forward declaration */
diff --git a/include/linux/serialP.h b/include/linux/serialP.h
index 2307f11d8a6b..2b2f35a64d75 100644
--- a/include/linux/serialP.h
+++ b/include/linux/serialP.h
@@ -19,7 +19,6 @@
19 * For definitions of the flags field, see tty.h 19 * For definitions of the flags field, see tty.h
20 */ 20 */
21 21
22#include <linux/version.h>
23#include <linux/config.h> 22#include <linux/config.h>
24#include <linux/termios.h> 23#include <linux/termios.h>
25#include <linux/workqueue.h> 24#include <linux/workqueue.h>
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 823181af6ddf..3e3c1fa35b06 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -22,6 +22,7 @@ struct plat_serial8250_port {
22 unsigned int uartclk; /* UART clock rate */ 22 unsigned int uartclk; /* UART clock rate */
23 unsigned char regshift; /* register shift */ 23 unsigned char regshift; /* register shift */
24 unsigned char iotype; /* UPIO_* */ 24 unsigned char iotype; /* UPIO_* */
25 unsigned char hub6;
25 unsigned int flags; /* UPF_* flags */ 26 unsigned int flags; /* UPF_* flags */
26}; 27};
27 28
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index d6025af7efac..f6fca8f2f3ca 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -104,7 +104,7 @@
104#define PORT_MPSC 63 104#define PORT_MPSC 63
105 105
106/* TXX9 type number */ 106/* TXX9 type number */
107#define PORT_TXX9 64 107#define PORT_TXX9 64
108 108
109/* NEC VR4100 series SIU/DSIU */ 109/* NEC VR4100 series SIU/DSIU */
110#define PORT_VR41XX_SIU 65 110#define PORT_VR41XX_SIU 65
@@ -122,6 +122,7 @@
122#ifdef __KERNEL__ 122#ifdef __KERNEL__
123 123
124#include <linux/config.h> 124#include <linux/config.h>
125#include <linux/compiler.h>
125#include <linux/interrupt.h> 126#include <linux/interrupt.h>
126#include <linux/circ_buf.h> 127#include <linux/circ_buf.h>
127#include <linux/spinlock.h> 128#include <linux/spinlock.h>
@@ -359,8 +360,8 @@ struct tty_driver *uart_console_device(struct console *co, int *index);
359 */ 360 */
360int uart_register_driver(struct uart_driver *uart); 361int uart_register_driver(struct uart_driver *uart);
361void uart_unregister_driver(struct uart_driver *uart); 362void uart_unregister_driver(struct uart_driver *uart);
362void uart_unregister_port(struct uart_driver *reg, int line); 363void __deprecated uart_unregister_port(struct uart_driver *reg, int line);
363int uart_register_port(struct uart_driver *reg, struct uart_port *port); 364int __deprecated uart_register_port(struct uart_driver *reg, struct uart_port *port);
364int uart_add_one_port(struct uart_driver *reg, struct uart_port *port); 365int uart_add_one_port(struct uart_driver *reg, struct uart_port *port);
365int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); 366int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port);
366int uart_match_port(struct uart_port *port1, struct uart_port *port2); 367int uart_match_port(struct uart_port *port1, struct uart_port *port2);
diff --git a/include/linux/serio.h b/include/linux/serio.h
index a2d3b9ae06f4..aa4d6493a034 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -83,6 +83,7 @@ static inline void serio_register_port(struct serio *serio)
83} 83}
84 84
85void serio_unregister_port(struct serio *serio); 85void serio_unregister_port(struct serio *serio);
86void serio_unregister_child_port(struct serio *serio);
86void __serio_unregister_port_delayed(struct serio *serio, struct module *owner); 87void __serio_unregister_port_delayed(struct serio *serio, struct module *owner);
87static inline void serio_unregister_port_delayed(struct serio *serio) 88static inline void serio_unregister_port_delayed(struct serio *serio)
88{ 89{
@@ -153,6 +154,11 @@ static inline int serio_pin_driver(struct serio *serio)
153 return down_interruptible(&serio->drv_sem); 154 return down_interruptible(&serio->drv_sem);
154} 155}
155 156
157static inline void serio_pin_driver_uninterruptible(struct serio *serio)
158{
159 down(&serio->drv_sem);
160}
161
156static inline void serio_unpin_driver(struct serio *serio) 162static inline void serio_unpin_driver(struct serio *serio)
157{ 163{
158 up(&serio->drv_sem); 164 up(&serio->drv_sem);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index d7c839a21842..948527e42a60 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -27,6 +27,7 @@
27#include <linux/highmem.h> 27#include <linux/highmem.h>
28#include <linux/poll.h> 28#include <linux/poll.h>
29#include <linux/net.h> 29#include <linux/net.h>
30#include <linux/textsearch.h>
30#include <net/checksum.h> 31#include <net/checksum.h>
31 32
32#define HAVE_ALLOC_SKB /* For the drivers to know */ 33#define HAVE_ALLOC_SKB /* For the drivers to know */
@@ -182,7 +183,6 @@ struct skb_shared_info {
182 * @priority: Packet queueing priority 183 * @priority: Packet queueing priority
183 * @users: User count - see {datagram,tcp}.c 184 * @users: User count - see {datagram,tcp}.c
184 * @protocol: Packet protocol from driver 185 * @protocol: Packet protocol from driver
185 * @security: Security level of packet
186 * @truesize: Buffer size 186 * @truesize: Buffer size
187 * @head: Head of buffer 187 * @head: Head of buffer
188 * @data: Data head pointer 188 * @data: Data head pointer
@@ -248,18 +248,18 @@ struct sk_buff {
248 data_len, 248 data_len,
249 mac_len, 249 mac_len,
250 csum; 250 csum;
251 unsigned char local_df,
252 cloned:1,
253 nohdr:1,
254 pkt_type,
255 ip_summed;
256 __u32 priority; 251 __u32 priority;
257 unsigned short protocol, 252 __u8 local_df:1,
258 security; 253 cloned:1,
254 ip_summed:2,
255 nohdr:1;
256 /* 3 bits spare */
257 __u8 pkt_type;
258 __be16 protocol;
259 259
260 void (*destructor)(struct sk_buff *skb); 260 void (*destructor)(struct sk_buff *skb);
261#ifdef CONFIG_NETFILTER 261#ifdef CONFIG_NETFILTER
262 unsigned long nfmark; 262 unsigned long nfmark;
263 __u32 nfcache; 263 __u32 nfcache;
264 __u32 nfctinfo; 264 __u32 nfctinfo;
265 struct nf_conntrack *nfct; 265 struct nf_conntrack *nfct;
@@ -300,20 +300,26 @@ struct sk_buff {
300#include <asm/system.h> 300#include <asm/system.h>
301 301
302extern void __kfree_skb(struct sk_buff *skb); 302extern void __kfree_skb(struct sk_buff *skb);
303extern struct sk_buff *alloc_skb(unsigned int size, int priority); 303extern struct sk_buff *alloc_skb(unsigned int size,
304 unsigned int __nocast priority);
304extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, 305extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp,
305 unsigned int size, int priority); 306 unsigned int size,
307 unsigned int __nocast priority);
306extern void kfree_skbmem(struct sk_buff *skb); 308extern void kfree_skbmem(struct sk_buff *skb);
307extern struct sk_buff *skb_clone(struct sk_buff *skb, int priority); 309extern struct sk_buff *skb_clone(struct sk_buff *skb,
308extern struct sk_buff *skb_copy(const struct sk_buff *skb, int priority); 310 unsigned int __nocast priority);
309extern struct sk_buff *pskb_copy(struct sk_buff *skb, int gfp_mask); 311extern struct sk_buff *skb_copy(const struct sk_buff *skb,
312 unsigned int __nocast priority);
313extern struct sk_buff *pskb_copy(struct sk_buff *skb,
314 unsigned int __nocast gfp_mask);
310extern int pskb_expand_head(struct sk_buff *skb, 315extern int pskb_expand_head(struct sk_buff *skb,
311 int nhead, int ntail, int gfp_mask); 316 int nhead, int ntail,
317 unsigned int __nocast gfp_mask);
312extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, 318extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb,
313 unsigned int headroom); 319 unsigned int headroom);
314extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, 320extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb,
315 int newheadroom, int newtailroom, 321 int newheadroom, int newtailroom,
316 int priority); 322 unsigned int __nocast priority);
317extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad); 323extern struct sk_buff * skb_pad(struct sk_buff *skb, int pad);
318#define dev_kfree_skb(a) kfree_skb(a) 324#define dev_kfree_skb(a) kfree_skb(a)
319extern void skb_over_panic(struct sk_buff *skb, int len, 325extern void skb_over_panic(struct sk_buff *skb, int len,
@@ -321,6 +327,28 @@ extern void skb_over_panic(struct sk_buff *skb, int len,
321extern void skb_under_panic(struct sk_buff *skb, int len, 327extern void skb_under_panic(struct sk_buff *skb, int len,
322 void *here); 328 void *here);
323 329
330struct skb_seq_state
331{
332 __u32 lower_offset;
333 __u32 upper_offset;
334 __u32 frag_idx;
335 __u32 stepped_offset;
336 struct sk_buff *root_skb;
337 struct sk_buff *cur_skb;
338 __u8 *frag_data;
339};
340
341extern void skb_prepare_seq_read(struct sk_buff *skb,
342 unsigned int from, unsigned int to,
343 struct skb_seq_state *st);
344extern unsigned int skb_seq_read(unsigned int consumed, const u8 **data,
345 struct skb_seq_state *st);
346extern void skb_abort_seq_read(struct skb_seq_state *st);
347
348extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
349 unsigned int to, struct ts_config *config,
350 struct ts_state *state);
351
324/* Internal */ 352/* Internal */
325#define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end)) 353#define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end))
326 354
@@ -442,7 +470,8 @@ static inline int skb_shared(const struct sk_buff *skb)
442 * 470 *
443 * NULL is returned on a memory allocation failure. 471 * NULL is returned on a memory allocation failure.
444 */ 472 */
445static inline struct sk_buff *skb_share_check(struct sk_buff *skb, int pri) 473static inline struct sk_buff *skb_share_check(struct sk_buff *skb,
474 unsigned int __nocast pri)
446{ 475{
447 might_sleep_if(pri & __GFP_WAIT); 476 might_sleep_if(pri & __GFP_WAIT);
448 if (skb_shared(skb)) { 477 if (skb_shared(skb)) {
@@ -473,7 +502,8 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, int pri)
473 * 502 *
474 * %NULL is returned on a memory allocation failure. 503 * %NULL is returned on a memory allocation failure.
475 */ 504 */
476static inline struct sk_buff *skb_unshare(struct sk_buff *skb, int pri) 505static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
506 unsigned int __nocast pri)
477{ 507{
478 might_sleep_if(pri & __GFP_WAIT); 508 might_sleep_if(pri & __GFP_WAIT);
479 if (skb_cloned(skb)) { 509 if (skb_cloned(skb)) {
@@ -979,7 +1009,7 @@ static inline void __skb_queue_purge(struct sk_buff_head *list)
979 * %NULL is returned in there is no free memory. 1009 * %NULL is returned in there is no free memory.
980 */ 1010 */
981static inline struct sk_buff *__dev_alloc_skb(unsigned int length, 1011static inline struct sk_buff *__dev_alloc_skb(unsigned int length,
982 int gfp_mask) 1012 unsigned int __nocast gfp_mask)
983{ 1013{
984 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); 1014 struct sk_buff *skb = alloc_skb(length + 16, gfp_mask);
985 if (likely(skb)) 1015 if (likely(skb))
@@ -1092,8 +1122,8 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1092 * If there is no free memory -ENOMEM is returned, otherwise zero 1122 * If there is no free memory -ENOMEM is returned, otherwise zero
1093 * is returned and the old skb data released. 1123 * is returned and the old skb data released.
1094 */ 1124 */
1095extern int __skb_linearize(struct sk_buff *skb, int gfp); 1125extern int __skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp);
1096static inline int skb_linearize(struct sk_buff *skb, int gfp) 1126static inline int skb_linearize(struct sk_buff *skb, unsigned int __nocast gfp)
1097{ 1127{
1098 return __skb_linearize(skb, gfp); 1128 return __skb_linearize(skb, gfp);
1099} 1129}
@@ -1188,7 +1218,7 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
1188{ 1218{
1189 int hlen = skb_headlen(skb); 1219 int hlen = skb_headlen(skb);
1190 1220
1191 if (offset + len <= hlen) 1221 if (hlen - offset >= len)
1192 return skb->data + offset; 1222 return skb->data + offset;
1193 1223
1194 if (skb_copy_bits(skb, offset, buffer, len) < 0) 1224 if (skb_copy_bits(skb, offset, buffer, len) < 0)
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 76cf7e60216c..80b2dfde2e80 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -65,7 +65,7 @@ extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast);
65extern void kmem_cache_free(kmem_cache_t *, void *); 65extern void kmem_cache_free(kmem_cache_t *, void *);
66extern unsigned int kmem_cache_size(kmem_cache_t *); 66extern unsigned int kmem_cache_size(kmem_cache_t *);
67extern const char *kmem_cache_name(kmem_cache_t *); 67extern const char *kmem_cache_name(kmem_cache_t *);
68extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); 68extern kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags);
69 69
70/* Size description struct for general caches. */ 70/* Size description struct for general caches. */
71struct cache_sizes { 71struct cache_sizes {
@@ -105,13 +105,13 @@ extern unsigned int ksize(const void *);
105 105
106#ifdef CONFIG_NUMA 106#ifdef CONFIG_NUMA
107extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node); 107extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node);
108extern void *kmalloc_node(size_t size, int flags, int node); 108extern void *kmalloc_node(size_t size, unsigned int __nocast flags, int node);
109#else 109#else
110static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node) 110static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node)
111{ 111{
112 return kmem_cache_alloc(cachep, flags); 112 return kmem_cache_alloc(cachep, flags);
113} 113}
114static inline void *kmalloc_node(size_t size, int flags, int node) 114static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node)
115{ 115{
116 return kmalloc(size, flags); 116 return kmalloc(size, flags);
117} 117}
diff --git a/include/linux/string.h b/include/linux/string.h
index b9fc59469956..dab2652acbd8 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -88,6 +88,8 @@ extern int memcmp(const void *,const void *,__kernel_size_t);
88extern void * memchr(const void *,int,__kernel_size_t); 88extern void * memchr(const void *,int,__kernel_size_t);
89#endif 89#endif
90 90
91extern char *kstrdup(const char *s, unsigned int __nocast gfp);
92
91#ifdef __cplusplus 93#ifdef __cplusplus
92} 94}
93#endif 95#endif
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 2709caf4d128..ab151bbb66df 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -111,6 +111,11 @@ struct rpc_procinfo {
111struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, 111struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname,
112 struct rpc_program *info, 112 struct rpc_program *info,
113 u32 version, rpc_authflavor_t authflavor); 113 u32 version, rpc_authflavor_t authflavor);
114struct rpc_clnt *rpc_new_client(struct rpc_xprt *xprt, char *servname,
115 struct rpc_program *info,
116 u32 version, rpc_authflavor_t authflavor);
117struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
118 struct rpc_program *, int);
114struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 119struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
115int rpc_shutdown_client(struct rpc_clnt *); 120int rpc_shutdown_client(struct rpc_clnt *);
116int rpc_destroy_client(struct rpc_clnt *); 121int rpc_destroy_client(struct rpc_clnt *);
@@ -129,6 +134,7 @@ void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset);
129void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); 134void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
130void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 135void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
131size_t rpc_max_payload(struct rpc_clnt *); 136size_t rpc_max_payload(struct rpc_clnt *);
137int rpc_ping(struct rpc_clnt *clnt, int flags);
132 138
133static __inline__ 139static __inline__
134int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags) 140int rpc_call(struct rpc_clnt *clnt, u32 proc, void *argp, void *resp, int flags)
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 99d17ed7cebb..4d77e90d0b30 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -31,7 +31,6 @@ struct rpc_wait_queue;
31struct rpc_wait { 31struct rpc_wait {
32 struct list_head list; /* wait queue links */ 32 struct list_head list; /* wait queue links */
33 struct list_head links; /* Links to related tasks */ 33 struct list_head links; /* Links to related tasks */
34 wait_queue_head_t waitq; /* sync: sleep on this q */
35 struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */ 34 struct rpc_wait_queue * rpc_waitq; /* RPC wait queue we're on */
36}; 35};
37 36
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 37003970cf2e..5af8800e0ce3 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -185,6 +185,17 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
185 return vec->iov_len <= PAGE_SIZE; 185 return vec->iov_len <= PAGE_SIZE;
186} 186}
187 187
188static inline struct page *
189svc_take_res_page(struct svc_rqst *rqstp)
190{
191 if (rqstp->rq_arghi <= rqstp->rq_argused)
192 return NULL;
193 rqstp->rq_arghi--;
194 rqstp->rq_respages[rqstp->rq_resused] =
195 rqstp->rq_argpages[rqstp->rq_arghi];
196 return rqstp->rq_respages[rqstp->rq_resused++];
197}
198
188static inline int svc_take_page(struct svc_rqst *rqstp) 199static inline int svc_take_page(struct svc_rqst *rqstp)
189{ 200{
190 if (rqstp->rq_arghi <= rqstp->rq_argused) 201 if (rqstp->rq_arghi <= rqstp->rq_argused)
@@ -240,9 +251,10 @@ struct svc_deferred_req {
240}; 251};
241 252
242/* 253/*
243 * RPC program 254 * List of RPC programs on the same transport endpoint
244 */ 255 */
245struct svc_program { 256struct svc_program {
257 struct svc_program * pg_next; /* other programs (same xprt) */
246 u32 pg_prog; /* program number */ 258 u32 pg_prog; /* program number */
247 unsigned int pg_lovers; /* lowest version */ 259 unsigned int pg_lovers; /* lowest version */
248 unsigned int pg_hivers; /* lowest version */ 260 unsigned int pg_hivers; /* lowest version */
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 541dcf838abf..23448d0fb5bc 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -146,7 +146,8 @@ extern void xdr_shift_buf(struct xdr_buf *, size_t);
146extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *); 146extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
147extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int); 147extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int);
148extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int); 148extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int);
149extern int read_bytes_from_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len); 149extern int read_bytes_from_xdr_buf(struct xdr_buf *, int, void *, int);
150extern int write_bytes_to_xdr_buf(struct xdr_buf *, int, void *, int);
150 151
151/* 152/*
152 * Helper structure for copying from an sk_buff. 153 * Helper structure for copying from an sk_buff.
@@ -160,7 +161,7 @@ typedef struct {
160 161
161typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 162typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
162 163
163extern void xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int, 164extern ssize_t xdr_partial_copy_from_skb(struct xdr_buf *, unsigned int,
164 skb_reader_t *, skb_read_actor_t); 165 skb_reader_t *, skb_read_actor_t);
165 166
166struct socket; 167struct socket;
@@ -168,6 +169,23 @@ struct sockaddr;
168extern int xdr_sendpages(struct socket *, struct sockaddr *, int, 169extern int xdr_sendpages(struct socket *, struct sockaddr *, int,
169 struct xdr_buf *, unsigned int, int); 170 struct xdr_buf *, unsigned int, int);
170 171
172extern int xdr_encode_word(struct xdr_buf *, int, u32);
173extern int xdr_decode_word(struct xdr_buf *, int, u32 *);
174
175struct xdr_array2_desc;
176typedef int (*xdr_xcode_elem_t)(struct xdr_array2_desc *desc, void *elem);
177struct xdr_array2_desc {
178 unsigned int elem_size;
179 unsigned int array_len;
180 unsigned int array_maxlen;
181 xdr_xcode_elem_t xcode;
182};
183
184extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base,
185 struct xdr_array2_desc *desc);
186extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base,
187 struct xdr_array2_desc *desc);
188
171/* 189/*
172 * Provide some simple tools for XDR buffer overflow-checking etc. 190 * Provide some simple tools for XDR buffer overflow-checking etc.
173 */ 191 */
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 2bf0d5fabcdb..f2e96fdfaae0 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -58,7 +58,7 @@ static inline int software_suspend(void)
58} 58}
59#endif 59#endif
60 60
61#ifdef CONFIG_SMP 61#ifdef CONFIG_SUSPEND_SMP
62extern void disable_nonboot_cpus(void); 62extern void disable_nonboot_cpus(void);
63extern void enable_nonboot_cpus(void); 63extern void enable_nonboot_cpus(void);
64#else 64#else
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 2343f999e6e1..bfe3e763ccf2 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -7,6 +7,7 @@
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10
10#include <asm/atomic.h> 11#include <asm/atomic.h>
11#include <asm/page.h> 12#include <asm/page.h>
12 13
@@ -148,7 +149,7 @@ struct swap_list_t {
148#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages) 149#define vm_swap_full() (nr_swap_pages*2 < total_swap_pages)
149 150
150/* linux/mm/oom_kill.c */ 151/* linux/mm/oom_kill.c */
151extern void out_of_memory(unsigned int __nocast gfp_mask); 152extern void out_of_memory(unsigned int __nocast gfp_mask, int order);
152 153
153/* linux/mm/memory.c */ 154/* linux/mm/memory.c */
154extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *); 155extern void swapin_readahead(swp_entry_t, unsigned long, struct vm_area_struct *);
@@ -253,6 +254,8 @@ static inline void put_swap_token(struct mm_struct *mm)
253 254
254#define si_swapinfo(val) \ 255#define si_swapinfo(val) \
255 do { (val)->freeswap = (val)->totalswap = 0; } while (0) 256 do { (val)->freeswap = (val)->totalswap = 0; } while (0)
257/* only sparc can not include linux/pagemap.h in this file
258 * so leave page_cache_release and release_pages undeclared... */
256#define free_page_and_swap_cache(page) \ 259#define free_page_and_swap_cache(page) \
257 page_cache_release(page) 260 page_cache_release(page)
258#define free_pages_and_swap_cache(pages, nr) \ 261#define free_pages_and_swap_cache(pages, nr) \
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c39f6f72cbbc..425f58c8ea4a 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -159,8 +159,9 @@ asmlinkage long sys_shutdown(int, int);
159asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd, 159asmlinkage long sys_reboot(int magic1, int magic2, unsigned int cmd,
160 void __user *arg); 160 void __user *arg);
161asmlinkage long sys_restart_syscall(void); 161asmlinkage long sys_restart_syscall(void);
162asmlinkage long sys_kexec_load(void *entry, unsigned long nr_segments, 162asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
163 struct kexec_segment *segments, unsigned long flags); 163 struct kexec_segment __user *segments,
164 unsigned long flags);
164 165
165asmlinkage long sys_exit(int error_code); 166asmlinkage long sys_exit(int error_code);
166asmlinkage void sys_exit_group(int error_code); 167asmlinkage void sys_exit_group(int error_code);
@@ -505,4 +506,7 @@ asmlinkage long sys_request_key(const char __user *_type,
505asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3, 506asmlinkage long sys_keyctl(int cmd, unsigned long arg2, unsigned long arg3,
506 unsigned long arg4, unsigned long arg5); 507 unsigned long arg4, unsigned long arg5);
507 508
509asmlinkage long sys_ioprio_set(int which, int who, int ioprio);
510asmlinkage long sys_ioprio_get(int which, int who);
511
508#endif 512#endif
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index a17745c80a91..e82be96d4906 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -70,6 +70,14 @@ enum
70 CTL_BUS_ISA=1 /* ISA */ 70 CTL_BUS_ISA=1 /* ISA */
71}; 71};
72 72
73/* /proc/sys/fs/inotify/ */
74enum
75{
76 INOTIFY_MAX_USER_INSTANCES=1, /* max instances per user */
77 INOTIFY_MAX_USER_WATCHES=2, /* max watches per user */
78 INOTIFY_MAX_QUEUED_EVENTS=3 /* max queued events per instance */
79};
80
73/* CTL_KERN names: */ 81/* CTL_KERN names: */
74enum 82enum
75{ 83{
@@ -136,6 +144,8 @@ enum
136 KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */ 144 KERN_UNKNOWN_NMI_PANIC=66, /* int: unknown nmi panic flag */
137 KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */ 145 KERN_BOOTLOADER_TYPE=67, /* int: boot loader type */
138 KERN_RANDOMIZE=68, /* int: randomize virtual address space */ 146 KERN_RANDOMIZE=68, /* int: randomize virtual address space */
147 KERN_SETUID_DUMPABLE=69, /* int: behaviour of dumps for setuid core */
148 KERN_SPIN_RETRY=70, /* int: number of spinlock retries */
139}; 149};
140 150
141 151
@@ -242,6 +252,7 @@ enum
242 NET_CORE_MOD_CONG=16, 252 NET_CORE_MOD_CONG=16,
243 NET_CORE_DEV_WEIGHT=17, 253 NET_CORE_DEV_WEIGHT=17,
244 NET_CORE_SOMAXCONN=18, 254 NET_CORE_SOMAXCONN=18,
255 NET_CORE_BUDGET=19,
245}; 256};
246 257
247/* /proc/sys/net/ethernet */ 258/* /proc/sys/net/ethernet */
@@ -332,21 +343,14 @@ enum
332 NET_TCP_FRTO=92, 343 NET_TCP_FRTO=92,
333 NET_TCP_LOW_LATENCY=93, 344 NET_TCP_LOW_LATENCY=93,
334 NET_IPV4_IPFRAG_SECRET_INTERVAL=94, 345 NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
335 NET_TCP_WESTWOOD=95,
336 NET_IPV4_IGMP_MAX_MSF=96, 346 NET_IPV4_IGMP_MAX_MSF=96,
337 NET_TCP_NO_METRICS_SAVE=97, 347 NET_TCP_NO_METRICS_SAVE=97,
338 NET_TCP_VEGAS=98,
339 NET_TCP_VEGAS_ALPHA=99,
340 NET_TCP_VEGAS_BETA=100,
341 NET_TCP_VEGAS_GAMMA=101,
342 NET_TCP_BIC=102,
343 NET_TCP_BIC_FAST_CONVERGENCE=103,
344 NET_TCP_BIC_LOW_WINDOW=104,
345 NET_TCP_DEFAULT_WIN_SCALE=105, 348 NET_TCP_DEFAULT_WIN_SCALE=105,
346 NET_TCP_MODERATE_RCVBUF=106, 349 NET_TCP_MODERATE_RCVBUF=106,
347 NET_TCP_TSO_WIN_DIVISOR=107, 350 NET_TCP_TSO_WIN_DIVISOR=107,
348 NET_TCP_BIC_BETA=108, 351 NET_TCP_BIC_BETA=108,
349 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, 352 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
353 NET_TCP_CONG_CONTROL=110,
350}; 354};
351 355
352enum { 356enum {
@@ -646,6 +650,7 @@ enum {
646 NET_SCTP_ADDIP_ENABLE = 13, 650 NET_SCTP_ADDIP_ENABLE = 13,
647 NET_SCTP_PRSCTP_ENABLE = 14, 651 NET_SCTP_PRSCTP_ENABLE = 14,
648 NET_SCTP_SNDBUF_POLICY = 15, 652 NET_SCTP_SNDBUF_POLICY = 15,
653 NET_SCTP_SACK_TIMEOUT = 16,
649}; 654};
650 655
651/* /proc/sys/net/bridge */ 656/* /proc/sys/net/bridge */
@@ -680,6 +685,7 @@ enum
680 FS_XFS=17, /* struct: control xfs parameters */ 685 FS_XFS=17, /* struct: control xfs parameters */
681 FS_AIO_NR=18, /* current system-wide number of aio requests */ 686 FS_AIO_NR=18, /* current system-wide number of aio requests */
682 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */ 687 FS_AIO_MAX_NR=19, /* system-wide maximum number of aio requests */
688 FS_INOTIFY=20, /* inotify submenu */
683}; 689};
684 690
685/* /proc/sys/fs/quota/ */ 691/* /proc/sys/fs/quota/ */
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index a6b2cc530af5..081b1ee8516e 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -41,19 +41,14 @@ enum
41 TCF_META_ID_LOADAVG_1, 41 TCF_META_ID_LOADAVG_1,
42 TCF_META_ID_LOADAVG_2, 42 TCF_META_ID_LOADAVG_2,
43 TCF_META_ID_DEV, 43 TCF_META_ID_DEV,
44 TCF_META_ID_INDEV,
45 TCF_META_ID_REALDEV,
46 TCF_META_ID_PRIORITY, 44 TCF_META_ID_PRIORITY,
47 TCF_META_ID_PROTOCOL, 45 TCF_META_ID_PROTOCOL,
48 TCF_META_ID_SECURITY,
49 TCF_META_ID_PKTTYPE, 46 TCF_META_ID_PKTTYPE,
50 TCF_META_ID_PKTLEN, 47 TCF_META_ID_PKTLEN,
51 TCF_META_ID_DATALEN, 48 TCF_META_ID_DATALEN,
52 TCF_META_ID_MACLEN, 49 TCF_META_ID_MACLEN,
53 TCF_META_ID_NFMARK, 50 TCF_META_ID_NFMARK,
54 TCF_META_ID_TCINDEX, 51 TCF_META_ID_TCINDEX,
55 TCF_META_ID_TCVERDICT,
56 TCF_META_ID_TCCLASSID,
57 TCF_META_ID_RTCLASSID, 52 TCF_META_ID_RTCLASSID,
58 TCF_META_ID_RTIIF, 53 TCF_META_ID_RTIIF,
59 TCF_META_ID_SK_FAMILY, 54 TCF_META_ID_SK_FAMILY,
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/linux/tc_ematch/tc_em_text.h
new file mode 100644
index 000000000000..7cd43e99c7f5
--- /dev/null
+++ b/include/linux/tc_ematch/tc_em_text.h
@@ -0,0 +1,19 @@
1#ifndef __LINUX_TC_EM_TEXT_H
2#define __LINUX_TC_EM_TEXT_H
3
4#include <linux/pkt_cls.h>
5
6#define TC_EM_TEXT_ALGOSIZ 16
7
8struct tcf_em_text
9{
10 char algo[TC_EM_TEXT_ALGOSIZ];
11 __u16 from_offset;
12 __u16 to_offset;
13 __u16 pattern_len;
14 __u8 from_layer:4;
15 __u8 to_layer:4;
16 __u8 pad;
17};
18
19#endif
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 97a7c9e03df5..e4fd82e42104 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -127,6 +127,7 @@ enum {
127#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ 127#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
128#define TCP_INFO 11 /* Information about this connection. */ 128#define TCP_INFO 11 /* Information about this connection. */
129#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 129#define TCP_QUICKACK 12 /* Block/reenable quick acks */
130#define TCP_CONGESTION 13 /* Congestion control algorithm */
130 131
131#define TCPI_OPT_TIMESTAMPS 1 132#define TCPI_OPT_TIMESTAMPS 1
132#define TCPI_OPT_SACK 2 133#define TCPI_OPT_SACK 2
@@ -203,13 +204,6 @@ struct tcp_sack_block {
203 __u32 end_seq; 204 __u32 end_seq;
204}; 205};
205 206
206enum tcp_congestion_algo {
207 TCP_RENO=0,
208 TCP_VEGAS,
209 TCP_WESTWOOD,
210 TCP_BIC,
211};
212
213struct tcp_options_received { 207struct tcp_options_received {
214/* PAWS/RTTM data */ 208/* PAWS/RTTM data */
215 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ 209 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
@@ -292,7 +286,7 @@ struct tcp_sock {
292 __u32 max_window; /* Maximal window ever seen from peer */ 286 __u32 max_window; /* Maximal window ever seen from peer */
293 __u32 pmtu_cookie; /* Last pmtu seen by socket */ 287 __u32 pmtu_cookie; /* Last pmtu seen by socket */
294 __u32 mss_cache; /* Cached effective mss, not including SACKS */ 288 __u32 mss_cache; /* Cached effective mss, not including SACKS */
295 __u16 mss_cache_std; /* Like mss_cache, but without TSO */ 289 __u16 xmit_size_goal; /* Goal for segmenting output packets */
296 __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ 290 __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */
297 __u8 ca_state; /* State of fast-retransmit machine */ 291 __u8 ca_state; /* State of fast-retransmit machine */
298 __u8 retransmits; /* Number of unrecovered RTO timeouts. */ 292 __u8 retransmits; /* Number of unrecovered RTO timeouts. */
@@ -305,7 +299,7 @@ struct tcp_sock {
305 __u8 reordering; /* Packet reordering metric. */ 299 __u8 reordering; /* Packet reordering metric. */
306 __u8 frto_counter; /* Number of new acks after RTO */ 300 __u8 frto_counter; /* Number of new acks after RTO */
307 301
308 __u8 adv_cong; /* Using Vegas, Westwood, or BIC */ 302 __u8 unused;
309 __u8 defer_accept; /* User waits for some data after accept() */ 303 __u8 defer_accept; /* User waits for some data after accept() */
310 304
311/* RTT measurement */ 305/* RTT measurement */
@@ -401,37 +395,10 @@ struct tcp_sock {
401 __u32 time; 395 __u32 time;
402 } rcvq_space; 396 } rcvq_space;
403 397
404/* TCP Westwood structure */ 398 /* Pluggable TCP congestion control hook */
405 struct { 399 struct tcp_congestion_ops *ca_ops;
406 __u32 bw_ns_est; /* first bandwidth estimation..not too smoothed 8) */ 400 u32 ca_priv[16];
407 __u32 bw_est; /* bandwidth estimate */ 401#define TCP_CA_PRIV_SIZE (16*sizeof(u32))
408 __u32 rtt_win_sx; /* here starts a new evaluation... */
409 __u32 bk;
410 __u32 snd_una; /* used for evaluating the number of acked bytes */
411 __u32 cumul_ack;
412 __u32 accounted;
413 __u32 rtt;
414 __u32 rtt_min; /* minimum observed RTT */
415 } westwood;
416
417/* Vegas variables */
418 struct {
419 __u32 beg_snd_nxt; /* right edge during last RTT */
420 __u32 beg_snd_una; /* left edge during last RTT */
421 __u32 beg_snd_cwnd; /* saves the size of the cwnd */
422 __u8 doing_vegas_now;/* if true, do vegas for this RTT */
423 __u16 cntRTT; /* # of RTTs measured within last RTT */
424 __u32 minRTT; /* min of RTTs measured within last RTT (in usec) */
425 __u32 baseRTT; /* the min of all Vegas RTT measurements seen (in usec) */
426 } vegas;
427
428 /* BI TCP Parameters */
429 struct {
430 __u32 cnt; /* increase cwnd by 1 after this number of ACKs */
431 __u32 last_max_cwnd; /* last maximium snd_cwnd */
432 __u32 last_cwnd; /* the last snd_cwnd */
433 __u32 last_stamp; /* time when updated last_cwnd */
434 } bictcp;
435}; 402};
436 403
437static inline struct tcp_sock *tcp_sk(const struct sock *sk) 404static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -439,6 +406,11 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
439 return (struct tcp_sock *)sk; 406 return (struct tcp_sock *)sk;
440} 407}
441 408
409static inline void *tcp_ca(const struct tcp_sock *tp)
410{
411 return (void *) tp->ca_priv;
412}
413
442#endif 414#endif
443 415
444#endif /* _LINUX_TCP_H */ 416#endif /* _LINUX_TCP_H */
diff --git a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h
index ceee962e1d15..7a5996743946 100644
--- a/include/linux/tcp_diag.h
+++ b/include/linux/tcp_diag.h
@@ -99,9 +99,10 @@ enum
99 TCPDIAG_MEMINFO, 99 TCPDIAG_MEMINFO,
100 TCPDIAG_INFO, 100 TCPDIAG_INFO,
101 TCPDIAG_VEGASINFO, 101 TCPDIAG_VEGASINFO,
102 TCPDIAG_CONG,
102}; 103};
103 104
104#define TCPDIAG_MAX TCPDIAG_VEGASINFO 105#define TCPDIAG_MAX TCPDIAG_CONG
105 106
106 107
107/* TCPDIAG_MEM */ 108/* TCPDIAG_MEM */
@@ -123,5 +124,4 @@ struct tcpvegas_info {
123 __u32 tcpv_minrtt; 124 __u32 tcpv_minrtt;
124}; 125};
125 126
126
127#endif /* _TCP_DIAG_H_ */ 127#endif /* _TCP_DIAG_H_ */
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
new file mode 100644
index 000000000000..941f45ac117a
--- /dev/null
+++ b/include/linux/textsearch.h
@@ -0,0 +1,180 @@
1#ifndef __LINUX_TEXTSEARCH_H
2#define __LINUX_TEXTSEARCH_H
3
4#ifdef __KERNEL__
5
6#include <linux/types.h>
7#include <linux/list.h>
8#include <linux/kernel.h>
9#include <linux/module.h>
10#include <linux/err.h>
11
12struct ts_config;
13
14/**
15 * TS_AUTOLOAD - Automatically load textsearch modules when needed
16 */
17#define TS_AUTOLOAD 1
18
19/**
20 * struct ts_state - search state
21 * @offset: offset for next match
22 * @cb: control buffer, for persistant variables of get_next_block()
23 */
24struct ts_state
25{
26 unsigned int offset;
27 char cb[40];
28};
29
30/**
31 * struct ts_ops - search module operations
32 * @name: name of search algorithm
33 * @init: initialization function to prepare a search
34 * @find: find the next occurrence of the pattern
35 * @destroy: destroy algorithm specific parts of a search configuration
36 * @get_pattern: return head of pattern
37 * @get_pattern_len: return length of pattern
38 * @owner: module reference to algorithm
39 */
40struct ts_ops
41{
42 const char *name;
43 struct ts_config * (*init)(const void *, unsigned int, int);
44 unsigned int (*find)(struct ts_config *,
45 struct ts_state *);
46 void (*destroy)(struct ts_config *);
47 void * (*get_pattern)(struct ts_config *);
48 unsigned int (*get_pattern_len)(struct ts_config *);
49 struct module *owner;
50 struct list_head list;
51};
52
53/**
54 * struct ts_config - search configuration
55 * @ops: operations of chosen algorithm
56 * @get_next_block: callback to fetch the next block to search in
57 * @finish: callback to finalize a search
58 */
59struct ts_config
60{
61 struct ts_ops *ops;
62
63 /**
64 * get_next_block - fetch next block of data
65 * @consumed: number of bytes consumed by the caller
66 * @dst: destination buffer
67 * @conf: search configuration
68 * @state: search state
69 *
70 * Called repeatedly until 0 is returned. Must assign the
71 * head of the next block of data to &*dst and return the length
72 * of the block or 0 if at the end. consumed == 0 indicates
73 * a new search. May store/read persistant values in state->cb.
74 */
75 unsigned int (*get_next_block)(unsigned int consumed,
76 const u8 **dst,
77 struct ts_config *conf,
78 struct ts_state *state);
79
80 /**
81 * finish - finalize/clean a series of get_next_block() calls
82 * @conf: search configuration
83 * @state: search state
84 *
85 * Called after the last use of get_next_block(), may be used
86 * to cleanup any leftovers.
87 */
88 void (*finish)(struct ts_config *conf,
89 struct ts_state *state);
90};
91
92/**
93 * textsearch_next - continue searching for a pattern
94 * @conf: search configuration
95 * @state: search state
96 *
97 * Continues a search looking for more occurrences of the pattern.
98 * textsearch_find() must be called to find the first occurrence
99 * in order to reset the state.
100 *
101 * Returns the position of the next occurrence of the pattern or
102 * UINT_MAX if not match was found.
103 */
104static inline unsigned int textsearch_next(struct ts_config *conf,
105 struct ts_state *state)
106{
107 unsigned int ret = conf->ops->find(conf, state);
108
109 if (conf->finish)
110 conf->finish(conf, state);
111
112 return ret;
113}
114
115/**
116 * textsearch_find - start searching for a pattern
117 * @conf: search configuration
118 * @state: search state
119 *
120 * Returns the position of first occurrence of the pattern or
121 * UINT_MAX if no match was found.
122 */
123static inline unsigned int textsearch_find(struct ts_config *conf,
124 struct ts_state *state)
125{
126 state->offset = 0;
127 return textsearch_next(conf, state);
128}
129
130/**
131 * textsearch_get_pattern - return head of the pattern
132 * @conf: search configuration
133 */
134static inline void *textsearch_get_pattern(struct ts_config *conf)
135{
136 return conf->ops->get_pattern(conf);
137}
138
139/**
140 * textsearch_get_pattern_len - return length of the pattern
141 * @conf: search configuration
142 */
143static inline unsigned int textsearch_get_pattern_len(struct ts_config *conf)
144{
145 return conf->ops->get_pattern_len(conf);
146}
147
148extern int textsearch_register(struct ts_ops *);
149extern int textsearch_unregister(struct ts_ops *);
150extern struct ts_config *textsearch_prepare(const char *, const void *,
151 unsigned int, int, int);
152extern void textsearch_destroy(struct ts_config *conf);
153extern unsigned int textsearch_find_continuous(struct ts_config *,
154 struct ts_state *,
155 const void *, unsigned int);
156
157
158#define TS_PRIV_ALIGNTO 8
159#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1))
160
161static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask)
162{
163 struct ts_config *conf;
164
165 conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
166 if (conf == NULL)
167 return ERR_PTR(-ENOMEM);
168
169 memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload);
170 return conf;
171}
172
173static inline void *ts_config_priv(struct ts_config *conf)
174{
175 return ((u8 *) conf + TS_PRIV_ALIGN(sizeof(struct ts_config)));
176}
177
178#endif /* __KERNEL__ */
179
180#endif
diff --git a/include/linux/textsearch_fsm.h b/include/linux/textsearch_fsm.h
new file mode 100644
index 000000000000..fdfa078c66e5
--- /dev/null
+++ b/include/linux/textsearch_fsm.h
@@ -0,0 +1,48 @@
1#ifndef __LINUX_TEXTSEARCH_FSM_H
2#define __LINUX_TEXTSEARCH_FSM_H
3
4#include <linux/types.h>
5
6enum {
7 TS_FSM_SPECIFIC, /* specific character */
8 TS_FSM_WILDCARD, /* any character */
9 TS_FSM_DIGIT, /* isdigit() */
10 TS_FSM_XDIGIT, /* isxdigit() */
11 TS_FSM_PRINT, /* isprint() */
12 TS_FSM_ALPHA, /* isalpha() */
13 TS_FSM_ALNUM, /* isalnum() */
14 TS_FSM_ASCII, /* isascii() */
15 TS_FSM_CNTRL, /* iscntrl() */
16 TS_FSM_GRAPH, /* isgraph() */
17 TS_FSM_LOWER, /* islower() */
18 TS_FSM_UPPER, /* isupper() */
19 TS_FSM_PUNCT, /* ispunct() */
20 TS_FSM_SPACE, /* isspace() */
21 __TS_FSM_TYPE_MAX,
22};
23#define TS_FSM_TYPE_MAX (__TS_FSM_TYPE_MAX - 1)
24
25enum {
26 TS_FSM_SINGLE, /* 1 occurrence */
27 TS_FSM_PERHAPS, /* 1 or 0 occurrence */
28 TS_FSM_ANY, /* 0..n occurrences */
29 TS_FSM_MULTI, /* 1..n occurrences */
30 TS_FSM_HEAD_IGNORE, /* 0..n ignored occurrences at head */
31 __TS_FSM_RECUR_MAX,
32};
33#define TS_FSM_RECUR_MAX (__TS_FSM_RECUR_MAX - 1)
34
35/**
36 * struct ts_fsm_token - state machine token (state)
37 * @type: type of token
38 * @recur: number of recurrences
39 * @value: character value for TS_FSM_SPECIFIC
40 */
41struct ts_fsm_token
42{
43 __u16 type;
44 __u8 recur;
45 __u8 value;
46};
47
48#endif
diff --git a/include/linux/timer.h b/include/linux/timer.h
index 90db1cc62ddd..221f81ac2002 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -6,45 +6,33 @@
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/stddef.h> 7#include <linux/stddef.h>
8 8
9struct tvec_t_base_s; 9struct timer_base_s;
10 10
11struct timer_list { 11struct timer_list {
12 struct list_head entry; 12 struct list_head entry;
13 unsigned long expires; 13 unsigned long expires;
14 14
15 spinlock_t lock;
16 unsigned long magic; 15 unsigned long magic;
17 16
18 void (*function)(unsigned long); 17 void (*function)(unsigned long);
19 unsigned long data; 18 unsigned long data;
20 19
21 struct tvec_t_base_s *base; 20 struct timer_base_s *base;
22}; 21};
23 22
24#define TIMER_MAGIC 0x4b87ad6e 23#define TIMER_MAGIC 0x4b87ad6e
25 24
25extern struct timer_base_s __init_timer_base;
26
26#define TIMER_INITIALIZER(_function, _expires, _data) { \ 27#define TIMER_INITIALIZER(_function, _expires, _data) { \
27 .function = (_function), \ 28 .function = (_function), \
28 .expires = (_expires), \ 29 .expires = (_expires), \
29 .data = (_data), \ 30 .data = (_data), \
30 .base = NULL, \ 31 .base = &__init_timer_base, \
31 .magic = TIMER_MAGIC, \ 32 .magic = TIMER_MAGIC, \
32 .lock = SPIN_LOCK_UNLOCKED, \
33 } 33 }
34 34
35/*** 35void fastcall init_timer(struct timer_list * timer);
36 * init_timer - initialize a timer.
37 * @timer: the timer to be initialized
38 *
39 * init_timer() must be done to a timer prior calling *any* of the
40 * other timer functions.
41 */
42static inline void init_timer(struct timer_list * timer)
43{
44 timer->base = NULL;
45 timer->magic = TIMER_MAGIC;
46 spin_lock_init(&timer->lock);
47}
48 36
49/*** 37/***
50 * timer_pending - is a timer pending? 38 * timer_pending - is a timer pending?
@@ -58,7 +46,7 @@ static inline void init_timer(struct timer_list * timer)
58 */ 46 */
59static inline int timer_pending(const struct timer_list * timer) 47static inline int timer_pending(const struct timer_list * timer)
60{ 48{
61 return timer->base != NULL; 49 return timer->entry.next != NULL;
62} 50}
63 51
64extern void add_timer_on(struct timer_list *timer, int cpu); 52extern void add_timer_on(struct timer_list *timer, int cpu);
@@ -88,13 +76,15 @@ static inline void add_timer(struct timer_list * timer)
88} 76}
89 77
90#ifdef CONFIG_SMP 78#ifdef CONFIG_SMP
79 extern int try_to_del_timer_sync(struct timer_list *timer);
91 extern int del_timer_sync(struct timer_list *timer); 80 extern int del_timer_sync(struct timer_list *timer);
92 extern int del_singleshot_timer_sync(struct timer_list *timer);
93#else 81#else
94# define del_timer_sync(t) del_timer(t) 82# define try_to_del_timer_sync(t) del_timer(t)
95# define del_singleshot_timer_sync(t) del_timer(t) 83# define del_timer_sync(t) del_timer(t)
96#endif 84#endif
97 85
86#define del_singleshot_timer_sync(t) del_timer_sync(t)
87
98extern void init_timers(void); 88extern void init_timers(void);
99extern void run_local_timers(void); 89extern void run_local_timers(void);
100extern void it_real_fn(unsigned long); 90extern void it_real_fn(unsigned long);
diff --git a/include/linux/topology.h b/include/linux/topology.h
index d70e8972c67f..0320225e96da 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -89,6 +89,11 @@
89 .cache_hot_time = 0, \ 89 .cache_hot_time = 0, \
90 .cache_nice_tries = 0, \ 90 .cache_nice_tries = 0, \
91 .per_cpu_gain = 25, \ 91 .per_cpu_gain = 25, \
92 .busy_idx = 0, \
93 .idle_idx = 0, \
94 .newidle_idx = 1, \
95 .wake_idx = 0, \
96 .forkexec_idx = 0, \
92 .flags = SD_LOAD_BALANCE \ 97 .flags = SD_LOAD_BALANCE \
93 | SD_BALANCE_NEWIDLE \ 98 | SD_BALANCE_NEWIDLE \
94 | SD_BALANCE_EXEC \ 99 | SD_BALANCE_EXEC \
@@ -115,12 +120,15 @@
115 .cache_hot_time = (5*1000000/2), \ 120 .cache_hot_time = (5*1000000/2), \
116 .cache_nice_tries = 1, \ 121 .cache_nice_tries = 1, \
117 .per_cpu_gain = 100, \ 122 .per_cpu_gain = 100, \
123 .busy_idx = 2, \
124 .idle_idx = 1, \
125 .newidle_idx = 2, \
126 .wake_idx = 1, \
127 .forkexec_idx = 1, \
118 .flags = SD_LOAD_BALANCE \ 128 .flags = SD_LOAD_BALANCE \
119 | SD_BALANCE_NEWIDLE \ 129 | SD_BALANCE_NEWIDLE \
120 | SD_BALANCE_EXEC \ 130 | SD_BALANCE_EXEC \
121 | SD_WAKE_AFFINE \ 131 | SD_WAKE_AFFINE, \
122 | SD_WAKE_IDLE \
123 | SD_WAKE_BALANCE, \
124 .last_balance = jiffies, \ 132 .last_balance = jiffies, \
125 .balance_interval = 1, \ 133 .balance_interval = 1, \
126 .nr_balance_failed = 0, \ 134 .nr_balance_failed = 0, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 1b76106272d3..59ff42c629ec 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -345,6 +345,7 @@ extern int tty_check_change(struct tty_struct * tty);
345extern void stop_tty(struct tty_struct * tty); 345extern void stop_tty(struct tty_struct * tty);
346extern void start_tty(struct tty_struct * tty); 346extern void start_tty(struct tty_struct * tty);
347extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc); 347extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
348extern int tty_unregister_ldisc(int disc);
348extern int tty_register_driver(struct tty_driver *driver); 349extern int tty_register_driver(struct tty_driver *driver);
349extern int tty_unregister_driver(struct tty_driver *driver); 350extern int tty_unregister_driver(struct tty_driver *driver);
350extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); 351extern void tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev);
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 4c2c82336d10..84876077027f 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -42,8 +42,7 @@ struct uinput_request {
42 int code; /* UI_FF_UPLOAD, UI_FF_ERASE */ 42 int code; /* UI_FF_UPLOAD, UI_FF_ERASE */
43 43
44 int retval; 44 int retval;
45 wait_queue_head_t waitq; 45 struct completion done;
46 int completed;
47 46
48 union { 47 union {
49 int effect_id; 48 int effect_id;
@@ -62,7 +61,7 @@ struct uinput_device {
62 61
63 struct uinput_request *requests[UINPUT_NUM_REQUESTS]; 62 struct uinput_request *requests[UINPUT_NUM_REQUESTS];
64 wait_queue_head_t requests_waitq; 63 wait_queue_head_t requests_waitq;
65 struct semaphore requests_sem; 64 spinlock_t requests_lock;
66}; 65};
67#endif /* __KERNEL__ */ 66#endif /* __KERNEL__ */
68 67
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 3d508bf08402..724637792996 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -290,7 +290,7 @@ struct usb_bus {
290 struct class_device *class_dev; /* class device for this bus */ 290 struct class_device *class_dev; /* class device for this bus */
291 struct kref kref; /* handles reference counting this bus */ 291 struct kref kref; /* handles reference counting this bus */
292 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ 292 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */
293#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) 293#if defined(CONFIG_USB_MON)
294 struct mon_bus *mon_bus; /* non-null when associated */ 294 struct mon_bus *mon_bus; /* non-null when associated */
295 int monitored; /* non-zero when monitored */ 295 int monitored; /* non-zero when monitored */
296#endif 296#endif
@@ -938,17 +938,17 @@ static inline void usb_fill_int_urb (struct urb *urb,
938} 938}
939 939
940extern void usb_init_urb(struct urb *urb); 940extern void usb_init_urb(struct urb *urb);
941extern struct urb *usb_alloc_urb(int iso_packets, int mem_flags); 941extern struct urb *usb_alloc_urb(int iso_packets, unsigned mem_flags);
942extern void usb_free_urb(struct urb *urb); 942extern void usb_free_urb(struct urb *urb);
943#define usb_put_urb usb_free_urb 943#define usb_put_urb usb_free_urb
944extern struct urb *usb_get_urb(struct urb *urb); 944extern struct urb *usb_get_urb(struct urb *urb);
945extern int usb_submit_urb(struct urb *urb, int mem_flags); 945extern int usb_submit_urb(struct urb *urb, unsigned mem_flags);
946extern int usb_unlink_urb(struct urb *urb); 946extern int usb_unlink_urb(struct urb *urb);
947extern void usb_kill_urb(struct urb *urb); 947extern void usb_kill_urb(struct urb *urb);
948 948
949#define HAVE_USB_BUFFERS 949#define HAVE_USB_BUFFERS
950void *usb_buffer_alloc (struct usb_device *dev, size_t size, 950void *usb_buffer_alloc (struct usb_device *dev, size_t size,
951 int mem_flags, dma_addr_t *dma); 951 unsigned mem_flags, dma_addr_t *dma);
952void usb_buffer_free (struct usb_device *dev, size_t size, 952void usb_buffer_free (struct usb_device *dev, size_t size,
953 void *addr, dma_addr_t dma); 953 void *addr, dma_addr_t dma);
954 954
@@ -1055,7 +1055,7 @@ int usb_sg_init (
1055 struct scatterlist *sg, 1055 struct scatterlist *sg,
1056 int nents, 1056 int nents,
1057 size_t length, 1057 size_t length,
1058 int mem_flags 1058 unsigned mem_flags
1059); 1059);
1060void usb_sg_cancel (struct usb_sg_request *io); 1060void usb_sg_cancel (struct usb_sg_request *io);
1061void usb_sg_wait (struct usb_sg_request *io); 1061void usb_sg_wait (struct usb_sg_request *io);
diff --git a/include/linux/usb_cdc.h b/include/linux/usb_cdc.h
index f22d6beecc73..ba617c372455 100644
--- a/include/linux/usb_cdc.h
+++ b/include/linux/usb_cdc.h
@@ -34,6 +34,7 @@
34#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */ 34#define USB_CDC_ACM_TYPE 0x02 /* acm_descriptor */
35#define USB_CDC_UNION_TYPE 0x06 /* union_desc */ 35#define USB_CDC_UNION_TYPE 0x06 /* union_desc */
36#define USB_CDC_COUNTRY_TYPE 0x07 36#define USB_CDC_COUNTRY_TYPE 0x07
37#define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a /* network_terminal_desc */
37#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */ 38#define USB_CDC_ETHERNET_TYPE 0x0f /* ether_desc */
38#define USB_CDC_WHCM_TYPE 0x11 39#define USB_CDC_WHCM_TYPE 0x11
39#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */ 40#define USB_CDC_MDLM_TYPE 0x12 /* mdlm_desc */
@@ -83,6 +84,18 @@ struct usb_cdc_union_desc {
83 /* ... and there could be other slave interfaces */ 84 /* ... and there could be other slave interfaces */
84} __attribute__ ((packed)); 85} __attribute__ ((packed));
85 86
87/* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */
88struct usb_cdc_network_terminal_desc {
89 __u8 bLength;
90 __u8 bDescriptorType;
91 __u8 bDescriptorSubType;
92
93 __u8 bEntityId;
94 __u8 iName;
95 __u8 bChannelIndex;
96 __u8 bPhysicalInterface;
97} __attribute__ ((packed));
98
86/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */ 99/* "Ethernet Networking Functional Descriptor" from CDC spec 5.2.3.16 */
87struct usb_cdc_ether_desc { 100struct usb_cdc_ether_desc {
88 __u8 bLength; 101 __u8 bLength;
diff --git a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
index f5fe94e09a03..ee21e6bf3867 100644
--- a/include/linux/usb_ch9.h
+++ b/include/linux/usb_ch9.h
@@ -6,17 +6,20 @@
6 * 6 *
7 * - the master/host side Linux-USB kernel driver API; 7 * - the master/host side Linux-USB kernel driver API;
8 * - the "usbfs" user space API; and 8 * - the "usbfs" user space API; and
9 * - (eventually) a Linux "gadget" slave/device side driver API. 9 * - the Linux "gadget" slave/device/peripheral side driver API.
10 * 10 *
11 * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems 11 * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems
12 * act either as a USB master/host or as a USB slave/device. That means 12 * act either as a USB master/host or as a USB slave/device. That means
13 * the master and slave side APIs will benefit from working well together. 13 * the master and slave side APIs benefit from working well together.
14 *
15 * There's also "Wireless USB", using low power short range radios for
16 * peripheral interconnection but otherwise building on the USB framework.
14 */ 17 */
15 18
16#ifndef __LINUX_USB_CH9_H 19#ifndef __LINUX_USB_CH9_H
17#define __LINUX_USB_CH9_H 20#define __LINUX_USB_CH9_H
18 21
19#include <asm/types.h> /* __u8 etc */ 22#include <linux/types.h> /* __u8 etc */
20 23
21/*-------------------------------------------------------------------------*/ 24/*-------------------------------------------------------------------------*/
22 25
@@ -68,6 +71,18 @@
68#define USB_REQ_SET_INTERFACE 0x0B 71#define USB_REQ_SET_INTERFACE 0x0B
69#define USB_REQ_SYNCH_FRAME 0x0C 72#define USB_REQ_SYNCH_FRAME 0x0C
70 73
74#define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */
75#define USB_REQ_GET_ENCRYPTION 0x0E
76#define USB_REQ_SET_HANDSHAKE 0x0F
77#define USB_REQ_GET_HANDSHAKE 0x10
78#define USB_REQ_SET_CONNECTION 0x11
79#define USB_REQ_SET_SECURITY_DATA 0x12
80#define USB_REQ_GET_SECURITY_DATA 0x13
81#define USB_REQ_SET_WUSB_DATA 0x14
82#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
83#define USB_REQ_LOOPBACK_DATA_READ 0x16
84#define USB_REQ_SET_INTERFACE_DS 0x17
85
71/* 86/*
72 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and 87 * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
73 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there 88 * are read as a bit array returned by USB_REQ_GET_STATUS. (So there
@@ -75,10 +90,12 @@
75 */ 90 */
76#define USB_DEVICE_SELF_POWERED 0 /* (read only) */ 91#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
77#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ 92#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
78#define USB_DEVICE_TEST_MODE 2 /* (high speed only) */ 93#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
79#define USB_DEVICE_B_HNP_ENABLE 3 /* dev may initiate HNP */ 94#define USB_DEVICE_BATTERY 2 /* (wireless) */
80#define USB_DEVICE_A_HNP_SUPPORT 4 /* RH port supports HNP */ 95#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
81#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* other RH port does */ 96#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
97#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
98#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
82#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ 99#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
83 100
84#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 101#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
@@ -135,6 +152,13 @@ struct usb_ctrlrequest {
135#define USB_DT_OTG 0x09 152#define USB_DT_OTG 0x09
136#define USB_DT_DEBUG 0x0a 153#define USB_DT_DEBUG 0x0a
137#define USB_DT_INTERFACE_ASSOCIATION 0x0b 154#define USB_DT_INTERFACE_ASSOCIATION 0x0b
155/* these are from the Wireless USB spec */
156#define USB_DT_SECURITY 0x0c
157#define USB_DT_KEY 0x0d
158#define USB_DT_ENCRYPTION_TYPE 0x0e
159#define USB_DT_BOS 0x0f
160#define USB_DT_DEVICE_CAPABILITY 0x10
161#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
138 162
139/* conventional codes for class-specific descriptors */ 163/* conventional codes for class-specific descriptors */
140#define USB_DT_CS_DEVICE 0x21 164#define USB_DT_CS_DEVICE 0x21
@@ -192,6 +216,7 @@ struct usb_device_descriptor {
192#define USB_CLASS_CSCID 0x0b /* chip+ smart card */ 216#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
193#define USB_CLASS_CONTENT_SEC 0x0d /* content security */ 217#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
194#define USB_CLASS_VIDEO 0x0e 218#define USB_CLASS_VIDEO 0x0e
219#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
195#define USB_CLASS_APP_SPEC 0xfe 220#define USB_CLASS_APP_SPEC 0xfe
196#define USB_CLASS_VENDOR_SPEC 0xff 221#define USB_CLASS_VENDOR_SPEC 0xff
197 222
@@ -223,6 +248,7 @@ struct usb_config_descriptor {
223#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */ 248#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
224#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */ 249#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
225#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */ 250#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
251#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
226 252
227/*-------------------------------------------------------------------------*/ 253/*-------------------------------------------------------------------------*/
228 254
@@ -268,8 +294,8 @@ struct usb_endpoint_descriptor {
268 __le16 wMaxPacketSize; 294 __le16 wMaxPacketSize;
269 __u8 bInterval; 295 __u8 bInterval;
270 296
271 // NOTE: these two are _only_ in audio endpoints. 297 /* NOTE: these two are _only_ in audio endpoints. */
272 // use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. 298 /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
273 __u8 bRefresh; 299 __u8 bRefresh;
274 __u8 bSynchAddress; 300 __u8 bSynchAddress;
275} __attribute__ ((packed)); 301} __attribute__ ((packed));
@@ -289,6 +315,7 @@ struct usb_endpoint_descriptor {
289#define USB_ENDPOINT_XFER_ISOC 1 315#define USB_ENDPOINT_XFER_ISOC 1
290#define USB_ENDPOINT_XFER_BULK 2 316#define USB_ENDPOINT_XFER_BULK 2
291#define USB_ENDPOINT_XFER_INT 3 317#define USB_ENDPOINT_XFER_INT 3
318#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
292 319
293 320
294/*-------------------------------------------------------------------------*/ 321/*-------------------------------------------------------------------------*/
@@ -352,12 +379,154 @@ struct usb_interface_assoc_descriptor {
352 379
353/*-------------------------------------------------------------------------*/ 380/*-------------------------------------------------------------------------*/
354 381
382/* USB_DT_SECURITY: group of wireless security descriptors, including
383 * encryption types available for setting up a CC/association.
384 */
385struct usb_security_descriptor {
386 __u8 bLength;
387 __u8 bDescriptorType;
388
389 __le16 wTotalLength;
390 __u8 bNumEncryptionTypes;
391};
392
393/*-------------------------------------------------------------------------*/
394
395/* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys
396 * may be retrieved.
397 */
398struct usb_key_descriptor {
399 __u8 bLength;
400 __u8 bDescriptorType;
401
402 __u8 tTKID[3];
403 __u8 bReserved;
404 __u8 bKeyData[0];
405};
406
407/*-------------------------------------------------------------------------*/
408
409/* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */
410struct usb_encryption_descriptor {
411 __u8 bLength;
412 __u8 bDescriptorType;
413
414 __u8 bEncryptionType;
415#define USB_ENC_TYPE_UNSECURE 0
416#define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */
417#define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */
418#define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */
419 __u8 bEncryptionValue; /* use in SET_ENCRYPTION */
420 __u8 bAuthKeyIndex;
421};
422
423
424/*-------------------------------------------------------------------------*/
425
426/* USB_DT_BOS: group of wireless capabilities */
427struct usb_bos_descriptor {
428 __u8 bLength;
429 __u8 bDescriptorType;
430
431 __le16 wTotalLength;
432 __u8 bNumDeviceCaps;
433};
434
435/*-------------------------------------------------------------------------*/
436
437/* USB_DT_DEVICE_CAPABILITY: grouped with BOS */
438struct usb_dev_cap_header {
439 __u8 bLength;
440 __u8 bDescriptorType;
441 __u8 bDevCapabilityType;
442};
443
444#define USB_CAP_TYPE_WIRELESS_USB 1
445
446struct usb_wireless_cap_descriptor { /* Ultra Wide Band */
447 __u8 bLength;
448 __u8 bDescriptorType;
449 __u8 bDevCapabilityType;
450
451 __u8 bmAttributes;
452#define USB_WIRELESS_P2P_DRD (1 << 1)
453#define USB_WIRELESS_BEACON_MASK (3 << 2)
454#define USB_WIRELESS_BEACON_SELF (1 << 2)
455#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
456#define USB_WIRELESS_BEACON_NONE (3 << 2)
457 __le16 wPHYRates; /* bit rates, Mbps */
458#define USB_WIRELESS_PHY_53 (1 << 0) /* always set */
459#define USB_WIRELESS_PHY_80 (1 << 1)
460#define USB_WIRELESS_PHY_107 (1 << 2) /* always set */
461#define USB_WIRELESS_PHY_160 (1 << 3)
462#define USB_WIRELESS_PHY_200 (1 << 4) /* always set */
463#define USB_WIRELESS_PHY_320 (1 << 5)
464#define USB_WIRELESS_PHY_400 (1 << 6)
465#define USB_WIRELESS_PHY_480 (1 << 7)
466 __u8 bmTFITXPowerInfo; /* TFI power levels */
467 __u8 bmFFITXPowerInfo; /* FFI power levels */
468 __le16 bmBandGroup;
469 __u8 bReserved;
470};
471
472/*-------------------------------------------------------------------------*/
473
474/* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with
475 * each endpoint descriptor for a wireless device
476 */
477struct usb_wireless_ep_comp_descriptor {
478 __u8 bLength;
479 __u8 bDescriptorType;
480
481 __u8 bMaxBurst;
482 __u8 bMaxSequence;
483 __le16 wMaxStreamDelay;
484 __le16 wOverTheAirPacketSize;
485 __u8 bOverTheAirInterval;
486 __u8 bmCompAttributes;
487#define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */
488#define USB_ENDPOINT_SWITCH_NO 0
489#define USB_ENDPOINT_SWITCH_SWITCH 1
490#define USB_ENDPOINT_SWITCH_SCALE 2
491};
492
493/*-------------------------------------------------------------------------*/
494
495/* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless
496 * host and a device for connection set up, mutual authentication, and
497 * exchanging short lived session keys. The handshake depends on a CC.
498 */
499struct usb_handshake {
500 __u8 bMessageNumber;
501 __u8 bStatus;
502 __u8 tTKID[3];
503 __u8 bReserved;
504 __u8 CDID[16];
505 __u8 nonce[16];
506 __u8 MIC[8];
507};
508
509/*-------------------------------------------------------------------------*/
510
511/* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC).
512 * A CC may also be set up using non-wireless secure channels (including
513 * wired USB!), and some devices may support CCs with multiple hosts.
514 */
515struct usb_connection_context {
516 __u8 CHID[16]; /* persistent host id */
517 __u8 CDID[16]; /* device id (unique w/in host context) */
518 __u8 CK[16]; /* connection key */
519};
520
521/*-------------------------------------------------------------------------*/
522
355/* USB 2.0 defines three speeds, here's how Linux identifies them */ 523/* USB 2.0 defines three speeds, here's how Linux identifies them */
356 524
357enum usb_device_speed { 525enum usb_device_speed {
358 USB_SPEED_UNKNOWN = 0, /* enumerating */ 526 USB_SPEED_UNKNOWN = 0, /* enumerating */
359 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ 527 USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
360 USB_SPEED_HIGH /* usb 2.0 */ 528 USB_SPEED_HIGH, /* usb 2.0 */
529 USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
361}; 530};
362 531
363enum usb_device_state { 532enum usb_device_state {
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index 9bba9997947b..71e608607324 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -107,18 +107,18 @@ struct usb_ep_ops {
107 int (*disable) (struct usb_ep *ep); 107 int (*disable) (struct usb_ep *ep);
108 108
109 struct usb_request *(*alloc_request) (struct usb_ep *ep, 109 struct usb_request *(*alloc_request) (struct usb_ep *ep,
110 int gfp_flags); 110 unsigned gfp_flags);
111 void (*free_request) (struct usb_ep *ep, struct usb_request *req); 111 void (*free_request) (struct usb_ep *ep, struct usb_request *req);
112 112
113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes, 113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes,
114 dma_addr_t *dma, int gfp_flags); 114 dma_addr_t *dma, unsigned gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma, 115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes); 116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and 117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead. 118 // dma_sync_single_*() to directly manage dma overhead.
119 119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 120 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 int gfp_flags); 121 unsigned gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
123 123
124 int (*set_halt) (struct usb_ep *ep, int value); 124 int (*set_halt) (struct usb_ep *ep, int value);
@@ -214,7 +214,7 @@ usb_ep_disable (struct usb_ep *ep)
214 * Returns the request, or null if one could not be allocated. 214 * Returns the request, or null if one could not be allocated.
215 */ 215 */
216static inline struct usb_request * 216static inline struct usb_request *
217usb_ep_alloc_request (struct usb_ep *ep, int gfp_flags) 217usb_ep_alloc_request (struct usb_ep *ep, unsigned gfp_flags)
218{ 218{
219 return ep->ops->alloc_request (ep, gfp_flags); 219 return ep->ops->alloc_request (ep, gfp_flags);
220} 220}
@@ -254,7 +254,7 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
254 */ 254 */
255static inline void * 255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma, 256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 int gfp_flags) 257 unsigned gfp_flags)
258{ 258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags); 259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260} 260}
@@ -330,7 +330,7 @@ usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
330 * reported when the usb peripheral is disconnected. 330 * reported when the usb peripheral is disconnected.
331 */ 331 */
332static inline int 332static inline int
333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, int gfp_flags) 333usb_ep_queue (struct usb_ep *ep, struct usb_request *req, unsigned gfp_flags)
334{ 334{
335 return ep->ops->queue (ep, req, gfp_flags); 335 return ep->ops->queue (ep, req, gfp_flags);
336} 336}
@@ -711,7 +711,7 @@ usb_gadget_disconnect (struct usb_gadget *gadget)
711 * the hardware level driver. Most calls must be handled by 711 * the hardware level driver. Most calls must be handled by
712 * the gadget driver, including descriptor and configuration 712 * the gadget driver, including descriptor and configuration
713 * management. The 16 bit members of the setup data are in 713 * management. The 16 bit members of the setup data are in
714 * cpu order. Called in_interrupt; this may not sleep. Driver 714 * USB byte order. Called in_interrupt; this may not sleep. Driver
715 * queues a response to ep0, or returns negative to stall. 715 * queues a response to ep0, or returns negative to stall.
716 * @disconnect: Invoked after all transfers have been stopped, 716 * @disconnect: Invoked after all transfers have been stopped,
717 * when the host is disconnected. May be called in_interrupt; this 717 * when the host is disconnected. May be called in_interrupt; this
diff --git a/include/linux/usb_input.h b/include/linux/usb_input.h
new file mode 100644
index 000000000000..716e0cc16043
--- /dev/null
+++ b/include/linux/usb_input.h
@@ -0,0 +1,25 @@
1#ifndef __USB_INPUT_H
2#define __USB_INPUT_H
3
4/*
5 * Copyright (C) 2005 Dmitry Torokhov
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12#include <linux/usb.h>
13#include <linux/input.h>
14#include <asm/byteorder.h>
15
16static inline void
17usb_to_input_id(const struct usb_device *dev, struct input_id *id)
18{
19 id->bustype = BUS_USB;
20 id->vendor = le16_to_cpu(dev->descriptor.idVendor);
21 id->product = le16_to_cpu(dev->descriptor.idProduct);
22 id->version = le16_to_cpu(dev->descriptor.bcdDevice);
23}
24
25#endif
diff --git a/include/linux/usb_isp116x.h b/include/linux/usb_isp116x.h
new file mode 100644
index 000000000000..5f5a9d9bd6c2
--- /dev/null
+++ b/include/linux/usb_isp116x.h
@@ -0,0 +1,47 @@
1
2/*
3 * Board initialization code should put one of these into dev->platform_data
4 * and place the isp116x onto platform_bus.
5 */
6
7struct isp116x_platform_data {
8 /* Enable internal resistors on downstream ports */
9 unsigned sel15Kres:1;
10 /* Chip's internal clock won't be stopped in suspended state.
11 Setting/unsetting this bit takes effect only if
12 'remote_wakeup_enable' below is not set. */
13 unsigned clknotstop:1;
14 /* On-chip overcurrent protection */
15 unsigned oc_enable:1;
16 /* INT output polarity */
17 unsigned int_act_high:1;
18 /* INT edge or level triggered */
19 unsigned int_edge_triggered:1;
20 /* WAKEUP pin connected - NOT SUPPORTED */
21 /* unsigned remote_wakeup_connected:1; */
22 /* Wakeup by devices on usb bus enabled */
23 unsigned remote_wakeup_enable:1;
24 /* Switch or not to switch (keep always powered) */
25 unsigned no_power_switching:1;
26 /* Ganged port power switching (0) or individual port
27 power switching (1) */
28 unsigned power_switching_mode:1;
29 /* Given port_power, msec/2 after power on till power good */
30 u8 potpg;
31 /* Hardware reset set/clear. If implemented, this function must:
32 if set == 0, deassert chip's HW reset pin
33 otherwise, assert chip's HW reset pin */
34 void (*reset) (struct device * dev, int set);
35 /* Hardware clock start/stop. If implemented, this function must:
36 if start == 0, stop the external clock
37 otherwise, start the external clock
38 */
39 void (*clock) (struct device * dev, int start);
40 /* Inter-io delay (ns). The chip is picky about access timings; it
41 expects at least:
42 150ns delay between consecutive accesses to DATA_REG,
43 300ns delay between access to ADDR_REG and DATA_REG
44 OE, WE MUST NOT be changed during these intervals
45 */
46 void (*delay) (struct device * dev, int delay);
47};
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 4e0edce53760..acbfc525576d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -221,6 +221,8 @@ struct v4l2_pix_format
221/* Vendor-specific formats */ 221/* Vendor-specific formats */
222#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */ 222#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A') /* Winnov hw compress */
223#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */ 223#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0') /* SN9C10x compression */
224#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1') /* pwc older webcam */
225#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2') /* pwc newer webcam */
224 226
225/* 227/*
226 * F O R M A T E N U M E R A T I O N 228 * F O R M A T E N U M E R A T I O N
diff --git a/include/linux/wait.h b/include/linux/wait.h
index c9486c3efb4a..d38c9fecdc36 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -33,7 +33,7 @@ int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key
33struct __wait_queue { 33struct __wait_queue {
34 unsigned int flags; 34 unsigned int flags;
35#define WQ_FLAG_EXCLUSIVE 0x01 35#define WQ_FLAG_EXCLUSIVE 0x01
36 struct task_struct * task; 36 void *private;
37 wait_queue_func_t func; 37 wait_queue_func_t func;
38 struct list_head task_list; 38 struct list_head task_list;
39}; 39};
@@ -60,7 +60,7 @@ typedef struct __wait_queue_head wait_queue_head_t;
60 */ 60 */
61 61
62#define __WAITQUEUE_INITIALIZER(name, tsk) { \ 62#define __WAITQUEUE_INITIALIZER(name, tsk) { \
63 .task = tsk, \ 63 .private = tsk, \
64 .func = default_wake_function, \ 64 .func = default_wake_function, \
65 .task_list = { NULL, NULL } } 65 .task_list = { NULL, NULL } }
66 66
@@ -86,7 +86,7 @@ static inline void init_waitqueue_head(wait_queue_head_t *q)
86static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 86static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
87{ 87{
88 q->flags = 0; 88 q->flags = 0;
89 q->task = p; 89 q->private = p;
90 q->func = default_wake_function; 90 q->func = default_wake_function;
91} 91}
92 92
@@ -94,7 +94,7 @@ static inline void init_waitqueue_func_entry(wait_queue_t *q,
94 wait_queue_func_t func) 94 wait_queue_func_t func)
95{ 95{
96 q->flags = 0; 96 q->flags = 0;
97 q->task = NULL; 97 q->private = NULL;
98 q->func = func; 98 q->func = func;
99} 99}
100 100
@@ -110,7 +110,7 @@ static inline int waitqueue_active(wait_queue_head_t *q)
110 * aio specifies a wait queue entry with an async notification 110 * aio specifies a wait queue entry with an async notification
111 * callback routine, not associated with any task. 111 * callback routine, not associated with any task.
112 */ 112 */
113#define is_sync_wait(wait) (!(wait) || ((wait)->task)) 113#define is_sync_wait(wait) (!(wait) || ((wait)->private))
114 114
115extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); 115extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait));
116extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); 116extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait));
@@ -384,7 +384,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
384 384
385#define DEFINE_WAIT(name) \ 385#define DEFINE_WAIT(name) \
386 wait_queue_t name = { \ 386 wait_queue_t name = { \
387 .task = current, \ 387 .private = current, \
388 .func = autoremove_wake_function, \ 388 .func = autoremove_wake_function, \
389 .task_list = LIST_HEAD_INIT((name).task_list), \ 389 .task_list = LIST_HEAD_INIT((name).task_list), \
390 } 390 }
@@ -393,7 +393,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
393 struct wait_bit_queue name = { \ 393 struct wait_bit_queue name = { \
394 .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \ 394 .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \
395 .wait = { \ 395 .wait = { \
396 .task = current, \ 396 .private = current, \
397 .func = wake_bit_function, \ 397 .func = wake_bit_function, \
398 .task_list = \ 398 .task_list = \
399 LIST_HEAD_INIT((name).wait.task_list), \ 399 LIST_HEAD_INIT((name).wait.task_list), \
@@ -402,7 +402,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key);
402 402
403#define init_wait(wait) \ 403#define init_wait(wait) \
404 do { \ 404 do { \
405 (wait)->task = current; \ 405 (wait)->private = current; \
406 (wait)->func = autoremove_wake_function; \ 406 (wait)->func = autoremove_wake_function; \
407 INIT_LIST_HEAD(&(wait)->task_list); \ 407 INIT_LIST_HEAD(&(wait)->task_list); \
408 } while (0) 408 } while (0)
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 3e89f0f15f49..1b6b76a4eb54 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -516,8 +516,7 @@ struct wan_device {
516/* Public functions available for device drivers */ 516/* Public functions available for device drivers */
517extern int register_wan_device(struct wan_device *wandev); 517extern int register_wan_device(struct wan_device *wandev);
518extern int unregister_wan_device(char *name); 518extern int unregister_wan_device(char *name);
519unsigned short wanrouter_type_trans(struct sk_buff *skb, 519__be16 wanrouter_type_trans(struct sk_buff *skb, struct net_device *dev);
520 struct net_device *dev);
521int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev, 520int wanrouter_encapsulate(struct sk_buff *skb, struct net_device *dev,
522 unsigned short type); 521 unsigned short type);
523 522
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 88ba0d29f8c8..1192ed8f4fe8 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -47,4 +47,14 @@ struct watchdog_info {
47#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */ 47#define WDIOS_ENABLECARD 0x0002 /* Turn on the watchdog timer */
48#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */ 48#define WDIOS_TEMPPANIC 0x0004 /* Kernel panic on temperature trip */
49 49
50#ifdef __KERNEL__
51
52#ifdef CONFIG_WATCHDOG_NOWAYOUT
53#define WATCHDOG_NOWAYOUT 1
54#else
55#define WATCHDOG_NOWAYOUT 0
56#endif
57
58#endif /* __KERNEL__ */
59
50#endif /* ifndef _LINUX_WATCHDOG_H */ 60#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 1262cb43c3ab..542dbaee6512 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -14,11 +14,13 @@ extern struct list_head inode_unused;
14 * Yes, writeback.h requires sched.h 14 * Yes, writeback.h requires sched.h
15 * No, sched.h is not included from here. 15 * No, sched.h is not included from here.
16 */ 16 */
17static inline int current_is_pdflush(void) 17static inline int task_is_pdflush(struct task_struct *task)
18{ 18{
19 return current->flags & PF_FLUSHER; 19 return task->flags & PF_FLUSHER;
20} 20}
21 21
22#define current_is_pdflush() task_is_pdflush(current)
23
22/* 24/*
23 * fs/fs-writeback.c 25 * fs/fs-writeback.c
24 */ 26 */
@@ -83,7 +85,7 @@ static inline void wait_on_inode(struct inode *inode)
83/* 85/*
84 * mm/page-writeback.c 86 * mm/page-writeback.c
85 */ 87 */
86int wakeup_bdflush(long nr_pages); 88int wakeup_pdflush(long nr_pages);
87void laptop_io_completion(void); 89void laptop_io_completion(void);
88void laptop_sync_completion(void); 90void laptop_sync_completion(void);
89void throttle_vm_writeout(void); 91void throttle_vm_writeout(void);
diff --git a/include/linux/x25.h b/include/linux/x25.h
index 7531cfed5885..16d44931afa0 100644
--- a/include/linux/x25.h
+++ b/include/linux/x25.h
@@ -4,6 +4,8 @@
4 * History 4 * History
5 * mar/20/00 Daniela Squassoni Disabling/enabling of facilities 5 * mar/20/00 Daniela Squassoni Disabling/enabling of facilities
6 * negotiation. 6 * negotiation.
7 * apr/02/05 Shaun Pereira Selective sub address matching with
8 * call user data
7 */ 9 */
8 10
9#ifndef X25_KERNEL_H 11#ifndef X25_KERNEL_H
@@ -16,6 +18,9 @@
16#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4) 18#define SIOCX25GCALLUSERDATA (SIOCPROTOPRIVATE + 4)
17#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5) 19#define SIOCX25SCALLUSERDATA (SIOCPROTOPRIVATE + 5)
18#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6) 20#define SIOCX25GCAUSEDIAG (SIOCPROTOPRIVATE + 6)
21#define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7)
22#define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8)
23#define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9)
19 24
20/* 25/*
21 * Values for {get,set}sockopt. 26 * Values for {get,set}sockopt.
@@ -109,4 +114,11 @@ struct x25_causediag {
109 unsigned char diagnostic; 114 unsigned char diagnostic;
110}; 115};
111 116
117/*
118 * Further optional call user data match length selection
119 */
120struct x25_subaddr {
121 unsigned int cudmatchlength;
122};
123
112#endif 124#endif
diff --git a/include/linux/xattr_acl.h b/include/linux/xattr_acl.h
deleted file mode 100644
index 7a1f9b93a45f..000000000000
--- a/include/linux/xattr_acl.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 File: linux/xattr_acl.h
3
4 (extended attribute representation of access control lists)
5
6 (C) 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org>
7*/
8
9#ifndef _LINUX_XATTR_ACL_H
10#define _LINUX_XATTR_ACL_H
11
12#include <linux/posix_acl.h>
13
14#define XATTR_NAME_ACL_ACCESS "system.posix_acl_access"
15#define XATTR_NAME_ACL_DEFAULT "system.posix_acl_default"
16
17#define XATTR_ACL_VERSION 0x0002
18
19typedef struct {
20 __u16 e_tag;
21 __u16 e_perm;
22 __u32 e_id;
23} xattr_acl_entry;
24
25typedef struct {
26 __u32 a_version;
27 xattr_acl_entry a_entries[0];
28} xattr_acl_header;
29
30static inline size_t xattr_acl_size(int count)
31{
32 return sizeof(xattr_acl_header) + count * sizeof(xattr_acl_entry);
33}
34
35static inline int xattr_acl_count(size_t size)
36{
37 if (size < sizeof(xattr_acl_header))
38 return -1;
39 size -= sizeof(xattr_acl_header);
40 if (size % sizeof(xattr_acl_entry))
41 return -1;
42 return size / sizeof(xattr_acl_entry);
43}
44
45struct posix_acl * posix_acl_from_xattr(const void *value, size_t size);
46int posix_acl_to_xattr(const struct posix_acl *acl, void *buffer, size_t size);
47
48
49
50#endif /* _LINUX_XATTR_ACL_H */
diff --git a/include/linux/zlib.h b/include/linux/zlib.h
index 850076ea14d3..74f7b78c22d2 100644
--- a/include/linux/zlib.h
+++ b/include/linux/zlib.h
@@ -506,6 +506,11 @@ extern int zlib_deflateReset (z_streamp strm);
506 stream state was inconsistent (such as zalloc or state being NULL). 506 stream state was inconsistent (such as zalloc or state being NULL).
507*/ 507*/
508 508
509static inline unsigned long deflateBound(unsigned long s)
510{
511 return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
512}
513
509extern int zlib_deflateParams (z_streamp strm, int level, int strategy); 514extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
510/* 515/*
511 Dynamically update the compression level and compression strategy. The 516 Dynamically update the compression level and compression strategy. The
diff --git a/include/media/audiochip.h b/include/media/audiochip.h
index d3e9e30608dc..cd831168fdc1 100644
--- a/include/media/audiochip.h
+++ b/include/media/audiochip.h
@@ -1,3 +1,7 @@
1/*
2 * $Id: audiochip.h,v 1.5 2005/06/16 22:59:16 hhackmann Exp $
3 */
4
1#ifndef AUDIOCHIP_H 5#ifndef AUDIOCHIP_H
2#define AUDIOCHIP_H 6#define AUDIOCHIP_H
3 7
@@ -31,5 +35,4 @@
31 35
32/* misc stuff to pass around config info to i2c chips */ 36/* misc stuff to pass around config info to i2c chips */
33#define AUDC_CONFIG_PINNACLE _IOW('m',32,int) 37#define AUDC_CONFIG_PINNACLE _IOW('m',32,int)
34
35#endif /* AUDIOCHIP_H */ 38#endif /* AUDIOCHIP_H */
diff --git a/include/media/id.h b/include/media/id.h
index 1b0320dc8f73..a39a6423914b 100644
--- a/include/media/id.h
+++ b/include/media/id.h
@@ -1,3 +1,7 @@
1/*
2 * $Id: id.h,v 1.4 2005/06/12 04:19:19 mchehab Exp $
3 */
4
1/* FIXME: this temporarely, until these are included in linux/i2c-id.h */ 5/* FIXME: this temporarely, until these are included in linux/i2c-id.h */
2 6
3/* drivers */ 7/* drivers */
diff --git a/include/media/ir-common.h b/include/media/ir-common.h
index 62c963a52d86..698670547f16 100644
--- a/include/media/ir-common.h
+++ b/include/media/ir-common.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: ir-common.h,v 1.8 2005/02/22 12:28:40 kraxel Exp $ 2 * $Id: ir-common.h,v 1.9 2005/05/15 19:01:26 mchehab Exp $
3 * 3 *
4 * some common structs and functions to handle infrared remotes via 4 * some common structs and functions to handle infrared remotes via
5 * input layer ... 5 * input layer ...
@@ -50,6 +50,7 @@ extern IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE];
50extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE]; 50extern IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE];
51extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE]; 51extern IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE];
52extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE]; 52extern IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE];
53extern IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE];
53 54
54void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, 55void ir_input_init(struct input_dev *dev, struct ir_input_state *ir,
55 int ir_type, IR_KEYTAB_TYPE *ir_codes); 56 int ir_type, IR_KEYTAB_TYPE *ir_codes);
diff --git a/include/media/saa6752hs.h b/include/media/saa6752hs.h
index 791bad2b86e9..3b8686ead80d 100644
--- a/include/media/saa6752hs.h
+++ b/include/media/saa6752hs.h
@@ -18,55 +18,6 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#if 0 /* ndef _SAA6752HS_H */
22#define _SAA6752HS_H
23
24enum mpeg_video_bitrate_mode {
25 MPEG_VIDEO_BITRATE_MODE_VBR = 0, /* Variable bitrate */
26 MPEG_VIDEO_BITRATE_MODE_CBR = 1, /* Constant bitrate */
27
28 MPEG_VIDEO_BITRATE_MODE_MAX
29};
30
31enum mpeg_audio_bitrate {
32 MPEG_AUDIO_BITRATE_256 = 0, /* 256 kBit/sec */
33 MPEG_AUDIO_BITRATE_384 = 1, /* 384 kBit/sec */
34
35 MPEG_AUDIO_BITRATE_MAX
36};
37
38enum mpeg_video_format {
39 MPEG_VIDEO_FORMAT_D1 = 0,
40 MPEG_VIDEO_FORMAT_2_3_D1 = 1,
41 MPEG_VIDEO_FORMAT_1_2_D1 = 2,
42 MPEG_VIDEO_FORMAT_SIF = 3,
43
44 MPEG_VIDEO_FORMAT_MAX
45};
46
47#define MPEG_VIDEO_TARGET_BITRATE_MAX 27000
48#define MPEG_VIDEO_MAX_BITRATE_MAX 27000
49#define MPEG_TOTAL_BITRATE_MAX 27000
50#define MPEG_PID_MAX ((1 << 14) - 1)
51
52struct mpeg_params {
53 enum mpeg_video_bitrate_mode video_bitrate_mode;
54 unsigned int video_target_bitrate;
55 unsigned int video_max_bitrate; // only used for VBR
56 enum mpeg_audio_bitrate audio_bitrate;
57 unsigned int total_bitrate;
58
59 unsigned int pmt_pid;
60 unsigned int video_pid;
61 unsigned int audio_pid;
62 unsigned int pcr_pid;
63
64 enum mpeg_video_format video_format;
65};
66
67#define MPEG_SETPARAMS _IOW('6',100,struct mpeg_params)
68
69#endif // _SAA6752HS_H
70 21
71/* 22/*
72 * Local variables: 23 * Local variables:
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 156a9c51ffec..eeaa15ddee85 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -1,5 +1,6 @@
1 1
2/* 2/* $Id: tuner.h,v 1.45 2005/07/28 18:41:21 mchehab Exp $
3 *
3 tuner.h - definition for different tuners 4 tuner.h - definition for different tuners
4 5
5 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de) 6 Copyright (C) 1997 Markus Schroeder (schroedm@uni-duesseldorf.de)
@@ -23,7 +24,9 @@
23#ifndef _TUNER_H 24#ifndef _TUNER_H
24#define _TUNER_H 25#define _TUNER_H
25 26
26#include "id.h" 27#include <linux/videodev2.h>
28
29#define ADDR_UNSET (255)
27 30
28#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */ 31#define TUNER_TEMIC_PAL 0 /* 4002 FH5 (3X 7756, 9483) */
29#define TUNER_PHILIPS_PAL_I 1 32#define TUNER_PHILIPS_PAL_I 1
@@ -86,7 +89,7 @@
86#define TUNER_LG_NTSC_TAPE 47 89#define TUNER_LG_NTSC_TAPE 47
87 90
88#define TUNER_TNF_8831BGFF 48 91#define TUNER_TNF_8831BGFF 48
89#define TUNER_MICROTUNE_4042FI5 49 /* FusionHDTV 3 Gold - 4042 FI5 (3X 8147) */ 92#define TUNER_MICROTUNE_4042FI5 49 /* DViCO FusionHDTV 3 Gold-Q - 4042 FI5 (3X 8147) */
90#define TUNER_TCL_2002N 50 93#define TUNER_TCL_2002N 50
91#define TUNER_PHILIPS_FM1256_IH3 51 94#define TUNER_PHILIPS_FM1256_IH3 51
92 95
@@ -96,7 +99,17 @@
96#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */ 99#define TUNER_LG_PAL_TAPE 55 /* Hauppauge PVR-150 PAL */
97 100
98#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */ 101#define TUNER_PHILIPS_FQ1216AME_MK4 56 /* Hauppauge PVR-150 PAL */
99#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */ 102#define TUNER_PHILIPS_FQ1236A_MK4 57 /* Hauppauge PVR-500MCE NTSC */
103
104#define TUNER_YMEC_TVF_8531MF 58
105#define TUNER_YMEC_TVF_5533MF 59 /* Pixelview Pro Ultra NTSC */
106#define TUNER_THOMSON_DTT7611 60 /* DViCO FusionHDTV 3 Gold-T */
107#define TUNER_TENA_9533_DI 61
108
109#define TUNER_TEA5767 62 /* Only FM Radio Tuner */
110#define TUNER_PHILIPS_FMD1216ME_MK3 63
111#define TUNER_LG_TDVS_H062F 64 /* DViCO FusionHDTV 5 */
112#define TUNER_YMEC_TVF66T5_B_DFF 65 /* Acorp Y878F */
100 113
101#define NOTUNER 0 114#define NOTUNER 0
102#define PAL 1 /* PAL_BG */ 115#define PAL 1 /* PAL_BG */
@@ -104,6 +117,7 @@
104#define NTSC 3 117#define NTSC 3
105#define SECAM 4 118#define SECAM 4
106#define ATSC 5 119#define ATSC 5
120#define RADIO 6
107 121
108#define NoTuner 0 122#define NoTuner 0
109#define Philips 1 123#define Philips 1
@@ -119,10 +133,9 @@
119#define TCL 11 133#define TCL 11
120#define THOMSON 12 134#define THOMSON 12
121 135
122#define TUNER_SET_TYPE _IOW('t',1,int) /* set tuner type */ 136#define TUNER_SET_TYPE_ADDR _IOW('T',3,int)
123#define TUNER_SET_TVFREQ _IOW('t',2,int) /* set tv freq */ 137#define TDA9887_SET_CONFIG _IOW('t',5,int)
124 138
125#define TDA9887_SET_CONFIG _IOW('t',5,int)
126/* tv card specific */ 139/* tv card specific */
127# define TDA9887_PRESENT (1<<0) 140# define TDA9887_PRESENT (1<<0)
128# define TDA9887_PORT1_INACTIVE (1<<1) 141# define TDA9887_PORT1_INACTIVE (1<<1)
@@ -143,19 +156,34 @@
143#define I2C_ADDR_TDA8290 0x4b 156#define I2C_ADDR_TDA8290 0x4b
144#define I2C_ADDR_TDA8275 0x61 157#define I2C_ADDR_TDA8275 0x61
145 158
159enum tuner_mode {
160 T_UNINITIALIZED = 0,
161 T_RADIO = 1 << V4L2_TUNER_RADIO,
162 T_ANALOG_TV = 1 << V4L2_TUNER_ANALOG_TV,
163 T_DIGITAL_TV = 1 << V4L2_TUNER_DIGITAL_TV,
164 T_STANDBY = 1 << 31
165};
166
167struct tuner_setup {
168 unsigned short addr;
169 unsigned int type;
170 unsigned int mode_mask;
171};
172
146struct tuner { 173struct tuner {
147 /* device */ 174 /* device */
148 struct i2c_client i2c; 175 struct i2c_client i2c;
149 176
150 /* state + config */
151 unsigned int initialized;
152 unsigned int type; /* chip type */ 177 unsigned int type; /* chip type */
178
179 unsigned int mode;
180 unsigned int mode_mask; /* Combination of allowable modes */
181
153 unsigned int freq; /* keep track of the current settings */ 182 unsigned int freq; /* keep track of the current settings */
183 unsigned int audmode;
154 v4l2_std_id std; 184 v4l2_std_id std;
155 int using_v4l2;
156 185
157 enum v4l2_tuner_type mode; 186 int using_v4l2;
158 unsigned int input;
159 187
160 /* used by MT2032 */ 188 /* used by MT2032 */
161 unsigned int xogc; 189 unsigned int xogc;
@@ -177,7 +205,9 @@ extern unsigned const int tuner_count;
177 205
178extern int microtune_init(struct i2c_client *c); 206extern int microtune_init(struct i2c_client *c);
179extern int tda8290_init(struct i2c_client *c); 207extern int tda8290_init(struct i2c_client *c);
208extern int tea5767_tuner_init(struct i2c_client *c);
180extern int default_tuner_init(struct i2c_client *c); 209extern int default_tuner_init(struct i2c_client *c);
210extern int tea5767_autodetection(struct i2c_client *c);
181 211
182#define tuner_warn(fmt, arg...) \ 212#define tuner_warn(fmt, arg...) \
183 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg) 213 dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg)
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 627603e561a6..854a2c2f105b 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -1,3 +1,7 @@
1/*
2 * $Id: tveeprom.h,v 1.2 2005/06/12 04:19:19 mchehab Exp $
3 */
4
1struct tveeprom { 5struct tveeprom {
2 u32 has_radio; 6 u32 has_radio;
3 7
@@ -20,4 +24,3 @@ void tveeprom_hauppauge_analog(struct tveeprom *tvee,
20 unsigned char *eeprom_data); 24 unsigned char *eeprom_data);
21 25
22int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len); 26int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);
23int tveeprom_dump(unsigned char *eedata, int len);
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index a76ab898f445..428d9122940b 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: mtd-abi.h,v 1.7 2004/11/23 15:37:32 gleixner Exp $ 2 * $Id: mtd-abi.h,v 1.11 2005/05/19 16:08:58 gleixner Exp $
3 * 3 *
4 * Portions of MTD ABI definition which are shared by kernel and user space 4 * Portions of MTD ABI definition which are shared by kernel and user space
5 */ 5 */
@@ -29,6 +29,7 @@ struct mtd_oob_buf {
29#define MTD_NORFLASH 3 29#define MTD_NORFLASH 3
30#define MTD_NANDFLASH 4 30#define MTD_NANDFLASH 4
31#define MTD_PEROM 5 31#define MTD_PEROM 5
32#define MTD_DATAFLASH 6
32#define MTD_OTHER 14 33#define MTD_OTHER 14
33#define MTD_UNKNOWN 15 34#define MTD_UNKNOWN 15
34 35
@@ -60,6 +61,12 @@ struct mtd_oob_buf {
60#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) 61#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode)
61#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme 62#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme
62#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read) 63#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read)
64#define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default
65
66/* OTP mode selection */
67#define MTD_OTP_OFF 0
68#define MTD_OTP_FACTORY 1
69#define MTD_OTP_USER 2
63 70
64struct mtd_info_user { 71struct mtd_info_user {
65 uint8_t type; 72 uint8_t type;
@@ -80,6 +87,12 @@ struct region_info_user {
80 uint32_t regionindex; 87 uint32_t regionindex;
81}; 88};
82 89
90struct otp_info {
91 uint32_t start;
92 uint32_t length;
93 uint32_t locked;
94};
95
83#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) 96#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
84#define MEMERASE _IOW('M', 2, struct erase_info_user) 97#define MEMERASE _IOW('M', 2, struct erase_info_user)
85#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) 98#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
@@ -92,6 +105,10 @@ struct region_info_user {
92#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) 105#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
93#define MEMGETBADBLOCK _IOW('M', 11, loff_t) 106#define MEMGETBADBLOCK _IOW('M', 11, loff_t)
94#define MEMSETBADBLOCK _IOW('M', 12, loff_t) 107#define MEMSETBADBLOCK _IOW('M', 12, loff_t)
108#define OTPSELECT _IOR('M', 13, int)
109#define OTPGETREGIONCOUNT _IOW('M', 14, int)
110#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
111#define OTPLOCK _IOR('M', 16, struct otp_info)
95 112
96struct nand_oobinfo { 113struct nand_oobinfo {
97 uint32_t useecc; 114 uint32_t useecc;
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 828a3a93dda1..3696f988a9f1 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -139,11 +139,25 @@ enum {
139#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ 139#define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */
140 140
141typedef struct ax25_uid_assoc { 141typedef struct ax25_uid_assoc {
142 struct ax25_uid_assoc *next; 142 struct hlist_node uid_node;
143 atomic_t refcount;
143 uid_t uid; 144 uid_t uid;
144 ax25_address call; 145 ax25_address call;
145} ax25_uid_assoc; 146} ax25_uid_assoc;
146 147
148#define ax25_uid_for_each(__ax25, node, list) \
149 hlist_for_each_entry(__ax25, node, list, uid_node)
150
151#define ax25_uid_hold(ax25) \
152 atomic_inc(&((ax25)->refcount))
153
154static inline void ax25_uid_put(ax25_uid_assoc *assoc)
155{
156 if (atomic_dec_and_test(&assoc->refcount)) {
157 kfree(assoc);
158 }
159}
160
147typedef struct { 161typedef struct {
148 ax25_address calls[AX25_MAX_DIGIS]; 162 ax25_address calls[AX25_MAX_DIGIS];
149 unsigned char repeated[AX25_MAX_DIGIS]; 163 unsigned char repeated[AX25_MAX_DIGIS];
@@ -376,7 +390,7 @@ extern unsigned long ax25_display_timer(struct timer_list *);
376 390
377/* ax25_uid.c */ 391/* ax25_uid.c */
378extern int ax25_uid_policy; 392extern int ax25_uid_policy;
379extern ax25_address *ax25_findbyuid(uid_t); 393extern ax25_uid_assoc *ax25_findbyuid(uid_t);
380extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *); 394extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *);
381extern struct file_operations ax25_uid_fops; 395extern struct file_operations ax25_uid_fops;
382extern void ax25_uid_free(void); 396extern void ax25_uid_free(void);
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 42a84c53678b..06b24f637026 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -57,12 +57,6 @@
57#define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg) 57#define BT_DBG(fmt, arg...) printk(KERN_INFO "%s: " fmt "\n" , __FUNCTION__ , ## arg)
58#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg) 58#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __FUNCTION__ , ## arg)
59 59
60#ifdef HCI_DATA_DUMP
61#define BT_DMP(buf, len) bt_dump(__FUNCTION__, buf, len)
62#else
63#define BT_DMP(D...)
64#endif
65
66extern struct proc_dir_entry *proc_bt; 60extern struct proc_dir_entry *proc_bt;
67 61
68/* Connection and socket states */ 62/* Connection and socket states */
@@ -174,8 +168,6 @@ static inline int skb_frags_no(struct sk_buff *skb)
174 return n; 168 return n;
175} 169}
176 170
177void bt_dump(char *pref, __u8 *buf, int count);
178
179int bt_err(__u16 code); 171int bt_err(__u16 code);
180 172
181#endif /* __BLUETOOTH_H */ 173#endif /* __BLUETOOTH_H */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
new file mode 100644
index 000000000000..db09580ad14b
--- /dev/null
+++ b/include/net/ieee80211.h
@@ -0,0 +1,856 @@
1/*
2 * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11
3 * remains copyright by the original authors
4 *
5 * Portions of the merged code are based on Host AP (software wireless
6 * LAN access point) driver for Intersil Prism2/2.5/3.
7 *
8 * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
9 * <jkmaline@cc.hut.fi>
10 * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
11 *
12 * Adaption to a generic IEEE 802.11 stack by James Ketrenos
13 * <jketreno@linux.intel.com>
14 * Copyright (c) 2004, Intel Corporation
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation. See README and COPYING for
19 * more details.
20 */
21#ifndef IEEE80211_H
22#define IEEE80211_H
23
24#include <linux/if_ether.h> /* ETH_ALEN */
25#include <linux/kernel.h> /* ARRAY_SIZE */
26
27#if WIRELESS_EXT < 17
28#define IW_QUAL_QUAL_INVALID 0x10
29#define IW_QUAL_LEVEL_INVALID 0x20
30#define IW_QUAL_NOISE_INVALID 0x40
31#define IW_QUAL_QUAL_UPDATED 0x1
32#define IW_QUAL_LEVEL_UPDATED 0x2
33#define IW_QUAL_NOISE_UPDATED 0x4
34#endif
35
36#define IEEE80211_DATA_LEN 2304
37/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
38 6.2.1.1.2.
39
40 The figure in section 7.1.2 suggests a body size of up to 2312
41 bytes is allowed, which is a bit confusing, I suspect this
42 represents the 2304 bytes of real data, plus a possible 8 bytes of
43 WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
44
45
46#define IEEE80211_HLEN 30
47#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
48
49struct ieee80211_hdr {
50 u16 frame_ctl;
51 u16 duration_id;
52 u8 addr1[ETH_ALEN];
53 u8 addr2[ETH_ALEN];
54 u8 addr3[ETH_ALEN];
55 u16 seq_ctl;
56 u8 addr4[ETH_ALEN];
57} __attribute__ ((packed));
58
59struct ieee80211_hdr_3addr {
60 u16 frame_ctl;
61 u16 duration_id;
62 u8 addr1[ETH_ALEN];
63 u8 addr2[ETH_ALEN];
64 u8 addr3[ETH_ALEN];
65 u16 seq_ctl;
66} __attribute__ ((packed));
67
68enum eap_type {
69 EAP_PACKET = 0,
70 EAPOL_START,
71 EAPOL_LOGOFF,
72 EAPOL_KEY,
73 EAPOL_ENCAP_ASF_ALERT
74};
75
76static const char *eap_types[] = {
77 [EAP_PACKET] = "EAP-Packet",
78 [EAPOL_START] = "EAPOL-Start",
79 [EAPOL_LOGOFF] = "EAPOL-Logoff",
80 [EAPOL_KEY] = "EAPOL-Key",
81 [EAPOL_ENCAP_ASF_ALERT] = "EAPOL-Encap-ASF-Alert"
82};
83
84static inline const char *eap_get_type(int type)
85{
86 return (type >= ARRAY_SIZE(eap_types)) ? "Unknown" : eap_types[type];
87}
88
89struct eapol {
90 u8 snap[6];
91 u16 ethertype;
92 u8 version;
93 u8 type;
94 u16 length;
95} __attribute__ ((packed));
96
97#define IEEE80211_1ADDR_LEN 10
98#define IEEE80211_2ADDR_LEN 16
99#define IEEE80211_3ADDR_LEN 24
100#define IEEE80211_4ADDR_LEN 30
101#define IEEE80211_FCS_LEN 4
102
103#define MIN_FRAG_THRESHOLD 256U
104#define MAX_FRAG_THRESHOLD 2346U
105
106/* Frame control field constants */
107#define IEEE80211_FCTL_VERS 0x0002
108#define IEEE80211_FCTL_FTYPE 0x000c
109#define IEEE80211_FCTL_STYPE 0x00f0
110#define IEEE80211_FCTL_TODS 0x0100
111#define IEEE80211_FCTL_FROMDS 0x0200
112#define IEEE80211_FCTL_MOREFRAGS 0x0400
113#define IEEE80211_FCTL_RETRY 0x0800
114#define IEEE80211_FCTL_PM 0x1000
115#define IEEE80211_FCTL_MOREDATA 0x2000
116#define IEEE80211_FCTL_WEP 0x4000
117#define IEEE80211_FCTL_ORDER 0x8000
118
119#define IEEE80211_FTYPE_MGMT 0x0000
120#define IEEE80211_FTYPE_CTL 0x0004
121#define IEEE80211_FTYPE_DATA 0x0008
122
123/* management */
124#define IEEE80211_STYPE_ASSOC_REQ 0x0000
125#define IEEE80211_STYPE_ASSOC_RESP 0x0010
126#define IEEE80211_STYPE_REASSOC_REQ 0x0020
127#define IEEE80211_STYPE_REASSOC_RESP 0x0030
128#define IEEE80211_STYPE_PROBE_REQ 0x0040
129#define IEEE80211_STYPE_PROBE_RESP 0x0050
130#define IEEE80211_STYPE_BEACON 0x0080
131#define IEEE80211_STYPE_ATIM 0x0090
132#define IEEE80211_STYPE_DISASSOC 0x00A0
133#define IEEE80211_STYPE_AUTH 0x00B0
134#define IEEE80211_STYPE_DEAUTH 0x00C0
135
136/* control */
137#define IEEE80211_STYPE_PSPOLL 0x00A0
138#define IEEE80211_STYPE_RTS 0x00B0
139#define IEEE80211_STYPE_CTS 0x00C0
140#define IEEE80211_STYPE_ACK 0x00D0
141#define IEEE80211_STYPE_CFEND 0x00E0
142#define IEEE80211_STYPE_CFENDACK 0x00F0
143
144/* data */
145#define IEEE80211_STYPE_DATA 0x0000
146#define IEEE80211_STYPE_DATA_CFACK 0x0010
147#define IEEE80211_STYPE_DATA_CFPOLL 0x0020
148#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
149#define IEEE80211_STYPE_NULLFUNC 0x0040
150#define IEEE80211_STYPE_CFACK 0x0050
151#define IEEE80211_STYPE_CFPOLL 0x0060
152#define IEEE80211_STYPE_CFACKPOLL 0x0070
153
154#define IEEE80211_SCTL_FRAG 0x000F
155#define IEEE80211_SCTL_SEQ 0xFFF0
156
157
158/* debug macros */
159
160#ifdef CONFIG_IEEE80211_DEBUG
161extern u32 ieee80211_debug_level;
162#define IEEE80211_DEBUG(level, fmt, args...) \
163do { if (ieee80211_debug_level & (level)) \
164 printk(KERN_DEBUG "ieee80211: %c %s " fmt, \
165 in_interrupt() ? 'I' : 'U', __FUNCTION__ , ## args); } while (0)
166#else
167#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
168#endif /* CONFIG_IEEE80211_DEBUG */
169
170/*
171 * To use the debug system;
172 *
173 * If you are defining a new debug classification, simply add it to the #define
174 * list here in the form of:
175 *
176 * #define IEEE80211_DL_xxxx VALUE
177 *
178 * shifting value to the left one bit from the previous entry. xxxx should be
179 * the name of the classification (for example, WEP)
180 *
181 * You then need to either add a IEEE80211_xxxx_DEBUG() macro definition for your
182 * classification, or use IEEE80211_DEBUG(IEEE80211_DL_xxxx, ...) whenever you want
183 * to send output to that classification.
184 *
185 * To add your debug level to the list of levels seen when you perform
186 *
187 * % cat /proc/net/ipw/debug_level
188 *
189 * you simply need to add your entry to the ipw_debug_levels array.
190 *
191 * If you do not see debug_level in /proc/net/ipw then you do not have
192 * CONFIG_IEEE80211_DEBUG defined in your kernel configuration
193 *
194 */
195
196#define IEEE80211_DL_INFO (1<<0)
197#define IEEE80211_DL_WX (1<<1)
198#define IEEE80211_DL_SCAN (1<<2)
199#define IEEE80211_DL_STATE (1<<3)
200#define IEEE80211_DL_MGMT (1<<4)
201#define IEEE80211_DL_FRAG (1<<5)
202#define IEEE80211_DL_EAP (1<<6)
203#define IEEE80211_DL_DROP (1<<7)
204
205#define IEEE80211_DL_TX (1<<8)
206#define IEEE80211_DL_RX (1<<9)
207
208#define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
209#define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
210#define IEEE80211_DEBUG_INFO(f, a...) IEEE80211_DEBUG(IEEE80211_DL_INFO, f, ## a)
211
212#define IEEE80211_DEBUG_WX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_WX, f, ## a)
213#define IEEE80211_DEBUG_SCAN(f, a...) IEEE80211_DEBUG(IEEE80211_DL_SCAN, f, ## a)
214#define IEEE80211_DEBUG_STATE(f, a...) IEEE80211_DEBUG(IEEE80211_DL_STATE, f, ## a)
215#define IEEE80211_DEBUG_MGMT(f, a...) IEEE80211_DEBUG(IEEE80211_DL_MGMT, f, ## a)
216#define IEEE80211_DEBUG_FRAG(f, a...) IEEE80211_DEBUG(IEEE80211_DL_FRAG, f, ## a)
217#define IEEE80211_DEBUG_EAP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_EAP, f, ## a)
218#define IEEE80211_DEBUG_DROP(f, a...) IEEE80211_DEBUG(IEEE80211_DL_DROP, f, ## a)
219#define IEEE80211_DEBUG_TX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_TX, f, ## a)
220#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
221#include <linux/netdevice.h>
222#include <linux/wireless.h>
223#include <linux/if_arp.h> /* ARPHRD_ETHER */
224
225#ifndef WIRELESS_SPY
226#define WIRELESS_SPY // enable iwspy support
227#endif
228#include <net/iw_handler.h> // new driver API
229
230#ifndef ETH_P_PAE
231#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
232#endif /* ETH_P_PAE */
233
234#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
235
236#ifndef ETH_P_80211_RAW
237#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
238#endif
239
240/* IEEE 802.11 defines */
241
242#define P80211_OUI_LEN 3
243
244struct ieee80211_snap_hdr {
245
246 u8 dsap; /* always 0xAA */
247 u8 ssap; /* always 0xAA */
248 u8 ctrl; /* always 0x03 */
249 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
250
251} __attribute__ ((packed));
252
253#define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
254
255#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
256#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
257
258#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
259#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ)
260
261/* Authentication algorithms */
262#define WLAN_AUTH_OPEN 0
263#define WLAN_AUTH_SHARED_KEY 1
264
265#define WLAN_AUTH_CHALLENGE_LEN 128
266
267#define WLAN_CAPABILITY_BSS (1<<0)
268#define WLAN_CAPABILITY_IBSS (1<<1)
269#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
270#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
271#define WLAN_CAPABILITY_PRIVACY (1<<4)
272#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
273#define WLAN_CAPABILITY_PBCC (1<<6)
274#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
275
276/* Status codes */
277#define WLAN_STATUS_SUCCESS 0
278#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
279#define WLAN_STATUS_CAPS_UNSUPPORTED 10
280#define WLAN_STATUS_REASSOC_NO_ASSOC 11
281#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
282#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
283#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
284#define WLAN_STATUS_CHALLENGE_FAIL 15
285#define WLAN_STATUS_AUTH_TIMEOUT 16
286#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
287#define WLAN_STATUS_ASSOC_DENIED_RATES 18
288/* 802.11b */
289#define WLAN_STATUS_ASSOC_DENIED_NOSHORT 19
290#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
291#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
292
293/* Reason codes */
294#define WLAN_REASON_UNSPECIFIED 1
295#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
296#define WLAN_REASON_DEAUTH_LEAVING 3
297#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
298#define WLAN_REASON_DISASSOC_AP_BUSY 5
299#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
300#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
301#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
302#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
303
304
305#define IEEE80211_STATMASK_SIGNAL (1<<0)
306#define IEEE80211_STATMASK_RSSI (1<<1)
307#define IEEE80211_STATMASK_NOISE (1<<2)
308#define IEEE80211_STATMASK_RATE (1<<3)
309#define IEEE80211_STATMASK_WEMASK 0x7
310
311
312#define IEEE80211_CCK_MODULATION (1<<0)
313#define IEEE80211_OFDM_MODULATION (1<<1)
314
315#define IEEE80211_24GHZ_BAND (1<<0)
316#define IEEE80211_52GHZ_BAND (1<<1)
317
318#define IEEE80211_CCK_RATE_1MB 0x02
319#define IEEE80211_CCK_RATE_2MB 0x04
320#define IEEE80211_CCK_RATE_5MB 0x0B
321#define IEEE80211_CCK_RATE_11MB 0x16
322#define IEEE80211_OFDM_RATE_6MB 0x0C
323#define IEEE80211_OFDM_RATE_9MB 0x12
324#define IEEE80211_OFDM_RATE_12MB 0x18
325#define IEEE80211_OFDM_RATE_18MB 0x24
326#define IEEE80211_OFDM_RATE_24MB 0x30
327#define IEEE80211_OFDM_RATE_36MB 0x48
328#define IEEE80211_OFDM_RATE_48MB 0x60
329#define IEEE80211_OFDM_RATE_54MB 0x6C
330#define IEEE80211_BASIC_RATE_MASK 0x80
331
332#define IEEE80211_CCK_RATE_1MB_MASK (1<<0)
333#define IEEE80211_CCK_RATE_2MB_MASK (1<<1)
334#define IEEE80211_CCK_RATE_5MB_MASK (1<<2)
335#define IEEE80211_CCK_RATE_11MB_MASK (1<<3)
336#define IEEE80211_OFDM_RATE_6MB_MASK (1<<4)
337#define IEEE80211_OFDM_RATE_9MB_MASK (1<<5)
338#define IEEE80211_OFDM_RATE_12MB_MASK (1<<6)
339#define IEEE80211_OFDM_RATE_18MB_MASK (1<<7)
340#define IEEE80211_OFDM_RATE_24MB_MASK (1<<8)
341#define IEEE80211_OFDM_RATE_36MB_MASK (1<<9)
342#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
343#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
344
345#define IEEE80211_CCK_RATES_MASK 0x0000000F
346#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
347 IEEE80211_CCK_RATE_2MB_MASK)
348#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
349 IEEE80211_CCK_RATE_5MB_MASK | \
350 IEEE80211_CCK_RATE_11MB_MASK)
351
352#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
353#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
354 IEEE80211_OFDM_RATE_12MB_MASK | \
355 IEEE80211_OFDM_RATE_24MB_MASK)
356#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
357 IEEE80211_OFDM_RATE_9MB_MASK | \
358 IEEE80211_OFDM_RATE_18MB_MASK | \
359 IEEE80211_OFDM_RATE_36MB_MASK | \
360 IEEE80211_OFDM_RATE_48MB_MASK | \
361 IEEE80211_OFDM_RATE_54MB_MASK)
362#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
363 IEEE80211_CCK_DEFAULT_RATES_MASK)
364
365#define IEEE80211_NUM_OFDM_RATES 8
366#define IEEE80211_NUM_CCK_RATES 4
367#define IEEE80211_OFDM_SHIFT_MASK_A 4
368
369
370
371
372/* NOTE: This data is for statistical purposes; not all hardware provides this
373 * information for frames received. Not setting these will not cause
374 * any adverse affects. */
375struct ieee80211_rx_stats {
376 u32 mac_time;
377 s8 rssi;
378 u8 signal;
379 u8 noise;
380 u16 rate; /* in 100 kbps */
381 u8 received_channel;
382 u8 control;
383 u8 mask;
384 u8 freq;
385 u16 len;
386};
387
388/* IEEE 802.11 requires that STA supports concurrent reception of at least
389 * three fragmented frames. This define can be increased to support more
390 * concurrent frames, but it should be noted that each entry can consume about
391 * 2 kB of RAM and increasing cache size will slow down frame reassembly. */
392#define IEEE80211_FRAG_CACHE_LEN 4
393
394struct ieee80211_frag_entry {
395 unsigned long first_frag_time;
396 unsigned int seq;
397 unsigned int last_frag;
398 struct sk_buff *skb;
399 u8 src_addr[ETH_ALEN];
400 u8 dst_addr[ETH_ALEN];
401};
402
403struct ieee80211_stats {
404 unsigned int tx_unicast_frames;
405 unsigned int tx_multicast_frames;
406 unsigned int tx_fragments;
407 unsigned int tx_unicast_octets;
408 unsigned int tx_multicast_octets;
409 unsigned int tx_deferred_transmissions;
410 unsigned int tx_single_retry_frames;
411 unsigned int tx_multiple_retry_frames;
412 unsigned int tx_retry_limit_exceeded;
413 unsigned int tx_discards;
414 unsigned int rx_unicast_frames;
415 unsigned int rx_multicast_frames;
416 unsigned int rx_fragments;
417 unsigned int rx_unicast_octets;
418 unsigned int rx_multicast_octets;
419 unsigned int rx_fcs_errors;
420 unsigned int rx_discards_no_buffer;
421 unsigned int tx_discards_wrong_sa;
422 unsigned int rx_discards_undecryptable;
423 unsigned int rx_message_in_msg_fragments;
424 unsigned int rx_message_in_bad_msg_fragments;
425};
426
427struct ieee80211_device;
428
429#if 0 /* for later */
430#include "ieee80211_crypt.h"
431#endif
432
433#define SEC_KEY_1 (1<<0)
434#define SEC_KEY_2 (1<<1)
435#define SEC_KEY_3 (1<<2)
436#define SEC_KEY_4 (1<<3)
437#define SEC_ACTIVE_KEY (1<<4)
438#define SEC_AUTH_MODE (1<<5)
439#define SEC_UNICAST_GROUP (1<<6)
440#define SEC_LEVEL (1<<7)
441#define SEC_ENABLED (1<<8)
442
443#define SEC_LEVEL_0 0 /* None */
444#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
445#define SEC_LEVEL_2 2 /* Level 1 + TKIP */
446#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
447#define SEC_LEVEL_3 4 /* Level 2 + CCMP */
448
449#define WEP_KEYS 4
450#define WEP_KEY_LEN 13
451
452struct ieee80211_security {
453 u16 active_key:2,
454 enabled:1,
455 auth_mode:2,
456 auth_algo:4,
457 unicast_uses_group:1;
458 u8 key_sizes[WEP_KEYS];
459 u8 keys[WEP_KEYS][WEP_KEY_LEN];
460 u8 level;
461 u16 flags;
462} __attribute__ ((packed));
463
464
465/*
466
467 802.11 data frame from AP
468
469 ,-------------------------------------------------------------------.
470Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
471 |------|------|---------|---------|---------|------|---------|------|
472Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs |
473 | | tion | (BSSID) | | | ence | data | |
474 `-------------------------------------------------------------------'
475
476Total: 28-2340 bytes
477
478*/
479
480#define BEACON_PROBE_SSID_ID_POSITION 12
481
482/* Management Frame Information Element Types */
483#define MFIE_TYPE_SSID 0
484#define MFIE_TYPE_RATES 1
485#define MFIE_TYPE_FH_SET 2
486#define MFIE_TYPE_DS_SET 3
487#define MFIE_TYPE_CF_SET 4
488#define MFIE_TYPE_TIM 5
489#define MFIE_TYPE_IBSS_SET 6
490#define MFIE_TYPE_CHALLENGE 16
491#define MFIE_TYPE_RSN 48
492#define MFIE_TYPE_RATES_EX 50
493#define MFIE_TYPE_GENERIC 221
494
495struct ieee80211_info_element_hdr {
496 u8 id;
497 u8 len;
498} __attribute__ ((packed));
499
500struct ieee80211_info_element {
501 u8 id;
502 u8 len;
503 u8 data[0];
504} __attribute__ ((packed));
505
506/*
507 * These are the data types that can make up management packets
508 *
509 u16 auth_algorithm;
510 u16 auth_sequence;
511 u16 beacon_interval;
512 u16 capability;
513 u8 current_ap[ETH_ALEN];
514 u16 listen_interval;
515 struct {
516 u16 association_id:14, reserved:2;
517 } __attribute__ ((packed));
518 u32 time_stamp[2];
519 u16 reason;
520 u16 status;
521*/
522
523struct ieee80211_authentication {
524 struct ieee80211_hdr_3addr header;
525 u16 algorithm;
526 u16 transaction;
527 u16 status;
528 struct ieee80211_info_element info_element;
529} __attribute__ ((packed));
530
531
532struct ieee80211_probe_response {
533 struct ieee80211_hdr_3addr header;
534 u32 time_stamp[2];
535 u16 beacon_interval;
536 u16 capability;
537 struct ieee80211_info_element info_element;
538} __attribute__ ((packed));
539
540struct ieee80211_assoc_request_frame {
541 u16 capability;
542 u16 listen_interval;
543 u8 current_ap[ETH_ALEN];
544 struct ieee80211_info_element info_element;
545} __attribute__ ((packed));
546
547struct ieee80211_assoc_response_frame {
548 struct ieee80211_hdr_3addr header;
549 u16 capability;
550 u16 status;
551 u16 aid;
552 struct ieee80211_info_element info_element; /* supported rates */
553} __attribute__ ((packed));
554
555
556struct ieee80211_txb {
557 u8 nr_frags;
558 u8 encrypted;
559 u16 reserved;
560 u16 frag_size;
561 u16 payload_size;
562 struct sk_buff *fragments[0];
563};
564
565
566/* SWEEP TABLE ENTRIES NUMBER*/
567#define MAX_SWEEP_TAB_ENTRIES 42
568#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
569/* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
570 * only use 8, and then use extended rates for the remaining supported
571 * rates. Other APs, however, stick all of their supported rates on the
572 * main rates information element... */
573#define MAX_RATES_LENGTH ((u8)12)
574#define MAX_RATES_EX_LENGTH ((u8)16)
575#define MAX_NETWORK_COUNT 128
576
577#define CRC_LENGTH 4U
578
579#define MAX_WPA_IE_LEN 64
580
581#define NETWORK_EMPTY_ESSID (1<<0)
582#define NETWORK_HAS_OFDM (1<<1)
583#define NETWORK_HAS_CCK (1<<2)
584
585struct ieee80211_network {
586 /* These entries are used to identify a unique network */
587 u8 bssid[ETH_ALEN];
588 u8 channel;
589 /* Ensure null-terminated for any debug msgs */
590 u8 ssid[IW_ESSID_MAX_SIZE + 1];
591 u8 ssid_len;
592
593 /* These are network statistics */
594 struct ieee80211_rx_stats stats;
595 u16 capability;
596 u8 rates[MAX_RATES_LENGTH];
597 u8 rates_len;
598 u8 rates_ex[MAX_RATES_EX_LENGTH];
599 u8 rates_ex_len;
600 unsigned long last_scanned;
601 u8 mode;
602 u8 flags;
603 u32 last_associate;
604 u32 time_stamp[2];
605 u16 beacon_interval;
606 u16 listen_interval;
607 u16 atim_window;
608 u8 wpa_ie[MAX_WPA_IE_LEN];
609 size_t wpa_ie_len;
610 u8 rsn_ie[MAX_WPA_IE_LEN];
611 size_t rsn_ie_len;
612 struct list_head list;
613};
614
615enum ieee80211_state {
616 IEEE80211_UNINITIALIZED = 0,
617 IEEE80211_INITIALIZED,
618 IEEE80211_ASSOCIATING,
619 IEEE80211_ASSOCIATED,
620 IEEE80211_AUTHENTICATING,
621 IEEE80211_AUTHENTICATED,
622 IEEE80211_SHUTDOWN
623};
624
625#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
626#define DEFAULT_FTS 2346
627#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
628#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
629
630
631#define CFG_IEEE80211_RESERVE_FCS (1<<0)
632#define CFG_IEEE80211_COMPUTE_FCS (1<<1)
633
634struct ieee80211_device {
635 struct net_device *dev;
636
637 /* Bookkeeping structures */
638 struct net_device_stats stats;
639 struct ieee80211_stats ieee_stats;
640
641 /* Probe / Beacon management */
642 struct list_head network_free_list;
643 struct list_head network_list;
644 struct ieee80211_network *networks;
645 int scans;
646 int scan_age;
647
648 int iw_mode; /* operating mode (IW_MODE_*) */
649
650 spinlock_t lock;
651
652 int tx_headroom; /* Set to size of any additional room needed at front
653 * of allocated Tx SKBs */
654 u32 config;
655
656 /* WEP and other encryption related settings at the device level */
657 int open_wep; /* Set to 1 to allow unencrypted frames */
658
659 int reset_on_keychange; /* Set to 1 if the HW needs to be reset on
660 * WEP key changes */
661
662 /* If the host performs {en,de}cryption, then set to 1 */
663 int host_encrypt;
664 int host_decrypt;
665 int ieee802_1x; /* is IEEE 802.1X used */
666
667 /* WPA data */
668 int wpa_enabled;
669 int drop_unencrypted;
670 int tkip_countermeasures;
671 int privacy_invoked;
672 size_t wpa_ie_len;
673 u8 *wpa_ie;
674
675 struct list_head crypt_deinit_list;
676 struct ieee80211_crypt_data *crypt[WEP_KEYS];
677 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
678 struct timer_list crypt_deinit_timer;
679
680 int bcrx_sta_key; /* use individual keys to override default keys even
681 * with RX of broad/multicast frames */
682
683 /* Fragmentation structures */
684 struct ieee80211_frag_entry frag_cache[IEEE80211_FRAG_CACHE_LEN];
685 unsigned int frag_next_idx;
686 u16 fts; /* Fragmentation Threshold */
687
688 /* Association info */
689 u8 bssid[ETH_ALEN];
690
691 enum ieee80211_state state;
692
693 int mode; /* A, B, G */
694 int modulation; /* CCK, OFDM */
695 int freq_band; /* 2.4Ghz, 5.2Ghz, Mixed */
696 int abg_ture; /* ABG flag */
697
698 /* Callback functions */
699 void (*set_security)(struct net_device *dev,
700 struct ieee80211_security *sec);
701 int (*hard_start_xmit)(struct ieee80211_txb *txb,
702 struct net_device *dev);
703 int (*reset_port)(struct net_device *dev);
704
705 /* This must be the last item so that it points to the data
706 * allocated beyond this structure by alloc_ieee80211 */
707 u8 priv[0];
708};
709
710#define IEEE_A (1<<0)
711#define IEEE_B (1<<1)
712#define IEEE_G (1<<2)
713#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G)
714
715extern inline void *ieee80211_priv(struct net_device *dev)
716{
717 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
718}
719
720extern inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
721{
722 /* Single white space is for Linksys APs */
723 if (essid_len == 1 && essid[0] == ' ')
724 return 1;
725
726 /* Otherwise, if the entire essid is 0, we assume it is hidden */
727 while (essid_len) {
728 essid_len--;
729 if (essid[essid_len] != '\0')
730 return 0;
731 }
732
733 return 1;
734}
735
736extern inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, int mode)
737{
738 /*
739 * It is possible for both access points and our device to support
740 * combinations of modes, so as long as there is one valid combination
741 * of ap/device supported modes, then return success
742 *
743 */
744 if ((mode & IEEE_A) &&
745 (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
746 (ieee->freq_band & IEEE80211_52GHZ_BAND))
747 return 1;
748
749 if ((mode & IEEE_G) &&
750 (ieee->modulation & IEEE80211_OFDM_MODULATION) &&
751 (ieee->freq_band & IEEE80211_24GHZ_BAND))
752 return 1;
753
754 if ((mode & IEEE_B) &&
755 (ieee->modulation & IEEE80211_CCK_MODULATION) &&
756 (ieee->freq_band & IEEE80211_24GHZ_BAND))
757 return 1;
758
759 return 0;
760}
761
762extern inline int ieee80211_get_hdrlen(u16 fc)
763{
764 int hdrlen = IEEE80211_3ADDR_LEN;
765
766 switch (WLAN_FC_GET_TYPE(fc)) {
767 case IEEE80211_FTYPE_DATA:
768 if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
769 hdrlen = IEEE80211_4ADDR_LEN;
770 break;
771 case IEEE80211_FTYPE_CTL:
772 switch (WLAN_FC_GET_STYPE(fc)) {
773 case IEEE80211_STYPE_CTS:
774 case IEEE80211_STYPE_ACK:
775 hdrlen = IEEE80211_1ADDR_LEN;
776 break;
777 default:
778 hdrlen = IEEE80211_2ADDR_LEN;
779 break;
780 }
781 break;
782 }
783
784 return hdrlen;
785}
786
787
788
789/* ieee80211.c */
790extern void free_ieee80211(struct net_device *dev);
791extern struct net_device *alloc_ieee80211(int sizeof_priv);
792
793extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
794
795/* ieee80211_tx.c */
796
797
798extern int ieee80211_xmit(struct sk_buff *skb,
799 struct net_device *dev);
800extern void ieee80211_txb_free(struct ieee80211_txb *);
801
802
803/* ieee80211_rx.c */
804extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
805 struct ieee80211_rx_stats *rx_stats);
806extern void ieee80211_rx_mgt(struct ieee80211_device *ieee,
807 struct ieee80211_hdr *header,
808 struct ieee80211_rx_stats *stats);
809
810/* iee80211_wx.c */
811extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
812 struct iw_request_info *info,
813 union iwreq_data *wrqu, char *key);
814extern int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
815 struct iw_request_info *info,
816 union iwreq_data *wrqu, char *key);
817extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
818 struct iw_request_info *info,
819 union iwreq_data *wrqu, char *key);
820
821
822extern inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
823{
824 ieee->scans++;
825}
826
827extern inline int ieee80211_get_scans(struct ieee80211_device *ieee)
828{
829 return ieee->scans;
830}
831
832static inline const char *escape_essid(const char *essid, u8 essid_len) {
833 static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
834 const char *s = essid;
835 char *d = escaped;
836
837 if (ieee80211_is_empty_essid(essid, essid_len)) {
838 memcpy(escaped, "<hidden>", sizeof("<hidden>"));
839 return escaped;
840 }
841
842 essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
843 while (essid_len--) {
844 if (*s == '\0') {
845 *d++ = '\\';
846 *d++ = '0';
847 s++;
848 } else {
849 *d++ = *s++;
850 }
851 }
852 *d = '\0';
853 return escaped;
854}
855
856#endif /* IEEE80211_H */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 771b47e30f86..69324465e8b3 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -183,7 +183,6 @@ struct ipv6_txoptions
183 struct ipv6_opt_hdr *hopopt; 183 struct ipv6_opt_hdr *hopopt;
184 struct ipv6_opt_hdr *dst0opt; 184 struct ipv6_opt_hdr *dst0opt;
185 struct ipv6_rt_hdr *srcrt; /* Routing Header */ 185 struct ipv6_rt_hdr *srcrt; /* Routing Header */
186 struct ipv6_opt_hdr *auth;
187 struct ipv6_opt_hdr *dst1opt; 186 struct ipv6_opt_hdr *dst1opt;
188 187
189 /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ 188 /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 71d6af83b631..92c828029cd8 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -224,7 +224,7 @@ int irda_device_is_receiving(struct net_device *dev);
224/* Interface for internal use */ 224/* Interface for internal use */
225static inline int irda_device_txqueue_empty(const struct net_device *dev) 225static inline int irda_device_txqueue_empty(const struct net_device *dev)
226{ 226{
227 return (skb_queue_len(&dev->qdisc->q) == 0); 227 return skb_queue_empty(&dev->qdisc->q);
228} 228}
229int irda_device_set_raw_mode(struct net_device* self, int status); 229int irda_device_set_raw_mode(struct net_device* self, int status);
230struct net_device *alloc_irdadev(int sizeof_priv); 230struct net_device *alloc_irdadev(int sizeof_priv);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index fcb05a387dbe..6492e7363d84 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -13,13 +13,12 @@ struct qdisc_walker
13 13
14extern rwlock_t qdisc_tree_lock; 14extern rwlock_t qdisc_tree_lock;
15 15
16#define QDISC_ALIGN 32 16#define QDISC_ALIGNTO 32
17#define QDISC_ALIGN_CONST (QDISC_ALIGN - 1) 17#define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1))
18 18
19static inline void *qdisc_priv(struct Qdisc *q) 19static inline void *qdisc_priv(struct Qdisc *q)
20{ 20{
21 return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST) 21 return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc));
22 & ~QDISC_ALIGN_CONST);
23} 22}
24 23
25/* 24/*
@@ -207,8 +206,6 @@ psched_tod_diff(int delta_sec, int bound)
207 206
208#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */ 207#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
209 208
210extern struct Qdisc noop_qdisc;
211extern struct Qdisc_ops noop_qdisc_ops;
212extern struct Qdisc_ops pfifo_qdisc_ops; 209extern struct Qdisc_ops pfifo_qdisc_ops;
213extern struct Qdisc_ops bfifo_qdisc_ops; 210extern struct Qdisc_ops bfifo_qdisc_ops;
214 211
@@ -216,14 +213,6 @@ extern int register_qdisc(struct Qdisc_ops *qops);
216extern int unregister_qdisc(struct Qdisc_ops *qops); 213extern int unregister_qdisc(struct Qdisc_ops *qops);
217extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 214extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
218extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 215extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
219extern void dev_init_scheduler(struct net_device *dev);
220extern void dev_shutdown(struct net_device *dev);
221extern void dev_activate(struct net_device *dev);
222extern void dev_deactivate(struct net_device *dev);
223extern void qdisc_reset(struct Qdisc *qdisc);
224extern void qdisc_destroy(struct Qdisc *qdisc);
225extern struct Qdisc * qdisc_create_dflt(struct net_device *dev,
226 struct Qdisc_ops *ops);
227extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 216extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
228 struct rtattr *tab); 217 struct rtattr *tab);
229extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 218extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 7b97405e2dbf..7b6ec9986715 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -164,6 +164,19 @@ extern void qdisc_unlock_tree(struct net_device *dev);
164#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) 164#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev)
165#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) 165#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev)
166 166
167extern struct Qdisc noop_qdisc;
168extern struct Qdisc_ops noop_qdisc_ops;
169
170extern void dev_init_scheduler(struct net_device *dev);
171extern void dev_shutdown(struct net_device *dev);
172extern void dev_activate(struct net_device *dev);
173extern void dev_deactivate(struct net_device *dev);
174extern void qdisc_reset(struct Qdisc *qdisc);
175extern void qdisc_destroy(struct Qdisc *qdisc);
176extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops);
177extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
178 struct Qdisc_ops *ops);
179
167static inline void 180static inline void
168tcf_destroy(struct tcf_proto *tp) 181tcf_destroy(struct tcf_proto *tp)
169{ 182{
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 4868c7f7749d..5999e5684bbf 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -263,23 +263,11 @@ enum { SCTP_MIN_PMTU = 576 };
263enum { SCTP_MAX_DUP_TSNS = 16 }; 263enum { SCTP_MAX_DUP_TSNS = 16 };
264enum { SCTP_MAX_GABS = 16 }; 264enum { SCTP_MAX_GABS = 16 };
265 265
266/* Here we define the default timers. */ 266/* Heartbeat interval - 30 secs */
267#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (30 * HZ)
267 268
268/* cookie timer def = ? seconds */ 269/* Delayed sack timer - 200ms */
269#define SCTP_DEFAULT_TIMEOUT_T1_COOKIE (3 * HZ)
270
271/* init timer def = 3 seconds */
272#define SCTP_DEFAULT_TIMEOUT_T1_INIT (3 * HZ)
273
274/* shutdown timer def = 300 ms */
275#define SCTP_DEFAULT_TIMEOUT_T2_SHUTDOWN ((300 * HZ) / 1000)
276
277/* 0 seconds + RTO */
278#define SCTP_DEFAULT_TIMEOUT_HEARTBEAT (10 * HZ)
279
280/* recv timer def = 200ms (in usec) */
281#define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000) 270#define SCTP_DEFAULT_TIMEOUT_SACK ((200 * HZ) / 1000)
282#define SCTP_DEFAULT_TIMEOUT_SACK_MAX ((500 * HZ) / 1000) /* 500 ms */
283 271
284/* RTO.Initial - 3 seconds 272/* RTO.Initial - 3 seconds
285 * RTO.Min - 1 second 273 * RTO.Min - 1 second
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ef2738159ab3..e1d5ec1c23c0 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -125,7 +125,8 @@
125 */ 125 */
126extern struct sock *sctp_get_ctl_sock(void); 126extern struct sock *sctp_get_ctl_sock(void);
127extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, 127extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
128 sctp_scope_t, int gfp, int flags); 128 sctp_scope_t, unsigned int __nocast gfp,
129 int flags);
129extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 130extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
130extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 131extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
131 132
@@ -166,15 +167,12 @@ void sctp_unhash_established(struct sctp_association *);
166void sctp_hash_endpoint(struct sctp_endpoint *); 167void sctp_hash_endpoint(struct sctp_endpoint *);
167void sctp_unhash_endpoint(struct sctp_endpoint *); 168void sctp_unhash_endpoint(struct sctp_endpoint *);
168struct sock *sctp_err_lookup(int family, struct sk_buff *, 169struct sock *sctp_err_lookup(int family, struct sk_buff *,
169 struct sctphdr *, struct sctp_endpoint **, 170 struct sctphdr *, struct sctp_association **,
170 struct sctp_association **,
171 struct sctp_transport **); 171 struct sctp_transport **);
172void sctp_err_finish(struct sock *, struct sctp_endpoint *, 172void sctp_err_finish(struct sock *, struct sctp_association *);
173 struct sctp_association *);
174void sctp_icmp_frag_needed(struct sock *, struct sctp_association *, 173void sctp_icmp_frag_needed(struct sock *, struct sctp_association *,
175 struct sctp_transport *t, __u32 pmtu); 174 struct sctp_transport *t, __u32 pmtu);
176void sctp_icmp_proto_unreachable(struct sock *sk, 175void sctp_icmp_proto_unreachable(struct sock *sk,
177 struct sctp_endpoint *ep,
178 struct sctp_association *asoc, 176 struct sctp_association *asoc,
179 struct sctp_transport *t); 177 struct sctp_transport *t);
180 178
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index a53e08a45e32..58462164d960 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -131,7 +131,6 @@ sctp_state_fn_t sctp_sf_do_ecne;
131sctp_state_fn_t sctp_sf_ootb; 131sctp_state_fn_t sctp_sf_ootb;
132sctp_state_fn_t sctp_sf_pdiscard; 132sctp_state_fn_t sctp_sf_pdiscard;
133sctp_state_fn_t sctp_sf_violation; 133sctp_state_fn_t sctp_sf_violation;
134sctp_state_fn_t sctp_sf_violation_chunklen;
135sctp_state_fn_t sctp_sf_discard_chunk; 134sctp_state_fn_t sctp_sf_discard_chunk;
136sctp_state_fn_t sctp_sf_do_5_2_1_siminit; 135sctp_state_fn_t sctp_sf_do_5_2_1_siminit;
137sctp_state_fn_t sctp_sf_do_5_2_2_dupinit; 136sctp_state_fn_t sctp_sf_do_5_2_2_dupinit;
@@ -182,17 +181,17 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t,
182int sctp_chunk_iif(const struct sctp_chunk *); 181int sctp_chunk_iif(const struct sctp_chunk *);
183struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *, 182struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *,
184 struct sctp_chunk *, 183 struct sctp_chunk *,
185 int gfp); 184 unsigned int __nocast gfp);
186__u32 sctp_generate_verification_tag(void); 185__u32 sctp_generate_verification_tag(void);
187void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); 186void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag);
188 187
189/* Prototypes for chunk-building functions. */ 188/* Prototypes for chunk-building functions. */
190struct sctp_chunk *sctp_make_init(const struct sctp_association *, 189struct sctp_chunk *sctp_make_init(const struct sctp_association *,
191 const struct sctp_bind_addr *, 190 const struct sctp_bind_addr *,
192 int gfp, int vparam_len); 191 unsigned int __nocast gfp, int vparam_len);
193struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *, 192struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *,
194 const struct sctp_chunk *, 193 const struct sctp_chunk *,
195 const int gfp, 194 const unsigned int __nocast gfp,
196 const int unkparam_len); 195 const int unkparam_len);
197struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *, 196struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *,
198 const struct sctp_chunk *); 197 const struct sctp_chunk *);
@@ -259,11 +258,6 @@ struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
259void sctp_chunk_assign_tsn(struct sctp_chunk *); 258void sctp_chunk_assign_tsn(struct sctp_chunk *);
260void sctp_chunk_assign_ssn(struct sctp_chunk *); 259void sctp_chunk_assign_ssn(struct sctp_chunk *);
261 260
262sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands,
263 __u16 error,
264 const struct sctp_association *asoc,
265 struct sctp_transport *transport);
266
267/* Prototypes for statetable processing. */ 261/* Prototypes for statetable processing. */
268 262
269int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, 263int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
@@ -271,7 +265,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
271 struct sctp_endpoint *, 265 struct sctp_endpoint *,
272 struct sctp_association *asoc, 266 struct sctp_association *asoc,
273 void *event_arg, 267 void *event_arg,
274 int gfp); 268 unsigned int __nocast gfp);
275 269
276/* 2nd level prototypes */ 270/* 2nd level prototypes */
277void sctp_generate_t3_rtx_event(unsigned long peer); 271void sctp_generate_t3_rtx_event(unsigned long peer);
@@ -281,7 +275,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *);
281 275
282struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, 276struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *,
283 const struct sctp_association *, 277 const struct sctp_association *,
284 struct sctp_chunk *, int gfp, int *err, 278 struct sctp_chunk *,
279 unsigned int __nocast gfp, int *err,
285 struct sctp_chunk **err_chk_p); 280 struct sctp_chunk **err_chk_p);
286int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, 281int sctp_addip_addr_config(struct sctp_association *, sctp_param_t,
287 struct sockaddr_storage*, int); 282 struct sockaddr_storage*, int);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index dfad4d3c581c..994009bbe3b4 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -161,6 +161,9 @@ extern struct sctp_globals {
161 */ 161 */
162 int sndbuf_policy; 162 int sndbuf_policy;
163 163
164 /* Delayed SACK timeout 200ms default*/
165 int sack_timeout;
166
164 /* HB.interval - 30 seconds */ 167 /* HB.interval - 30 seconds */
165 int hb_interval; 168 int hb_interval;
166 169
@@ -217,6 +220,7 @@ extern struct sctp_globals {
217#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy) 220#define sctp_sndbuf_policy (sctp_globals.sndbuf_policy)
218#define sctp_max_retrans_path (sctp_globals.max_retrans_path) 221#define sctp_max_retrans_path (sctp_globals.max_retrans_path)
219#define sctp_max_retrans_init (sctp_globals.max_retrans_init) 222#define sctp_max_retrans_init (sctp_globals.max_retrans_init)
223#define sctp_sack_timeout (sctp_globals.sack_timeout)
220#define sctp_hb_interval (sctp_globals.hb_interval) 224#define sctp_hb_interval (sctp_globals.hb_interval)
221#define sctp_max_instreams (sctp_globals.max_instreams) 225#define sctp_max_instreams (sctp_globals.max_instreams)
222#define sctp_max_outstreams (sctp_globals.max_outstreams) 226#define sctp_max_outstreams (sctp_globals.max_outstreams)
@@ -441,7 +445,8 @@ struct sctp_ssnmap {
441 int malloced; 445 int malloced;
442}; 446};
443 447
444struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp); 448struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out,
449 unsigned int __nocast gfp);
445void sctp_ssnmap_free(struct sctp_ssnmap *map); 450void sctp_ssnmap_free(struct sctp_ssnmap *map);
446void sctp_ssnmap_clear(struct sctp_ssnmap *map); 451void sctp_ssnmap_clear(struct sctp_ssnmap *map);
447 452
@@ -578,7 +583,6 @@ void sctp_datamsg_track(struct sctp_chunk *);
578void sctp_chunk_fail(struct sctp_chunk *, int error); 583void sctp_chunk_fail(struct sctp_chunk *, int error);
579int sctp_chunk_abandoned(struct sctp_chunk *); 584int sctp_chunk_abandoned(struct sctp_chunk *);
580 585
581
582/* RFC2960 1.4 Key Terms 586/* RFC2960 1.4 Key Terms
583 * 587 *
584 * o Chunk: A unit of information within an SCTP packet, consisting of 588 * o Chunk: A unit of information within an SCTP packet, consisting of
@@ -588,13 +592,8 @@ int sctp_chunk_abandoned(struct sctp_chunk *);
588 * each chunk as well as a few other header pointers... 592 * each chunk as well as a few other header pointers...
589 */ 593 */
590struct sctp_chunk { 594struct sctp_chunk {
591 /* These first three elements MUST PRECISELY match the first 595 struct list_head list;
592 * three elements of struct sk_buff. This allows us to reuse 596
593 * all the skb_* queue management functions.
594 */
595 struct sctp_chunk *next;
596 struct sctp_chunk *prev;
597 struct sk_buff_head *list;
598 atomic_t refcnt; 597 atomic_t refcnt;
599 598
600 /* This is our link to the per-transport transmitted list. */ 599 /* This is our link to the per-transport transmitted list. */
@@ -713,7 +712,7 @@ struct sctp_packet {
713 __u32 vtag; 712 __u32 vtag;
714 713
715 /* This contains the payload chunks. */ 714 /* This contains the payload chunks. */
716 struct sk_buff_head chunks; 715 struct list_head chunk_list;
717 716
718 /* This is the overhead of the sctp and ip headers. */ 717 /* This is the overhead of the sctp and ip headers. */
719 size_t overhead; 718 size_t overhead;
@@ -947,7 +946,8 @@ struct sctp_transport {
947 } cacc; 946 } cacc;
948}; 947};
949 948
950struct sctp_transport *sctp_transport_new(const union sctp_addr *, int); 949struct sctp_transport *sctp_transport_new(const union sctp_addr *,
950 unsigned int __nocast);
951void sctp_transport_set_owner(struct sctp_transport *, 951void sctp_transport_set_owner(struct sctp_transport *,
952 struct sctp_association *); 952 struct sctp_association *);
953void sctp_transport_route(struct sctp_transport *, union sctp_addr *, 953void sctp_transport_route(struct sctp_transport *, union sctp_addr *,
@@ -970,7 +970,7 @@ struct sctp_inq {
970 /* This is actually a queue of sctp_chunk each 970 /* This is actually a queue of sctp_chunk each
971 * containing a partially decoded packet. 971 * containing a partially decoded packet.
972 */ 972 */
973 struct sk_buff_head in; 973 struct list_head in_chunk_list;
974 /* This is the packet which is currently off the in queue and is 974 /* This is the packet which is currently off the in queue and is
975 * being worked on through the inbound chunk processing. 975 * being worked on through the inbound chunk processing.
976 */ 976 */
@@ -1013,7 +1013,7 @@ struct sctp_outq {
1013 struct sctp_association *asoc; 1013 struct sctp_association *asoc;
1014 1014
1015 /* Data pending that has never been transmitted. */ 1015 /* Data pending that has never been transmitted. */
1016 struct sk_buff_head out; 1016 struct list_head out_chunk_list;
1017 1017
1018 unsigned out_qlen; /* Total length of queued data chunks. */ 1018 unsigned out_qlen; /* Total length of queued data chunks. */
1019 1019
@@ -1021,7 +1021,7 @@ struct sctp_outq {
1021 unsigned error; 1021 unsigned error;
1022 1022
1023 /* These are control chunks we want to send. */ 1023 /* These are control chunks we want to send. */
1024 struct sk_buff_head control; 1024 struct list_head control_chunk_list;
1025 1025
1026 /* These are chunks that have been sacked but are above the 1026 /* These are chunks that have been sacked but are above the
1027 * CTSN, or cumulative tsn ack point. 1027 * CTSN, or cumulative tsn ack point.
@@ -1095,9 +1095,10 @@ void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port);
1095void sctp_bind_addr_free(struct sctp_bind_addr *); 1095void sctp_bind_addr_free(struct sctp_bind_addr *);
1096int sctp_bind_addr_copy(struct sctp_bind_addr *dest, 1096int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
1097 const struct sctp_bind_addr *src, 1097 const struct sctp_bind_addr *src,
1098 sctp_scope_t scope, int gfp,int flags); 1098 sctp_scope_t scope, unsigned int __nocast gfp,
1099 int flags);
1099int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, 1100int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *,
1100 int gfp); 1101 unsigned int __nocast gfp);
1101int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); 1102int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *);
1102int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, 1103int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *,
1103 struct sctp_sock *); 1104 struct sctp_sock *);
@@ -1106,9 +1107,10 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
1106 int addrcnt, 1107 int addrcnt,
1107 struct sctp_sock *opt); 1108 struct sctp_sock *opt);
1108union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, 1109union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp,
1109 int *addrs_len, int gfp); 1110 int *addrs_len,
1111 unsigned int __nocast gfp);
1110int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, 1112int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len,
1111 __u16 port, int gfp); 1113 __u16 port, unsigned int __nocast gfp);
1112 1114
1113sctp_scope_t sctp_scope(const union sctp_addr *); 1115sctp_scope_t sctp_scope(const union sctp_addr *);
1114int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1116int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
@@ -1237,7 +1239,7 @@ static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base)
1237} 1239}
1238 1240
1239/* These are function signatures for manipulating endpoints. */ 1241/* These are function signatures for manipulating endpoints. */
1240struct sctp_endpoint *sctp_endpoint_new(struct sock *, int); 1242struct sctp_endpoint *sctp_endpoint_new(struct sock *, unsigned int __nocast);
1241void sctp_endpoint_free(struct sctp_endpoint *); 1243void sctp_endpoint_free(struct sctp_endpoint *);
1242void sctp_endpoint_put(struct sctp_endpoint *); 1244void sctp_endpoint_put(struct sctp_endpoint *);
1243void sctp_endpoint_hold(struct sctp_endpoint *); 1245void sctp_endpoint_hold(struct sctp_endpoint *);
@@ -1258,7 +1260,7 @@ int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t,
1258 struct sctp_chunk **err_chunk); 1260 struct sctp_chunk **err_chunk);
1259int sctp_process_init(struct sctp_association *, sctp_cid_t cid, 1261int sctp_process_init(struct sctp_association *, sctp_cid_t cid,
1260 const union sctp_addr *peer, 1262 const union sctp_addr *peer,
1261 sctp_init_chunk_t *init, int gfp); 1263 sctp_init_chunk_t *init, unsigned int __nocast gfp);
1262__u32 sctp_generate_tag(const struct sctp_endpoint *); 1264__u32 sctp_generate_tag(const struct sctp_endpoint *);
1263__u32 sctp_generate_tsn(const struct sctp_endpoint *); 1265__u32 sctp_generate_tsn(const struct sctp_endpoint *);
1264 1266
@@ -1668,7 +1670,7 @@ struct sctp_association {
1668 * which already resides in sctp_outq. Please move this 1670 * which already resides in sctp_outq. Please move this
1669 * queue and its supporting logic down there. --piggy] 1671 * queue and its supporting logic down there. --piggy]
1670 */ 1672 */
1671 struct sk_buff_head addip_chunks; 1673 struct list_head addip_chunk_list;
1672 1674
1673 /* ADDIP Section 4.1 ASCONF Chunk Procedures 1675 /* ADDIP Section 4.1 ASCONF Chunk Procedures
1674 * 1676 *
@@ -1721,7 +1723,7 @@ static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base)
1721 1723
1722struct sctp_association * 1724struct sctp_association *
1723sctp_association_new(const struct sctp_endpoint *, const struct sock *, 1725sctp_association_new(const struct sctp_endpoint *, const struct sock *,
1724 sctp_scope_t scope, int gfp); 1726 sctp_scope_t scope, unsigned int __nocast gfp);
1725void sctp_association_free(struct sctp_association *); 1727void sctp_association_free(struct sctp_association *);
1726void sctp_association_put(struct sctp_association *); 1728void sctp_association_put(struct sctp_association *);
1727void sctp_association_hold(struct sctp_association *); 1729void sctp_association_hold(struct sctp_association *);
@@ -1737,7 +1739,7 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
1737 const union sctp_addr *laddr); 1739 const union sctp_addr *laddr);
1738struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, 1740struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *,
1739 const union sctp_addr *address, 1741 const union sctp_addr *address,
1740 const int gfp, 1742 const unsigned int __nocast gfp,
1741 const int peer_state); 1743 const int peer_state);
1742void sctp_assoc_del_peer(struct sctp_association *asoc, 1744void sctp_assoc_del_peer(struct sctp_association *asoc,
1743 const union sctp_addr *addr); 1745 const union sctp_addr *addr);
@@ -1761,9 +1763,11 @@ void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned);
1761void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); 1763void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned);
1762void sctp_assoc_set_primary(struct sctp_association *, 1764void sctp_assoc_set_primary(struct sctp_association *,
1763 struct sctp_transport *); 1765 struct sctp_transport *);
1764int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int); 1766int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *,
1767 unsigned int __nocast);
1765int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, 1768int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *,
1766 struct sctp_cookie*, int gfp); 1769 struct sctp_cookie*,
1770 unsigned int __nocast gfp);
1767 1771
1768int sctp_cmp_addr_exact(const union sctp_addr *ss1, 1772int sctp_cmp_addr_exact(const union sctp_addr *ss1,
1769 const union sctp_addr *ss2); 1773 const union sctp_addr *ss2);
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 1019d83a580a..90fe4bf6754f 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -88,7 +88,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
88 __u16 error, 88 __u16 error,
89 __u16 outbound, 89 __u16 outbound,
90 __u16 inbound, 90 __u16 inbound,
91 int gfp); 91 unsigned int __nocast gfp);
92 92
93struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( 93struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
94 const struct sctp_association *asoc, 94 const struct sctp_association *asoc,
@@ -96,35 +96,35 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change(
96 int flags, 96 int flags,
97 int state, 97 int state,
98 int error, 98 int error,
99 int gfp); 99 unsigned int __nocast gfp);
100 100
101struct sctp_ulpevent *sctp_ulpevent_make_remote_error( 101struct sctp_ulpevent *sctp_ulpevent_make_remote_error(
102 const struct sctp_association *asoc, 102 const struct sctp_association *asoc,
103 struct sctp_chunk *chunk, 103 struct sctp_chunk *chunk,
104 __u16 flags, 104 __u16 flags,
105 int gfp); 105 unsigned int __nocast gfp);
106struct sctp_ulpevent *sctp_ulpevent_make_send_failed( 106struct sctp_ulpevent *sctp_ulpevent_make_send_failed(
107 const struct sctp_association *asoc, 107 const struct sctp_association *asoc,
108 struct sctp_chunk *chunk, 108 struct sctp_chunk *chunk,
109 __u16 flags, 109 __u16 flags,
110 __u32 error, 110 __u32 error,
111 int gfp); 111 unsigned int __nocast gfp);
112 112
113struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( 113struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event(
114 const struct sctp_association *asoc, 114 const struct sctp_association *asoc,
115 __u16 flags, 115 __u16 flags,
116 int gfp); 116 unsigned int __nocast gfp);
117 117
118struct sctp_ulpevent *sctp_ulpevent_make_pdapi( 118struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
119 const struct sctp_association *asoc, 119 const struct sctp_association *asoc,
120 __u32 indication, int gfp); 120 __u32 indication, unsigned int __nocast gfp);
121 121
122struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( 122struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication(
123 const struct sctp_association *asoc, int gfp); 123 const struct sctp_association *asoc, unsigned int __nocast gfp);
124 124
125struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, 125struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
126 struct sctp_chunk *chunk, 126 struct sctp_chunk *chunk,
127 int gfp); 127 unsigned int __nocast gfp);
128 128
129void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, 129void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
130 struct msghdr *); 130 struct msghdr *);
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 961736d29d21..1a60c6d943c1 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -62,19 +62,22 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *,
62void sctp_ulpq_free(struct sctp_ulpq *); 62void sctp_ulpq_free(struct sctp_ulpq *);
63 63
64/* Add a new DATA chunk for processing. */ 64/* Add a new DATA chunk for processing. */
65int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, int); 65int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *,
66 unsigned int __nocast);
66 67
67/* Add a new event for propagation to the ULP. */ 68/* Add a new event for propagation to the ULP. */
68int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); 69int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev);
69 70
70/* Renege previously received chunks. */ 71/* Renege previously received chunks. */
71void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, int); 72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *,
73 unsigned int __nocast);
72 74
73/* Perform partial delivery. */ 75/* Perform partial delivery. */
74void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, int); 76void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *,
77 unsigned int __nocast);
75 78
76/* Abort the partial delivery. */ 79/* Abort the partial delivery. */
77void sctp_ulpq_abort_pd(struct sctp_ulpq *, int); 80void sctp_ulpq_abort_pd(struct sctp_ulpq *, unsigned int __nocast);
78 81
79/* Clear the partial data delivery condition on this socket. */ 82/* Clear the partial data delivery condition on this socket. */
80int sctp_clear_pd(struct sock *sk); 83int sctp_clear_pd(struct sock *sk);
diff --git a/include/net/slhc_vj.h b/include/net/slhc_vj.h
index 0b2c2784f333..8716d5942b65 100644
--- a/include/net/slhc_vj.h
+++ b/include/net/slhc_vj.h
@@ -170,19 +170,14 @@ struct slcompress {
170}; 170};
171#define NULLSLCOMPR (struct slcompress *)0 171#define NULLSLCOMPR (struct slcompress *)0
172 172
173#define __ARGS(x) x
174
175/* In slhc.c: */ 173/* In slhc.c: */
176struct slcompress *slhc_init __ARGS((int rslots, int tslots)); 174struct slcompress *slhc_init(int rslots, int tslots);
177void slhc_free __ARGS((struct slcompress *comp)); 175void slhc_free(struct slcompress *comp);
178 176
179int slhc_compress __ARGS((struct slcompress *comp, unsigned char *icp, 177int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
180 int isize, unsigned char *ocp, unsigned char **cpp, 178 unsigned char *ocp, unsigned char **cpp, int compress_cid);
181 int compress_cid)); 179int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize);
182int slhc_uncompress __ARGS((struct slcompress *comp, unsigned char *icp, 180int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize);
183 int isize)); 181int slhc_toss(struct slcompress *comp);
184int slhc_remember __ARGS((struct slcompress *comp, unsigned char *icp,
185 int isize));
186int slhc_toss __ARGS((struct slcompress *comp));
187 182
188#endif /* _SLHC_H */ 183#endif /* _SLHC_H */
diff --git a/include/net/sock.h b/include/net/sock.h
index e593af5b1ecc..e9b1dbab90d0 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -384,6 +384,11 @@ enum sock_flags {
384 SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */ 384 SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */
385}; 385};
386 386
387static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
388{
389 nsk->sk_flags = osk->sk_flags;
390}
391
387static inline void sock_set_flag(struct sock *sk, enum sock_flags flag) 392static inline void sock_set_flag(struct sock *sk, enum sock_flags flag)
388{ 393{
389 __set_bit(flag, &sk->sk_flags); 394 __set_bit(flag, &sk->sk_flags);
@@ -684,16 +689,17 @@ extern void FASTCALL(release_sock(struct sock *sk));
684#define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) 689#define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock))
685#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) 690#define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock))
686 691
687extern struct sock *sk_alloc(int family, int priority, 692extern struct sock *sk_alloc(int family,
693 unsigned int __nocast priority,
688 struct proto *prot, int zero_it); 694 struct proto *prot, int zero_it);
689extern void sk_free(struct sock *sk); 695extern void sk_free(struct sock *sk);
690 696
691extern struct sk_buff *sock_wmalloc(struct sock *sk, 697extern struct sk_buff *sock_wmalloc(struct sock *sk,
692 unsigned long size, int force, 698 unsigned long size, int force,
693 int priority); 699 unsigned int __nocast priority);
694extern struct sk_buff *sock_rmalloc(struct sock *sk, 700extern struct sk_buff *sock_rmalloc(struct sock *sk,
695 unsigned long size, int force, 701 unsigned long size, int force,
696 int priority); 702 unsigned int __nocast priority);
697extern void sock_wfree(struct sk_buff *skb); 703extern void sock_wfree(struct sk_buff *skb);
698extern void sock_rfree(struct sk_buff *skb); 704extern void sock_rfree(struct sk_buff *skb);
699 705
@@ -708,7 +714,8 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk,
708 unsigned long size, 714 unsigned long size,
709 int noblock, 715 int noblock,
710 int *errcode); 716 int *errcode);
711extern void *sock_kmalloc(struct sock *sk, int size, int priority); 717extern void *sock_kmalloc(struct sock *sk, int size,
718 unsigned int __nocast priority);
712extern void sock_kfree_s(struct sock *sk, void *mem, int size); 719extern void sock_kfree_s(struct sock *sk, void *mem, int size);
713extern void sk_send_sigurg(struct sock *sk); 720extern void sk_send_sigurg(struct sock *sk);
714 721
@@ -1132,15 +1139,19 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk)
1132} 1139}
1133 1140
1134static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, 1141static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
1135 int size, int mem, int gfp) 1142 int size, int mem,
1143 unsigned int __nocast gfp)
1136{ 1144{
1137 struct sk_buff *skb = alloc_skb(size + sk->sk_prot->max_header, gfp); 1145 struct sk_buff *skb;
1146 int hdr_len;
1138 1147
1148 hdr_len = SKB_DATA_ALIGN(sk->sk_prot->max_header);
1149 skb = alloc_skb(size + hdr_len, gfp);
1139 if (skb) { 1150 if (skb) {
1140 skb->truesize += mem; 1151 skb->truesize += mem;
1141 if (sk->sk_forward_alloc >= (int)skb->truesize || 1152 if (sk->sk_forward_alloc >= (int)skb->truesize ||
1142 sk_stream_mem_schedule(sk, skb->truesize, 0)) { 1153 sk_stream_mem_schedule(sk, skb->truesize, 0)) {
1143 skb_reserve(skb, sk->sk_prot->max_header); 1154 skb_reserve(skb, hdr_len);
1144 return skb; 1155 return skb;
1145 } 1156 }
1146 __kfree_skb(skb); 1157 __kfree_skb(skb);
@@ -1152,7 +1163,8 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk,
1152} 1163}
1153 1164
1154static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, 1165static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk,
1155 int size, int gfp) 1166 int size,
1167 unsigned int __nocast gfp)
1156{ 1168{
1157 return sk_stream_alloc_pskb(sk, size, 0, gfp); 1169 return sk_stream_alloc_pskb(sk, size, 0, gfp);
1158} 1170}
@@ -1185,7 +1197,7 @@ static inline int sock_writeable(const struct sock *sk)
1185 return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); 1197 return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2);
1186} 1198}
1187 1199
1188static inline int gfp_any(void) 1200static inline unsigned int __nocast gfp_any(void)
1189{ 1201{
1190 return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; 1202 return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
1191} 1203}
diff --git a/include/net/tcp.h b/include/net/tcp.h
index f730935b824a..5010f0c5a56e 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -505,25 +505,6 @@ static __inline__ int tcp_sk_listen_hashfn(struct sock *sk)
505#else 505#else
506# define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG) 506# define TCP_TW_RECYCLE_TICK (12+2-TCP_TW_RECYCLE_SLOTS_LOG)
507#endif 507#endif
508
509#define BICTCP_BETA_SCALE 1024 /* Scale factor beta calculation
510 * max_cwnd = snd_cwnd * beta
511 */
512#define BICTCP_MAX_INCREMENT 32 /*
513 * Limit on the amount of
514 * increment allowed during
515 * binary search.
516 */
517#define BICTCP_FUNC_OF_MIN_INCR 11 /*
518 * log(B/Smin)/log(B/(B-1))+1,
519 * Smin:min increment
520 * B:log factor
521 */
522#define BICTCP_B 4 /*
523 * In binary search,
524 * go to point (max+min)/N
525 */
526
527/* 508/*
528 * TCP option 509 * TCP option
529 */ 510 */
@@ -596,16 +577,7 @@ extern int sysctl_tcp_adv_win_scale;
596extern int sysctl_tcp_tw_reuse; 577extern int sysctl_tcp_tw_reuse;
597extern int sysctl_tcp_frto; 578extern int sysctl_tcp_frto;
598extern int sysctl_tcp_low_latency; 579extern int sysctl_tcp_low_latency;
599extern int sysctl_tcp_westwood;
600extern int sysctl_tcp_vegas_cong_avoid;
601extern int sysctl_tcp_vegas_alpha;
602extern int sysctl_tcp_vegas_beta;
603extern int sysctl_tcp_vegas_gamma;
604extern int sysctl_tcp_nometrics_save; 580extern int sysctl_tcp_nometrics_save;
605extern int sysctl_tcp_bic;
606extern int sysctl_tcp_bic_fast_convergence;
607extern int sysctl_tcp_bic_low_window;
608extern int sysctl_tcp_bic_beta;
609extern int sysctl_tcp_moderate_rcvbuf; 581extern int sysctl_tcp_moderate_rcvbuf;
610extern int sysctl_tcp_tso_win_divisor; 582extern int sysctl_tcp_tso_win_divisor;
611 583
@@ -749,11 +721,16 @@ static inline int tcp_ack_scheduled(struct tcp_sock *tp)
749 return tp->ack.pending&TCP_ACK_SCHED; 721 return tp->ack.pending&TCP_ACK_SCHED;
750} 722}
751 723
752static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp) 724static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp, unsigned int pkts)
753{ 725{
754 if (tp->ack.quick && --tp->ack.quick == 0) { 726 if (tp->ack.quick) {
755 /* Leaving quickack mode we deflate ATO. */ 727 if (pkts >= tp->ack.quick) {
756 tp->ack.ato = TCP_ATO_MIN; 728 tp->ack.quick = 0;
729
730 /* Leaving quickack mode we deflate ATO. */
731 tp->ack.ato = TCP_ATO_MIN;
732 } else
733 tp->ack.quick -= pkts;
757 } 734 }
758} 735}
759 736
@@ -871,7 +848,9 @@ extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
871 848
872/* tcp_output.c */ 849/* tcp_output.c */
873 850
874extern int tcp_write_xmit(struct sock *, int nonagle); 851extern void __tcp_push_pending_frames(struct sock *sk, struct tcp_sock *tp,
852 unsigned int cur_mss, int nonagle);
853extern int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp);
875extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); 854extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
876extern void tcp_xmit_retransmit_queue(struct sock *); 855extern void tcp_xmit_retransmit_queue(struct sock *);
877extern void tcp_simple_retransmit(struct sock *); 856extern void tcp_simple_retransmit(struct sock *);
@@ -881,12 +860,16 @@ extern void tcp_send_probe0(struct sock *);
881extern void tcp_send_partial(struct sock *); 860extern void tcp_send_partial(struct sock *);
882extern int tcp_write_wakeup(struct sock *); 861extern int tcp_write_wakeup(struct sock *);
883extern void tcp_send_fin(struct sock *sk); 862extern void tcp_send_fin(struct sock *sk);
884extern void tcp_send_active_reset(struct sock *sk, int priority); 863extern void tcp_send_active_reset(struct sock *sk,
864 unsigned int __nocast priority);
885extern int tcp_send_synack(struct sock *); 865extern int tcp_send_synack(struct sock *);
886extern void tcp_push_one(struct sock *, unsigned mss_now); 866extern void tcp_push_one(struct sock *, unsigned int mss_now);
887extern void tcp_send_ack(struct sock *sk); 867extern void tcp_send_ack(struct sock *sk);
888extern void tcp_send_delayed_ack(struct sock *sk); 868extern void tcp_send_delayed_ack(struct sock *sk);
889 869
870/* tcp_input.c */
871extern void tcp_cwnd_application_limited(struct sock *sk);
872
890/* tcp_timer.c */ 873/* tcp_timer.c */
891extern void tcp_init_xmit_timers(struct sock *); 874extern void tcp_init_xmit_timers(struct sock *);
892extern void tcp_clear_xmit_timers(struct sock *); 875extern void tcp_clear_xmit_timers(struct sock *);
@@ -986,7 +969,7 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long
986static inline void tcp_initialize_rcv_mss(struct sock *sk) 969static inline void tcp_initialize_rcv_mss(struct sock *sk)
987{ 970{
988 struct tcp_sock *tp = tcp_sk(sk); 971 struct tcp_sock *tp = tcp_sk(sk);
989 unsigned int hint = min(tp->advmss, tp->mss_cache_std); 972 unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache);
990 973
991 hint = min(hint, tp->rcv_wnd/2); 974 hint = min(hint, tp->rcv_wnd/2);
992 hint = min(hint, TCP_MIN_RCVMSS); 975 hint = min(hint, TCP_MIN_RCVMSS);
@@ -1009,7 +992,7 @@ static __inline__ void tcp_fast_path_on(struct tcp_sock *tp)
1009 992
1010static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) 993static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp)
1011{ 994{
1012 if (skb_queue_len(&tp->out_of_order_queue) == 0 && 995 if (skb_queue_empty(&tp->out_of_order_queue) &&
1013 tp->rcv_wnd && 996 tp->rcv_wnd &&
1014 atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && 997 atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf &&
1015 !tp->urg_data) 998 !tp->urg_data)
@@ -1136,6 +1119,82 @@ static inline void tcp_packets_out_dec(struct tcp_sock *tp,
1136 tp->packets_out -= tcp_skb_pcount(skb); 1119 tp->packets_out -= tcp_skb_pcount(skb);
1137} 1120}
1138 1121
1122/* Events passed to congestion control interface */
1123enum tcp_ca_event {
1124 CA_EVENT_TX_START, /* first transmit when no packets in flight */
1125 CA_EVENT_CWND_RESTART, /* congestion window restart */
1126 CA_EVENT_COMPLETE_CWR, /* end of congestion recovery */
1127 CA_EVENT_FRTO, /* fast recovery timeout */
1128 CA_EVENT_LOSS, /* loss timeout */
1129 CA_EVENT_FAST_ACK, /* in sequence ack */
1130 CA_EVENT_SLOW_ACK, /* other ack */
1131};
1132
1133/*
1134 * Interface for adding new TCP congestion control handlers
1135 */
1136#define TCP_CA_NAME_MAX 16
1137struct tcp_congestion_ops {
1138 struct list_head list;
1139
1140 /* initialize private data (optional) */
1141 void (*init)(struct tcp_sock *tp);
1142 /* cleanup private data (optional) */
1143 void (*release)(struct tcp_sock *tp);
1144
1145 /* return slow start threshold (required) */
1146 u32 (*ssthresh)(struct tcp_sock *tp);
1147 /* lower bound for congestion window (optional) */
1148 u32 (*min_cwnd)(struct tcp_sock *tp);
1149 /* do new cwnd calculation (required) */
1150 void (*cong_avoid)(struct tcp_sock *tp, u32 ack,
1151 u32 rtt, u32 in_flight, int good_ack);
1152 /* round trip time sample per acked packet (optional) */
1153 void (*rtt_sample)(struct tcp_sock *tp, u32 usrtt);
1154 /* call before changing ca_state (optional) */
1155 void (*set_state)(struct tcp_sock *tp, u8 new_state);
1156 /* call when cwnd event occurs (optional) */
1157 void (*cwnd_event)(struct tcp_sock *tp, enum tcp_ca_event ev);
1158 /* new value of cwnd after loss (optional) */
1159 u32 (*undo_cwnd)(struct tcp_sock *tp);
1160 /* hook for packet ack accounting (optional) */
1161 void (*pkts_acked)(struct tcp_sock *tp, u32 num_acked);
1162 /* get info for tcp_diag (optional) */
1163 void (*get_info)(struct tcp_sock *tp, u32 ext, struct sk_buff *skb);
1164
1165 char name[TCP_CA_NAME_MAX];
1166 struct module *owner;
1167};
1168
1169extern int tcp_register_congestion_control(struct tcp_congestion_ops *type);
1170extern void tcp_unregister_congestion_control(struct tcp_congestion_ops *type);
1171
1172extern void tcp_init_congestion_control(struct tcp_sock *tp);
1173extern void tcp_cleanup_congestion_control(struct tcp_sock *tp);
1174extern int tcp_set_default_congestion_control(const char *name);
1175extern void tcp_get_default_congestion_control(char *name);
1176extern int tcp_set_congestion_control(struct tcp_sock *tp, const char *name);
1177
1178extern struct tcp_congestion_ops tcp_init_congestion_ops;
1179extern u32 tcp_reno_ssthresh(struct tcp_sock *tp);
1180extern void tcp_reno_cong_avoid(struct tcp_sock *tp, u32 ack,
1181 u32 rtt, u32 in_flight, int flag);
1182extern u32 tcp_reno_min_cwnd(struct tcp_sock *tp);
1183extern struct tcp_congestion_ops tcp_reno;
1184
1185static inline void tcp_set_ca_state(struct tcp_sock *tp, u8 ca_state)
1186{
1187 if (tp->ca_ops->set_state)
1188 tp->ca_ops->set_state(tp, ca_state);
1189 tp->ca_state = ca_state;
1190}
1191
1192static inline void tcp_ca_event(struct tcp_sock *tp, enum tcp_ca_event event)
1193{
1194 if (tp->ca_ops->cwnd_event)
1195 tp->ca_ops->cwnd_event(tp, event);
1196}
1197
1139/* This determines how many packets are "in the network" to the best 1198/* This determines how many packets are "in the network" to the best
1140 * of our knowledge. In many cases it is conservative, but where 1199 * of our knowledge. In many cases it is conservative, but where
1141 * detailed information is available from the receiver (via SACK 1200 * detailed information is available from the receiver (via SACK
@@ -1155,91 +1214,6 @@ static __inline__ unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
1155 return (tp->packets_out - tp->left_out + tp->retrans_out); 1214 return (tp->packets_out - tp->left_out + tp->retrans_out);
1156} 1215}
1157 1216
1158/*
1159 * Which congestion algorithim is in use on the connection.
1160 */
1161#define tcp_is_vegas(__tp) ((__tp)->adv_cong == TCP_VEGAS)
1162#define tcp_is_westwood(__tp) ((__tp)->adv_cong == TCP_WESTWOOD)
1163#define tcp_is_bic(__tp) ((__tp)->adv_cong == TCP_BIC)
1164
1165/* Recalculate snd_ssthresh, we want to set it to:
1166 *
1167 * Reno:
1168 * one half the current congestion window, but no
1169 * less than two segments
1170 *
1171 * BIC:
1172 * behave like Reno until low_window is reached,
1173 * then increase congestion window slowly
1174 */
1175static inline __u32 tcp_recalc_ssthresh(struct tcp_sock *tp)
1176{
1177 if (tcp_is_bic(tp)) {
1178 if (sysctl_tcp_bic_fast_convergence &&
1179 tp->snd_cwnd < tp->bictcp.last_max_cwnd)
1180 tp->bictcp.last_max_cwnd = (tp->snd_cwnd *
1181 (BICTCP_BETA_SCALE
1182 + sysctl_tcp_bic_beta))
1183 / (2 * BICTCP_BETA_SCALE);
1184 else
1185 tp->bictcp.last_max_cwnd = tp->snd_cwnd;
1186
1187 if (tp->snd_cwnd > sysctl_tcp_bic_low_window)
1188 return max((tp->snd_cwnd * sysctl_tcp_bic_beta)
1189 / BICTCP_BETA_SCALE, 2U);
1190 }
1191
1192 return max(tp->snd_cwnd >> 1U, 2U);
1193}
1194
1195/* Stop taking Vegas samples for now. */
1196#define tcp_vegas_disable(__tp) ((__tp)->vegas.doing_vegas_now = 0)
1197
1198static inline void tcp_vegas_enable(struct tcp_sock *tp)
1199{
1200 /* There are several situations when we must "re-start" Vegas:
1201 *
1202 * o when a connection is established
1203 * o after an RTO
1204 * o after fast recovery
1205 * o when we send a packet and there is no outstanding
1206 * unacknowledged data (restarting an idle connection)
1207 *
1208 * In these circumstances we cannot do a Vegas calculation at the
1209 * end of the first RTT, because any calculation we do is using
1210 * stale info -- both the saved cwnd and congestion feedback are
1211 * stale.
1212 *
1213 * Instead we must wait until the completion of an RTT during
1214 * which we actually receive ACKs.
1215 */
1216
1217 /* Begin taking Vegas samples next time we send something. */
1218 tp->vegas.doing_vegas_now = 1;
1219
1220 /* Set the beginning of the next send window. */
1221 tp->vegas.beg_snd_nxt = tp->snd_nxt;
1222
1223 tp->vegas.cntRTT = 0;
1224 tp->vegas.minRTT = 0x7fffffff;
1225}
1226
1227/* Should we be taking Vegas samples right now? */
1228#define tcp_vegas_enabled(__tp) ((__tp)->vegas.doing_vegas_now)
1229
1230extern void tcp_ca_init(struct tcp_sock *tp);
1231
1232static inline void tcp_set_ca_state(struct tcp_sock *tp, u8 ca_state)
1233{
1234 if (tcp_is_vegas(tp)) {
1235 if (ca_state == TCP_CA_Open)
1236 tcp_vegas_enable(tp);
1237 else
1238 tcp_vegas_disable(tp);
1239 }
1240 tp->ca_state = ca_state;
1241}
1242
1243/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. 1217/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
1244 * The exception is rate halving phase, when cwnd is decreasing towards 1218 * The exception is rate halving phase, when cwnd is decreasing towards
1245 * ssthresh. 1219 * ssthresh.
@@ -1262,33 +1236,11 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp)
1262 tp->left_out = tp->sacked_out + tp->lost_out; 1236 tp->left_out = tp->sacked_out + tp->lost_out;
1263} 1237}
1264 1238
1265extern void tcp_cwnd_application_limited(struct sock *sk); 1239/* Set slow start threshold and cwnd not falling to slow start */
1266
1267/* Congestion window validation. (RFC2861) */
1268
1269static inline void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp)
1270{
1271 __u32 packets_out = tp->packets_out;
1272
1273 if (packets_out >= tp->snd_cwnd) {
1274 /* Network is feed fully. */
1275 tp->snd_cwnd_used = 0;
1276 tp->snd_cwnd_stamp = tcp_time_stamp;
1277 } else {
1278 /* Network starves. */
1279 if (tp->packets_out > tp->snd_cwnd_used)
1280 tp->snd_cwnd_used = tp->packets_out;
1281
1282 if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto)
1283 tcp_cwnd_application_limited(sk);
1284 }
1285}
1286
1287/* Set slow start threshould and cwnd not falling to slow start */
1288static inline void __tcp_enter_cwr(struct tcp_sock *tp) 1240static inline void __tcp_enter_cwr(struct tcp_sock *tp)
1289{ 1241{
1290 tp->undo_marker = 0; 1242 tp->undo_marker = 0;
1291 tp->snd_ssthresh = tcp_recalc_ssthresh(tp); 1243 tp->snd_ssthresh = tp->ca_ops->ssthresh(tp);
1292 tp->snd_cwnd = min(tp->snd_cwnd, 1244 tp->snd_cwnd = min(tp->snd_cwnd,
1293 tcp_packets_in_flight(tp) + 1U); 1245 tcp_packets_in_flight(tp) + 1U);
1294 tp->snd_cwnd_cnt = 0; 1246 tp->snd_cwnd_cnt = 0;
@@ -1316,12 +1268,6 @@ static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp)
1316 return 3; 1268 return 3;
1317} 1269}
1318 1270
1319static __inline__ int tcp_minshall_check(const struct tcp_sock *tp)
1320{
1321 return after(tp->snd_sml,tp->snd_una) &&
1322 !after(tp->snd_sml, tp->snd_nxt);
1323}
1324
1325static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, 1271static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss,
1326 const struct sk_buff *skb) 1272 const struct sk_buff *skb)
1327{ 1273{
@@ -1329,122 +1275,18 @@ static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss,
1329 tp->snd_sml = TCP_SKB_CB(skb)->end_seq; 1275 tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
1330} 1276}
1331 1277
1332/* Return 0, if packet can be sent now without violation Nagle's rules:
1333 1. It is full sized.
1334 2. Or it contains FIN.
1335 3. Or TCP_NODELAY was set.
1336 4. Or TCP_CORK is not set, and all sent packets are ACKed.
1337 With Minshall's modification: all sent small packets are ACKed.
1338 */
1339
1340static __inline__ int
1341tcp_nagle_check(const struct tcp_sock *tp, const struct sk_buff *skb,
1342 unsigned mss_now, int nonagle)
1343{
1344 return (skb->len < mss_now &&
1345 !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) &&
1346 ((nonagle&TCP_NAGLE_CORK) ||
1347 (!nonagle &&
1348 tp->packets_out &&
1349 tcp_minshall_check(tp))));
1350}
1351
1352extern void tcp_set_skb_tso_segs(struct sock *, struct sk_buff *);
1353
1354/* This checks if the data bearing packet SKB (usually sk->sk_send_head)
1355 * should be put on the wire right now.
1356 */
1357static __inline__ int tcp_snd_test(struct sock *sk,
1358 struct sk_buff *skb,
1359 unsigned cur_mss, int nonagle)
1360{
1361 struct tcp_sock *tp = tcp_sk(sk);
1362 int pkts = tcp_skb_pcount(skb);
1363
1364 if (!pkts) {
1365 tcp_set_skb_tso_segs(sk, skb);
1366 pkts = tcp_skb_pcount(skb);
1367 }
1368
1369 /* RFC 1122 - section 4.2.3.4
1370 *
1371 * We must queue if
1372 *
1373 * a) The right edge of this frame exceeds the window
1374 * b) There are packets in flight and we have a small segment
1375 * [SWS avoidance and Nagle algorithm]
1376 * (part of SWS is done on packetization)
1377 * Minshall version sounds: there are no _small_
1378 * segments in flight. (tcp_nagle_check)
1379 * c) We have too many packets 'in flight'
1380 *
1381 * Don't use the nagle rule for urgent data (or
1382 * for the final FIN -DaveM).
1383 *
1384 * Also, Nagle rule does not apply to frames, which
1385 * sit in the middle of queue (they have no chances
1386 * to get new data) and if room at tail of skb is
1387 * not enough to save something seriously (<32 for now).
1388 */
1389
1390 /* Don't be strict about the congestion window for the
1391 * final FIN frame. -DaveM
1392 */
1393 return (((nonagle&TCP_NAGLE_PUSH) || tp->urg_mode
1394 || !tcp_nagle_check(tp, skb, cur_mss, nonagle)) &&
1395 (((tcp_packets_in_flight(tp) + (pkts-1)) < tp->snd_cwnd) ||
1396 (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)) &&
1397 !after(TCP_SKB_CB(skb)->end_seq, tp->snd_una + tp->snd_wnd));
1398}
1399
1400static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) 1278static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp)
1401{ 1279{
1402 if (!tp->packets_out && !tp->pending) 1280 if (!tp->packets_out && !tp->pending)
1403 tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto); 1281 tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto);
1404} 1282}
1405 1283
1406static __inline__ int tcp_skb_is_last(const struct sock *sk,
1407 const struct sk_buff *skb)
1408{
1409 return skb->next == (struct sk_buff *)&sk->sk_write_queue;
1410}
1411
1412/* Push out any pending frames which were held back due to
1413 * TCP_CORK or attempt at coalescing tiny packets.
1414 * The socket must be locked by the caller.
1415 */
1416static __inline__ void __tcp_push_pending_frames(struct sock *sk,
1417 struct tcp_sock *tp,
1418 unsigned cur_mss,
1419 int nonagle)
1420{
1421 struct sk_buff *skb = sk->sk_send_head;
1422
1423 if (skb) {
1424 if (!tcp_skb_is_last(sk, skb))
1425 nonagle = TCP_NAGLE_PUSH;
1426 if (!tcp_snd_test(sk, skb, cur_mss, nonagle) ||
1427 tcp_write_xmit(sk, nonagle))
1428 tcp_check_probe_timer(sk, tp);
1429 }
1430 tcp_cwnd_validate(sk, tp);
1431}
1432
1433static __inline__ void tcp_push_pending_frames(struct sock *sk, 1284static __inline__ void tcp_push_pending_frames(struct sock *sk,
1434 struct tcp_sock *tp) 1285 struct tcp_sock *tp)
1435{ 1286{
1436 __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle); 1287 __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle);
1437} 1288}
1438 1289
1439static __inline__ int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp)
1440{
1441 struct sk_buff *skb = sk->sk_send_head;
1442
1443 return (skb &&
1444 tcp_snd_test(sk, skb, tcp_current_mss(sk, 1),
1445 tcp_skb_is_last(sk, skb) ? TCP_NAGLE_PUSH : tp->nonagle));
1446}
1447
1448static __inline__ void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) 1290static __inline__ void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq)
1449{ 1291{
1450 tp->snd_wl1 = seq; 1292 tp->snd_wl1 = seq;
@@ -1876,52 +1718,4 @@ struct tcp_iter_state {
1876extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo); 1718extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo);
1877extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo); 1719extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo);
1878 1720
1879/* TCP Westwood functions and constants */
1880
1881#define TCP_WESTWOOD_INIT_RTT (20*HZ) /* maybe too conservative?! */
1882#define TCP_WESTWOOD_RTT_MIN (HZ/20) /* 50ms */
1883
1884static inline void tcp_westwood_update_rtt(struct tcp_sock *tp, __u32 rtt_seq)
1885{
1886 if (tcp_is_westwood(tp))
1887 tp->westwood.rtt = rtt_seq;
1888}
1889
1890static inline __u32 __tcp_westwood_bw_rttmin(const struct tcp_sock *tp)
1891{
1892 return max((tp->westwood.bw_est) * (tp->westwood.rtt_min) /
1893 (__u32) (tp->mss_cache_std),
1894 2U);
1895}
1896
1897static inline __u32 tcp_westwood_bw_rttmin(const struct tcp_sock *tp)
1898{
1899 return tcp_is_westwood(tp) ? __tcp_westwood_bw_rttmin(tp) : 0;
1900}
1901
1902static inline int tcp_westwood_ssthresh(struct tcp_sock *tp)
1903{
1904 __u32 ssthresh = 0;
1905
1906 if (tcp_is_westwood(tp)) {
1907 ssthresh = __tcp_westwood_bw_rttmin(tp);
1908 if (ssthresh)
1909 tp->snd_ssthresh = ssthresh;
1910 }
1911
1912 return (ssthresh != 0);
1913}
1914
1915static inline int tcp_westwood_cwnd(struct tcp_sock *tp)
1916{
1917 __u32 cwnd = 0;
1918
1919 if (tcp_is_westwood(tp)) {
1920 cwnd = __tcp_westwood_bw_rttmin(tp);
1921 if (cwnd)
1922 tp->snd_cwnd = cwnd;
1923 }
1924
1925 return (cwnd != 0);
1926}
1927#endif /* _TCP_H */ 1721#endif /* _TCP_H */
diff --git a/include/net/x25.h b/include/net/x25.h
index 7a1ba5bbb868..8b39b98876e8 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -79,6 +79,8 @@ enum {
79#define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */ 79#define X25_DEFAULT_PACKET_SIZE X25_PS128 /* Default Packet Size */
80#define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */ 80#define X25_DEFAULT_THROUGHPUT 0x0A /* Deafult Throughput */
81#define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */ 81#define X25_DEFAULT_REVERSE 0x00 /* Default Reverse Charging */
82#define X25_DENY_ACCPT_APPRV 0x01 /* Default value */
83#define X25_ALLOW_ACCPT_APPRV 0x00 /* Control enabled */
82 84
83#define X25_SMODULUS 8 85#define X25_SMODULUS 8
84#define X25_EMODULUS 128 86#define X25_EMODULUS 128
@@ -94,7 +96,7 @@ enum {
94#define X25_FAC_CLASS_C 0x80 96#define X25_FAC_CLASS_C 0x80
95#define X25_FAC_CLASS_D 0xC0 97#define X25_FAC_CLASS_D 0xC0
96 98
97#define X25_FAC_REVERSE 0x01 99#define X25_FAC_REVERSE 0x01 /* also fast select */
98#define X25_FAC_THROUGHPUT 0x02 100#define X25_FAC_THROUGHPUT 0x02
99#define X25_FAC_PACKET_SIZE 0x42 101#define X25_FAC_PACKET_SIZE 0x42
100#define X25_FAC_WINDOW_SIZE 0x43 102#define X25_FAC_WINDOW_SIZE 0x43
@@ -134,8 +136,8 @@ struct x25_sock {
134 struct sock sk; 136 struct sock sk;
135 struct x25_address source_addr, dest_addr; 137 struct x25_address source_addr, dest_addr;
136 struct x25_neigh *neighbour; 138 struct x25_neigh *neighbour;
137 unsigned int lci; 139 unsigned int lci, cudmatchlength;
138 unsigned char state, condition, qbitincl, intflag; 140 unsigned char state, condition, qbitincl, intflag, accptapprv;
139 unsigned short vs, vr, va, vl; 141 unsigned short vs, vr, va, vl;
140 unsigned long t2, t21, t22, t23; 142 unsigned long t2, t21, t22, t23;
141 unsigned short fraglen; 143 unsigned short fraglen;
@@ -242,7 +244,6 @@ extern int x25_validate_nr(struct sock *, unsigned short);
242extern void x25_write_internal(struct sock *, int); 244extern void x25_write_internal(struct sock *, int);
243extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, int *); 245extern int x25_decode(struct sock *, struct sk_buff *, int *, int *, int *, int *, int *);
244extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char); 246extern void x25_disconnect(struct sock *, int, unsigned char, unsigned char);
245extern int x25_check_calluserdata(struct x25_calluserdata *,struct x25_calluserdata *);
246 247
247/* x25_timer.c */ 248/* x25_timer.c */
248extern void x25_start_heartbeat(struct sock *); 249extern void x25_start_heartbeat(struct sock *);
diff --git a/include/net/x25device.h b/include/net/x25device.h
index cf36a20ea3c5..d45ae883bd1d 100644
--- a/include/net/x25device.h
+++ b/include/net/x25device.h
@@ -5,8 +5,7 @@
5#include <linux/if_packet.h> 5#include <linux/if_packet.h>
6#include <linux/skbuff.h> 6#include <linux/skbuff.h>
7 7
8static inline unsigned short x25_type_trans(struct sk_buff *skb, 8static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev)
9 struct net_device *dev)
10{ 9{
11 skb->mac.raw = skb->data; 10 skb->mac.raw = skb->data;
12 skb->input_dev = skb->dev = dev; 11 skb->input_dev = skb->dev = dev;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 029522a4ceda..868ef88ef971 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -803,7 +803,7 @@ struct xfrm_algo_desc {
803/* XFRM tunnel handlers. */ 803/* XFRM tunnel handlers. */
804struct xfrm_tunnel { 804struct xfrm_tunnel {
805 int (*handler)(struct sk_buff *skb); 805 int (*handler)(struct sk_buff *skb);
806 void (*err_handler)(struct sk_buff *skb, void *info); 806 void (*err_handler)(struct sk_buff *skb, __u32 info);
807}; 807};
808 808
809struct xfrm6_tunnel { 809struct xfrm6_tunnel {
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h
index 2000b43ece91..da19c297dd65 100644
--- a/include/pcmcia/ciscode.h
+++ b/include/pcmcia/ciscode.h
@@ -112,6 +112,8 @@
112 112
113#define MANFID_TDK 0x0105 113#define MANFID_TDK 0x0105
114#define PRODID_TDK_CF010 0x0900 114#define PRODID_TDK_CF010 0x0900
115#define PRODID_TDK_NP9610 0x0d0a
116#define PRODID_TDK_MN3200 0x0e0a
115#define PRODID_TDK_GN3410 0x4815 117#define PRODID_TDK_GN3410 0x4815
116 118
117#define MANFID_TOSHIBA 0x0098 119#define MANFID_TOSHIBA 0x0098
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 8d8643adc786..2cab39f49eb2 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -68,21 +68,9 @@ typedef struct adjust_t {
68#define RES_ALLOCATED 0x20 68#define RES_ALLOCATED 0x20
69#define RES_REMOVED 0x40 69#define RES_REMOVED 0x40
70 70
71typedef struct servinfo_t {
72 char Signature[2];
73 u_int Count;
74 u_int Revision;
75 u_int CSLevel;
76 char *VendorString;
77} servinfo_t;
78
79typedef struct event_callback_args_t { 71typedef struct event_callback_args_t {
80 client_handle_t client_handle; 72 struct pcmcia_device *client_handle;
81 void *info; 73 void *client_data;
82 void *mtdrequest;
83 void *buffer;
84 void *misc;
85 void *client_data;
86} event_callback_args_t; 74} event_callback_args_t;
87 75
88/* for GetConfigurationInfo */ 76/* for GetConfigurationInfo */
@@ -393,31 +381,29 @@ enum service {
393 381
394struct pcmcia_socket; 382struct pcmcia_socket;
395 383
396int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); 384int pcmcia_access_configuration_register(struct pcmcia_device *p_dev, conf_reg_t *reg);
397int pcmcia_deregister_client(client_handle_t handle); 385int pcmcia_deregister_client(struct pcmcia_device *p_dev);
398int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); 386int pcmcia_get_configuration_info(struct pcmcia_device *p_dev, config_info_t *config);
399int pcmcia_get_card_services_info(servinfo_t *info);
400int pcmcia_get_first_window(window_handle_t *win, win_req_t *req); 387int pcmcia_get_first_window(window_handle_t *win, win_req_t *req);
401int pcmcia_get_next_window(window_handle_t *win, win_req_t *req); 388int pcmcia_get_next_window(window_handle_t *win, win_req_t *req);
402int pcmcia_get_status(client_handle_t handle, cs_status_t *status); 389int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status);
403int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); 390int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
404int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); 391int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
405int pcmcia_modify_configuration(client_handle_t handle, modconf_t *mod); 392int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
406int pcmcia_register_client(client_handle_t *handle, client_reg_t *req); 393int pcmcia_register_client(client_handle_t *handle, client_reg_t *req);
407int pcmcia_release_configuration(client_handle_t handle); 394int pcmcia_release_configuration(struct pcmcia_device *p_dev);
408int pcmcia_release_io(client_handle_t handle, io_req_t *req); 395int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req);
409int pcmcia_release_irq(client_handle_t handle, irq_req_t *req); 396int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req);
410int pcmcia_release_window(window_handle_t win); 397int pcmcia_release_window(window_handle_t win);
411int pcmcia_request_configuration(client_handle_t handle, config_req_t *req); 398int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
412int pcmcia_request_io(client_handle_t handle, io_req_t *req); 399int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
413int pcmcia_request_irq(client_handle_t handle, irq_req_t *req); 400int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req);
414int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle_t *wh); 401int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh);
415int pcmcia_reset_card(client_handle_t handle, client_req_t *req); 402int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req);
416int pcmcia_suspend_card(struct pcmcia_socket *skt); 403int pcmcia_suspend_card(struct pcmcia_socket *skt);
417int pcmcia_resume_card(struct pcmcia_socket *skt); 404int pcmcia_resume_card(struct pcmcia_socket *skt);
418int pcmcia_eject_card(struct pcmcia_socket *skt); 405int pcmcia_eject_card(struct pcmcia_socket *skt);
419int pcmcia_insert_card(struct pcmcia_socket *skt); 406int pcmcia_insert_card(struct pcmcia_socket *skt);
420int pcmcia_report_error(client_handle_t handle, error_info_t *err);
421 407
422struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); 408struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt);
423void pcmcia_put_socket(struct pcmcia_socket *skt); 409void pcmcia_put_socket(struct pcmcia_socket *skt);
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index 7881d40aac8d..c1d1629fcd27 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -34,8 +34,8 @@ typedef u_int event_t;
34typedef u_char cisdata_t; 34typedef u_char cisdata_t;
35typedef u_short page_t; 35typedef u_short page_t;
36 36
37struct client_t; 37struct pcmcia_device;
38typedef struct client_t *client_handle_t; 38typedef struct pcmcia_device *client_handle_t;
39 39
40struct window_t; 40struct window_t;
41typedef struct window_t *window_handle_t; 41typedef struct window_t *window_handle_t;
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
new file mode 100644
index 000000000000..346d81ece287
--- /dev/null
+++ b/include/pcmcia/device_id.h
@@ -0,0 +1,249 @@
1/*
2 * Copyright (2003-2004) Dominik Brodowski <linux@brodo.de>
3 * David Woodhouse
4 *
5 * License: GPL v2
6 */
7
8#define PCMCIA_DEVICE_MANF_CARD(manf, card) { \
9 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
10 PCMCIA_DEV_ID_MATCH_CARD_ID, \
11 .manf_id = (manf), \
12 .card_id = (card), }
13
14#define PCMCIA_DEVICE_FUNC_ID(func) { \
15 .match_flags = PCMCIA_DEV_ID_MATCH_FUNC_ID, \
16 .func_id = (func), }
17
18#define PCMCIA_DEVICE_PROD_ID1(v1, vh1) { \
19 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1, \
20 .prod_id = { (v1), NULL, NULL, NULL }, \
21 .prod_id_hash = { (vh1), 0, 0, 0 }, }
22
23#define PCMCIA_DEVICE_PROD_ID2(v2, vh2) { \
24 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2, \
25 .prod_id = { NULL, (v2), NULL, NULL }, \
26 .prod_id_hash = { 0, (vh2), 0, 0 }, }
27
28#define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \
29 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
30 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
31 .prod_id = { (v1), (v2), NULL, NULL }, \
32 .prod_id_hash = { (vh1), (vh2), 0, 0 }, }
33
34#define PCMCIA_DEVICE_PROD_ID13(v1, v3, vh1, vh3) { \
35 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
36 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
37 .prod_id = { (v1), NULL, (v3), NULL }, \
38 .prod_id_hash = { (vh1), 0, (vh3), 0 }, }
39
40#define PCMCIA_DEVICE_PROD_ID14(v1, v4, vh1, vh4) { \
41 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
42 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
43 .prod_id = { (v1), NULL, NULL, (v4) }, \
44 .prod_id_hash = { (vh1), 0, 0, (vh4) }, }
45
46#define PCMCIA_DEVICE_PROD_ID123(v1, v2, v3, vh1, vh2, vh3) { \
47 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
48 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
49 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
50 .prod_id = { (v1), (v2), (v3), NULL },\
51 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, }
52
53#define PCMCIA_DEVICE_PROD_ID124(v1, v2, v4, vh1, vh2, vh4) { \
54 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
55 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
56 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
57 .prod_id = { (v1), (v2), NULL, (v4) }, \
58 .prod_id_hash = { (vh1), (vh2), 0, (vh4) }, }
59
60#define PCMCIA_DEVICE_PROD_ID134(v1, v3, v4, vh1, vh3, vh4) { \
61 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
62 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
63 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
64 .prod_id = { (v1), NULL, (v3), (v4) }, \
65 .prod_id_hash = { (vh1), 0, (vh3), (vh4) }, }
66
67#define PCMCIA_DEVICE_PROD_ID1234(v1, v2, v3, v4, vh1, vh2, vh3, vh4) { \
68 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
69 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
70 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
71 PCMCIA_DEV_ID_MATCH_PROD_ID4, \
72 .prod_id = { (v1), (v2), (v3), (v4) }, \
73 .prod_id_hash = { (vh1), (vh2), (vh3), (vh4) }, }
74
75
76/* multi-function devices */
77
78#define PCMCIA_MFC_DEVICE_MANF_CARD(mfc, manf, card) { \
79 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
80 PCMCIA_DEV_ID_MATCH_CARD_ID| \
81 PCMCIA_DEV_ID_MATCH_FUNCTION, \
82 .manf_id = (manf), \
83 .card_id = (card), \
84 .function = (mfc), }
85
86#define PCMCIA_MFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
87 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
88 PCMCIA_DEV_ID_MATCH_FUNCTION, \
89 .prod_id = { (v1), NULL, NULL, NULL }, \
90 .prod_id_hash = { (vh1), 0, 0, 0 }, \
91 .function = (mfc), }
92
93#define PCMCIA_MFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
94 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
95 PCMCIA_DEV_ID_MATCH_FUNCTION, \
96 .prod_id = { NULL, (v2), NULL, NULL }, \
97 .prod_id_hash = { 0, (vh2), 0, 0 }, \
98 .function = (mfc), }
99
100#define PCMCIA_MFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
101 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
102 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
103 PCMCIA_DEV_ID_MATCH_FUNCTION, \
104 .prod_id = { (v1), (v2), NULL, NULL }, \
105 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
106 .function = (mfc), }
107
108#define PCMCIA_MFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
109 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
110 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
111 PCMCIA_DEV_ID_MATCH_FUNCTION, \
112 .prod_id = { (v1), NULL, (v3), NULL }, \
113 .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
114 .function = (mfc), }
115
116#define PCMCIA_MFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
117 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
118 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
119 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
120 PCMCIA_DEV_ID_MATCH_FUNCTION, \
121 .prod_id = { (v1), (v2), (v3), NULL },\
122 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
123 .function = (mfc), }
124
125/* pseudo multi-function devices */
126
127#define PCMCIA_PFC_DEVICE_MANF_CARD(mfc, manf, card) { \
128 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
129 PCMCIA_DEV_ID_MATCH_CARD_ID| \
130 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
131 .manf_id = (manf), \
132 .card_id = (card), \
133 .device_no = (mfc), }
134
135#define PCMCIA_PFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \
136 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
137 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
138 .prod_id = { (v1), NULL, NULL, NULL }, \
139 .prod_id_hash = { (vh1), 0, 0, 0 }, \
140 .device_no = (mfc), }
141
142#define PCMCIA_PFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \
143 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \
144 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
145 .prod_id = { NULL, (v2), NULL, NULL }, \
146 .prod_id_hash = { 0, (vh2), 0, 0 }, \
147 .device_no = (mfc), }
148
149#define PCMCIA_PFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \
150 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
151 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
152 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
153 .prod_id = { (v1), (v2), NULL, NULL }, \
154 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
155 .device_no = (mfc), }
156
157#define PCMCIA_PFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \
158 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
159 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
160 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
161 .prod_id = { (v1), NULL, (v3), NULL }, \
162 .prod_id_hash = { (vh1), 0, (vh3), 0 }, \
163 .device_no = (mfc), }
164
165#define PCMCIA_PFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \
166 .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \
167 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
168 PCMCIA_DEV_ID_MATCH_PROD_ID3| \
169 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
170 .prod_id = { (v1), (v2), (v3), NULL },\
171 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
172 .device_no = (mfc), }
173
174/* cards needing a CIS override */
175
176#define PCMCIA_DEVICE_CIS_MANF_CARD(manf, card, _cisfile) { \
177 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
178 PCMCIA_DEV_ID_MATCH_MANF_ID| \
179 PCMCIA_DEV_ID_MATCH_CARD_ID, \
180 .manf_id = (manf), \
181 .card_id = (card), \
182 .cisfile = (_cisfile)}
183
184#define PCMCIA_DEVICE_CIS_PROD_ID12(v1, v2, vh1, vh2, _cisfile) { \
185 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
186 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
187 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
188 .prod_id = { (v1), (v2), NULL, NULL }, \
189 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
190 .cisfile = (_cisfile)}
191
192#define PCMCIA_DEVICE_CIS_PROD_ID123(v1, v2, v3, vh1, vh2, vh3, _cisfile) { \
193 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
194 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
195 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
196 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
197 .prod_id = { (v1), (v2), (v3), NULL },\
198 .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \
199 .cisfile = (_cisfile)}
200
201
202#define PCMCIA_DEVICE_CIS_PROD_ID2(v2, vh2, _cisfile) { \
203 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
204 PCMCIA_DEV_ID_MATCH_PROD_ID2, \
205 .prod_id = { NULL, (v2), NULL, NULL }, \
206 .prod_id_hash = { 0, (vh2), 0, 0 }, \
207 .cisfile = (_cisfile)}
208
209#define PCMCIA_PFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
210 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
211 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
212 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
213 PCMCIA_DEV_ID_MATCH_DEVICE_NO, \
214 .prod_id = { (v1), (v2), NULL, NULL }, \
215 .prod_id_hash = { (vh1), (vh2), 0, 0 },\
216 .device_no = (mfc), \
217 .cisfile = (_cisfile)}
218
219#define PCMCIA_MFC_DEVICE_CIS_MANF_CARD(mfc, manf, card, _cisfile) { \
220 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
221 PCMCIA_DEV_ID_MATCH_MANF_ID| \
222 PCMCIA_DEV_ID_MATCH_CARD_ID| \
223 PCMCIA_DEV_ID_MATCH_FUNCTION, \
224 .manf_id = (manf), \
225 .card_id = (card), \
226 .function = (mfc), \
227 .cisfile = (_cisfile)}
228
229#define PCMCIA_MFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \
230 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
231 PCMCIA_DEV_ID_MATCH_PROD_ID1| \
232 PCMCIA_DEV_ID_MATCH_PROD_ID2| \
233 PCMCIA_DEV_ID_MATCH_FUNCTION, \
234 .prod_id = { (v1), (v2), NULL, NULL }, \
235 .prod_id_hash = { (vh1), (vh2), 0, 0 }, \
236 .function = (mfc), \
237 .cisfile = (_cisfile)}
238
239#define PCMCIA_MFC_DEVICE_CIS_PROD_ID4(mfc, v4, vh4, _cisfile) { \
240 .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \
241 PCMCIA_DEV_ID_MATCH_PROD_ID4| \
242 PCMCIA_DEV_ID_MATCH_FUNCTION, \
243 .prod_id = { NULL, NULL, NULL, (v4) }, \
244 .prod_id_hash = { 0, 0, 0, (vh4) }, \
245 .function = (mfc), \
246 .cisfile = (_cisfile)}
247
248
249#define PCMCIA_DEVICE_NULL { .match_flags = 0, }
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 312fd958c901..b707a603351b 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -16,8 +16,13 @@
16#ifndef _LINUX_DS_H 16#ifndef _LINUX_DS_H
17#define _LINUX_DS_H 17#define _LINUX_DS_H
18 18
19#ifdef __KERNEL__
20#include <linux/mod_devicetable.h>
21#endif
22
19#include <pcmcia/bulkmem.h> 23#include <pcmcia/bulkmem.h>
20#include <pcmcia/cs_types.h> 24#include <pcmcia/cs_types.h>
25#include <pcmcia/device_id.h>
21 26
22typedef struct tuple_parse_t { 27typedef struct tuple_parse_t {
23 tuple_t tuple; 28 tuple_t tuple;
@@ -47,7 +52,6 @@ typedef struct mtd_info_t {
47} mtd_info_t; 52} mtd_info_t;
48 53
49typedef union ds_ioctl_arg_t { 54typedef union ds_ioctl_arg_t {
50 servinfo_t servinfo;
51 adjust_t adjust; 55 adjust_t adjust;
52 config_info_t config; 56 config_info_t config;
53 tuple_t tuple; 57 tuple_t tuple;
@@ -63,7 +67,6 @@ typedef union ds_ioctl_arg_t {
63 cisdump_t cisdump; 67 cisdump_t cisdump;
64} ds_ioctl_arg_t; 68} ds_ioctl_arg_t;
65 69
66#define DS_GET_CARD_SERVICES_INFO _IOR ('d', 1, servinfo_t)
67#define DS_ADJUST_RESOURCE_INFO _IOWR('d', 2, adjust_t) 70#define DS_ADJUST_RESOURCE_INFO _IOWR('d', 2, adjust_t)
68#define DS_GET_CONFIGURATION_INFO _IOWR('d', 3, config_info_t) 71#define DS_GET_CONFIGURATION_INFO _IOWR('d', 3, config_info_t)
69#define DS_GET_FIRST_TUPLE _IOWR('d', 4, tuple_t) 72#define DS_GET_FIRST_TUPLE _IOWR('d', 4, tuple_t)
@@ -129,12 +132,13 @@ typedef struct dev_link_t {
129 132
130struct pcmcia_socket; 133struct pcmcia_socket;
131 134
132extern struct bus_type pcmcia_bus_type;
133
134struct pcmcia_driver { 135struct pcmcia_driver {
135 dev_link_t *(*attach)(void); 136 dev_link_t *(*attach)(void);
137 int (*event) (event_t event, int priority,
138 event_callback_args_t *);
136 void (*detach)(dev_link_t *); 139 void (*detach)(dev_link_t *);
137 struct module *owner; 140 struct module *owner;
141 struct pcmcia_device_id *id_table;
138 struct device_driver drv; 142 struct device_driver drv;
139}; 143};
140 144
@@ -158,22 +162,16 @@ struct pcmcia_device {
158 /* deprecated, a cleaned up version will be moved into this 162 /* deprecated, a cleaned up version will be moved into this
159 struct soon */ 163 struct soon */
160 dev_link_t *instance; 164 dev_link_t *instance;
161 struct client_t { 165 event_callback_args_t event_callback_args;
162 u_short client_magic; 166 u_int state;
163 struct pcmcia_socket *Socket;
164 u_char Function;
165 u_int state;
166 event_t EventMask;
167 int (*event_handler) (event_t event, int priority,
168 event_callback_args_t *);
169 event_callback_args_t event_callback_args;
170 } client;
171 167
172 /* information about this device */ 168 /* information about this device */
173 u8 has_manf_id:1; 169 u8 has_manf_id:1;
174 u8 has_card_id:1; 170 u8 has_card_id:1;
175 u8 has_func_id:1; 171 u8 has_func_id:1;
176 u8 reserved:5; 172
173 u8 allow_func_id_match:1;
174 u8 reserved:4;
177 175
178 u8 func_id; 176 u8 func_id;
179 u16 manf_id; 177 u16 manf_id;
@@ -190,8 +188,8 @@ struct pcmcia_device {
190#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 188#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)
191#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) 189#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
192 190
193#define handle_to_pdev(handle) container_of(handle, struct pcmcia_device, client); 191#define handle_to_pdev(handle) (handle)
194#define handle_to_dev(handle) ((container_of(handle, struct pcmcia_device, client))->dev) 192#define handle_to_dev(handle) (handle->dev)
195 193
196/* error reporting */ 194/* error reporting */
197void cs_error(client_handle_t handle, int func, int ret); 195void cs_error(client_handle_t handle, int func, int ret);
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 6d3413a56708..0f7aacc33fe9 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -15,10 +15,12 @@
15#ifndef _LINUX_SS_H 15#ifndef _LINUX_SS_H
16#define _LINUX_SS_H 16#define _LINUX_SS_H
17 17
18#include <linux/config.h>
19#include <linux/device.h>
20
18#include <pcmcia/cs_types.h> 21#include <pcmcia/cs_types.h>
19#include <pcmcia/cs.h> 22#include <pcmcia/cs.h>
20#include <pcmcia/bulkmem.h> 23#include <pcmcia/bulkmem.h>
21#include <linux/device.h>
22 24
23/* Definitions for card status flags for GetStatus */ 25/* Definitions for card status flags for GetStatus */
24#define SS_WRPROT 0x0001 26#define SS_WRPROT 0x0001
@@ -77,6 +79,11 @@ extern socket_state_t dead_socket;
77/* Use this just for bridge windows */ 79/* Use this just for bridge windows */
78#define MAP_IOSPACE 0x20 80#define MAP_IOSPACE 0x20
79 81
82/* power hook operations */
83#define HOOK_POWER_PRE 0x01
84#define HOOK_POWER_POST 0x02
85
86
80typedef struct pccard_io_map { 87typedef struct pccard_io_map {
81 u_char map; 88 u_char map;
82 u_char flags; 89 u_char flags;
@@ -166,7 +173,7 @@ typedef struct window_t {
166 173
167struct config_t; 174struct config_t;
168struct pcmcia_callback; 175struct pcmcia_callback;
169 176struct user_info_t;
170 177
171struct pcmcia_socket { 178struct pcmcia_socket {
172 struct module *owner; 179 struct module *owner;
@@ -211,8 +218,9 @@ struct pcmcia_socket {
211 218
212 /* is set to one if resource setup is done using adjust_resource_info() */ 219 /* is set to one if resource setup is done using adjust_resource_info() */
213 u8 resource_setup_old:1; 220 u8 resource_setup_old:1;
221 u8 resource_setup_new:1;
214 222
215 u8 reserved:6; 223 u8 reserved:5;
216 224
217 /* socket operations */ 225 /* socket operations */
218 struct pccard_operations * ops; 226 struct pccard_operations * ops;
@@ -222,6 +230,9 @@ struct pcmcia_socket {
222 /* Zoom video behaviour is so chip specific its not worth adding 230 /* Zoom video behaviour is so chip specific its not worth adding
223 this to _ops */ 231 this to _ops */
224 void (*zoom_video)(struct pcmcia_socket *, int); 232 void (*zoom_video)(struct pcmcia_socket *, int);
233
234 /* so is power hook */
235 int (*power_hook)(struct pcmcia_socket *sock, int operation);
225 236
226 /* state thread */ 237 /* state thread */
227 struct semaphore skt_sem; /* protects socket h/w state */ 238 struct semaphore skt_sem; /* protects socket h/w state */
@@ -233,9 +244,32 @@ struct pcmcia_socket {
233 unsigned int thread_events; 244 unsigned int thread_events;
234 245
235 /* pcmcia (16-bit) */ 246 /* pcmcia (16-bit) */
236 struct pcmcia_bus_socket *pcmcia;
237 struct pcmcia_callback *callback; 247 struct pcmcia_callback *callback;
238 248
249#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE)
250 struct list_head devices_list; /* PCMCIA devices */
251 u8 device_count; /* the number of devices, used
252 * only internally and subject
253 * to incorrectness and change */
254
255 struct {
256 u8 present:1, /* PCMCIA card is present in socket */
257 busy:1, /* "master" ioctl is used */
258 dead:1, /* pcmcia module is being unloaded */
259 device_add_pending:1, /* a pseudo-multifunction-device
260 * add event is pending */
261 reserved:4;
262 } pcmcia_state;
263
264 struct work_struct device_add; /* for adding further pseudo-multifunction
265 * devices */
266
267#ifdef CONFIG_PCMCIA_IOCTL
268 struct user_info_t *user;
269 wait_queue_head_t queue;
270#endif
271#endif
272
239 /* cardbus (32-bit) */ 273 /* cardbus (32-bit) */
240#ifdef CONFIG_CARDBUS 274#ifdef CONFIG_CARDBUS
241 struct resource * cb_cis_res; 275 struct resource * cb_cis_res;
diff --git a/include/pcmcia/version.h b/include/pcmcia/version.h
index eb88263fc8d5..5ad9c5e198b6 100644
--- a/include/pcmcia/version.h
+++ b/include/pcmcia/version.h
@@ -1,4 +1,3 @@
1/* version.h 1.94 2000/10/03 17:55:48 (David Hinds) */ 1/* version.h 1.94 2000/10/03 17:55:48 (David Hinds) */
2 2
3#define CS_RELEASE "3.1.22" 3/* This file will be removed, please don't include it */
4#define CS_RELEASE_CODE 0x3116
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 1fb233741513..b361172b576c 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -28,7 +28,7 @@ extern const unsigned char scsi_command_size[8];
28 * SCSI device types 28 * SCSI device types
29 */ 29 */
30 30
31#define MAX_SCSI_DEVICE_CODE 14 31#define MAX_SCSI_DEVICE_CODE 15
32extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE]; 32extern const char *const scsi_device_types[MAX_SCSI_DEVICE_CODE];
33 33
34/* 34/*
@@ -211,8 +211,8 @@ static inline int scsi_status_is_good(int status)
211 * - treated as TYPE_DISK */ 211 * - treated as TYPE_DISK */
212#define TYPE_MEDIUM_CHANGER 0x08 212#define TYPE_MEDIUM_CHANGER 0x08
213#define TYPE_COMM 0x09 /* Communications device */ 213#define TYPE_COMM 0x09 /* Communications device */
214#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
215#define TYPE_RAID 0x0c 214#define TYPE_RAID 0x0c
215#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
216#define TYPE_RBC 0x0e 216#define TYPE_RBC 0x0e
217#define TYPE_NO_LUN 0x7f 217#define TYPE_NO_LUN 0x7f
218 218
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 07f5c699eaa7..9957f16dcc5d 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -31,14 +31,11 @@ struct scsi_cmnd {
31 int sc_magic; 31 int sc_magic;
32 32
33 struct scsi_device *device; 33 struct scsi_device *device;
34 unsigned short state;
35 unsigned short owner;
36 struct scsi_request *sc_request; 34 struct scsi_request *sc_request;
37 35
38 struct list_head list; /* scsi_cmnd participates in queue lists */ 36 struct list_head list; /* scsi_cmnd participates in queue lists */
39 37
40 struct list_head eh_entry; /* entry for the host eh_cmd_q */ 38 struct list_head eh_entry; /* entry for the host eh_cmd_q */
41 int eh_state; /* Used for state tracking in error handlr */
42 int eh_eflags; /* Used by error handlr */ 39 int eh_eflags; /* Used by error handlr */
43 void (*done) (struct scsi_cmnd *); /* Mid-level done function */ 40 void (*done) (struct scsi_cmnd *); /* Mid-level done function */
44 41
@@ -80,8 +77,6 @@ struct scsi_cmnd {
80 * sense info */ 77 * sense info */
81 unsigned short use_sg; /* Number of pieces of scatter-gather */ 78 unsigned short use_sg; /* Number of pieces of scatter-gather */
82 unsigned short sglist_len; /* size of malloc'd scatter-gather list */ 79 unsigned short sglist_len; /* size of malloc'd scatter-gather list */
83 unsigned short abort_reason; /* If the mid-level code requests an
84 * abort, this is the reason. */
85 unsigned bufflen; /* Size of data buffer */ 80 unsigned bufflen; /* Size of data buffer */
86 void *buffer; /* Data buffer */ 81 void *buffer; /* Data buffer */
87 82
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 63c91dd85ca1..835af8ecbb7c 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -9,7 +9,7 @@
9struct request_queue; 9struct request_queue;
10struct scsi_cmnd; 10struct scsi_cmnd;
11struct scsi_mode_data; 11struct scsi_mode_data;
12 12struct scsi_lun;
13 13
14/* 14/*
15 * sdev state: If you alter this, you also need to alter scsi_sysfs.c 15 * sdev state: If you alter this, you also need to alter scsi_sysfs.c
@@ -243,6 +243,7 @@ extern void scsi_target_reap(struct scsi_target *);
243extern void scsi_target_block(struct device *); 243extern void scsi_target_block(struct device *);
244extern void scsi_target_unblock(struct device *); 244extern void scsi_target_unblock(struct device *);
245extern void scsi_remove_target(struct device *); 245extern void scsi_remove_target(struct device *);
246extern void int_to_scsilun(unsigned int, struct scsi_lun *);
246extern const char *scsi_device_state_name(enum scsi_device_state); 247extern const char *scsi_device_state_name(enum scsi_device_state);
247extern int scsi_is_sdev_device(const struct device *); 248extern int scsi_is_sdev_device(const struct device *);
248extern int scsi_is_target_device(const struct device *); 249extern int scsi_is_target_device(const struct device *);
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index db9914adeac9..81d5234f6771 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -641,12 +641,6 @@ static inline void scsi_assign_lock(struct Scsi_Host *shost, spinlock_t *lock)
641 shost->host_lock = lock; 641 shost->host_lock = lock;
642} 642}
643 643
644static inline void scsi_set_device(struct Scsi_Host *shost,
645 struct device *dev)
646{
647 shost->shost_gendev.parent = dev;
648}
649
650static inline struct device *scsi_get_device(struct Scsi_Host *shost) 644static inline struct device *scsi_get_device(struct Scsi_Host *shost)
651{ 645{
652 return shost->shost_gendev.parent; 646 return shost->shost_gendev.parent;
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index a4f1837a33b1..f6e0bb484c63 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -29,6 +29,14 @@ struct scsi_transport_template {
29 struct transport_container target_attrs; 29 struct transport_container target_attrs;
30 struct transport_container device_attrs; 30 struct transport_container device_attrs;
31 31
32 /*
33 * If set, call target_parent prior to allocating a scsi_target,
34 * so we get the appropriate parent for the target. This function
35 * is required for transports like FC and iSCSI that do not put the
36 * scsi_target under scsi_host.
37 */
38 struct device *(*target_parent)(struct Scsi_Host *, int, uint);
39
32 /* The size of the specific transport attribute structure (a 40 /* The size of the specific transport attribute structure (a
33 * space of this size will be left at the end of the 41 * space of this size will be left at the end of the
34 * scsi_* structure */ 42 * scsi_* structure */
diff --git a/include/scsi/sg_request.h b/include/scsi/sg_request.h
new file mode 100644
index 000000000000..57ff525bdd3b
--- /dev/null
+++ b/include/scsi/sg_request.h
@@ -0,0 +1,26 @@
1typedef struct scsi_request Scsi_Request;
2
3static Scsi_Request *dummy_cmdp; /* only used for sizeof */
4
5typedef struct sg_scatter_hold { /* holding area for scsi scatter gather info */
6 unsigned short k_use_sg; /* Count of kernel scatter-gather pieces */
7 unsigned short sglist_len; /* size of malloc'd scatter-gather list ++ */
8 unsigned bufflen; /* Size of (aggregate) data buffer */
9 unsigned b_malloc_len; /* actual len malloc'ed in buffer */
10 void *buffer; /* Data buffer or scatter list (k_use_sg>0) */
11 char dio_in_use; /* 0->indirect IO (or mmap), 1->dio */
12 unsigned char cmd_opcode; /* first byte of command */
13} Sg_scatter_hold;
14
15typedef struct sg_request { /* SG_MAX_QUEUE requests outstanding per file */
16 Scsi_Request *my_cmdp; /* != 0 when request with lower levels */
17 struct sg_request *nextrp; /* NULL -> tail request (slist) */
18 struct sg_fd *parentfp; /* NULL -> not in use */
19 Sg_scatter_hold data; /* hold buffer, perhaps scatter list */
20 sg_io_hdr_t header; /* scsi command+info, see <scsi/sg.h> */
21 unsigned char sense_b[sizeof (dummy_cmdp->sr_sense_buffer)];
22 char res_used; /* 1 -> using reserve buffer, 0 -> not ... */
23 char orphan; /* 1 -> drop on sight, 0 -> normal */
24 char sg_io_owned; /* 1 -> packet belongs to SG_IO */
25 volatile char done; /* 0->before bh, 1->before read, 2->read */
26} Sg_request;
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 2433e279e071..1309c12b8f71 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -437,6 +437,7 @@ struct snd_ac97_build_ops {
437 void (*suspend) (ac97_t *ac97); 437 void (*suspend) (ac97_t *ac97);
438 void (*resume) (ac97_t *ac97); 438 void (*resume) (ac97_t *ac97);
439#endif 439#endif
440 void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */
440}; 441};
441 442
442struct _snd_ac97_bus_ops { 443struct _snd_ac97_bus_ops {
@@ -516,6 +517,9 @@ struct _snd_ac97 {
516 } ad18xx; 517 } ad18xx;
517 unsigned int dev_flags; /* device specific */ 518 unsigned int dev_flags; /* device specific */
518 } spec; 519 } spec;
520 /* jack-sharing info */
521 unsigned char indep_surround;
522 unsigned char channel_mode;
519}; 523};
520 524
521/* conditions */ 525/* conditions */
@@ -569,8 +573,8 @@ enum {
569}; 573};
570 574
571struct ac97_quirk { 575struct ac97_quirk {
572 unsigned short vendor; /* PCI vendor id */ 576 unsigned short subvendor; /* PCI subsystem vendor id */
573 unsigned short device; /* PCI device id */ 577 unsigned short subdevice; /* PCI sybsystem device id */
574 unsigned short mask; /* device id bit mask, 0 = accept all */ 578 unsigned short mask; /* device id bit mask, 0 = accept all */
575 unsigned int codec_id; /* codec id (if any), 0 = accept all */ 579 unsigned int codec_id; /* codec id (if any), 0 = accept all */
576 const char *name; /* name shown as info */ 580 const char *name; /* name shown as info */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index a4d149f34541..9974f83cca44 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -113,9 +113,10 @@ enum sndrv_hwdep_iface {
113 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */ 113 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
114 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */ 114 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
115 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */ 115 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
116 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
116 117
117 /* Don't forget to change the following: */ 118 /* Don't forget to change the following: */
118 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_PCXHR 119 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
119}; 120};
120 121
121struct sndrv_hwdep_info { 122struct sndrv_hwdep_info {
@@ -344,7 +345,7 @@ enum sndrv_pcm_hw_param {
344 SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME 345 SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME
345}; 346};
346 347
347#define SNDRV_PCM_HW_PARAMS_RUNTIME (1<<0) 348#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
348 349
349struct sndrv_interval { 350struct sndrv_interval {
350 unsigned int min, max; 351 unsigned int min, max;
@@ -559,7 +560,7 @@ enum {
559 * Timer section - /dev/snd/timer 560 * Timer section - /dev/snd/timer
560 */ 561 */
561 562
562#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 2) 563#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4)
563 564
564enum sndrv_timer_class { 565enum sndrv_timer_class {
565 SNDRV_TIMER_CLASS_NONE = -1, 566 SNDRV_TIMER_CLASS_NONE = -1,
@@ -672,10 +673,11 @@ enum {
672 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), 673 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info),
673 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), 674 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params),
674 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), 675 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status),
675 SNDRV_TIMER_IOCTL_START = _IO('T', 0x20), 676 /* The following four ioctls are changed since 1.0.9 due to confliction */
676 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0x21), 677 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0),
677 SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0x22), 678 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1),
678 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0x23), 679 SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0xa2),
680 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3),
679}; 681};
680 682
681struct sndrv_timer_read { 683struct sndrv_timer_read {
diff --git a/include/sound/control.h b/include/sound/control.h
index 7b9444cd02f4..ef7903c7a327 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -106,7 +106,7 @@ typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card,
106void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); 106void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id);
107 107
108snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access); 108snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access);
109snd_kcontrol_t *snd_ctl_new1(snd_kcontrol_new_t * kcontrolnew, void * private_data); 109snd_kcontrol_t *snd_ctl_new1(const snd_kcontrol_new_t * kcontrolnew, void * private_data);
110void snd_ctl_free_one(snd_kcontrol_t * kcontrol); 110void snd_ctl_free_one(snd_kcontrol_t * kcontrol);
111int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); 111int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol);
112int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol); 112int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol);
diff --git a/include/sound/core.h b/include/sound/core.h
index 9117c23e3a01..f72b3ef515e2 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -126,25 +126,26 @@ struct snd_monitor_file {
126 struct snd_monitor_file *next; 126 struct snd_monitor_file *next;
127}; 127};
128 128
129struct snd_shutdown_f_ops; /* define it later */ 129struct snd_shutdown_f_ops; /* define it later in init.c */
130 130
131/* main structure for soundcard */ 131/* main structure for soundcard */
132 132
133struct _snd_card { 133struct _snd_card {
134 int number; /* number of soundcard (index to snd_cards) */ 134 int number; /* number of soundcard (index to
135 snd_cards) */
135 136
136 char id[16]; /* id string of this card */ 137 char id[16]; /* id string of this card */
137 char driver[16]; /* driver name */ 138 char driver[16]; /* driver name */
138 char shortname[32]; /* short name of this soundcard */ 139 char shortname[32]; /* short name of this soundcard */
139 char longname[80]; /* name of this soundcard */ 140 char longname[80]; /* name of this soundcard */
140 char mixername[80]; /* mixer name */ 141 char mixername[80]; /* mixer name */
141 char components[80]; /* card components delimited with space */ 142 char components[80]; /* card components delimited with
142 143 space */
143 struct module *module; /* top-level module */ 144 struct module *module; /* top-level module */
144 145
145 void *private_data; /* private data for soundcard */ 146 void *private_data; /* private data for soundcard */
146 void (*private_free) (snd_card_t *card); /* callback for freeing of private data */ 147 void (*private_free) (snd_card_t *card); /* callback for freeing of
147 148 private data */
148 struct list_head devices; /* devices */ 149 struct list_head devices; /* devices */
149 150
150 unsigned int last_numid; /* last used numeric ID */ 151 unsigned int last_numid; /* last used numeric ID */
@@ -160,7 +161,8 @@ struct _snd_card {
160 struct proc_dir_entry *proc_root_link; /* number link to real id */ 161 struct proc_dir_entry *proc_root_link; /* number link to real id */
161 162
162 struct snd_monitor_file *files; /* all files associated to this card */ 163 struct snd_monitor_file *files; /* all files associated to this card */
163 struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown state */ 164 struct snd_shutdown_f_ops *s_f_ops; /* file operations in the shutdown
165 state */
164 spinlock_t files_lock; /* lock the files for this card */ 166 spinlock_t files_lock; /* lock the files for this card */
165 int shutdown; /* this card is going down */ 167 int shutdown; /* this card is going down */
166 wait_queue_head_t shutdown_sleep; 168 wait_queue_head_t shutdown_sleep;
@@ -196,8 +198,6 @@ static inline void snd_power_unlock(snd_card_t *card)
196 up(&card->power_lock); 198 up(&card->power_lock);
197} 199}
198 200
199int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file);
200
201static inline unsigned int snd_power_get_state(snd_card_t *card) 201static inline unsigned int snd_power_get_state(snd_card_t *card)
202{ 202{
203 return card->power_state; 203 return card->power_state;
@@ -208,6 +208,10 @@ static inline void snd_power_change_state(snd_card_t *card, unsigned int state)
208 card->power_state = state; 208 card->power_state = state;
209 wake_up(&card->power_sleep); 209 wake_up(&card->power_sleep);
210} 210}
211
212/* init.c */
213int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file);
214
211int snd_card_set_pm_callback(snd_card_t *card, 215int snd_card_set_pm_callback(snd_card_t *card,
212 int (*suspend)(snd_card_t *, pm_message_t), 216 int (*suspend)(snd_card_t *, pm_message_t),
213 int (*resume)(snd_card_t *), 217 int (*resume)(snd_card_t *),
@@ -238,15 +242,14 @@ static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct fi
238 242
239#endif /* CONFIG_PM */ 243#endif /* CONFIG_PM */
240 244
241/* device.c */
242
243struct _snd_minor { 245struct _snd_minor {
244 struct list_head list; /* list of all minors per card */ 246 struct list_head list; /* list of all minors per card */
245 int number; /* minor number */ 247 int number; /* minor number */
246 int device; /* device number */ 248 int device; /* device number */
247 const char *comment; /* for /proc/asound/devices */ 249 const char *comment; /* for /proc/asound/devices */
248 struct file_operations *f_ops; /* file operations */ 250 struct file_operations *f_ops; /* file operations */
249 char name[0]; /* device name (keep at the end of structure) */ 251 char name[0]; /* device name (keep at the end of
252 structure) */
250}; 253};
251 254
252typedef struct _snd_minor snd_minor_t; 255typedef struct _snd_minor snd_minor_t;
@@ -287,11 +290,12 @@ void snd_memory_init(void);
287void snd_memory_done(void); 290void snd_memory_done(void);
288int snd_memory_info_init(void); 291int snd_memory_info_init(void);
289int snd_memory_info_done(void); 292int snd_memory_info_done(void);
290void *snd_hidden_kmalloc(size_t size, int flags); 293void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags);
291void *snd_hidden_kcalloc(size_t n, size_t size, int flags); 294void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags);
292void snd_hidden_kfree(const void *obj); 295void snd_hidden_kfree(const void *obj);
293void *snd_hidden_vmalloc(unsigned long size); 296void *snd_hidden_vmalloc(unsigned long size);
294void snd_hidden_vfree(void *obj); 297void snd_hidden_vfree(void *obj);
298char *snd_hidden_kstrdup(const char *s, unsigned int __nocast flags);
295#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags) 299#define kmalloc(size, flags) snd_hidden_kmalloc(size, flags)
296#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags) 300#define kcalloc(n, size, flags) snd_hidden_kcalloc(n, size, flags)
297#define kfree(obj) snd_hidden_kfree(obj) 301#define kfree(obj) snd_hidden_kfree(obj)
@@ -301,6 +305,7 @@ void snd_hidden_vfree(void *obj);
301#define vmalloc_nocheck(size) snd_wrapper_vmalloc(size) 305#define vmalloc_nocheck(size) snd_wrapper_vmalloc(size)
302#define kfree_nocheck(obj) snd_wrapper_kfree(obj) 306#define kfree_nocheck(obj) snd_wrapper_kfree(obj)
303#define vfree_nocheck(obj) snd_wrapper_vfree(obj) 307#define vfree_nocheck(obj) snd_wrapper_vfree(obj)
308#define kstrdup(s, flags) snd_hidden_kstrdup(s, flags)
304#else 309#else
305#define snd_memory_init() /*NOP*/ 310#define snd_memory_init() /*NOP*/
306#define snd_memory_done() /*NOP*/ 311#define snd_memory_done() /*NOP*/
@@ -311,7 +316,6 @@ void snd_hidden_vfree(void *obj);
311#define kfree_nocheck(obj) kfree(obj) 316#define kfree_nocheck(obj) kfree(obj)
312#define vfree_nocheck(obj) vfree(obj) 317#define vfree_nocheck(obj) vfree(obj)
313#endif 318#endif
314char *snd_kmalloc_strdup(const char *string, int flags);
315int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count); 319int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count);
316int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count); 320int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count);
317 321
@@ -356,11 +360,13 @@ int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd);
356 360
357/* isadma.c */ 361/* isadma.c */
358 362
363#ifdef CONFIG_ISA_DMA_API
359#define DMA_MODE_NO_ENABLE 0x0100 364#define DMA_MODE_NO_ENABLE 0x0100
360 365
361void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode); 366void snd_dma_program(unsigned long dma, unsigned long addr, unsigned int size, unsigned short mode);
362void snd_dma_disable(unsigned long dma); 367void snd_dma_disable(unsigned long dma);
363unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); 368unsigned int snd_dma_pointer(unsigned long dma, unsigned int size);
369#endif
364 370
365/* misc.c */ 371/* misc.c */
366 372
@@ -410,7 +416,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
410 printk(fmt ,##args) 416 printk(fmt ,##args)
411#endif 417#endif
412/** 418/**
413 * snd_assert - run-time assersion macro 419 * snd_assert - run-time assertion macro
414 * @expr: expression 420 * @expr: expression
415 * @args...: the action 421 * @args...: the action
416 * 422 *
@@ -426,7 +432,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
426 }\ 432 }\
427} while (0) 433} while (0)
428/** 434/**
429 * snd_runtime_check - run-time assersion macro 435 * snd_runtime_check - run-time assertion macro
430 * @expr: expression 436 * @expr: expression
431 * @args...: the action 437 * @args...: the action
432 * 438 *
diff --git a/include/sound/driver.h b/include/sound/driver.h
index 948e9a1aebef..0d12456ec3ae 100644
--- a/include/sound/driver.h
+++ b/include/sound/driver.h
@@ -51,7 +51,7 @@
51#ifdef CONFIG_SND_DEBUG_MEMORY 51#ifdef CONFIG_SND_DEBUG_MEMORY
52#include <linux/slab.h> 52#include <linux/slab.h>
53#include <linux/vmalloc.h> 53#include <linux/vmalloc.h>
54void *snd_wrapper_kmalloc(size_t, int); 54void *snd_wrapper_kmalloc(size_t, unsigned int __nocast);
55#undef kmalloc 55#undef kmalloc
56void snd_wrapper_kfree(const void *); 56void snd_wrapper_kfree(const void *);
57#undef kfree 57#undef kfree
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 43b6786abae5..c2ef3f023687 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -83,7 +83,8 @@
83#define IPR 0x08 /* Global interrupt pending register */ 83#define IPR 0x08 /* Global interrupt pending register */
84 /* Clear pending interrupts by writing a 1 to */ 84 /* Clear pending interrupts by writing a 1 to */
85 /* the relevant bits and zero to the other bits */ 85 /* the relevant bits and zero to the other bits */
86 86#define IPR_P16V 0x80000000 /* Bit set when the CA0151 P16V chip wishes
87 to interrupt */
87#define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure 88#define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure
88 which INTE bits enable it) */ 89 which INTE bits enable it) */
89 90
@@ -746,6 +747,7 @@
746 /* Assumes sample lock */ 747 /* Assumes sample lock */
747 748
748/* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */ 749/* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */
750#define SRCS_SPDIFVALID 0x04000000 /* SPDIF stream valid */
749#define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */ 751#define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */
750#define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ 752#define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */
751#define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */ 753#define SRCS_ESTSAMPLERATE 0x0007ffff /* Do not modify this field. */
@@ -803,10 +805,26 @@
803#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */ 805#define A_FXWC2 0x75 /* Selects 0x9f-0x80 for FX recording */
804 806
805#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ 807#define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */
806#define A_SPDIF_RATE_MASK 0x000000c0 808#define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */
809#define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */
810#define A_SAMPLE_RATE_UNKNOWN 0xf0030001 /* Bits that can be set, but have unknown use. */
811#define A_SPDIF_RATE_MASK 0x000000e0 /* Any other values for rates, just use 48000 */
807#define A_SPDIF_48000 0x00000000 812#define A_SPDIF_48000 0x00000000
808#define A_SPDIF_44100 0x00000080 813#define A_SPDIF_192000 0x00000020
809#define A_SPDIF_96000 0x00000040 814#define A_SPDIF_96000 0x00000040
815#define A_SPDIF_44100 0x00000080
816
817#define A_I2S_CAPTURE_RATE_MASK 0x00000e00 /* This sets the capture PCM rate, but it is */
818#define A_I2S_CAPTURE_48000 0x00000000 /* unclear if this sets the ADC rate as well. */
819#define A_I2S_CAPTURE_192000 0x00000200
820#define A_I2S_CAPTURE_96000 0x00000400
821#define A_I2S_CAPTURE_44100 0x00000800
822
823#define A_PCM_RATE_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */
824#define A_PCM_48000 0x00000000
825#define A_PCM_192000 0x00002000
826#define A_PCM_96000 0x00004000
827#define A_PCM_44100 0x00008000
810 828
811/* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ 829/* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */
812/* 0x7a, 0x7b - lookup tables */ 830/* 0x7a, 0x7b - lookup tables */
@@ -1039,28 +1057,28 @@ typedef struct {
1039 u32 vendor; 1057 u32 vendor;
1040 u32 device; 1058 u32 device;
1041 u32 subsystem; 1059 u32 subsystem;
1060 unsigned char revision;
1042 unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ 1061 unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */
1043 unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ 1062 unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */
1044 unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ 1063 unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */
1045 unsigned char ca0108_chip; /* Audigy 2 Value */ 1064 unsigned char ca0108_chip; /* Audigy 2 Value */
1046 unsigned char ca0151_chip; /* P16V */ 1065 unsigned char ca0151_chip; /* P16V */
1047 unsigned char spk71; /* Has 7.1 speakers */ 1066 unsigned char spk71; /* Has 7.1 speakers */
1067 unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */
1048 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1068 unsigned char spdif_bug; /* Has Spdif phasing bug */
1049 unsigned char ac97_chip; /* Has an AC97 chip */ 1069 unsigned char ac97_chip; /* Has an AC97 chip */
1050 unsigned char ecard; /* APS EEPROM */ 1070 unsigned char ecard; /* APS EEPROM */
1051 char * driver; 1071 const char *driver;
1052 char * name; 1072 const char *name;
1073 const char *id; /* for backward compatibility - can be NULL if not needed */
1053} emu_chip_details_t; 1074} emu_chip_details_t;
1054 1075
1055struct _snd_emu10k1 { 1076struct _snd_emu10k1 {
1056 int irq; 1077 int irq;
1057 1078
1058 unsigned long port; /* I/O port number */ 1079 unsigned long port; /* I/O port number */
1059 unsigned int APS: 1, /* APS flag */ 1080 unsigned int tos_link: 1, /* tos link detected */
1060 no_ac97: 1, /* no AC'97 */ 1081 rear_ac97: 1; /* rear channels are on AC'97 */
1061 tos_link: 1, /* tos link detected */
1062 rear_ac97: 1, /* rear channels are on AC'97 */
1063 spk71:1; /* 7.1 configuration (Audigy 2 ZS) */
1064 const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ 1082 const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */
1065 unsigned int audigy; /* is Audigy? */ 1083 unsigned int audigy; /* is Audigy? */
1066 unsigned int revision; /* chip revision */ 1084 unsigned int revision; /* chip revision */
@@ -1109,7 +1127,10 @@ struct _snd_emu10k1 {
1109 1127
1110 emu10k1_voice_t voices[NUM_G]; 1128 emu10k1_voice_t voices[NUM_G];
1111 emu10k1_voice_t p16v_voices[4]; 1129 emu10k1_voice_t p16v_voices[4];
1130 emu10k1_voice_t p16v_capture_voice;
1112 int p16v_device_offset; 1131 int p16v_device_offset;
1132 u32 p16v_capture_source;
1133 u32 p16v_capture_channel;
1113 emu10k1_pcm_mixer_t pcm_mixer[32]; 1134 emu10k1_pcm_mixer_t pcm_mixer[32];
1114 emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK]; 1135 emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK];
1115 snd_kcontrol_t *ctl_send_routing; 1136 snd_kcontrol_t *ctl_send_routing;
@@ -1146,6 +1167,7 @@ int snd_emu10k1_create(snd_card_t * card,
1146 unsigned short extout_mask, 1167 unsigned short extout_mask,
1147 long max_cache_bytes, 1168 long max_cache_bytes,
1148 int enable_ir, 1169 int enable_ir,
1170 uint subsystem,
1149 emu10k1_t ** remu); 1171 emu10k1_t ** remu);
1150 1172
1151int snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1173int snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm);
@@ -1453,7 +1475,6 @@ int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu,
1453#endif 1475#endif
1454 1476
1455typedef struct { 1477typedef struct {
1456 unsigned int card; /* card type */
1457 unsigned int internal_tram_size; /* in samples */ 1478 unsigned int internal_tram_size; /* in samples */
1458 unsigned int external_tram_size; /* in samples */ 1479 unsigned int external_tram_size; /* in samples */
1459 char fxbus_names[16][32]; /* names of FXBUSes */ 1480 char fxbus_names[16][32]; /* names of FXBUSes */
diff --git a/include/sound/gus.h b/include/sound/gus.h
index 8b6287a6fff5..b4b461ca173d 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -526,9 +526,6 @@ extern void snd_gf1_adlib_write(snd_gus_card_t * gus, unsigned char reg, unsigne
526extern void snd_gf1_dram_addr(snd_gus_card_t * gus, unsigned int addr); 526extern void snd_gf1_dram_addr(snd_gus_card_t * gus, unsigned int addr);
527extern void snd_gf1_poke(snd_gus_card_t * gus, unsigned int addr, unsigned char data); 527extern void snd_gf1_poke(snd_gus_card_t * gus, unsigned int addr, unsigned char data);
528extern unsigned char snd_gf1_peek(snd_gus_card_t * gus, unsigned int addr); 528extern unsigned char snd_gf1_peek(snd_gus_card_t * gus, unsigned int addr);
529extern void snd_gf1_pokew(snd_gus_card_t * gus, unsigned int addr, unsigned short data);
530extern unsigned short snd_gf1_peekw(snd_gus_card_t * gus, unsigned int addr);
531extern void snd_gf1_dram_setmem(snd_gus_card_t * gus, unsigned int addr, unsigned short value, unsigned int count);
532extern void snd_gf1_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit); 529extern void snd_gf1_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit);
533extern unsigned int snd_gf1_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit); 530extern unsigned int snd_gf1_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit);
534extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg); 531extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg);
@@ -544,9 +541,6 @@ extern inline unsigned short snd_gf1_i_read16(snd_gus_card_t * gus, unsigned cha
544{ 541{
545 return snd_gf1_i_look16(gus, reg | 0x80); 542 return snd_gf1_i_look16(gus, reg | 0x80);
546} 543}
547extern void snd_gf1_i_adlib_write(snd_gus_card_t * gus, unsigned char reg, unsigned char data);
548extern void snd_gf1_i_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit);
549extern unsigned int snd_gf1_i_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit);
550 544
551extern void snd_gf1_select_active_voices(snd_gus_card_t * gus); 545extern void snd_gf1_select_active_voices(snd_gus_card_t * gus);
552 546
@@ -580,10 +574,6 @@ extern void snd_gf1_lfo_command(snd_gus_card_t * gus, int voice, unsigned char *
580 574
581void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup); 575void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup);
582int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block); 576int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block);
583snd_gf1_mem_block_t *snd_gf1_mem_look(snd_gf1_mem_t * alloc,
584 unsigned int address);
585snd_gf1_mem_block_t *snd_gf1_mem_share(snd_gf1_mem_t * alloc,
586 unsigned int *share_id);
587snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner, 577snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner,
588 char *name, int size, int w_16, 578 char *name, int size, int w_16,
589 int align, unsigned int *share_id); 579 int align, unsigned int *share_id);
@@ -608,23 +598,13 @@ int snd_gf1_dma_transfer_block(snd_gus_card_t * gus,
608/* gus_volume.c */ 598/* gus_volume.c */
609 599
610unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol); 600unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol);
611unsigned int snd_gf1_gvol_to_lvol_raw(unsigned short gf1_vol);
612unsigned int snd_gf1_calc_ramp_rate(snd_gus_card_t * gus,
613 unsigned short start,
614 unsigned short end,
615 unsigned int us);
616unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq2); 601unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq2);
617unsigned short snd_gf1_compute_pitchbend(unsigned short pitchbend, unsigned short sens);
618unsigned short snd_gf1_compute_freq(unsigned int freq,
619 unsigned int rate,
620 unsigned short mix_rate);
621 602
622/* gus_reset.c */ 603/* gus_reset.c */
623 604
624void snd_gf1_set_default_handlers(snd_gus_card_t * gus, unsigned int what); 605void snd_gf1_set_default_handlers(snd_gus_card_t * gus, unsigned int what);
625void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice); 606void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice);
626void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice); 607void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice);
627void snd_gf1_clear_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max);
628void snd_gf1_stop_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max); 608void snd_gf1_stop_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max);
629snd_gus_voice_t *snd_gf1_alloc_voice(snd_gus_card_t * gus, int type, int client, int port); 609snd_gus_voice_t *snd_gf1_alloc_voice(snd_gus_card_t * gus, int type, int client, int port);
630void snd_gf1_free_voice(snd_gus_card_t * gus, snd_gus_voice_t *voice); 610void snd_gf1_free_voice(snd_gus_card_t * gus, snd_gus_voice_t *voice);
@@ -641,9 +621,6 @@ int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pc
641 621
642#ifdef CONFIG_SND_DEBUG 622#ifdef CONFIG_SND_DEBUG
643extern void snd_gf1_print_voice_registers(snd_gus_card_t * gus); 623extern void snd_gf1_print_voice_registers(snd_gus_card_t * gus);
644extern void snd_gf1_print_global_registers(snd_gus_card_t * gus);
645extern void snd_gf1_print_setup_registers(snd_gus_card_t * gus);
646extern void snd_gf1_peek_print_block(snd_gus_card_t * gus, unsigned int addr, int count, int w_16bit);
647#endif 624#endif
648 625
649/* gus.c */ 626/* gus.c */
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
new file mode 100644
index 000000000000..c34427ccd0b3
--- /dev/null
+++ b/include/sound/hdspm.h
@@ -0,0 +1,131 @@
1#ifndef __SOUND_HDSPM_H /* -*- linux-c -*- */
2#define __SOUND_HDSPM_H
3/*
4 * Copyright (C) 2003 Winfried Ritsch (IEM)
5 * based on hdsp.h from Thomas Charbonnel (thomas@undata.org)
6 *
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23/* Maximum channels is 64 even on 56Mode you have 64playbacks to matrix */
24#define HDSPM_MAX_CHANNELS 64
25
26/* -------------------- IOCTL Peak/RMS Meters -------------------- */
27
28typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t;
29
30/* peam rms level structure like we get from hardware
31
32 maybe in future we can memory map it so I just copy it
33 to user on ioctl call now an dont change anything
34 rms are made out of low and high values
35 where (long) ????_rms = (????_rms_l >> 8) + ((????_rms_h & 0xFFFFFF00)<<24)
36 (i asume so from the code)
37*/
38
39struct _snd_hdspm_peak_rms {
40
41 unsigned int level_offset[1024];
42
43 unsigned int input_peak[64];
44 unsigned int playback_peak[64];
45 unsigned int output_peak[64];
46 unsigned int xxx_peak[64]; /* not used */
47
48 unsigned int reserved[256]; /* not used */
49
50 unsigned int input_rms_l[64];
51 unsigned int playback_rms_l[64];
52 unsigned int output_rms_l[64];
53 unsigned int xxx_rms_l[64]; /* not used */
54
55 unsigned int input_rms_h[64];
56 unsigned int playback_rms_h[64];
57 unsigned int output_rms_h[64];
58 unsigned int xxx_rms_h[64]; /* not used */
59};
60
61struct sndrv_hdspm_peak_rms_ioctl {
62 hdspm_peak_rms_t *peak;
63};
64
65/* use indirect access due to the limit of ioctl bit size */
66#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct sndrv_hdspm_peak_rms_ioctl)
67
68/* ------------ CONFIG block IOCTL ---------------------- */
69
70typedef struct _snd_hdspm_config_info hdspm_config_info_t;
71
72struct _snd_hdspm_config_info {
73 unsigned char pref_sync_ref;
74 unsigned char wordclock_sync_check;
75 unsigned char madi_sync_check;
76 unsigned int system_sample_rate;
77 unsigned int autosync_sample_rate;
78 unsigned char system_clock_mode;
79 unsigned char clock_source;
80 unsigned char autosync_ref;
81 unsigned char line_out;
82 unsigned int passthru;
83 unsigned int analog_out;
84};
85
86#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdspm_config_info_t)
87
88
89/* get Soundcard Version */
90
91typedef struct _snd_hdspm_version hdspm_version_t;
92
93struct _snd_hdspm_version {
94 unsigned short firmware_rev;
95};
96
97#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, hdspm_version_t)
98
99
100/* ------------- get Matrix Mixer IOCTL --------------- */
101
102/* MADI mixer: 64inputs+64playback in 64outputs = 8192 => *4Byte = 32768 Bytes */
103
104/* organisation is 64 channelfader in a continous memory block */
105/* equivalent to hardware definition, maybe for future feature of mmap of them */
106/* each of 64 outputs has 64 infader and 64 outfader:
107 Ins to Outs mixer[out].in[in], Outstreams to Outs mixer[out].pb[pb] */
108
109#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
110
111typedef struct _snd_hdspm_channelfader snd_hdspm_channelfader_t;
112
113struct _snd_hdspm_channelfader {
114 unsigned int in[HDSPM_MIXER_CHANNELS];
115 unsigned int pb[HDSPM_MIXER_CHANNELS];
116};
117
118typedef struct _snd_hdspm_mixer hdspm_mixer_t;
119
120struct _snd_hdspm_mixer {
121 snd_hdspm_channelfader_t ch[HDSPM_MIXER_CHANNELS];
122};
123
124struct sndrv_hdspm_mixer_ioctl {
125 hdspm_mixer_t *mixer;
126};
127
128/* use indirect access due to the limit of ioctl bit size */
129#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct sndrv_hdspm_mixer_ioctl)
130
131#endif /* __SOUND_HDSPM_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 53fc04d75bad..d935417575b5 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -848,23 +848,6 @@ int snd_interval_ratnum(snd_interval_t *i,
848 848
849void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); 849void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params);
850void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); 850void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var);
851int snd_pcm_hw_param_min(snd_pcm_substream_t *substream,
852 snd_pcm_hw_params_t *params,
853 snd_pcm_hw_param_t var,
854 unsigned int val, int *dir);
855int snd_pcm_hw_param_max(snd_pcm_substream_t *substream,
856 snd_pcm_hw_params_t *params,
857 snd_pcm_hw_param_t var,
858 unsigned int val, int *dir);
859int snd_pcm_hw_param_setinteger(snd_pcm_substream_t *substream,
860 snd_pcm_hw_params_t *params,
861 snd_pcm_hw_param_t var);
862int snd_pcm_hw_param_first(snd_pcm_substream_t *substream,
863 snd_pcm_hw_params_t *params,
864 snd_pcm_hw_param_t var, int *dir);
865int snd_pcm_hw_param_last(snd_pcm_substream_t *substream,
866 snd_pcm_hw_params_t *params,
867 snd_pcm_hw_param_t var, int *dir);
868int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, 851int snd_pcm_hw_param_near(snd_pcm_substream_t *substream,
869 snd_pcm_hw_params_t *params, 852 snd_pcm_hw_params_t *params,
870 snd_pcm_hw_param_t var, 853 snd_pcm_hw_param_t var,
@@ -876,7 +859,6 @@ int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm,
876int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 859int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params);
877 860
878int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 861int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params);
879int snd_pcm_hw_params(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params);
880 862
881int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); 863int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream);
882int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); 864int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream);
@@ -922,8 +904,22 @@ int snd_pcm_format_unsigned(snd_pcm_format_t format);
922int snd_pcm_format_linear(snd_pcm_format_t format); 904int snd_pcm_format_linear(snd_pcm_format_t format);
923int snd_pcm_format_little_endian(snd_pcm_format_t format); 905int snd_pcm_format_little_endian(snd_pcm_format_t format);
924int snd_pcm_format_big_endian(snd_pcm_format_t format); 906int snd_pcm_format_big_endian(snd_pcm_format_t format);
907/**
908 * snd_pcm_format_cpu_endian - Check the PCM format is CPU-endian
909 * @format: the format to check
910 *
911 * Returns 1 if the given PCM format is CPU-endian, 0 if
912 * opposite, or a negative error code if endian not specified.
913 */
914/* int snd_pcm_format_cpu_endian(snd_pcm_format_t format); */
915#ifdef SNDRV_LITTLE_ENDIAN
916#define snd_pcm_format_cpu_endian snd_pcm_format_little_endian
917#else
918#define snd_pcm_format_cpu_endian snd_pcm_format_big_endian
919#endif
925int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ 920int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */
926int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ 921int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */
922ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples);
927const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format); 923const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
928int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); 924int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
929snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); 925snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian);
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h
index 4357cac07500..8857e2bd31a5 100644
--- a/include/sound/seq_midi_event.h
+++ b/include/sound/seq_midi_event.h
@@ -41,9 +41,7 @@ struct snd_midi_event_t {
41}; 41};
42 42
43int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); 43int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev);
44int snd_midi_event_resize_buffer(snd_midi_event_t *dev, int bufsize);
45void snd_midi_event_free(snd_midi_event_t *dev); 44void snd_midi_event_free(snd_midi_event_t *dev);
46void snd_midi_event_init(snd_midi_event_t *dev);
47void snd_midi_event_reset_encode(snd_midi_event_t *dev); 45void snd_midi_event_reset_encode(snd_midi_event_t *dev);
48void snd_midi_event_reset_decode(snd_midi_event_t *dev); 46void snd_midi_event_reset_decode(snd_midi_event_t *dev);
49void snd_midi_event_no_status(snd_midi_event_t *dev, int on); 47void snd_midi_event_no_status(snd_midi_event_t *dev, int on);
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
index cf4e2388103f..1ad27e859af3 100644
--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -79,6 +79,5 @@ struct _snd_virmidi_dev {
79#define SNDRV_VIRMIDI_SEQ_DISPATCH 2 79#define SNDRV_VIRMIDI_SEQ_DISPATCH 2
80 80
81int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi); 81int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi);
82int snd_virmidi_receive(snd_rawmidi_t *rmidi, snd_seq_event_t *ev);
83 82
84#endif /* __SOUND_SEQ_VIRMIDI */ 83#endif /* __SOUND_SEQ_VIRMIDI */
diff --git a/include/sound/timer.h b/include/sound/timer.h
index 57fde990606e..1898511a0f38 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -152,6 +152,4 @@ extern int snd_timer_pause(snd_timer_instance_t * timeri);
152 152
153extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); 153extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left);
154 154
155extern unsigned int snd_timer_system_resolution(void);
156
157#endif /* __SOUND_TIMER_H */ 155#endif /* __SOUND_TIMER_H */
diff --git a/include/sound/version.h b/include/sound/version.h
index 98b4230778ed..c085136f391f 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by configure. */ 1/* include/version.h. Generated by configure. */
2#define CONFIG_SND_VERSION "1.0.9rc2" 2#define CONFIG_SND_VERSION "1.0.9b"
3#define CONFIG_SND_DATE " (Thu Mar 24 10:33:39 2005 UTC)" 3#define CONFIG_SND_DATE " (Thu Jul 28 12:20:13 2005 UTC)"
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index a7e29933f2d0..7a60a3888667 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -233,37 +233,37 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs);
233/* 233/*
234 * lowlevel functions 234 * lowlevel functions
235 */ 235 */
236inline static int vx_test_and_ack(vx_core_t *chip) 236static inline int vx_test_and_ack(vx_core_t *chip)
237{ 237{
238 snd_assert(chip->ops->test_and_ack, return -ENXIO); 238 snd_assert(chip->ops->test_and_ack, return -ENXIO);
239 return chip->ops->test_and_ack(chip); 239 return chip->ops->test_and_ack(chip);
240} 240}
241 241
242inline static void vx_validate_irq(vx_core_t *chip, int enable) 242static inline void vx_validate_irq(vx_core_t *chip, int enable)
243{ 243{
244 snd_assert(chip->ops->validate_irq, return); 244 snd_assert(chip->ops->validate_irq, return);
245 chip->ops->validate_irq(chip, enable); 245 chip->ops->validate_irq(chip, enable);
246} 246}
247 247
248inline static unsigned char snd_vx_inb(vx_core_t *chip, int reg) 248static inline unsigned char snd_vx_inb(vx_core_t *chip, int reg)
249{ 249{
250 snd_assert(chip->ops->in8, return 0); 250 snd_assert(chip->ops->in8, return 0);
251 return chip->ops->in8(chip, reg); 251 return chip->ops->in8(chip, reg);
252} 252}
253 253
254inline static unsigned int snd_vx_inl(vx_core_t *chip, int reg) 254static inline unsigned int snd_vx_inl(vx_core_t *chip, int reg)
255{ 255{
256 snd_assert(chip->ops->in32, return 0); 256 snd_assert(chip->ops->in32, return 0);
257 return chip->ops->in32(chip, reg); 257 return chip->ops->in32(chip, reg);
258} 258}
259 259
260inline static void snd_vx_outb(vx_core_t *chip, int reg, unsigned char val) 260static inline void snd_vx_outb(vx_core_t *chip, int reg, unsigned char val)
261{ 261{
262 snd_assert(chip->ops->out8, return); 262 snd_assert(chip->ops->out8, return);
263 chip->ops->out8(chip, reg, val); 263 chip->ops->out8(chip, reg, val);
264} 264}
265 265
266inline static void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val) 266static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val)
267{ 267{
268 snd_assert(chip->ops->out32, return); 268 snd_assert(chip->ops->out32, return);
269 chip->ops->out32(chip, reg, val); 269 chip->ops->out32(chip, reg, val);
@@ -303,14 +303,14 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time);
303/* 303/*
304 * pseudo-DMA transfer 304 * pseudo-DMA transfer
305 */ 305 */
306inline static void vx_pseudo_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, 306static inline void vx_pseudo_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime,
307 vx_pipe_t *pipe, int count) 307 vx_pipe_t *pipe, int count)
308{ 308{
309 snd_assert(chip->ops->dma_write, return); 309 snd_assert(chip->ops->dma_write, return);
310 chip->ops->dma_write(chip, runtime, pipe, count); 310 chip->ops->dma_write(chip, runtime, pipe, count);
311} 311}
312 312
313inline static void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, 313static inline void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime,
314 vx_pipe_t *pipe, int count) 314 vx_pipe_t *pipe, int count)
315{ 315{
316 snd_assert(chip->ops->dma_read, return); 316 snd_assert(chip->ops->dma_read, return);